diff options
| author | git perforce import user <a@b> | 2016-10-25 12:29:14 -0600 |
|---|---|---|
| committer | Sheikh Dawood Abdul Ajees <Sheikh Dawood Abdul Ajees> | 2016-10-25 18:56:37 -0500 |
| commit | 3dfe2108cfab31ba3ee5527e217d0d8e99a51162 (patch) | |
| tree | fa6485c169e50d7415a651bf838f5bcd0fd3bfbd /APEX_1.4/shared/external/include | |
| download | physx-3.4-3dfe2108cfab31ba3ee5527e217d0d8e99a51162.tar.xz physx-3.4-3dfe2108cfab31ba3ee5527e217d0d8e99a51162.zip | |
Initial commit:
PhysX 3.4.0 Update @ 21294896
APEX 1.4.0 Update @ 21275617
[CL 21300167]
Diffstat (limited to 'APEX_1.4/shared/external/include')
35 files changed, 10616 insertions, 0 deletions
diff --git a/APEX_1.4/shared/external/include/ApexMaterial.h b/APEX_1.4/shared/external/include/ApexMaterial.h new file mode 100644 index 00000000..252dd64f --- /dev/null +++ b/APEX_1.4/shared/external/include/ApexMaterial.h @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#ifndef _MATERIAL_H_ +#define _MATERIAL_H_ + +#include <stdio.h> +#include <string> +#include "ApexUsingNamespace.h" +#include "RenderMesh.h" +#include "MaterialLibrary.h" +#include "PxVec3.h" +#include <vector> + +/** + A generic texture map. Loads from a variety of file formats, but is stored in a unified basic format. + May be (de)serialized from/to an physx::PxFileBuf. +*/ +class ApexDefaultTextureMap : public TextureMap +{ +public: + ApexDefaultTextureMap(); + ApexDefaultTextureMap(const ApexDefaultTextureMap& textureMap) + { + *this = textureMap; + } + ApexDefaultTextureMap& operator = (const ApexDefaultTextureMap& textureMap); + virtual ~ApexDefaultTextureMap(); + + void build(PixelFormat format, uint32_t width, uint32_t height, uint32_t* fillColor = NULL); + + /** Deallocates all buffers and sets all values to the default constructor values. */ + void unload(); + + /** Saves the generic texture data to an physx::PxFileBuf. */ + void serialize(physx::PxFileBuf& stream) const; + + /** Loads generic texture data from an physx::PxFileBuf. */ + void deserialize(physx::PxFileBuf& stream, uint32_t version); + + // Texture API + PixelFormat getPixelFormat() const + { + return mPixelFormat; + } + uint32_t getWidth() const + { + return mWidth; + } + uint32_t getHeight() const + { + return mHeight; + } + uint32_t getComponentCount() const + { + return mComponentCount; + } + uint32_t getPixelBufferSize() const + { + return mPixelBufferSize; + } + uint8_t* getPixels() const + { + return mPixelBuffer; + } + +protected: + + PixelFormat mPixelFormat; + uint32_t mWidth; + uint32_t mHeight; + uint32_t mComponentCount; + uint32_t mPixelBufferSize; + uint8_t* mPixelBuffer; +}; + + +class ApexDefaultMaterial : public Material +{ +public: + + ApexDefaultMaterial(); + ApexDefaultMaterial(const ApexDefaultMaterial& material) + { + *this = material; + } + ApexDefaultMaterial& operator = (const ApexDefaultMaterial& material); + virtual ~ApexDefaultMaterial(); + + /** Sets the name of the material, for lookup by the named resource provider. */ + void setName(const char* name); + + /** Sets one of the material's texture maps (diffuse or normal) */ + bool setTextureMap(TextureMapType type, ApexDefaultTextureMap* textureMap); + + /** Sets the ambient lighting color. */ + void setAmbient(const physx::PxVec3& ambient) + { + mAmbient = ambient; + } + + /** Sets the diffuse lighting color. */ + void setDiffuse(const physx::PxVec3& diffuse) + { + mDiffuse = diffuse; + } + + /** Sets the specular lighting color. */ + void setSpecular(const physx::PxVec3& specular) + { + mSpecular = specular; + } + + /** Sets material's opacity. */ + void setAlpha(float alpha) + { + mAlpha = alpha; + } + + /** Sets the material's shininess (specular power). */ + void setShininess(float shininess) + { + mShininess = shininess; + } + + /** Deallocates all buffers and sets all values to the default constructor values. */ + void unload(); + + /** Saves the material to an physx::PxFileBuf. */ + void serialize(physx::PxFileBuf& stream) const; + + /** Loads material from an physx::PxFileBuf. */ + void deserialize(physx::PxFileBuf& stream, uint32_t version); + + // Material API + const char* getName() const + { + return mName.c_str(); + } + TextureMap* getTextureMap(TextureMapType type) const; + const physx::PxVec3& getAmbient() const + { + return mAmbient; + } + const physx::PxVec3& getDiffuse() const + { + return mDiffuse; + } + const physx::PxVec3& getSpecular() const + { + return mSpecular; + } + float getAlpha() const + { + return mAlpha; + } + float getShininess() const + { + return mShininess; + } + +private: + + std::string mName; + + ApexDefaultTextureMap* mTextureMaps[TEXTURE_MAP_TYPE_COUNT]; + + physx::PxVec3 mAmbient; + physx::PxVec3 mDiffuse; + physx::PxVec3 mSpecular; + float mAlpha; + float mShininess; +}; + + +class ApexDefaultMaterialLibrary : public MaterialLibrary +{ +public: + + ApexDefaultMaterialLibrary(); + ApexDefaultMaterialLibrary(const ApexDefaultMaterialLibrary& materialLibrary) + { + *this = materialLibrary; + } + ApexDefaultMaterialLibrary& operator = (const ApexDefaultMaterialLibrary& material); + virtual ~ApexDefaultMaterialLibrary(); + + /** Deallocates all buffers and sets all values to the default constructor values. */ + void unload(); + + /** Returns the number of materials in the library */ + uint32_t getMaterialCount() const + { + return (uint32_t)mMaterials.size(); + } + + /** + Access to the materials by index. + Valid range of materialIndex is 0 to getMaterialCount()-1. + */ + ApexDefaultMaterial* getMaterial(uint32_t materialIndex) const; + + /** + Remove and delete named material. + Returns true if the material was found, false if it was not. + */ + virtual bool deleteMaterial(const char* materialName); + + /** + Adds the materials from the given materialLibrary, which + aren't already in this material library. (Based upon name.) + */ + void merge(const ApexDefaultMaterialLibrary& materialLibrary); + + // MaterialLibrary API + + /** Saves the material to an physx::PxFileBuf. */ + void serialize(physx::PxFileBuf& stream) const; + + /** Loads material from an physx::PxFileBuf. */ + void deserialize(physx::PxFileBuf& stream); + + Material* getMaterial(const char* materialName, bool& created); + + /* Returns -1 if the material is not found */ + int32_t findMaterialIndex(const char* materialName); + +private: + + std::vector<ApexDefaultMaterial*> mMaterials; +}; + + +#endif // #ifndef _MATERIAL_H_ diff --git a/APEX_1.4/shared/external/include/BestFit.h b/APEX_1.4/shared/external/include/BestFit.h new file mode 100644 index 00000000..876d6e49 --- /dev/null +++ b/APEX_1.4/shared/external/include/BestFit.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef BEST_FIT_H + +#define BEST_FIT_H + +// A code snippet to compute the best fit AAB, OBB, plane, capsule and sphere +// Quaternions are assumed a float X,Y,Z,W +// Matrices are assumed 4x4 D3DX style format passed as a float pointer +// The orientation of a capsule is assumed that height is along the Y axis, the same format as the PhysX SDK uses +// The best fit plane routine is derived from code previously published by David Eberly on his Magic Software site. +// The best fit OBB is computed by first approximating the best fit plane, and then brute force rotating the points +// around a single axis to derive the closest fit. If you set 'bruteforce' to false, it will just use the orientation +// derived from the best fit plane, which is close enough in most cases, but not all. +// Each routine allows you to pass the point stride between position elements in your input vertex stream. +// These routines should all be thread safe as they make no use of any global variables. + + + +namespace SharedTools +{ + +bool computeBestFitPlane(size_t vcount, // number of input data points + const float* points, // starting address of points array. + size_t vstride, // stride between input points. + const float* weights, // *optional point weighting values. + size_t wstride, // weight stride for each vertex. + float plane[4]); + +float computeBestFitAABB(size_t vcount, const float* points, size_t pstride, float bmin[3], float bmax[3]); // returns the diagonal distance +float computeBestFitSphere(size_t vcount, const float* points, size_t pstride, float center[3]); +void computeBestFitOBB(size_t vcount, const float* points, size_t pstride, float* sides, float matrix[16], bool bruteForce); +void computeBestFitOBB(size_t vcount, const float* points, size_t pstride, float* sides, float pos[3], float quat[4], bool bruteForce); +void computeBestFitCapsule(size_t vcount, const float* points, size_t pstride, float& radius, float& height, float matrix[16], bool bruteForce); +void computeBestFitCapsule(size_t vcount, const float* points, size_t pstride, float& radius, float& height, float pos[3], float quat[4], bool bruteForce); + +}; + +#endif diff --git a/APEX_1.4/shared/external/include/ClothingAuthoring.h b/APEX_1.4/shared/external/include/ClothingAuthoring.h new file mode 100644 index 00000000..23c3c514 --- /dev/null +++ b/APEX_1.4/shared/external/include/ClothingAuthoring.h @@ -0,0 +1,1884 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#ifndef CLOTHING_AUTHORING_H +#define CLOTHING_AUTHORING_H + +#include "PxPreprocessor.h" +#if PX_WINDOWS_FAMILY + +#include "ApexDefs.h" + +#include "PxMath.h" +#include "PxMat33.h" +#include "PxMat44.h" +#include "PxCpuDispatcher.h" +#include <nvparameterized/NvSerializer.h> + +#include <IProgressListener.h> +#include <UserRenderResourceManager.h> +#include <UserRenderVertexBufferDesc.h> +#include <nvparameterized/NvParameterized.h> + +#include <clothing/ClothingAsset.h> + +#include <AutoGeometry.h> + +#include <vector> +#include <map> + + +namespace physx +{ +class PxScene; +class PxMaterial; +class PxRigidStatic; + +namespace pvdsdk +{ + class PxPvd; +} + +class PxCpuDispatcher; +} + +namespace nvidia +{ +namespace apex +{ +class ApexSDK; +class RenderDebugInterface; +class Renderable; +class Scene; +class ResourceCallback; +class UserRenderResourceManager; + +class RenderMeshAssetAuthoring; + +class ModuleClothing; +class ClothingActor; +class ClothingAsset; +class ClothingAssetAuthoring; +class ClothingPhysicalMesh; +class ClothingPreview; +class ClothingUserRecompute; +class ClothingPlane; +struct ClothingMeshSkinningMap; +} +} + + +namespace Samples +{ +class MaterialList; +class TriangleMesh; +class SkeletalAnim; +} + + + +namespace SharedTools +{ + +class MeshPainter; + +class ClothingAuthoring +{ +public: + + class ErrorCallback + { + public: + void reportErrorPrintf(const char* label, const char* fmt, ...); + virtual void reportError(const char* label, const char* message) = 0; + }; + + class NotificationCallback + { + public: + virtual void notifyRestart() = 0; + virtual void notifyInputMeshLoaded() = 0; + virtual void notifyMeshPos(const physx::PxVec3&) = 0; + }; + + + + struct BrushMode + { + enum Enum + { + PaintFlat, + PaintVolumetric, + Smooth, + }; + }; + + + + struct CollisionVolume + { + CollisionVolume() : boneIndex(-1), parentIndex(-1), transform(physx::PxIdentity), meshVolume(0.0f), + capsuleHeight(0.0f), capsuleRadius(0.0f), shapeOffset(physx::PxIdentity), inflation(0.0f) {} + + void draw(nvidia::apex::RenderDebugInterface* batcher, Samples::SkeletalAnim* anim, bool wireframe, float simulationScale); + + int boneIndex; + int parentIndex; + std::string boneName; + physx::PxTransform transform; + std::vector<physx::PxVec3> vertices; + std::vector<uint32_t> indices; + float meshVolume; + float capsuleHeight; + float capsuleRadius; + physx::PxTransform shapeOffset; + float inflation; + }; + + + + ClothingAuthoring( + nvidia::apex::ApexSDK* apexSDK, + nvidia::apex::ModuleClothing* moduleClothing, + nvidia::apex::ResourceCallback* resourceCallback, + nvidia::apex::UserRenderResourceManager* renderResourceManager, + ClothingAuthoring::ErrorCallback* errorCallback, + nvidia::PxPvd* pvd = NULL, + nvidia::apex::RenderDebugInterface* renderDebug = NULL + ); + + virtual ~ClothingAuthoring(); + + void addNotifyCallback(NotificationCallback* callback); + void setMaterialList(Samples::MaterialList* list); + + void releasePhysX(); + void connectPVD(bool toggle); + + int getNumParameters() const; + bool getParameter(unsigned int i, std::string& name, std::string& type, std::string& val) const; + bool setParameter(std::string& name, std::string& type, std::string& val); + + + // state information + + bool getAndClearNeedsRedraw() + { + bool temp = mState.needsRedraw; + mState.needsRedraw = false; + return temp; + } + + bool getAndClearNeedsRestart() + { + bool temp = mState.needsRestart; + mState.needsRestart = false; + return temp; + } + + bool getAndClearManualAnimation() + { + bool temp = mState.manualAnimation; + mState.manualAnimation = false; + return temp; + } + void setManualAnimation(bool on) + { + mState.manualAnimation = on; + } + + struct AuthoringState + { + enum Enum + { + None = 0, + MeshLoaded, + SubmeshSelectionChanged, + PaintingChanged, + RenderMeshAssetCreated, + PhysicalCustomMeshCreated, + PhysicalClothMeshCreated, + ClothingAssetCreated, + }; + }; + + AuthoringState::Enum getAuthoringState() const + { + return mState.authoringState; + } + + bool createDefaultMaterialLibrary(); + bool addMaterialLibrary(const char* name, NvParameterized::Interface* newInterface); + void removeMaterialLibrary(const char* name); + + void addMaterialToLibrary(const char* libName, const char* matName); + void removeMaterialFromLibrary(const char* libName, const char* matName); + + void selectMaterial(const char* libName, const char* matName); + void clearMaterialLibraries(); + + const char* getSelectedMaterialLibrary() const + { + return mState.selectedMaterialLibrary.c_str(); + } + const char* getSelectedMaterial() const + { + return mState.selectedMaterial.c_str(); + } + + physx::PxBounds3 getSimulationBounds() const + { + return mState.apexBounds; + } + + physx::PxBounds3 getCombinedSimulationBounds() const; + + size_t getNumMaterialLibraries() const + { + return mState.materialLibraries.size(); + } + NvParameterized::Interface* getMaterialLibrary(unsigned int libraryIndex) const; + bool setMaterialLibrary(unsigned int libraryIndex, NvParameterized::Interface* data); + const char* getMaterialLibraryName(unsigned int libraryIndex) const; + unsigned int getNumMaterials(unsigned int libraryIndex) const; + const char* getMaterialName(unsigned int libraryIndex, unsigned int materialIndex) const; + + float getDrawWindTime() const + { + return mState.drawWindTime; + } + const physx::PxVec3& getWindOrigin() const + { + return mState.windOrigin; + } + const physx::PxVec3& getWindTarget() const + { + return mState.windTarget; + } + + // dirty information + + void setMaxDistancePaintingDirty(bool dirty) + { + mDirty.maxDistancePainting |= dirty; + } + bool getAndClearMaxDistancePaintingDirty() + { + bool temp = mDirty.maxDistancePainting; + mDirty.maxDistancePainting = false; + return temp; + } + + bool getAndClearGroundPlaneDirty() + { + bool temp = mDirty.groundPlane; + mDirty.groundPlane = false; + return temp; + } + + bool getAndClearGravityDirty() + { + bool temp = mDirty.gravity; + mDirty.gravity = false; + return temp; + } + + bool getAndClearWorkspaceDirty() + { + bool temp = mDirty.workspace; + mDirty.workspace = false; + return temp; + } + + void setSimulationValueScale(float v) + { + mState.simulationValuesScale = v; + } + float getSimulationValueScale() const + { + return mState.simulationValuesScale; + } + + void setGravityValueScale(float v) + { + mState.gravityValueScale = v; + } + float getGravityValueScale() const + { + return mState.gravityValueScale; + } + + + + // simulation objects + size_t getNumSimulationAssets() const + { + return mSimulation.assets.size(); + } + size_t getNumTriangleMeshes() const + { + return mSimulation.actors.size(); + } + Samples::TriangleMesh* getTriangleMesh(size_t index) + { + return mSimulation.actors[index].triangleMesh; + } + const physx::PxMat44& getTriangleMeshPose(size_t index) const; + + size_t getNumActors() const + { + return mSimulation.actors.size() * mSimulation.assets.size(); + } + + size_t getNumSimulationActors() const; + nvidia::apex::ClothingActor* getSimulationActor(size_t index); + nvidia::apex::Renderable* getSimulationRenderable(size_t index); + + void initMeshSkinningData(); + nvidia::apex::ClothingMeshSkinningMap* getMeshSkinningMap(size_t index, uint32_t lod, uint32_t& mapSize, nvidia::apex::RenderMeshAsset*& renderMeshAsset); + + void setActorCount(int count, bool addToCommandQueue); + int getActorCount() const + { + return mSimulation.actorCount; + } + float getActorScale(size_t index); + + void setMatrices(const physx::PxMat44& viewMatrix, const physx::PxMat44& projectionMatrix); + + void startCreateApexScene(); + bool addAssetToScene(nvidia::apex::ClothingAsset* asset, nvidia::apex::IProgressListener* progress, unsigned int totalNumAssets = 1); + void handleGravity(); + void finishCreateApexScene(bool recomputeScale); + + void startSimulation(); + void stopSimulation(); + void restartSimulation(); + bool updateCCT(float deltaT); + + void stepsUntilPause(int steps); + unsigned int getFrameNumber() const + { + return mSimulation.frameNumber; + } + int getMaxLodValue() const; + nvidia::apex::Scene* getApexScene() const + { + return mSimulation.apexScene; + } +#if PX_PHYSICS_VERSION_MAJOR == 3 + physx::PxScene* getPhysXScene() const + { + return mSimulation.physxScene; + } +#endif + bool isPaused() const + { + return mSimulation.paused; + } + + + + // Meshes + bool loadInputMesh(const char* filename, bool allowConversion, bool silentOnError, bool recurseIntoApx); + bool loadAnimation(const char* filename, std::string& error); + NvParameterized::Interface* extractRMA(NvParameterized::Handle& param); + bool saveInputMeshToXml(const char* filename); + bool saveInputMeshToEzm(const char* filename); + void setInputMeshFilename(const char* filename) + { + mDirty.workspace |= mMeshes.inputMeshFilename.compare(filename) != 0; + mMeshes.inputMeshFilename = filename; + } + const char* getInputMeshFilename() const + { + return mMeshes.inputMeshFilename.c_str(); + } + void selectSubMesh(int subMeshNr, bool on); + bool hasTangentSpaceGenerated() + { + return mMeshes.tangentSpaceGenerated; + } + + bool loadCustomPhysicsMesh(const char* filename); + const char* getCustomPhysicsMeshFilename() const + { + return mMeshes.customPhysicsMeshFilename.empty() ? NULL : mMeshes.customPhysicsMeshFilename.c_str(); + } + void clearCustomPhysicsMesh(); + + Samples::TriangleMesh* getInputMesh() + { + return mMeshes.inputMesh; + } + Samples::SkeletalAnim* getSkeleton() + { + return mMeshes.skeleton; + } + Samples::TriangleMesh* getCustomPhysicsMesh() + { + return mMeshes.customPhysicsMesh; + } + Samples::TriangleMesh* getGroundMesh() + { + PX_ASSERT(mMeshes.groundMesh); + return mMeshes.groundMesh; + } + + // modify mesh + int subdivideSubmesh(int subMeshNumber); + size_t getNumSubdivisions() + { + return mMeshes.subdivideHistory.size(); + } + int getSubdivisionSubmesh(int index) + { + return mMeshes.subdivideHistory[(uint32_t)index].submesh; + } + int getSubdivisionSize(int index) + { + return mMeshes.subdivideHistory[(uint32_t)index].subdivision; + } + + void renameSubMeshMaterial(size_t submesh, const char* newName); + void generateInputTangentSpace(); + + // painting + MeshPainter* getPainter() + { + return mMeshes.painter; + } + void paint(const physx::PxVec3& rayOrigin, const physx::PxVec3& rayDirection, bool execute, bool leftButton, bool rightButton); + void floodPainting(bool invalid); + void smoothPainting(int numIterations); + + void updatePainter(); + void setPainterIndexBufferRange(); + void updatePaintingColors(); + bool getMaxDistancePaintValues(const float*& values, int& numValues, int& byteStride); + float getAbsolutePaintingScalingMaxDistance(); + float getAbsolutePaintingScalingCollisionFactor(); + + void initGroundMesh(const char* resourceDir); + + // modify animation + void setAnimationPose(int position); + void setBindPose(); + void setAnimationTime(float t); + float getAnimationTime() const; + bool updateAnimation(); + void skinMeshes(Samples::SkeletalAnim* anim); + + // collision volumes + void clearCollisionVolumes(); + unsigned int generateCollisionVolumes(bool useCapsule, bool commandMode, bool dirtyOnly); + CollisionVolume* addCollisionVolume(bool useCapsule, unsigned int boneIndex, bool createFromMesh); + size_t getNumCollisionVolumes() const + { + return mMeshes.collisionVolumes.size(); + } + CollisionVolume* getCollisionVolume(int index); + bool deleteCollisionVolume(int index); + void drawCollisionVolumes(bool wireframe) const; + + // Authoring objecst + size_t getNumRenderMeshAssets() + { + return (uint32_t)mConfig.cloth.numGraphicalLods; + } + nvidia::apex::RenderMeshAssetAuthoring* getRenderMeshAsset(int index); + + nvidia::apex::ClothingPhysicalMesh* getClothMesh(int index, nvidia::apex::IProgressListener* progress); + void simplifyClothMesh(float factor); + int getNumClothTriangles() const; + + nvidia::apex::ClothingPhysicalMesh* getPhysicalMesh(); + nvidia::apex::ClothingAssetAuthoring* getClothingAsset(nvidia::apex::IProgressListener* progress); + + // configuration.UI + void setZAxisUp(bool z); + bool getZAxisUp() const + { + return mConfig.ui.zAxisUp; + } + + void setSpotLight(bool s) + { + mDirty.workspace |= mConfig.ui.spotLight != s; + mConfig.ui.spotLight = s; + } + bool getSpotLight() const + { + return mConfig.ui.spotLight; + } + + void setSpotLightShadow(bool s) + { + mDirty.workspace |= mConfig.ui.spotLightShadow != s; + mConfig.ui.spotLightShadow = s; + } + bool getSpotLightShadow() const + { + return mConfig.ui.spotLightShadow; + } + + // configuration.mesh + void setSubmeshSubdiv(int value) + { + mDirty.workspace |= mConfig.mesh.originalMeshSubdivision != value; + mConfig.mesh.originalMeshSubdivision = value; + } + int getSubmeshSubdiv() const + { + return mConfig.mesh.originalMeshSubdivision; + } + + void setEvenOutVertexDegrees(bool on) + { + mDirty.workspace |= mConfig.mesh.evenOutVertexDegrees != on; + mConfig.mesh.evenOutVertexDegrees = on; + } + bool getEvenOutVertexDegrees() const + { + return mConfig.mesh.evenOutVertexDegrees; + } + + void setCullMode(nvidia::apex::RenderCullMode::Enum mode); + nvidia::apex::RenderCullMode::Enum getCullMode() const + { + return (nvidia::apex::RenderCullMode::Enum)mConfig.mesh.cullMode; + } + + void setTextureUvOrigin(nvidia::apex::TextureUVOrigin::Enum origin); + nvidia::apex::TextureUVOrigin::Enum getTextureUvOrigin() const + { + return (nvidia::apex::TextureUVOrigin::Enum)mConfig.mesh.textureUvOrigin; + } + + // configuration.Apex + void setParallelCpuSkinning(bool s) + { + mDirty.workspace |= mConfig.apex.parallelCpuSkinning != s; + mConfig.apex.parallelCpuSkinning = s; + mDirty.clothingActorFlags = true; + } + bool getParallelCpuSkinning() const + { + return mConfig.apex.parallelCpuSkinning; + } + + void setRecomputeNormals(bool r) + { + mDirty.workspace |= mConfig.apex.recomputeNormals != r; + mConfig.apex.recomputeNormals = r; + mDirty.clothingActorFlags = true; + } + bool getRecomputeNormals() const + { + return mConfig.apex.recomputeNormals; + } + + void setRecomputeTangents(bool r) + { + mDirty.workspace |= mConfig.apex.recomputeTangents != r; + mConfig.apex.recomputeTangents = r; + mDirty.clothingActorFlags = true; + } + bool getRecomputeTangents() const + { + return mConfig.apex.recomputeTangents; + } + + void setCorrectSimulationNormals(bool c) + { + mConfig.apex.correctSimulationNormals = c; + mDirty.clothingActorFlags = true; + } + bool getCorrectSimulationNormals() const + { + return mConfig.apex.correctSimulationNormals; + } + + void setUseMorphTargets(bool on) + { + mState.needsRestart |= mConfig.apex.useMorphTargetTest != on; + mConfig.apex.useMorphTargetTest = on; + } + bool getUseMorphTargets() const + { + return mConfig.apex.useMorphTargetTest; + } + + void setForceEmbedded(bool on) + { + mDirty.workspace |= mConfig.apex.forceEmbedded != on; + mConfig.apex.forceEmbedded = on; + mState.needsRestart = true; + } + bool getForceEmbedded() + { + return mConfig.apex.forceEmbedded; + } + + // configuration.tempMeshes.Cloth + void setClothNumGraphicalLods(int numLods) + { + mDirty.workspace |= mConfig.cloth.numGraphicalLods != numLods; + mConfig.cloth.numGraphicalLods = numLods; + setAuthoringState(AuthoringState::RenderMeshAssetCreated, false); + } + int getClothNumGraphicalLods() const + { + return mConfig.cloth.numGraphicalLods; + } + + void setClothSimplifySL(int simplification) + { + mDirty.workspace |= mConfig.cloth.simplify != simplification; + mConfig.cloth.simplify = simplification; + setAuthoringState(AuthoringState::RenderMeshAssetCreated, false); + } + int getClothSimplifySL() const + { + return mConfig.cloth.simplify; + } + + void setCloseCloth(bool close) + { + mDirty.workspace |= mConfig.cloth.close != close; + mConfig.cloth.close = close; + setAuthoringState(AuthoringState::RenderMeshAssetCreated, false); + } + bool getCloseCloth() const + { + return mConfig.cloth.close; + } + + void setSlSubdivideCloth(bool subdivide) + { + mDirty.workspace |= mConfig.cloth.subdivide != subdivide; + mConfig.cloth.subdivide = subdivide; + setAuthoringState(AuthoringState::RenderMeshAssetCreated, false); + } + bool getSlSubdivideCloth() const + { + return mConfig.cloth.subdivide; + } + + void setClothMeshSubdiv(int subdivision) + { + mDirty.workspace |= mConfig.cloth.subdivision != subdivision; + mConfig.cloth.subdivision = subdivision; + setAuthoringState(AuthoringState::RenderMeshAssetCreated, false); + } + int getClothMeshSubdiv() const + { + return mConfig.cloth.subdivision; + } + + // configuration.collisionVolumes + void setCollisionVolumeUsePaintChannel(bool on) + { + mDirty.workspace |= mConfig.collisionVolumes.usePaintingChannel != on; + mConfig.collisionVolumes.usePaintingChannel = on; + } + bool getCollisionVolumeUsePaintChannel() const + { + return mConfig.collisionVolumes.usePaintingChannel; + } + + + + // configuration.painting + void setBrushMode(BrushMode::Enum mode) + { + mDirty.workspace |= mConfig.painting.brushMode != mode; + mConfig.painting.brushMode = mode; + } + BrushMode::Enum getBrushMode() const + { + return (BrushMode::Enum)mConfig.painting.brushMode; + } + + void setFalloffExponent(float exp) + { + mDirty.workspace |= mConfig.painting.falloffExponent != exp; + mConfig.painting.falloffExponent = exp; + mState.needsRedraw = true; + } + float getFalloffExponent() const + { + return mConfig.painting.falloffExponent; + } + + void setPaintingChannel(int channel); + int getPaintingChannel() const + { + return mConfig.painting.channel; + } + + void setPaintingValue(float val, float vmin, float vmax); + float getPaintingValue() const + { + return mConfig.painting.value; + } + float getPaintingValueMin() const + { + return mConfig.painting.valueMin; + } + float getPaintingValueMax() const + { + return mConfig.painting.valueMax; + } + + void setPaintingValueFlag(unsigned int flags); + unsigned int getPaintingValueFlag() const + { + return (uint32_t)mConfig.painting.valueFlag; + } + + void setBrushRadius(int radius) + { + mDirty.workspace |= mConfig.painting.brushRadius != radius; + mConfig.painting.brushRadius = radius; + } + int getBrushRadius() const + { + return mConfig.painting.brushRadius; + } + + void setPaintingScalingMaxDistance(float scaling) + { + mDirty.workspace |= mConfig.painting.scalingMaxdistance != scaling; + mConfig.painting.scalingMaxdistance = scaling; + mDirty.maxDistancePainting = true; + mDirty.clothingActorFlags = true; + setAuthoringState(AuthoringState::PaintingChanged, false); + } + float getPaintingScalingMaxDistance() const + { + return mConfig.painting.scalingMaxdistance; + } + + void setPaintingScalingCollisionFactor(float scaling) + { + mDirty.workspace |= mConfig.painting.scalingCollisionFactor != scaling; + mConfig.painting.scalingCollisionFactor = scaling; + mDirty.clothingActorFlags = true; + setAuthoringState(AuthoringState::PaintingChanged, false); + } + float getPaintingScalingCollisionFactor() const + { + return mConfig.painting.scalingCollisionFactor; + } + + void setMaxDistanceScale(float scale) + { + mDirty.maxDistanceScale |= mConfig.painting.maxDistanceScale != scale; + mConfig.painting.maxDistanceScale = scale; + } + float getMaxDistanceScale() const + { + return mConfig.painting.maxDistanceScale; + } + + void setMaxDistanceScaleMultipliable(bool multipliable) + { + mDirty.maxDistanceScale |= mConfig.painting.maxDistanceScaleMultipliable != multipliable; + mConfig.painting.maxDistanceScaleMultipliable = multipliable; + } + bool getMaxDistanceScaleMultipliable() const + { + return mConfig.painting.maxDistanceScaleMultipliable; + } + + // configuration.setMeshes + void setDeriveNormalsFromBones(bool on) + { + mDirty.workspace |= mConfig.setMeshes.deriveNormalsFromBones != on; + mConfig.setMeshes.deriveNormalsFromBones = on; + } + bool getDeriveNormalsFromBones() const + { + return mConfig.setMeshes.deriveNormalsFromBones; + } + + // configuration.simulation + void setSimulationFrequency(int freq) + { + mDirty.workspace |= mConfig.simulation.frequency != (float)freq; + mConfig.simulation.frequency = (float)freq; + } + int getSimulationFrequency() const + { + return (int)mConfig.simulation.frequency; + } + + void setGravity(int gravity) + { + mDirty.workspace |= mConfig.simulation.gravity != gravity; + mConfig.simulation.gravity = gravity; + mDirty.gravity = true; + } + int getGravity() const + { + return mConfig.simulation.gravity; + } + + void setGroundplane(int v) + { + mDirty.workspace |= mConfig.simulation.groundplane != v; + mConfig.simulation.groundplane = v; + mDirty.groundPlane = true; + } + int getGroundplane() const + { + return mConfig.simulation.groundplane; + } + + void setGroundplaneEnabled(bool on) + { + mDirty.workspace |= mConfig.simulation.groundplaneEnabled != on; + mConfig.simulation.groundplaneEnabled = on; + mDirty.groundPlane = true; + } + bool getGroundplaneEnabled() const + { + return mConfig.simulation.groundplaneEnabled; + } + + void setBudgetPercent(int p) + { + p = physx::PxClamp(p, 0, 100); + mConfig.simulation.budgetPercent = p; + } + int getBudgetPercent() const + { + return mConfig.simulation.budgetPercent; + } + + void setInterCollisionDistance(float distance) + { + mDirty.workspace |= mConfig.simulation.interCollisionDistance != distance; + mConfig.simulation.interCollisionDistance = distance; + } + float getInterCollisionDistance() const + { + return mConfig.simulation.interCollisionDistance; + } + + void setInterCollisionStiffness(float stiffness) + { + mDirty.workspace |= mConfig.simulation.interCollisionStiffness != stiffness; + mConfig.simulation.interCollisionStiffness = stiffness; + } + float getInterCollisionStiffness() const + { + return mConfig.simulation.interCollisionStiffness; + } + + void setInterCollisionIterations(int iterations) + { + mDirty.workspace |= mConfig.simulation.interCollisionIterations != iterations; + mConfig.simulation.interCollisionIterations = iterations; + } + int getInterCollisionIterations() const + { + return mConfig.simulation.interCollisionIterations; + } + + void setBlendTime(float time) + { + mDirty.workspace |= mConfig.simulation.blendTime != time; + mConfig.simulation.blendTime = time; + mDirty.blendTime = true; + } + float getBlendTime() const + { + return mConfig.simulation.blendTime; + } + + void setPressure(float p) + { + mDirty.workspace |= mConfig.simulation.pressure != p; + mConfig.simulation.pressure = p; + mDirty.pressure = true; + } + float getPressure() const + { + return mConfig.simulation.pressure; + } + + void setLodOverwrite(int lod) + { + mDirty.workspace |= mConfig.simulation.lodOverwrite != lod; + mConfig.simulation.lodOverwrite = lod; + } + int getLodOverwrite() const + { + return mConfig.simulation.lodOverwrite; + } + + void setWindDirection(int w) + { + mDirty.workspace |= mConfig.simulation.windDirection != w; + mConfig.simulation.windDirection = w; + mState.drawWindTime = 3.0f; + } + int getWindDirection() const + { + return mConfig.simulation.windDirection; + } + + void setWindElevation(int w) + { + mDirty.workspace |= mConfig.simulation.windElevation != w; + mConfig.simulation.windElevation = w; + mState.drawWindTime = 3.0f; + } + int getWindElevation() const + { + return mConfig.simulation.windElevation; + } + + void setWindVelocity(int w) + { + mDirty.workspace |= mConfig.simulation.windVelocity != w; + mConfig.simulation.windVelocity = w; + mState.drawWindTime = 3.0f; + } + int getWindVelocity() const + { + return mConfig.simulation.windVelocity; + } + + void setGpuSimulation(bool gpuSimulation) + { + mDirty.workspace |= mConfig.simulation.gpuSimulation != gpuSimulation; + mConfig.simulation.gpuSimulation = gpuSimulation; + mState.needsRestart = true; + } + bool getGpuSimulation() const + { + return mConfig.simulation.gpuSimulation; + } + + void setMeshSkinningInApp(bool meshSkinningInApp) + { + mConfig.simulation.meshSkinningInApp = meshSkinningInApp; + mState.needsRestart = true; + } + bool getMeshSkinningInApp() const + { + return mConfig.simulation.meshSkinningInApp; + } + + void setFallbackSkinning(bool fallbackSkinning) + { + mDirty.workspace |= mConfig.simulation.fallbackSkinning != fallbackSkinning; + mConfig.simulation.fallbackSkinning = fallbackSkinning; + mState.needsRestart = true; + } + bool getFallbackSkinning() const + { + return mConfig.simulation.fallbackSkinning; + } + + void setCCTSpeed(float speed) + { + mConfig.simulation.CCTSpeed = speed; + } + float getCCTSpeed() const + { + return mConfig.simulation.CCTSpeed; + } + + void setTimingNoise(float noise) + { + mConfig.simulation.timingNoise = noise; + } + float getTimingNoise() const + { + return mConfig.simulation.timingNoise; + } + + void setScaleFactor(float factor) + { + mDirty.workspace |= mConfig.simulation.scaleFactor != factor; + mState.needsRestart |= mConfig.simulation.scaleFactor != factor; + mConfig.simulation.scaleFactor = factor; + } + float getScaleFactor() const + { + return mConfig.simulation.scaleFactor; + } + + void setPvdDebug(bool on) + { + mDirty.workspace |= mConfig.simulation.pvdDebug != on; + mState.needsReconnect |= mConfig.simulation.pvdProfile != on; + mConfig.simulation.pvdDebug = on; + } + bool getPvdDebug() const + { + return mConfig.simulation.pvdDebug; + } + + void setPvdProfile(bool on) + { + mDirty.workspace |= mConfig.simulation.pvdProfile != on; + mState.needsReconnect |= mConfig.simulation.pvdProfile != on; + mConfig.simulation.pvdProfile = on; + } + bool getPvdProfile() const + { + return mConfig.simulation.pvdProfile; + } + + void setPvdMemory(bool on) + { + mDirty.workspace |= mConfig.simulation.pvdMemory != on; + mState.needsReconnect |= mConfig.simulation.pvdMemory != on; + mConfig.simulation.pvdMemory = on; + } + bool getPvdMemory() const + { + return mConfig.simulation.pvdMemory; + } + + void setCCTDirection(const physx::PxVec3& direction) + { + mSimulation.CCTDirection = direction; + } + + void setCCTRotation(const physx::PxVec3 rotation) + { + mSimulation.CCTRotationDelta = rotation; + } + + void setGraphicalLod(int lod) + { + mDirty.workspace |= mConfig.simulation.graphicalLod != lod; + mConfig.simulation.graphicalLod = lod; + } + int getGraphicalLod() const + { + return mConfig.simulation.graphicalLod; + } + + void setUsePreview(bool on) + { + mState.needsRestart |= mSimulation.actors.size() > 0; + mConfig.simulation.usePreview = on; + } + bool getUsePreview() const + { + return mConfig.simulation.usePreview; + } + + void setLocalSpaceSim(bool on) + { + mDirty.workspace |= mConfig.simulation.localSpaceSim != on; + mState.needsRestart |= mConfig.simulation.localSpaceSim != on; + mConfig.simulation.localSpaceSim = on; + } + bool getLocalSpaceSim() const + { + return mConfig.simulation.localSpaceSim; + } + + + + // configuration.animation + void setShowSkinnedPose(bool on) + { + mConfig.animation.showSkinnedPose = on; + } + bool getShowSkinnedPose() + { + return mConfig.animation.showSkinnedPose; + } + + void setAnimation(int animation); + int getAnimation() const + { + return mConfig.animation.selectedAnimation; + } + + void setAnimationSpeed(int s) + { + mDirty.workspace |= mConfig.animation.speed != s; + mConfig.animation.speed = s; + } + int getAnimationSpeed() const + { + return mConfig.animation.speed; + } + + void setAnimationTimes(float val) + { + mConfig.animation.time = val; + } + float getAnimationTimes() const + { + return mConfig.animation.time; + } + void stepAnimationTimes(float animStep); + bool clampAnimation(float& time, bool stoppable, bool loop, float minTime, float maxTime); + + void setLoopAnimation(bool on) + { + mDirty.workspace |= mConfig.animation.loop != on; + mConfig.animation.loop = on; + } + bool getLoopAnimation() const + { + return mConfig.animation.loop; + } + + void setLockRootbone(bool on) + { + mDirty.workspace |= mConfig.animation.lockRootbone != on; + mConfig.animation.lockRootbone = on; + mState.manualAnimation = true; + } + bool getLockRootbone() const + { + return mConfig.animation.lockRootbone; + } + + void setAnimationContinuous(bool on) + { + mDirty.workspace |= mConfig.animation.continuous != on; + mConfig.animation.continuous = on; + } + bool getAnimationContinuous() const + { + return mConfig.animation.continuous; + } + + void setUseGlobalPoseMatrices(bool on) + { + mDirty.workspace |= mConfig.animation.useGlobalPoseMatrices != on; + mState.needsRestart = mConfig.animation.useGlobalPoseMatrices != on; + mConfig.animation.useGlobalPoseMatrices = on; + } + bool getUseGlobalPoseMatrices() const + { + return mConfig.animation.useGlobalPoseMatrices; + } + + void setApplyGlobalPoseInApp(bool on) + { + mDirty.workspace |= mConfig.animation.applyGlobalPoseInApp != on; + mState.needsRestart = mConfig.animation.applyGlobalPoseInApp != on; + mConfig.animation.applyGlobalPoseInApp = on; + } + bool getApplyGlobalPoseInApp() const + { + return mConfig.animation.applyGlobalPoseInApp; + } + + void setAnimationCrop(float min, float max); + + + + + // configuration.deformable + void setDeformableThickness(float value) + { + mDirty.workspace |= mConfig.deformable.thickness != value; + mConfig.deformable.thickness = value; + mConfig.deformable.drawThickness = true; + } + float getDeformableThickness() const + { + return mConfig.deformable.thickness; + } + + void setDrawDeformableThickness(bool on) + { + mConfig.deformable.drawThickness = on; + } + bool getDrawDeformableThickness() const + { + return mConfig.deformable.drawThickness; + } + + void setDeformableVirtualParticleDensity(float val) + { + mDirty.workspace |= mConfig.deformable.virtualParticleDensity != val; + mConfig.deformable.virtualParticleDensity = val; + } + + float getDeformableVirtualParticleDensity() const + { + return mConfig.deformable.virtualParticleDensity; + } + + void setDeformableHierarchicalLevels(int value) + { + mDirty.workspace |= mConfig.deformable.hierarchicalLevels != value; + mConfig.deformable.hierarchicalLevels = value; + } + int getDeformableHierarchicalLevels() const + { + return mConfig.deformable.hierarchicalLevels; + } + + void setDeformableDisableCCD(bool on) + { + mDirty.workspace |= mConfig.deformable.disableCCD != on; + mConfig.deformable.disableCCD = on; + } + bool getDeformableDisableCCD() const + { + return mConfig.deformable.disableCCD; + } + + void setDeformableTwowayInteraction(bool on) + { + mDirty.workspace |= mConfig.deformable.twowayInteraction != on; + mConfig.deformable.twowayInteraction = on; + } + bool getDeformableTwowayInteraction() const + { + return mConfig.deformable.twowayInteraction; + } + + void setDeformableUntangling(bool on) + { + mDirty.workspace |= mConfig.deformable.untangling != on; + mConfig.deformable.untangling = on; + } + bool getDeformableUntangling() const + { + return mConfig.deformable.untangling; + } + + void setDeformableRestLengthScale(float scale) + { + mDirty.workspace |= mConfig.deformable.restLengthScale != scale; + mConfig.deformable.restLengthScale = scale; + } + float getDeformableRestLengthScale() const + { + return mConfig.deformable.restLengthScale; + } + + + // init configuration + void resetTempConfiguration(); + void initConfiguration(); + void prepareConfiguration(); + + + size_t getNumCommands() const + { + return mRecordCommands.size(); + } + int getCommandFrameNumber(size_t index) const + { + return mRecordCommands[index].frameNumber; + } + const char* getCommandString(size_t index) const + { + return mRecordCommands[index].command.c_str(); + } + void addCommand(const char* command, int frameNumber = -2); + void clearCommands(); + + // file IO + bool loadParameterized(const char* filename, physx::PxFileBuf* filebuffer, NvParameterized::Serializer::DeserializedData& deserializedData, bool silent = false); + bool saveParameterized(const char* filename, physx::PxFileBuf* filebuffer, const NvParameterized::Interface** pInterfaces, unsigned int numInterfaces); + + void clearLoadedActorDescs(); + +protected: + std::vector<NvParameterized::Interface*> mLoadedActorDescs; + std::vector<float> mMaxTimesteps; + std::vector<int> mMaxIterations; + std::vector<int> mTimestepMethods; + std::vector<float> mDts; + std::vector<physx::PxVec3> mGravities; + unsigned int mCurrentActorDesc; + +private: + NvParameterized::Serializer::SerializeType extensionToType(const char* filename) const; + bool parameterizedError(NvParameterized::Serializer::ErrorType errorType, const char* filename); + + void setAuthoringState(AuthoringState::Enum authoringState, bool allowAdvance); + + // internal methods + HACD::AutoGeometry* createAutoGeometry(); + void addCollisionVolumeInternal(HACD::SimpleHull* hull, bool useCapsule); + + void createRenderMeshAssets(); + void createCustomMesh(); + void createClothMeshes(nvidia::apex::IProgressListener* progress); + void createClothingAsset(nvidia::apex::IProgressListener* progress); + + void updateDeformableParameters(); + + struct CurrentState + { + bool needsRedraw; + bool needsRestart; + bool needsReconnect; + bool manualAnimation; + AuthoringState::Enum authoringState; + float simulationValuesScale; + float gravityValueScale; + + typedef std::map<std::string, NvParameterized::Interface*> tMaterialLibraries; + tMaterialLibraries materialLibraries; + + std::string selectedMaterialLibrary; + std::string selectedMaterial; + + physx::PxVec3 windOrigin; + physx::PxVec3 windTarget; + float drawWindTime; + + physx::PxBounds3 apexBounds; + + int currentFrameNumber; + + void init() + { + needsRedraw = false; + needsRestart = false; + needsReconnect = false; + manualAnimation = false; + authoringState = AuthoringState::None; + simulationValuesScale = 1.0f; + gravityValueScale = 0.0f; + + for (tMaterialLibraries::iterator it = materialLibraries.begin(); it != materialLibraries.end(); ++it) + { + it->second->destroy(); + } + + materialLibraries.clear(); + + selectedMaterialLibrary.clear(); + selectedMaterial.clear(); + + windOrigin = physx::PxVec3(0.0f); + windTarget = physx::PxVec3(0.0f); + drawWindTime = 0; + + apexBounds.setEmpty(); + + currentFrameNumber = -1; + } + }; + CurrentState mState; + + + + struct DirtyFlags + { + bool maxDistancePainting; + bool maxDistanceScale; + bool clothingActorFlags; + bool groundPlane; + bool gravity; + bool blendTime; + bool pressure; + bool workspace; + + void init() + { + maxDistancePainting = false; + maxDistanceScale = false; + clothingActorFlags = false; + groundPlane = false; + gravity = false; + blendTime = false; + pressure = false; + workspace = false; + } + }; + DirtyFlags mDirty; + + + + struct Simulation + { + struct ClothingActor + { + ClothingActor() : scale(1.0f), triangleMesh(NULL) + { + initPose = physx::PxMat44(physx::PxIdentity); + currentPose = physx::PxMat44(physx::PxIdentity); + } + physx::PxMat44 initPose; + physx::PxMat44 currentPose; + float scale; + Samples::TriangleMesh* triangleMesh; + std::vector<nvidia::apex::ClothingActor*> actors; + std::vector<nvidia::apex::ClothingPreview*> previews; + std::vector<nvidia::apex::ClothingPlane*> actorGroundPlanes; + }; + + physx::PxCpuDispatcher* cpuDispatcher; + nvidia::apex::Scene* apexScene; + nvidia::apex::AssetPreviewScene* previewScene; + physx::PxCudaContextManager* cudaContextManager; + + physx::PxScene* physxScene; + physx::PxMaterial* physxMaterial; + + bool running; + + struct ClothingAsset + { + ClothingAsset(nvidia::apex::ClothingAsset* _apexAsset) : apexAsset(_apexAsset) {} + void releaseRenderMeshAssets(); + + nvidia::apex::ClothingAsset* apexAsset; + std::vector<short> remapToSkeleton; + std::vector<std::vector<nvidia::apex::ClothingMeshSkinningMap> > meshSkinningMaps; + std::vector<nvidia::apex::RenderMeshAsset*> renderMeshAssets; + }; + + std::vector<ClothingAsset> assets; + bool clearAssets; + int actorCount; + std::vector<ClothingActor> actors; + bool paused; + + physx::PxRigidStatic* groundPlane; + + unsigned int stepsUntilPause; + unsigned int frameNumber; + + physx::PxMat44 CCTPose; + physx::PxVec3 CCTDirection; + physx::PxVec3 CCTRotationDelta; + + + void init() + { + cpuDispatcher = NULL; + apexScene = NULL; + cudaContextManager = NULL; + physxScene = NULL; + physxMaterial = NULL; + groundPlane = NULL; + running = false; + clearAssets = true; + actorCount = 1; + paused = false; + stepsUntilPause = 0; + frameNumber = 0; + + CCTPose = physx::PxMat44(physx::PxIdentity); + CCTDirection = physx::PxVec3(0.0f); + CCTRotationDelta = physx::PxVec3(0.0f); + } + + void clear(); + }; + Simulation mSimulation; + + + + struct Meshes + { + Samples::TriangleMesh* inputMesh; + std::string inputMeshFilename; + MeshPainter* painter; + + Samples::TriangleMesh* customPhysicsMesh; + std::string customPhysicsMeshFilename; + + Samples::TriangleMesh* groundMesh; + + Samples::SkeletalAnim* skeleton; + Samples::SkeletalAnim* skeletonBehind; + std::vector<int> skeletonRemap; + + std::vector<CollisionVolume> collisionVolumes; + + bool tangentSpaceGenerated; + + struct SubdivideHistoryItem + { + int submesh; + int subdivision; + }; + std::vector<SubdivideHistoryItem> subdivideHistory; + + + struct SubmeshMaterialRename + { + int submesh; + std::string newName; + }; + + void init() + { + inputMesh = NULL; + //inputMeshFilename.clear(); + painter = NULL; + + customPhysicsMesh = NULL; + customPhysicsMeshFilename.clear(); + groundMesh = NULL; + + skeleton = NULL; + skeletonBehind = NULL; + skeletonRemap.clear(); + + collisionVolumes.clear(); + subdivideHistory.clear(); + tangentSpaceGenerated = false; + } + + void clear(nvidia::apex::UserRenderResourceManager* rrm, nvidia::apex::ResourceCallback* rcb, bool groundAsWell); + }; + Meshes mMeshes; + + + + struct AuthoringObjects + { + std::vector<nvidia::apex::RenderMeshAssetAuthoring*> renderMeshAssets; + std::vector<nvidia::apex::ClothingPhysicalMesh*> physicalMeshes; + nvidia::apex::ClothingAssetAuthoring* clothingAssetAuthoring; + + void init() + { + renderMeshAssets.clear(); + physicalMeshes.clear(); + clothingAssetAuthoring = NULL; + } + + void clear(); + }; + AuthoringObjects mAuthoringObjects; + + // configuration + std::map<std::string, float*> mFloatConfiguration; + std::map<std::string, float*> mFloatConfigurationOld; + std::map<std::string, int*> mIntConfiguration; + std::map<std::string, int*> mIntConfigurationOld; + std::map<std::string, bool*> mBoolConfiguration; + std::map<std::string, bool*> mBoolConfigurationOld; + + struct configUI + { + bool zAxisUp; + bool spotLight; + bool spotLightShadow; + + void init() + { + zAxisUp = false; + spotLight = false; + spotLightShadow = true; + } + }; + + struct configMesh + { + int originalMeshSubdivision; + bool evenOutVertexDegrees; + int cullMode; + int textureUvOrigin; + int physicalMeshType; + + void init() + { + originalMeshSubdivision = 10; + evenOutVertexDegrees = false; + cullMode = nvidia::apex::RenderCullMode::NONE; + textureUvOrigin = nvidia::apex::TextureUVOrigin::ORIGIN_TOP_LEFT; + physicalMeshType = 0; + } + }; + + struct configApex + { + bool parallelCpuSkinning; + bool recomputeNormals; + bool recomputeTangents; + bool correctSimulationNormals; + bool useMorphTargetTest; + bool forceEmbedded; + + void init() + { + parallelCpuSkinning = true; + recomputeNormals = false; + recomputeTangents = false; + correctSimulationNormals = true; + useMorphTargetTest = false; + forceEmbedded = false; + } + }; + + struct configCloth + { + int numGraphicalLods; + int simplify; + bool close; + bool subdivide; + int subdivision; + + void init() + { + numGraphicalLods = 1; + simplify = 40; + close = false; + subdivide = false; + subdivision = 40; + } + }; + + struct configCollisionVolumes + { + bool usePaintingChannel; + + void init() + { + usePaintingChannel = false; + } + }; + + struct configPainting + { + int brushMode; + float falloffExponent; + int channel; + float value; + float valueMin; + float valueMax; + int valueFlag; + int brushRadius; + float scalingMaxdistance; + float scalingCollisionFactor; + float maxDistanceScale; + bool maxDistanceScaleMultipliable; + + void init() + { + brushMode = BrushMode::PaintFlat; + falloffExponent = 1.0f; + channel = 4; // NUM_CHANNELS + value = 1.0f; + valueMin = 0.0f; + valueMax = 1.0f; + valueFlag = 1; + brushRadius = 50; + scalingMaxdistance = 1.0f; + scalingCollisionFactor = 1.0f; + maxDistanceScale = 1.0f; + maxDistanceScaleMultipliable = true; + } + }; + + struct configSetMeshes + { + bool deriveNormalsFromBones; + + void init() + { + deriveNormalsFromBones = false; + } + }; + + struct configSimulation + { + float frequency; + int gravity; + int groundplane; + bool groundplaneEnabled; + int budgetPercent; + float interCollisionDistance; + float interCollisionStiffness; + int interCollisionIterations; + float blendTime; + float pressure; + int lodOverwrite; + int windDirection; + int windElevation; + int windVelocity; + bool gpuSimulation; + bool meshSkinningInApp; + bool fallbackSkinning; + float CCTSpeed; + int graphicalLod; + bool usePreview; + float timingNoise; + float scaleFactor; + bool localSpaceSim; + + bool pvdDebug; + bool pvdProfile; + bool pvdMemory; + + void init() + { + frequency = 50.0f; + gravity = 10; + groundplane = 0; + groundplaneEnabled = true; + budgetPercent = 100; + interCollisionDistance = 0.1f; + interCollisionStiffness = 1.0f; + interCollisionIterations = 1; + blendTime = 1.0f; + pressure = -1.0f; + lodOverwrite = -1; + windDirection = 0; + windElevation = 0; + windVelocity = -1; + gpuSimulation = true; + meshSkinningInApp = false; + fallbackSkinning = false; + CCTSpeed = 0.0f; + graphicalLod = 0; + usePreview = false; + timingNoise = 0.0f; + scaleFactor = 1.0f; + localSpaceSim = true; + + pvdDebug = true; + pvdProfile = true; + pvdMemory = false; + } + }; + + struct configAnimation + { + bool showSkinnedPose; // can overwrite mAnimatio>0 for the non-simulating part + int selectedAnimation; // 0 and negative mean no animation (use negative to switch off and remember which one) + int speed; + float time; + bool loop; + bool lockRootbone; + bool continuous; + bool useGlobalPoseMatrices; + bool applyGlobalPoseInApp; + + float cropMin; + float cropMax; + + void init() + { + showSkinnedPose = false; + selectedAnimation = -1; + speed = 100; + time = 0.0f; + loop = true; + lockRootbone = false; + continuous = false; + useGlobalPoseMatrices = true; + applyGlobalPoseInApp = false; + + cropMin = 0.0f; + cropMax = 1000000.0f; + } + }; + + struct configDeformable + { + float thickness; + bool drawThickness; + float virtualParticleDensity; + int hierarchicalLevels; + bool disableCCD; + bool twowayInteraction; + bool untangling; + float restLengthScale; + + void init() + { + thickness = 0.01f; + drawThickness = false; + virtualParticleDensity = 0.0f; + hierarchicalLevels = 0; + disableCCD = false; + twowayInteraction = false; + untangling = false; + restLengthScale = 1.0f; + } + }; + + struct Configuration + { + configUI ui; + configMesh mesh; + configApex apex; + configCloth cloth; + configCollisionVolumes collisionVolumes; + configPainting painting; + configSetMeshes setMeshes; + configSimulation simulation; + configAnimation animation; + configDeformable deformable; + + void init() + { + ui.init(); + mesh.init(); + apex.init(); + cloth.init(); + collisionVolumes.init(); + painting.init(); + setMeshes.init(); + simulation.init(); + animation.init(); + deformable.init(); + } + }; + + Configuration mConfig; + + struct Command + { + int frameNumber; + std::string command; + }; + + std::vector<Command> mRecordCommands; + + +protected: + + // APEX + nvidia::apex::ApexSDK* _mApexSDK; + nvidia::apex::ModuleClothing* _mModuleClothing; + + nvidia::apex::RenderDebugInterface* _mApexRenderDebug; + + nvidia::apex::ResourceCallback* _mResourceCallback; + + nvidia::apex::UserRenderResourceManager* _mRenderResourceManager; + Samples::MaterialList* _mMaterialList; + + nvidia::PxPvd* mPvd; + + // Callback + ErrorCallback* _mErrorCallback; + + std::vector<NotificationCallback*> _mNotifyCallbacks; + +}; + +} // namespace SharedTools + +#endif //PX_WINDOWS_FAMILY + +#endif //CLOTHING_AUTHORING_H + diff --git a/APEX_1.4/shared/external/include/DirEntry.h b/APEX_1.4/shared/external/include/DirEntry.h new file mode 100644 index 00000000..c854e394 --- /dev/null +++ b/APEX_1.4/shared/external/include/DirEntry.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef DIR_ENTRY_INCLUDE_H +#define DIR_ENTRY_INCLUDE_H + +#include "PxPreprocessor.h" + +#if PX_WINDOWS_FAMILY + #include "windows/DirEntry.h" +#elif PX_XBOXONE + #include "xboxone/DirEntry.h" +#elif (PX_LINUX_FAMILY || PX_APPLE_FAMILY || PX_ANDROID) + #include "linux/DirEntry.h" +#elif PX_PS4 + #include "ps4/DirEntry.h" +#else + #error "Platform not supported!" +#endif + +#endif // DIR_ENTRY_INCLUDE_H diff --git a/APEX_1.4/shared/external/include/FilterBits.h b/APEX_1.4/shared/external/include/FilterBits.h new file mode 100644 index 00000000..242d10ff --- /dev/null +++ b/APEX_1.4/shared/external/include/FilterBits.h @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef FILTER_BITS_H + +#define FILTER_BITS_H + +// This class lets the user define an arbitrary set of 'types' or 'groups' up to 64 different kinds. +// Each 'type' is assigned a bit position up to 64 bits total. +// +// The application can decide whether a null string should be treated as all bits are off, or all bits are on. +// +// This class organizes and builds everything as 64 bits, but has the option of returning only a 32 bit version +// if that better matches the application requirements. +// +// Both the 64 bit and 32 bit representations are const pointers which are guaranteed to be persistent for the lifetime of the +// parent object. That way you can cache them in your own internal code. +// +// The purpose of this is so that artists/designers can express a set of 'groups/types' which interact with matching group +// types without depending on a hard coded predefined set of options. +// +// Here are some examples: +// +// "player=terrain,building" +// +// In this example the user would be specifying that this is an object of type 'player' which interacts with types 'terrain and building' +// +// The pointer to the filterData bits are persistent and can be cached by the application. +// +// It's important to note that: "a,b,c=d,e,f" will return the same result as "c,b,a=f,e,d" +// +// The following two strings are reserved: "none" and "all" where 'none' means all bits set to zero, and "all" means all bits set to one. + +#include "PxSimpleTypes.h" +#include "ApexUsingNamespace.h" + +class FilterData +{ +public: + FilterData(void) + { + w64.typeBits64 = 0; + w64.matchBits64 = 0; + typeString = 0; + for (uint32_t i=0; i<64; i++) + { + weights[i] = 1.0f; + } + } + union + { + struct + { + uint64_t typeBits64; // The set of bits which describe what 'type' or 'group' this corresponds with + uint64_t matchBits64; // The set of bits describing which types or groups this object interacts with. + } w64; + struct + { + uint32_t word0; + uint32_t word1; + uint32_t word2; + uint32_t word3; + } w32; + }; + float weights[64]; // filter data weights. + const char *typeString; // the source string which produced this set of bits. +}; + +// The 128 bit encoding of the FilterData class +class EncodedFilterData +{ +public: + union + { + struct + { + uint64_t typeBits64; // The set of bits which describe what 'type' or 'group' this corresponds with + uint64_t matchBits64; // The set of bits describing which types or groups this object interacts with. + } ew64; + struct + { + uint32_t word0; + uint32_t word1; + uint32_t word2; + uint32_t word3; + } ew32; + }; +}; + +class FilterBits +{ +public: + // Returns the ASCII string equivalent of this set of FilterData flags + virtual const char *getFilterDataString(const FilterData &fd) const = 0; + + // Returns the combination of string of types based on this bit sequence. + virtual const char *getFilterString(uint64_t bits) const = 0; + + // Returns the string for a single bit type 0-63 + virtual const char *getTypeString(uint8_t type) const = 0; // single type 0-63 + + // Return the bit flag for a single group/type, the parameter 'index' will be assigned with it's array index. If the type is 'all', then it will be set to 0xFFFFFFFF + virtual uint64_t getTypeBit(const char *str,uint32_t &index,bool &applyDefault) = 0; + + // Returns how many types were defined. + virtual uint8_t getTypeCount(void) const = 0; + + // Converts this ASCII string to it's corresponding binary bit representation with up to 64 bits worth of types. + virtual const FilterData *getFilterData(const char *str) = 0; + + virtual const EncodedFilterData *getEncodedFilterData(const char *str) = 0; + + // Encode it into 128 bits + virtual const EncodedFilterData &getEncodedFilterData(const FilterData &fd) = 0; + + // If this is properly encoded filter data, then return the original filter-data pointer + virtual FilterData * getFilterData(const EncodedFilterData &d) const = 0; + + virtual bool isEncodedFilterData(const EncodedFilterData &d) const = 0; + + // see if these two objects interact and, if so, return the weighting value to apply + virtual bool getWeightedFilter(const EncodedFilterData &o1,const EncodedFilterData &o2,float &weight) = 0; + + virtual void release(FilterData &fb) = 0; + + virtual void release(void) = 0; + +protected: + virtual ~FilterBits(void) + { + } +}; + +FilterBits *createFilterBits(void); + +extern FilterBits *gFilterBits; + + +#endif diff --git a/APEX_1.4/shared/external/include/Find.h b/APEX_1.4/shared/external/include/Find.h new file mode 100644 index 00000000..a40f5105 --- /dev/null +++ b/APEX_1.4/shared/external/include/Find.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef FIND_H +#define FIND_H + +namespace nvidia { +namespace apex { + +class FileHandler +{ +public: + virtual void handle(const char*) = 0; +}; + +void Find(const char* root, FileHandler& f, const char** ignoredFiles = 0); + +}} + +#endif diff --git a/APEX_1.4/shared/external/include/GL/glext.h b/APEX_1.4/shared/external/include/GL/glext.h new file mode 100644 index 00000000..4a2628b0 --- /dev/null +++ b/APEX_1.4/shared/external/include/GL/glext.h @@ -0,0 +1,3336 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __glext_h_ +#define __glext_h_ + +#ifdef __cplusplus +extern "C" { +#endif + + /* + ** License Applicability. Except to the extent portions of this file are + ** made subject to an alternative license as permitted in the SGI Free + ** Software License B, Version 1.1 (the "License"), the contents of this + ** file are subject only to the provisions of the License. You may not use + ** this file except in compliance with the License. You may obtain a copy + ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 + ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: + ** + ** http://oss.sgi.com/projects/FreeB + ** + ** Note that, as provided in the License, the Software is distributed on an + ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS + ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND + ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A + ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. + ** + ** Original Code. The Original Code is: OpenGL Sample Implementation, + ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, + ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. + ** Copyright in any portions created by third parties is as indicated + ** elsewhere herein. All Rights Reserved. + ** + ** Additional Notice Provisions: This software was created using the + ** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has + ** not been independently verified as being compliant with the OpenGL(R) + ** version 1.2.1 Specification. + */ + +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) +#define WIN32_LEAN_AND_MEAN 1 +#include <windows.h> +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif + + /*************************************************************/ + + /* Header file version number, required by OpenGL ABI for Linux */ +#define GL_GLEXT_VERSION 6 + +#ifndef GL_VERSION_1_2 +#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_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_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_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_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_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_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_SOURCE3_RGB 0x8583 +#define GL_SOURCE4_RGB 0x8584 +#define GL_SOURCE5_RGB 0x8585 +#define GL_SOURCE6_RGB 0x8586 +#define GL_SOURCE7_RGB 0x8587 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_SOURCE3_ALPHA 0x858B +#define GL_SOURCE4_ALPHA 0x858C +#define GL_SOURCE5_ALPHA 0x858D +#define GL_SOURCE6_ALPHA 0x858E +#define GL_SOURCE7_ALPHA 0x858F +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND3_RGB 0x8593 +#define GL_OPERAND4_RGB 0x8594 +#define GL_OPERAND5_RGB 0x8595 +#define GL_OPERAND6_RGB 0x8596 +#define GL_OPERAND7_RGB 0x8597 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_OPERAND3_ALPHA 0x859B +#define GL_OPERAND4_ALPHA 0x859C +#define GL_OPERAND5_ALPHA 0x859D +#define GL_OPERAND6_ALPHA 0x859E +#define GL_OPERAND7_ALPHA 0x859F +#define GL_SUBTRACT 0x84E7 +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF + +#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_CLAMP_TO_BORDER 0x812D + +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#endif + +#ifndef GL_APPLE_specular_vector +#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 +#endif + +#ifndef GL_APPLE_transform_hint +#define GL_TRANSFORM_HINT_APPLE 0x85B1 +#endif + +#ifndef GL_ARB_depth_texture +#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 +#endif + +#ifndef GL_ARB_fragment_program +#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 +#endif + +#ifndef GL_ARB_multisample +#define WGL_SAMPLE_BUFFERS_ARB 0x2041 +#define WGL_SAMPLES_ARB 0x2042 +#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 +#endif + +#ifndef GL_ARB_multitexture +#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 +#endif + +#ifndef GL_ARB_point_parameters +#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 +#endif + +#ifndef GL_ARB_shadow +#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C +#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D +#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E +#endif + +#ifndef GL_ARB_texture_border_clamp +#define GL_CLAMP_TO_BORDER_ARB 0x812D +#endif + +#ifndef GL_ARB_texture_compression +#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_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 +#endif + +#ifndef GL_ARB_texture_cube_map +#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 +#endif + +#ifndef GL_ARB_texture_env_add +#endif + +#ifndef GL_ARB_texture_env_combine +#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 GL_SUBTRACT_ARB 0x84E7 +#endif + +#ifndef GL_ARB_texture_env_dot3 +#define GL_DOT3_RGB_ARB 0x86AE +#define GL_DOT3_RGBA_ARB 0x86AF +#endif + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_MIRRORED_REPEAT_ARB 0x8370 +#endif + +#ifndef GL_ARB_transpose_matrix +#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 +#endif + +#ifndef GL_ARB_vertex_buffer_object +#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 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_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 +#define GL_READ_ONLY_ARB 0x88B8 +#define GL_WRITE_ONLY_ARB 0x88B9 +#define GL_READ_WRITE_ARB 0x88BA +#define GL_BUFFER_SIZE_ARB 0x8764 +#define GL_BUFFER_USAGE_ARB 0x8765 +#define GL_BUFFER_ACCESS_ARB 0x88BB +#define GL_BUFFER_MAPPED_ARB 0x88BC +#define GL_BUFFER_MAP_POINTER_ARB 0x88BD +#endif + +#ifndef GL_ARB_vertex_program +#define GL_VERTEX_PROGRAM_ARB 0x8620 +#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 +#define GL_COLOR_SUM_ARB 0x8458 +#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 +#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_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A +#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 +#define GL_PROGRAM_LENGTH_ARB 0x8627 +#define GL_PROGRAM_FORMAT_ARB 0x8876 +#define GL_PROGRAM_BINDING_ARB 0x8677 +#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_PROGRAM_STRING_ARB 0x8628 +#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B +#define GL_CURRENT_MATRIX_ARB 0x8641 +#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 +#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 +#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 +#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F +#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E +#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 +#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 +#endif + +#ifndef GL_ARB_window_pos +#endif + +#ifndef GL_EXT_422_pixels +#define GL_422_EXT 0x80CC +#define GL_422_REV_EXT 0x80CD +#define GL_422_AVERAGE_EXT 0x80CE +#define GL_422_REV_AVERAGE_EXT 0x80CF +#endif + +#ifndef GL_EXT_abgr +#define GL_ABGR_EXT 0x8000 +#endif + +#ifndef GL_EXT_bgra +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 +#endif + +#ifndef GL_EXT_blend_color +#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 +#endif + +#ifndef GL_EXT_blend_func_separate +#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 +#endif + +#ifndef GL_EXT_blend_logic_op +#endif + +#ifndef GL_EXT_blend_minmax +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_BLEND_EQUATION_EXT 0x8009 +#endif + +#ifndef GL_EXT_blend_subtract +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B +#endif + +#ifndef GL_EXT_polygon_offset +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 +#endif + +#ifndef GL_EXT_clip_volume_hint +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 +#endif + +#ifndef GL_EXT_cmyka +#define GL_CMYK_EXT 0x800C +#define GL_CMYKA_EXT 0x800D +#define GL_PACK_CMYK_HINT_EXT 0x800E +#define GL_UNPACK_CMYK_HINT_EXT 0x800F +#endif + +#ifndef GL_EXT_color_subtable +#endif + +#ifndef GL_EXT_compiled_vertex_array +#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 +#endif + +#ifndef GL_EXT_convolution +#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 +#endif + +#ifndef GL_EXT_copy_texture +#endif + +#ifndef GL_EXT_cull_vertex +#define GL_CULL_VERTEX_EXT 0x81AA +#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB +#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC +#endif + +#ifndef GL_EXT_draw_range_elements +#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 +#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 +#endif + +#ifndef GL_EXT_fog_coord +#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 +#endif + +#ifndef GL_EXT_histogram +#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 +#define GL_TABLE_TOO_LARGE_EXT 0x8031 +#endif + +#ifndef GL_EXT_misc_attribute +#endif + +#ifndef GL_EXT_index_array_formats +#define GL_IUI_V2F_EXT 0x81AD +#define GL_IUI_V3F_EXT 0x81AE +#define GL_IUI_N3F_V2F_EXT 0x81AF +#define GL_IUI_N3F_V3F_EXT 0x81B0 +#define GL_T2F_IUI_V2F_EXT 0x81B1 +#define GL_T2F_IUI_V3F_EXT 0x81B2 +#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 +#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 +#endif + +#ifndef GL_EXT_index_func +#define GL_INDEX_TEST_EXT 0x81B5 +#define GL_INDEX_TEST_FUNC_EXT 0x81B6 +#define GL_INDEX_TEST_REF_EXT 0x81B7 +#endif + +#ifndef GL_EXT_index_material +#define GL_INDEX_MATERIAL_EXT 0x81B8 +#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 +#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA +#endif + +#ifndef GL_EXT_index_texture +#endif + +#ifndef GL_EXT_light_texture +#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 + /* reuse GL_FRAGMENT_DEPTH_EXT */ +#endif + +#ifndef GL_EXT_multi_draw_arrays +#endif + +#ifndef GL_EXT_packed_pixels +#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 +#endif + +#ifndef GL_EXT_paletted_texture +#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 +#endif + +#ifndef GL_EXT_pixel_transform +#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 +#endif + +#ifndef GL_EXT_pixel_transform_color_table +#endif + +#ifndef GL_EXT_point_parameters +#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 +#endif + +#ifndef GL_EXT_rescale_normal +#define GL_RESCALE_NORMAL_EXT 0x803A +#endif + +#ifndef GL_EXT_secondary_color +#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 +#endif + +#ifndef GL_EXT_separate_specular_color +#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 +#define GL_SINGLE_COLOR_EXT 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA +#endif + +#ifndef GL_EXT_shadow_funcs +#endif + +#ifndef GL_EXT_shared_texture_palette +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB +#endif + +#ifndef GL_EXT_stencil_two_side +#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 +#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 +#endif + +#ifndef GL_EXT_stencil_wrap +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 +#endif + +#ifndef GL_EXT_subtexture +#endif + +#ifndef GL_EXT_texture +#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 GL_TEXTURE_TOO_LARGE_EXT 0x8065 +#endif + +#ifndef GL_EXT_texture_compression_s3tc +#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 +#endif + +#ifndef GL_EXT_texture_cube_map +#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 +#endif + +#ifndef GL_EXT_coordinate_frame +#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 +#endif + +#ifndef GL_EXT_texture_edge_clamp +#define CLAMP_TO_EDGE_EXT 0x812F +#endif + +#ifndef GL_EXT_texture_env_add +#endif + +#ifndef GL_EXT_texture_env_combine +#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_SOURCE3_RGB_EXT 0x8583 +#define GL_SOURCE4_RGB_EXT 0x8584 +#define GL_SOURCE5_RGB_EXT 0x8585 +#define GL_SOURCE6_RGB_EXT 0x8586 +#define GL_SOURCE7_RGB_EXT 0x8587 +#define GL_SOURCE0_ALPHA_EXT 0x8588 +#define GL_SOURCE1_ALPHA_EXT 0x8589 +#define GL_SOURCE2_ALPHA_EXT 0x858A +#define GL_SOURCE3_ALPHA_EXT 0x858B +#define GL_SOURCE4_ALPHA_EXT 0x858C +#define GL_SOURCE5_ALPHA_EXT 0x858D +#define GL_SOURCE6_ALPHA_EXT 0x858E +#define GL_SOURCE7_ALPHA_EXT 0x858F +#define GL_OPERAND0_RGB_EXT 0x8590 +#define GL_OPERAND1_RGB_EXT 0x8591 +#define GL_OPERAND2_RGB_EXT 0x8592 +#define GL_OPERAND3_RGB_EXT 0x8593 +#define GL_OPERAND4_RGB_EXT 0x8594 +#define GL_OPERAND5_RGB_EXT 0x8595 +#define GL_OPERAND6_RGB_EXT 0x8596 +#define GL_OPERAND7_RGB_EXT 0x8597 +#define GL_OPERAND0_ALPHA_EXT 0x8598 +#define GL_OPERAND1_ALPHA_EXT 0x8599 +#define GL_OPERAND2_ALPHA_EXT 0x859A +#define GL_OPERAND3_ALPHA_EXT 0x859B +#define GL_OPERAND4_ALPHA_EXT 0x859C +#define GL_OPERAND5_ALPHA_EXT 0x859D +#define GL_OPERAND6_ALPHA_EXT 0x859E +#define GL_OPERAND7_ALPHA_EXT 0x859F +#endif + +#ifndef GL_EXT_texture_env_dot3 +#define GL_DOT3_RGB_EXT 0x8740 +#define GL_DOT3_RGBA_EXT 0x8741 +#endif + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +#endif + +#ifndef GL_EXT_texture_lod_bias +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 +#endif + +#ifndef GL_EXT_texture_object +#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 +#endif + +#ifndef GL_EXT_texture_perturb_normal +#define GL_PERTURB_EXT 0x85AE +#define GL_TEXTURE_NORMAL_EXT 0x85AF +#endif + +#ifndef GL_EXT_texture3D +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 +#endif + +#ifndef GL_EXT_vertex_array +#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 +#endif + +#ifndef GL_EXT_vertex_weighting +#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH +#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 +#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX +#define GL_MODELVIEW_MATRIX1_EXT 0x8506 +#define GL_VERTEX_WEIGHTING_EXT 0x8509 +#define GL_MODELVIEW0_EXT GL_MODELVIEW +#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 +#endif + +#ifndef GL_HP_occlusion_test +#define GL_OCCLUSION_TEST_HP 0x8165 +#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 +#endif + +#ifndef GL_HP_convolution_border_modes +#define GL_IGNORE_BORDER_HP 0x8150 +#define GL_CONSTANT_BORDER_HP 0x8151 +#define GL_REPLICATE_BORDER_HP 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 +#endif + +#ifndef GL_HP_image_transform +#define GL_IMAGE_SCALE_X_HP 0x8155 +#define GL_IMAGE_SCALE_Y_HP 0x8156 +#define GL_IMAGE_TRANSLATE_X_HP 0x8157 +#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 +#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 +#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A +#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B +#define GL_IMAGE_MAG_FILTER_HP 0x815C +#define GL_IMAGE_MIN_FILTER_HP 0x815D +#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E +#define GL_CUBIC_HP 0x815F +#define GL_AVERAGE_HP 0x8160 +#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 +#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 +#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 +#endif + +#ifndef GL_HP_texture_lighting +#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 +#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 +#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 +#endif + +#ifndef GL_IBM_cull_vertex +#define GL_CULL_VERTEX_IBM 103050 +#endif + +#ifndef GL_IBM_multimode_draw_arrays +#endif + +#ifndef GL_IBM_rasterpos_clip +#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 +#endif + +#ifndef GL_IBM_texture_mirrored_repeat +#define GL_MIRRORED_REPEAT_IBM 0x8370 +#endif + +#ifndef GL_IBM_vertex_array_lists +#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 +#endif + +#ifndef GL_INGR_color_clamp +#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 +#endif + +#ifndef GL_INGR_interlace_read +#define GL_INTERLACE_READ_INGR 0x8568 +#endif + +#ifndef GL_INGR_palette_buffer +#endif + +#ifndef GL_INTEL_parallel_arrays +#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 +#endif + +#ifndef GL_INTEL_texture_scissor +#endif + +#ifndef GL_MESA_resize_buffers +#endif + +#ifndef GL_MESA_window_pos +#endif + +#ifndef GL_NV_blend_square +#endif + +#ifndef GL_NV_copy_depth_to_color +#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E +#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F +#endif + +#ifndef GL_NV_depth_clamp +#define GL_DEPTH_CLAMP_NV 0x864F +#endif + +#ifndef GL_NV_element_array +#define GL_ELEMENT_ARRAY_TYPE_NV 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_NV 0x876A +#endif + +#ifndef GL_NV_fence +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 +#endif + +#ifndef GL_NV_float_buffer +#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 +#endif + +#ifndef GL_NV_fog_distance +#define GL_FOG_DISTANCE_MODE_NV 0x855A +#define GL_EYE_RADIAL_NV 0x855B +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C + /* reuse GL_EYE_PLANE */ +#endif + +#ifndef GL_NV_fragment_program +#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 +#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 +#endif + +#ifndef GL_NV_half_float +#define GL_HALF_FLOAT_NV 0x140B +#endif + +#ifndef GL_NV_light_max_exponent +#define GL_MAX_SHININESS_NV 0x8504 +#define GL_MAX_SPOT_EXPONENT_NV 0x8505 +#endif + +#ifndef GL_NV_multisample_filter_hint +#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 +#endif + +#ifndef GL_NV_occlusion_query +#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 +#endif + +#ifndef GL_NV_packed_depth_stencil +#define GL_DEPTH_STENCIL_NV 0x84F9 +#define GL_UNSIGNED_INT_24_8_NV 0x84FA +#endif + +#ifndef GL_NV_pixel_data_range +#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 +#endif + +#ifndef GL_NV_point_sprite +#define GL_POINT_SPRITE_NV 0x8861 +#define GL_COORD_REPLACE_NV 0x8862 +#define GL_POINT_SPRITE_R_MODE_NV 0x8863 +#endif + +#ifndef GL_NV_primitive_restart +#define GL_PRIMITIVE_RESTART_NV 0x8558 +#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 +#endif + +#ifndef GL_NV_register_combiners +#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 + /* reuse GL_TEXTURE0_ARB */ + /* reuse GL_TEXTURE1_ARB */ + /* reuse GL_ZERO */ + /* reuse GL_NONE */ + /* reuse GL_FOG */ +#endif + +#ifndef GL_NV_register_combiners2 +#define GL_PER_STAGE_CONSTANTS_NV 0x8535 +#endif + +#ifndef GL_NV_stencil_two_side +#define GL_STENCIL_TEST_TWO_SIDE_NV 0x8910 +#define GL_ACTIVE_STENCIL_FACE_NV 0x8911 +#endif + +#ifndef GL_NV_texgen_emboss +#define GL_EMBOSS_LIGHT_NV 0x855D +#define GL_EMBOSS_CONSTANT_NV 0x855E +#define GL_EMBOSS_MAP_NV 0x855F +#endif + +#ifndef GL_NV_texgen_reflection +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 +#endif + +#ifndef GL_NV_texture_compression_vtc +#endif + +#ifndef GL_NV_texture_env_combine4 +#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 +#endif + +#ifndef GL_NV_texture_rectangle +#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 +#endif + +#ifndef GL_NV_texture_shader +#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_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 +#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV +#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV +#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV +#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_3D_NV 0x86EF +#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 +#endif + +#ifndef GL_NV_texture_shader2 +#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF +#endif + +#ifndef GL_NV_texture_shader3 +#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 +#endif + +#ifndef GL_NV_vertex_array_range +#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 +#endif + +#ifndef GL_NV_vertex_array_range2 +#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 +#endif + +#ifndef GL_NV_vertex_program +#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 +#endif + +#ifndef GL_NV_vertex_program1_1 +#endif + +#ifndef GL_NV_vertex_program2 +#endif + +#ifndef GL_PGI_misc_hints +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 +#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD +#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 +#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C +#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E +#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F +#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 +#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 +#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 +#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 +#define GL_CLIP_NEAR_HINT_PGI 0x1A220 +#define GL_CLIP_FAR_HINT_PGI 0x1A221 +#define GL_WIDE_LINE_HINT_PGI 0x1A222 +#define GL_BACK_NORMALS_HINT_PGI 0x1A223 +#endif + +#ifndef GL_PGI_vertex_hints +#define GL_VERTEX_DATA_HINT_PGI 0x1A22A +#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B +#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C +#define GL_MAX_VERTEX_HINT_PGI 0x1A22D +#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_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 GL_VERTEX23_BIT_PGI 0x00000004 +#define GL_VERTEX4_BIT_PGI 0x00000008 +#endif + +#ifndef GL_REND_screen_coordinates +#define GL_SCREEN_COORDINATES_REND 0x8490 +#define GL_INVERTED_SCREEN_W_REND 0x8491 +#endif + +#ifndef GL_SGI_color_matrix +#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 +#endif + +#ifndef GL_SGI_color_table +#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 +#endif + +#ifndef GL_SGI_texture_color_table +#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC +#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD +#endif + +#ifndef GL_SGIS_detail_texture +#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 +#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 +#define GL_LINEAR_DETAIL_SGIS 0x8097 +#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 +#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 +#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A +#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B +#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C +#endif + +#ifndef GL_SGIS_fog_function +#define GL_FOG_FUNC_SGIS 0x812A +#define GL_FOG_FUNC_POINTS_SGIS 0x812B +#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C +#endif + +#ifndef GL_SGIS_generate_mipmap +#define GL_GENERATE_MIPMAP_SGIS 0x8191 +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 +#endif + +#ifndef GL_SGIS_multisample +#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 +#endif + +#ifndef GL_SGIS_pixel_texture +#define GL_PIXEL_TEXTURE_SGIS 0x8353 +#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 +#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 +#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 +#endif + +#ifndef GL_SGIS_sharpen_texture +#define GL_LINEAR_SHARPEN_SGIS 0x80AD +#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE +#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF +#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 +#endif + +#ifndef GL_SGIS_texture_border_clamp +#define GL_CLAMP_TO_BORDER_SGIS 0x812D +#endif + +#ifndef GL_SGIS_texture_color_mask +#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF +#endif + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_CLAMP_TO_EDGE_SGIS 0x812F +#endif + +#ifndef GL_SGIS_texture_filter4 +#define GL_FILTER4_SGIS 0x8146 +#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 +#endif + +#ifndef GL_SGIS_texture_lod +#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 +#endif + +#ifndef GL_SGIS_texture_select +#define GL_DUAL_ALPHA4_SGIS 0x8110 +#define GL_DUAL_ALPHA8_SGIS 0x8111 +#define GL_DUAL_ALPHA12_SGIS 0x8112 +#define GL_DUAL_ALPHA16_SGIS 0x8113 +#define GL_DUAL_LUMINANCE4_SGIS 0x8114 +#define GL_DUAL_LUMINANCE8_SGIS 0x8115 +#define GL_DUAL_LUMINANCE12_SGIS 0x8116 +#define GL_DUAL_LUMINANCE16_SGIS 0x8117 +#define GL_DUAL_INTENSITY4_SGIS 0x8118 +#define GL_DUAL_INTENSITY8_SGIS 0x8119 +#define GL_DUAL_INTENSITY12_SGIS 0x811A +#define GL_DUAL_INTENSITY16_SGIS 0x811B +#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C +#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D +#define GL_QUAD_ALPHA4_SGIS 0x811E +#define GL_QUAD_ALPHA8_SGIS 0x811F +#define GL_QUAD_LUMINANCE4_SGIS 0x8120 +#define GL_QUAD_LUMINANCE8_SGIS 0x8121 +#define GL_QUAD_INTENSITY4_SGIS 0x8122 +#define GL_QUAD_INTENSITY8_SGIS 0x8123 +#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 +#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 +#endif + +#ifndef GL_SGIS_texture4D +#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 +#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 +#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 +#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 +#define GL_TEXTURE_4D_SGIS 0x8134 +#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 +#define GL_TEXTURE_4DSIZE_SGIS 0x8136 +#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 +#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 +#define GL_TEXTURE_4D_BINDING_SGIS 0x814F +#endif + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_ALPHA_MIN_SGIX 0x8320 +#define GL_ALPHA_MAX_SGIX 0x8321 +#endif + +#ifndef GL_SGIX_clipmap +#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 +#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 +#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 +#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 +#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 +#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 +#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 +#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 +#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 +#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D +#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E +#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F +#endif + +#ifndef GL_SGIX_depth_texture +#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 +#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 +#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 +#endif + +#ifndef GL_SGIX_flush_raster +#endif + +#ifndef GL_SGIX_fog_offset +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 +#endif + +#ifndef GL_SGIX_framezoom +#define GL_FRAMEZOOM_SGIX 0x818B +#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C +#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D +#endif + +#ifndef GL_SGIX_instruments +#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 +#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 +#endif + +#ifndef GL_SGIX_interlace +#define GL_INTERLACE_SGIX 0x8094 +#endif + +#ifndef GL_SGIX_ir_instrument1 +#define GL_IR_INSTRUMENT1_SGIX 0x817F +#endif + +#ifndef GL_SGIX_list_priority +#define GL_LIST_PRIORITY_SGIX 0x8182 +#endif + +#ifndef GL_SGIX_pixel_texture +#define GL_PIXEL_TEX_GEN_SGIX 0x8139 +#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B +#endif + +#ifndef GL_SGIX_reference_plane +#define GL_REFERENCE_PLANE_SGIX 0x817D +#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E +#endif + +#ifndef GL_SGIX_resample +#define GL_PACK_RESAMPLE_SGIX 0x842C +#define GL_UNPACK_RESAMPLE_SGIX 0x842D +#define GL_RESAMPLE_REPLICATE_SGIX 0x842E +#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F +#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 +#endif + +#ifndef GL_SGIX_shadow +#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 +#endif + +#ifndef GL_SGIX_shadow_ambient +#define GL_SHADOW_AMBIENT_SGIX 0x80BF +#endif + +#ifndef GL_SGIX_sprite +#define GL_SPRITE_SGIX 0x8148 +#define GL_SPRITE_MODE_SGIX 0x8149 +#define GL_SPRITE_AXIS_SGIX 0x814A +#define GL_SPRITE_TRANSLATION_SGIX 0x814B +#define GL_SPRITE_AXIAL_SGIX 0x814C +#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D +#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E +#endif + +#ifndef GL_SGIX_tag_sample_buffer +#endif + +#ifndef GL_SGIX_texture_add_env +#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE +#endif + +#ifndef GL_SGIX_texture_lod_bias +#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E +#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F +#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 +#endif + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E +#endif + +#ifndef GL_SGIX_texture_scale_bias +#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 +#endif + +#ifndef GL_SGIX_vertex_preclip +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF +#endif + +#ifndef GL_SGIX_ycrcb +#define GL_YCRCB_422_SGIX 0x81BB +#define GL_YCRCB_444_SGIX 0x81BC +#endif + +#ifndef GL_SUN_convolution_border_modes +#define GL_WRAP_BORDER_SUN 0x81D4 +#endif + +#ifndef GL_SUN_global_alpha +#define GL_GLOBAL_ALPHA_SUN 0x81D9 +#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA +#endif + +#ifndef GL_SUN_triangle_list +#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 +#endif + +#ifndef GL_SUN_vertex +#endif + +#ifndef GL_SUNX_constant_data +#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 +#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 +#endif + +#ifndef GL_WIN_phong_shading +#define GL_PHONG_WIN 0x80EA +#define GL_PHONG_HINT_WIN 0x80EB +#endif + +#ifndef GL_WIN_specular_fog +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC +#endif + + /*************************************************************/ + +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glBlendColor(GLclampf, GLclampf, GLclampf, GLclampf); + extern void APIENTRY glBlendEquation(GLenum); + extern void APIENTRY glDrawRangeElements(GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid*); + extern void APIENTRY glColorTable(GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid*); + extern void APIENTRY glColorTableParameterfv(GLenum, GLenum, const GLfloat*); + extern void APIENTRY glColorTableParameteriv(GLenum, GLenum, const GLint*); + extern void APIENTRY glCopyColorTable(GLenum, GLenum, GLint, GLint, GLsizei); + extern void APIENTRY glGetColorTable(GLenum, GLenum, GLenum, GLvoid*); + extern void APIENTRY glGetColorTableParameterfv(GLenum, GLenum, GLfloat*); + extern void APIENTRY glGetColorTableParameteriv(GLenum, GLenum, GLint*); + extern void APIENTRY glColorSubTable(GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid*); + extern void APIENTRY glCopyColorSubTable(GLenum, GLsizei, GLint, GLint, GLsizei); + extern void APIENTRY glConvolutionFilter1D(GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid*); + extern void APIENTRY glConvolutionFilter2D(GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid*); + extern void APIENTRY glConvolutionParameterf(GLenum, GLenum, GLfloat); + extern void APIENTRY glConvolutionParameterfv(GLenum, GLenum, const GLfloat*); + extern void APIENTRY glConvolutionParameteri(GLenum, GLenum, GLint); + extern void APIENTRY glConvolutionParameteriv(GLenum, GLenum, const GLint*); + extern void APIENTRY glCopyConvolutionFilter1D(GLenum, GLenum, GLint, GLint, GLsizei); + extern void APIENTRY glCopyConvolutionFilter2D(GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); + extern void APIENTRY glGetConvolutionFilter(GLenum, GLenum, GLenum, GLvoid*); + extern void APIENTRY glGetConvolutionParameterfv(GLenum, GLenum, GLfloat*); + extern void APIENTRY glGetConvolutionParameteriv(GLenum, GLenum, GLint*); + extern void APIENTRY glGetSeparableFilter(GLenum, GLenum, GLenum, GLvoid*, GLvoid*, GLvoid*); + extern void APIENTRY glSeparableFilter2D(GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid*, const GLvoid*); + extern void APIENTRY glGetHistogram(GLenum, GLboolean, GLenum, GLenum, GLvoid*); + extern void APIENTRY glGetHistogramParameterfv(GLenum, GLenum, GLfloat*); + extern void APIENTRY glGetHistogramParameteriv(GLenum, GLenum, GLint*); + extern void APIENTRY glGetMinmax(GLenum, GLboolean, GLenum, GLenum, GLvoid*); + extern void APIENTRY glGetMinmaxParameterfv(GLenum, GLenum, GLfloat*); + extern void APIENTRY glGetMinmaxParameteriv(GLenum, GLenum, GLint*); + extern void APIENTRY glHistogram(GLenum, GLsizei, GLenum, GLboolean); + extern void APIENTRY glMinmax(GLenum, GLenum, GLboolean); + extern void APIENTRY glResetHistogram(GLenum); + extern void APIENTRY glResetMinmax(GLenum); + extern void APIENTRY glTexImage3D(GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid*); + extern void APIENTRY glTexSubImage3D(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid*); + extern void APIENTRY glCopyTexSubImage3D(GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); + extern void APIENTRY glActiveTexture(GLenum); + extern void APIENTRY glClientActiveTexture(GLenum); + extern void APIENTRY glMultiTexCoord1d(GLenum, GLdouble); + extern void APIENTRY glMultiTexCoord1dv(GLenum, const GLdouble*); + extern void APIENTRY glMultiTexCoord1f(GLenum, GLfloat); + extern void APIENTRY glMultiTexCoord1fv(GLenum, const GLfloat*); + extern void APIENTRY glMultiTexCoord1i(GLenum, GLint); + extern void APIENTRY glMultiTexCoord1iv(GLenum, const GLint*); + extern void APIENTRY glMultiTexCoord1s(GLenum, GLshort); + extern void APIENTRY glMultiTexCoord1sv(GLenum, const GLshort*); + extern void APIENTRY glMultiTexCoord2d(GLenum, GLdouble, GLdouble); + extern void APIENTRY glMultiTexCoord2dv(GLenum, const GLdouble*); + extern void APIENTRY glMultiTexCoord2f(GLenum, GLfloat, GLfloat); + extern void APIENTRY glMultiTexCoord2fv(GLenum, const GLfloat*); + extern void APIENTRY glMultiTexCoord2i(GLenum, GLint, GLint); + extern void APIENTRY glMultiTexCoord2iv(GLenum, const GLint*); + extern void APIENTRY glMultiTexCoord2s(GLenum, GLshort, GLshort); + extern void APIENTRY glMultiTexCoord2sv(GLenum, const GLshort*); + extern void APIENTRY glMultiTexCoord3d(GLenum, GLdouble, GLdouble, GLdouble); + extern void APIENTRY glMultiTexCoord3dv(GLenum, const GLdouble*); + extern void APIENTRY glMultiTexCoord3f(GLenum, GLfloat, GLfloat, GLfloat); + extern void APIENTRY glMultiTexCoord3fv(GLenum, const GLfloat*); + extern void APIENTRY glMultiTexCoord3i(GLenum, GLint, GLint, GLint); + extern void APIENTRY glMultiTexCoord3iv(GLenum, const GLint*); + extern void APIENTRY glMultiTexCoord3s(GLenum, GLshort, GLshort, GLshort); + extern void APIENTRY glMultiTexCoord3sv(GLenum, const GLshort*); + extern void APIENTRY glMultiTexCoord4d(GLenum, GLdouble, GLdouble, GLdouble, GLdouble); + extern void APIENTRY glMultiTexCoord4dv(GLenum, const GLdouble*); + extern void APIENTRY glMultiTexCoord4f(GLenum, GLfloat, GLfloat, GLfloat, GLfloat); + extern void APIENTRY glMultiTexCoord4fv(GLenum, const GLfloat*); + extern void APIENTRY glMultiTexCoord4i(GLenum, GLint, GLint, GLint, GLint); + extern void APIENTRY glMultiTexCoord4iv(GLenum, const GLint*); + extern void APIENTRY glMultiTexCoord4s(GLenum, GLshort, GLshort, GLshort, GLshort); + extern void APIENTRY glMultiTexCoord4sv(GLenum, const GLshort*); +#endif /* GL_GLEXT_PROTOTYPES */ + typedef void (APIENTRY* PFNGLBLENDCOLORPROC)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); + typedef void (APIENTRY* PFNGLBLENDEQUATIONPROC)(GLenum mode); + typedef void (APIENTRY* PFNGLDRAWRANGEELEMENTSPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices); + typedef void (APIENTRY* PFNGLCOLORTABLEPROC)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid* table); + typedef void (APIENTRY* PFNGLCOLORTABLEPARAMETERFVPROC)(GLenum target, GLenum pname, const GLfloat* params); + typedef void (APIENTRY* PFNGLCOLORTABLEPARAMETERIVPROC)(GLenum target, GLenum pname, const GLint* params); + typedef void (APIENTRY* PFNGLCOPYCOLORTABLEPROC)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); + typedef void (APIENTRY* PFNGLGETCOLORTABLEPROC)(GLenum target, GLenum format, GLenum type, GLvoid* table); + typedef void (APIENTRY* PFNGLGETCOLORTABLEPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat* params); + typedef void (APIENTRY* PFNGLGETCOLORTABLEPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params); + typedef void (APIENTRY* PFNGLCOLORSUBTABLEPROC)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid* data); + typedef void (APIENTRY* PFNGLCOPYCOLORSUBTABLEPROC)(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); + typedef void (APIENTRY* PFNGLCONVOLUTIONFILTER1DPROC)(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid* image); + typedef void (APIENTRY* PFNGLCONVOLUTIONFILTER2DPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* image); + typedef void (APIENTRY* PFNGLCONVOLUTIONPARAMETERFPROC)(GLenum target, GLenum pname, GLfloat params); + typedef void (APIENTRY* PFNGLCONVOLUTIONPARAMETERFVPROC)(GLenum target, GLenum pname, const GLfloat* params); + typedef void (APIENTRY* PFNGLCONVOLUTIONPARAMETERIPROC)(GLenum target, GLenum pname, GLint params); + typedef void (APIENTRY* PFNGLCONVOLUTIONPARAMETERIVPROC)(GLenum target, GLenum pname, const GLint* params); + typedef void (APIENTRY* PFNGLCOPYCONVOLUTIONFILTER1DPROC)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); + typedef void (APIENTRY* PFNGLCOPYCONVOLUTIONFILTER2DPROC)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); + typedef void (APIENTRY* PFNGLGETCONVOLUTIONFILTERPROC)(GLenum target, GLenum format, GLenum type, GLvoid* image); + typedef void (APIENTRY* PFNGLGETCONVOLUTIONPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat* params); + typedef void (APIENTRY* PFNGLGETCONVOLUTIONPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params); + typedef void (APIENTRY* PFNGLGETSEPARABLEFILTERPROC)(GLenum target, GLenum format, GLenum type, GLvoid* row, GLvoid* column, GLvoid* span); + typedef void (APIENTRY* PFNGLSEPARABLEFILTER2DPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* row, const GLvoid* column); + typedef void (APIENTRY* PFNGLGETHISTOGRAMPROC)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid* values); + typedef void (APIENTRY* PFNGLGETHISTOGRAMPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat* params); + typedef void (APIENTRY* PFNGLGETHISTOGRAMPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params); + typedef void (APIENTRY* PFNGLGETMINMAXPROC)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid* values); + typedef void (APIENTRY* PFNGLGETMINMAXPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat* params); + typedef void (APIENTRY* PFNGLGETMINMAXPARAMETERIVPROC)(GLenum target, GLenum pname, GLint* params); + typedef void (APIENTRY* PFNGLHISTOGRAMPROC)(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); + typedef void (APIENTRY* PFNGLMINMAXPROC)(GLenum target, GLenum internalformat, GLboolean sink); + typedef void (APIENTRY* PFNGLRESETHISTOGRAMPROC)(GLenum target); + typedef void (APIENTRY* PFNGLRESETMINMAXPROC)(GLenum target); + typedef void (APIENTRY* PFNGLTEXIMAGE3DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels); + typedef void (APIENTRY* PFNGLTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels); + typedef void (APIENTRY* PFNGLCOPYTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); + typedef void (APIENTRY* PFNGLACTIVETEXTUREPROC)(GLenum texture); + typedef void (APIENTRY* PFNGLCLIENTACTIVETEXTUREPROC)(GLenum texture); + typedef void (APIENTRY* PFNGLMULTITEXCOORD1DPROC)(GLenum target, GLdouble s); + typedef void (APIENTRY* PFNGLMULTITEXCOORD1DVPROC)(GLenum target, const GLdouble* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD1FPROC)(GLenum target, GLfloat s); + typedef void (APIENTRY* PFNGLMULTITEXCOORD1FVPROC)(GLenum target, const GLfloat* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD1IPROC)(GLenum target, GLint s); + typedef void (APIENTRY* PFNGLMULTITEXCOORD1IVPROC)(GLenum target, const GLint* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD1SPROC)(GLenum target, GLshort s); + typedef void (APIENTRY* PFNGLMULTITEXCOORD1SVPROC)(GLenum target, const GLshort* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD2DPROC)(GLenum target, GLdouble s, GLdouble t); + typedef void (APIENTRY* PFNGLMULTITEXCOORD2DVPROC)(GLenum target, const GLdouble* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD2FPROC)(GLenum target, GLfloat s, GLfloat t); + typedef void (APIENTRY* PFNGLMULTITEXCOORD2FVPROC)(GLenum target, const GLfloat* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD2IPROC)(GLenum target, GLint s, GLint t); + typedef void (APIENTRY* PFNGLMULTITEXCOORD2IVPROC)(GLenum target, const GLint* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD2SPROC)(GLenum target, GLshort s, GLshort t); + typedef void (APIENTRY* PFNGLMULTITEXCOORD2SVPROC)(GLenum target, const GLshort* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD3DPROC)(GLenum target, GLdouble s, GLdouble t, GLdouble r); + typedef void (APIENTRY* PFNGLMULTITEXCOORD3DVPROC)(GLenum target, const GLdouble* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD3FPROC)(GLenum target, GLfloat s, GLfloat t, GLfloat r); + typedef void (APIENTRY* PFNGLMULTITEXCOORD3FVPROC)(GLenum target, const GLfloat* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD3IPROC)(GLenum target, GLint s, GLint t, GLint r); + typedef void (APIENTRY* PFNGLMULTITEXCOORD3IVPROC)(GLenum target, const GLint* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD3SPROC)(GLenum target, GLshort s, GLshort t, GLshort r); + typedef void (APIENTRY* PFNGLMULTITEXCOORD3SVPROC)(GLenum target, const GLshort* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD4DPROC)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); + typedef void (APIENTRY* PFNGLMULTITEXCOORD4DVPROC)(GLenum target, const GLdouble* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD4FPROC)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); + typedef void (APIENTRY* PFNGLMULTITEXCOORD4FVPROC)(GLenum target, const GLfloat* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD4IPROC)(GLenum target, GLint s, GLint t, GLint r, GLint q); + typedef void (APIENTRY* PFNGLMULTITEXCOORD4IVPROC)(GLenum target, const GLint* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD4SPROC)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); + typedef void (APIENTRY* PFNGLMULTITEXCOORD4SVPROC)(GLenum target, const GLshort* v); +#endif + +#ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glCompressedTexImage3D(GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*); + extern void APIENTRY glCompressedTexImage2D(GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*); + extern void APIENTRY glCompressedTexImage1D(GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid*); + extern void APIENTRY glCompressedTexSubImage3D(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*); + extern void APIENTRY glCompressedTexSubImage2D(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*); + extern void APIENTRY glCompressedTexSubImage1D(GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid*); + extern void APIENTRY glGetCompressedTexImage(GLenum, GLint, void*); + extern void APIENTRY glSampleCoverage(GLclampf, GLboolean); + extern void APIENTRY glLoadTransposeMatrixf(const GLfloat*); + extern void APIENTRY glLoadTransposeMatrixd(const GLdouble*); + extern void APIENTRY glMultTransposeMatrixf(const GLfloat*); + extern void APIENTRY glMultTransposeMatrixd(const GLdouble*); +#endif /* GL_GLEXT_PROTOTYPES */ + typedef void (APIENTRY* PFNGLCOMPRESSEDTEXIMAGE3DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data); + typedef void (APIENTRY* PFNGLCOMPRESSEDTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data); + typedef void (APIENTRY* PFNGLCOMPRESSEDTEXIMAGE1DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid* data); + typedef void (APIENTRY* 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 (APIENTRY* PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data); + typedef void (APIENTRY* PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid* data); + typedef void (APIENTRY* PFNGLGETCOMPRESSEDTEXIMAGEPROC)(GLenum target, GLint level, void* img); + typedef void (APIENTRY* PFNGLSAMPLECOVERAGEPROC)(GLclampf value, GLboolean invert); + typedef void (APIENTRY* PFNGLLOADTRANSPOSEMATRIXFPROC)(const GLfloat* m); + typedef void (APIENTRY* PFNGLLOADTRANSPOSEMATRIXDPROC)(const GLdouble* m); + typedef void (APIENTRY* PFNGLMULTTRANSPOSEMATRIXFPROC)(const GLfloat* m); + typedef void (APIENTRY* PFNGLMULTTRANSPOSEMATRIXDPROC)(const GLdouble* m); +#endif + +#ifndef GL_VERSION_1_4 +#define GL_VERSION_1_4 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glMultiDrawArrays(GLenum, GLint*, GLsizei*, GLsizei); + extern void APIENTRY glMultiDrawElements(GLenum, const GLsizei*, GLenum, const GLvoid**, GLsizei); + extern void APIENTRY glPointParameterf(GLenum pname, GLfloat param); + extern void APIENTRY glPointParameterfv(GLenum pname, GLfloat* params); + extern void APIENTRY glSecondaryColor3b(GLbyte, GLbyte, GLbyte); + extern void APIENTRY glSecondaryColor3bv(const GLbyte*); + extern void APIENTRY glSecondaryColor3d(GLdouble, GLdouble, GLdouble); + extern void APIENTRY glSecondaryColor3dv(const GLdouble*); + extern void APIENTRY glSecondaryColor3f(GLfloat, GLfloat, GLfloat); + extern void APIENTRY glSecondaryColor3fv(const GLfloat*); + extern void APIENTRY glSecondaryColor3i(GLint, GLint, GLint); + extern void APIENTRY glSecondaryColor3iv(const GLint*); + extern void APIENTRY glSecondaryColor3s(GLshort, GLshort, GLshort); + extern void APIENTRY glSecondaryColor3sv(const GLshort*); + extern void APIENTRY glSecondaryColor3ub(GLubyte, GLubyte, GLubyte); + extern void APIENTRY glSecondaryColor3ubv(const GLubyte*); + extern void APIENTRY glSecondaryColor3ui(GLuint, GLuint, GLuint); + extern void APIENTRY glSecondaryColor3uiv(const GLuint*); + extern void APIENTRY glSecondaryColor3us(GLushort, GLushort, GLushort); + extern void APIENTRY glSecondaryColor3usv(const GLushort*); + extern void APIENTRY glSecondaryColorPointer(GLint, GLenum, GLsizei, GLvoid*); + extern void APIENTRY glBlendFuncSeparate(GLenum, GLenum, GLenum, GLenum); + extern void APIENTRY glWindowPos2d(GLdouble x, GLdouble y); + extern void APIENTRY glWindowPos2f(GLfloat x, GLfloat y); + extern void APIENTRY glWindowPos2i(GLint x, GLint y); + extern void APIENTRY glWindowPos2s(GLshort x, GLshort y); + extern void APIENTRY glWindowPos2dv(const GLdouble* p); + extern void APIENTRY glWindowPos2fv(const GLfloat* p); + extern void APIENTRY glWindowPos2iv(const GLint* p); + extern void APIENTRY glWindowPos2sv(const GLshort* p); + extern void APIENTRY glWindowPos3d(GLdouble x, GLdouble y, GLdouble z); + extern void APIENTRY glWindowPos3f(GLfloat x, GLfloat y, GLfloat z); + extern void APIENTRY glWindowPos3i(GLint x, GLint y, GLint z); + extern void APIENTRY glWindowPos3s(GLshort x, GLshort y, GLshort z); + extern void APIENTRY glWindowPos3dv(const GLdouble* p); + extern void APIENTRY glWindowPos3fv(const GLfloat* p); + extern void APIENTRY glWindowPos3iv(const GLint* p); + extern void APIENTRY glWindowPos3sv(const GLshort* p); +#endif /* GL_GLEXT_PROTOTYPES */ + typedef void (APIENTRY* PFNGLMULTIDRAWARRAYSPROC)(GLenum mode, GLint* first, GLsizei* count, GLsizei primcount); + typedef void (APIENTRY* PFNGLMULTIDRAWELEMENTSPROC)(GLenum mode, const GLsizei* count, GLenum type, const GLvoid* *indices, GLsizei primcount); + typedef void (APIENTRY* PFNGLPOINTPARAMETERFPROC)(GLenum pname, GLfloat param); + typedef void (APIENTRY* PFNGLPOINTPARAMETERFVPROC)(GLenum pname, GLfloat* params); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3BPROC)(GLbyte red, GLbyte green, GLbyte blue); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3BVPROC)(const GLbyte* v); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3DPROC)(GLdouble red, GLdouble green, GLdouble blue); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3DVPROC)(const GLdouble* v); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3FPROC)(GLfloat red, GLfloat green, GLfloat blue); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3FVPROC)(const GLfloat* v); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3IPROC)(GLint red, GLint green, GLint blue); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3IVPROC)(const GLint* v); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3SPROC)(GLshort red, GLshort green, GLshort blue); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3SVPROC)(const GLshort* v); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3UBPROC)(GLubyte red, GLubyte green, GLubyte blue); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3UBVPROC)(const GLubyte* v); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3UIPROC)(GLuint red, GLuint green, GLuint blue); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3UIVPROC)(const GLuint* v); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3USPROC)(GLushort red, GLushort green, GLushort blue); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3USVPROC)(const GLushort* v); + typedef void (APIENTRY* PFNGLSECONDARYCOLORPOINTERPROC)(GLint size, GLenum type, GLsizei stride, GLvoid* pointer); + typedef void (APIENTRY* PFNGLBLENDFUNCSEPARATEPROC)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); + typedef void (APIENTRY* PFNGLWINDOWPOS2DPROC)(GLdouble x, GLdouble y); + typedef void (APIENTRY* PFNGLWINDOWPOS2FPROC)(GLfloat x, GLfloat y); + typedef void (APIENTRY* PFNGLWINDOWPOS2IPROC)(GLint x, GLint y); + typedef void (APIENTRY* PFNGLWINDOWPOS2SPROC)(GLshort x, GLshort y); + typedef void (APIENTRY* PFNGLWINDOWPOS2DVPROC)(const GLdouble* p); + typedef void (APIENTRY* PFNGLWINDOWPOS2FVPROC)(const GLfloat* p); + typedef void (APIENTRY* PFNGLWINDOWPOS2IVPROC)(const GLint* p); + typedef void (APIENTRY* PFNGLWINDOWPOS2SVPROC)(const GLshort* p); + typedef void (APIENTRY* PFNGLWINDOWPOS3DPROC)(GLdouble x, GLdouble y, GLdouble z); + typedef void (APIENTRY* PFNGLWINDOWPOS3FPROC)(GLfloat x, GLfloat y, GLfloat z); + typedef void (APIENTRY* PFNGLWINDOWPOS3IPROC)(GLint x, GLint y, GLint z); + typedef void (APIENTRY* PFNGLWINDOWPOS3SPROC)(GLshort x, GLshort y, GLshort z); + typedef void (APIENTRY* PFNGLWINDOWPOS3DVPROC)(const GLdouble* p); + typedef void (APIENTRY* PFNGLWINDOWPOS3FVPROC)(const GLfloat* p); + typedef void (APIENTRY* PFNGLWINDOWPOS3IVPROC)(const GLint* p); + typedef void (APIENTRY* PFNGLWINDOWPOS3SVPROC)(const GLshort* p); +#endif + + +#ifndef GL_ARB_depth_texture +#define GL_ARB_depth_texture 1 +#endif + +#ifndef GL_ARB_fragment_program +#define GL_ARB_fragment_program 1 +#endif + + +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glSampleCoverageARB(GLclampf, GLboolean); +#endif /* GL_GLEXT_PROTOTYPES */ + typedef void (APIENTRY* PFNGLSAMPLECOVERAGEARBPROC)(GLclampf value, GLboolean invert); +#endif + +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glActiveTextureARB(GLenum); + extern void APIENTRY glClientActiveTextureARB(GLenum); + extern void APIENTRY glMultiTexCoord1dARB(GLenum, GLdouble); + extern void APIENTRY glMultiTexCoord1dvARB(GLenum, const GLdouble*); + extern void APIENTRY glMultiTexCoord1fARB(GLenum, GLfloat); + extern void APIENTRY glMultiTexCoord1fvARB(GLenum, const GLfloat*); + extern void APIENTRY glMultiTexCoord1iARB(GLenum, GLint); + extern void APIENTRY glMultiTexCoord1ivARB(GLenum, const GLint*); + extern void APIENTRY glMultiTexCoord1sARB(GLenum, GLshort); + extern void APIENTRY glMultiTexCoord1svARB(GLenum, const GLshort*); + extern void APIENTRY glMultiTexCoord2dARB(GLenum, GLdouble, GLdouble); + extern void APIENTRY glMultiTexCoord2dvARB(GLenum, const GLdouble*); + extern void APIENTRY glMultiTexCoord2fARB(GLenum, GLfloat, GLfloat); + extern void APIENTRY glMultiTexCoord2fvARB(GLenum, const GLfloat*); + extern void APIENTRY glMultiTexCoord2iARB(GLenum, GLint, GLint); + extern void APIENTRY glMultiTexCoord2ivARB(GLenum, const GLint*); + extern void APIENTRY glMultiTexCoord2sARB(GLenum, GLshort, GLshort); + extern void APIENTRY glMultiTexCoord2svARB(GLenum, const GLshort*); + extern void APIENTRY glMultiTexCoord3dARB(GLenum, GLdouble, GLdouble, GLdouble); + extern void APIENTRY glMultiTexCoord3dvARB(GLenum, const GLdouble*); + extern void APIENTRY glMultiTexCoord3fARB(GLenum, GLfloat, GLfloat, GLfloat); + extern void APIENTRY glMultiTexCoord3fvARB(GLenum, const GLfloat*); + extern void APIENTRY glMultiTexCoord3iARB(GLenum, GLint, GLint, GLint); + extern void APIENTRY glMultiTexCoord3ivARB(GLenum, const GLint*); + extern void APIENTRY glMultiTexCoord3sARB(GLenum, GLshort, GLshort, GLshort); + extern void APIENTRY glMultiTexCoord3svARB(GLenum, const GLshort*); + extern void APIENTRY glMultiTexCoord4dARB(GLenum, GLdouble, GLdouble, GLdouble, GLdouble); + extern void APIENTRY glMultiTexCoord4dvARB(GLenum, const GLdouble*); + extern void APIENTRY glMultiTexCoord4fARB(GLenum, GLfloat, GLfloat, GLfloat, GLfloat); + extern void APIENTRY glMultiTexCoord4fvARB(GLenum, const GLfloat*); + extern void APIENTRY glMultiTexCoord4iARB(GLenum, GLint, GLint, GLint, GLint); + extern void APIENTRY glMultiTexCoord4ivARB(GLenum, const GLint*); + extern void APIENTRY glMultiTexCoord4sARB(GLenum, GLshort, GLshort, GLshort, GLshort); + extern void APIENTRY glMultiTexCoord4svARB(GLenum, const GLshort*); +#endif /* GL_GLEXT_PROTOTYPES */ + typedef void (APIENTRY* PFNGLACTIVETEXTUREARBPROC)(GLenum texture); + typedef void (APIENTRY* PFNGLCLIENTACTIVETEXTUREARBPROC)(GLenum texture); + typedef void (APIENTRY* PFNGLMULTITEXCOORD1DARBPROC)(GLenum target, GLdouble s); + typedef void (APIENTRY* PFNGLMULTITEXCOORD1DVARBPROC)(GLenum target, const GLdouble* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD1FARBPROC)(GLenum target, GLfloat s); + typedef void (APIENTRY* PFNGLMULTITEXCOORD1FVARBPROC)(GLenum target, const GLfloat* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD1IARBPROC)(GLenum target, GLint s); + typedef void (APIENTRY* PFNGLMULTITEXCOORD1IVARBPROC)(GLenum target, const GLint* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD1SARBPROC)(GLenum target, GLshort s); + typedef void (APIENTRY* PFNGLMULTITEXCOORD1SVARBPROC)(GLenum target, const GLshort* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD2DARBPROC)(GLenum target, GLdouble s, GLdouble t); + typedef void (APIENTRY* PFNGLMULTITEXCOORD2DVARBPROC)(GLenum target, const GLdouble* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD2FARBPROC)(GLenum target, GLfloat s, GLfloat t); + typedef void (APIENTRY* PFNGLMULTITEXCOORD2FVARBPROC)(GLenum target, const GLfloat* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD2IARBPROC)(GLenum target, GLint s, GLint t); + typedef void (APIENTRY* PFNGLMULTITEXCOORD2IVARBPROC)(GLenum target, const GLint* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD2SARBPROC)(GLenum target, GLshort s, GLshort t); + typedef void (APIENTRY* PFNGLMULTITEXCOORD2SVARBPROC)(GLenum target, const GLshort* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD3DARBPROC)(GLenum target, GLdouble s, GLdouble t, GLdouble r); + typedef void (APIENTRY* PFNGLMULTITEXCOORD3DVARBPROC)(GLenum target, const GLdouble* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD3FARBPROC)(GLenum target, GLfloat s, GLfloat t, GLfloat r); + typedef void (APIENTRY* PFNGLMULTITEXCOORD3FVARBPROC)(GLenum target, const GLfloat* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD3IARBPROC)(GLenum target, GLint s, GLint t, GLint r); + typedef void (APIENTRY* PFNGLMULTITEXCOORD3IVARBPROC)(GLenum target, const GLint* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD3SARBPROC)(GLenum target, GLshort s, GLshort t, GLshort r); + typedef void (APIENTRY* PFNGLMULTITEXCOORD3SVARBPROC)(GLenum target, const GLshort* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD4DARBPROC)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); + typedef void (APIENTRY* PFNGLMULTITEXCOORD4DVARBPROC)(GLenum target, const GLdouble* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD4FARBPROC)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); + typedef void (APIENTRY* PFNGLMULTITEXCOORD4FVARBPROC)(GLenum target, const GLfloat* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD4IARBPROC)(GLenum target, GLint s, GLint t, GLint r, GLint q); + typedef void (APIENTRY* PFNGLMULTITEXCOORD4IVARBPROC)(GLenum target, const GLint* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD4SARBPROC)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); + typedef void (APIENTRY* PFNGLMULTITEXCOORD4SVARBPROC)(GLenum target, const GLshort* v); +#endif + +#ifndef GL_ARB_point_parameters +#define GL_ARB_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glPointParameterfARB(GLenum pname, GLfloat param); + extern void APIENTRY glPointParameterfvARB(GLenum pname, GLfloat* params); +#endif + typedef void (APIENTRY* PFNGLPOINTPARAMETERFARBPROC)(GLenum pname, GLfloat param); + typedef void (APIENTRY* PFNGLPOINTPARAMETERFVARBPROC)(GLenum pname, GLfloat* params); +#endif + +#ifndef GL_ARB_shadow +#define GL_ARB_shadow 1 +#endif + +#ifndef GL_ARB_texture_border_clamp +#define GL_ARB_texture_border_clamp 1 +#endif + +#ifndef GL_ARB_texture_compression +#define GL_ARB_texture_compression 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glCompressedTexImage3DARB(GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*); + extern void APIENTRY glCompressedTexImage2DARB(GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*); + extern void APIENTRY glCompressedTexImage1DARB(GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid*); + extern void APIENTRY glCompressedTexSubImage3DARB(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*); + extern void APIENTRY glCompressedTexSubImage2DARB(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*); + extern void APIENTRY glCompressedTexSubImage1DARB(GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid*); + extern void APIENTRY glGetCompressedTexImageARB(GLenum, GLint, void*); +#endif /* GL_GLEXT_PROTOTYPES */ + typedef void (APIENTRY* PFNGLCOMPRESSEDTEXIMAGE3DARBPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data); + typedef void (APIENTRY* PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data); + typedef void (APIENTRY* PFNGLCOMPRESSEDTEXIMAGE1DARBPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid* data); + typedef void (APIENTRY* PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC)(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 (APIENTRY* PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data); + typedef void (APIENTRY* PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid* data); + typedef void (APIENTRY* PFNGLGETCOMPRESSEDTEXIMAGEARBPROC)(GLenum target, GLint level, void* img); +#endif + +#ifndef GL_ARB_texture_cube_map +#define GL_ARB_texture_cube_map 1 +#endif + +#ifndef GL_ARB_texture_env_add +#define GL_ARB_texture_env_add 1 +#endif + +#ifndef GL_ARB_texture_env_combine +#define GL_ARB_texture_env_combine 1 +#endif + +#ifndef GL_ARB_texture_env_dot3 +#define GL_ARB_texture_env_dot3 1 +#endif + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_ARB_texture_mirrored_repeat 1 +#endif + +#ifndef GL_ARB_transpose_matrix +#define GL_ARB_transpose_matrix 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glLoadTransposeMatrixfARB(const GLfloat*); + extern void APIENTRY glLoadTransposeMatrixdARB(const GLdouble*); + extern void APIENTRY glMultTransposeMatrixfARB(const GLfloat*); + extern void APIENTRY glMultTransposeMatrixdARB(const GLdouble*); +#endif /* GL_GLEXT_PROTOTYPES */ + typedef void (APIENTRY* PFNGLLOADTRANSPOSEMATRIXFARBPROC)(const GLfloat* m); + typedef void (APIENTRY* PFNGLLOADTRANSPOSEMATRIXDARBPROC)(const GLdouble* m); + typedef void (APIENTRY* PFNGLMULTTRANSPOSEMATRIXFARBPROC)(const GLfloat* m); + typedef void (APIENTRY* PFNGLMULTTRANSPOSEMATRIXDARBPROC)(const GLdouble* m); +#endif + +#ifndef GL_ARB_vertex_buffer_object +#define GL_ARB_vertex_buffer_object 1 +#if defined(_WIN64) + typedef __int64 GLintptrARB; + typedef __int64 GLsizeiptrARB; +#elif defined(__ia64__) || defined(__x86_64__) + typedef long int GLintptrARB; + typedef long int GLsizeiptrARB; +#else + typedef int GLintptrARB; + typedef int GLsizeiptrARB; +#endif +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glBindBufferARB(GLenum target, GLuint buffer); + extern void APIENTRY glDeleteBuffersARB(GLsizei n, const GLuint* buffers); + extern void APIENTRY glGenBuffersARB(GLsizei n, GLuint* buffers); + extern GLboolean APIENTRY glIsBufferARB(GLuint buffer); + extern void APIENTRY glBufferDataARB(GLenum target, GLsizeiptrARB size, const GLvoid* data, GLenum usage); + extern void APIENTRY glBufferSubDataARB(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid* data); + extern void APIENTRY glGetBufferSubDataARB(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid* data); + extern void* APIENTRY glMapBufferARB(GLenum target, GLenum access); + extern GLboolean APIENTRY glUnmapBufferARB(GLenum target); + extern void APIENTRY glGetBufferParameterivARB(GLenum target, GLenum pname, GLint* params); + extern void APIENTRY glGetBufferPointervARB(GLenum target, GLenum pname, GLvoid** params); +#endif + typedef void (APIENTRY* PFNGLBINDBUFFERARBPROC)(GLenum target, GLuint buffer); + typedef void (APIENTRY* PFNGLDELETEBUFFERSARBPROC)(GLsizei n, const GLuint* buffers); + typedef void (APIENTRY* PFNGLGENBUFFERSARBPROC)(GLsizei n, GLuint* buffers); + typedef GLboolean(APIENTRY* PFNGLISBUFFERARBPROC)(GLuint buffer); + typedef void (APIENTRY* PFNGLBUFFERDATAARBPROC)(GLenum target, GLsizeiptrARB size, const GLvoid* data, GLenum usage); + typedef void (APIENTRY* PFNGLBUFFERSUBDATAARBPROC)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid* data); + typedef void (APIENTRY* PFNGLGETBUFFERSUBDATAARBPROC)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid* data); + typedef void* (APIENTRY* PFNGLMAPBUFFERARBPROC)(GLenum target, GLenum access); + typedef GLboolean(APIENTRY* PFNGLUNMAPBUFFERARBPROC)(GLenum target); + typedef void (APIENTRY* PFNGLGETBUFFERPARAMETERIVARBPROC)(GLenum target, GLenum pname, GLint* params); + typedef void (APIENTRY* PFNGLGETBUFFERPOINTERVARBPROC)(GLenum target, GLenum pname, GLvoid** params); +#endif + +#ifndef GL_ARB_vertex_program +#define GL_ARB_vertex_program 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glVertexAttrib1sARB(GLuint index, GLshort x); + extern void APIENTRY glVertexAttrib1fARB(GLuint index, GLfloat x); + extern void APIENTRY glVertexAttrib1dARB(GLuint index, GLdouble x); + extern void APIENTRY glVertexAttrib2sARB(GLuint index, GLshort x, GLshort y); + extern void APIENTRY glVertexAttrib2fARB(GLuint index, GLfloat x, GLfloat y); + extern void APIENTRY glVertexAttrib2dARB(GLuint index, GLdouble x, GLdouble y); + extern void APIENTRY glVertexAttrib3sARB(GLuint index, GLshort x, GLshort y, GLshort z); + extern void APIENTRY glVertexAttrib3fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z); + extern void APIENTRY glVertexAttrib3dARB(GLuint index, GLdouble x, GLdouble y, GLdouble z); + extern void APIENTRY glVertexAttrib4sARB(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); + extern void APIENTRY glVertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); + extern void APIENTRY glVertexAttrib4dARB(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); + extern void APIENTRY glVertexAttrib4NubARB(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); + extern void APIENTRY glVertexAttrib1svARB(GLuint index, const GLshort* v); + extern void APIENTRY glVertexAttrib1fvARB(GLuint index, const GLfloat* v); + extern void APIENTRY glVertexAttrib1dvARB(GLuint index, const GLdouble* v); + extern void APIENTRY glVertexAttrib2svARB(GLuint index, const GLshort* v); + extern void APIENTRY glVertexAttrib2fvARB(GLuint index, const GLfloat* v); + extern void APIENTRY glVertexAttrib2dvARB(GLuint index, const GLdouble* v); + extern void APIENTRY glVertexAttrib3svARB(GLuint index, const GLshort* v); + extern void APIENTRY glVertexAttrib3fvARB(GLuint index, const GLfloat* v); + extern void APIENTRY glVertexAttrib3dvARB(GLuint index, const GLdouble* v); + extern void APIENTRY glVertexAttrib4bvARB(GLuint index, const GLbyte* v); + extern void APIENTRY glVertexAttrib4svARB(GLuint index, const GLshort* v); + extern void APIENTRY glVertexAttrib4ivARB(GLuint index, const GLint* v); + extern void APIENTRY glVertexAttrib4ubvARB(GLuint index, const GLubyte* v); + extern void APIENTRY glVertexAttrib4usvARB(GLuint index, const GLushort* v); + extern void APIENTRY glVertexAttrib4uivARB(GLuint index, const GLuint* v); + extern void APIENTRY glVertexAttrib4fvARB(GLuint index, const GLfloat* v); + extern void APIENTRY glVertexAttrib4dvARB(GLuint index, const GLdouble* v); + extern void APIENTRY glVertexAttrib4NbvARB(GLuint index, const GLbyte* v); + extern void APIENTRY glVertexAttrib4NsvARB(GLuint index, const GLshort* v); + extern void APIENTRY glVertexAttrib4NivARB(GLuint index, const GLint* v); + extern void APIENTRY glVertexAttrib4NubvARB(GLuint index, const GLubyte* v); + extern void APIENTRY glVertexAttrib4NusvARB(GLuint index, const GLushort* v); + extern void APIENTRY glVertexAttrib4NuivARB(GLuint index, const GLuint* v); + extern void APIENTRY glVertexAttribPointerARB(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer); + extern void APIENTRY glEnableVertexAttribArrayARB(GLuint index); + extern void APIENTRY glDisableVertexAttribArrayARB(GLuint index); + extern void APIENTRY glProgramStringARB(GLenum target, GLenum format, GLsizei len, const void* string); + extern void APIENTRY glBindProgramARB(GLenum target, GLuint program); + extern void APIENTRY glDeleteProgramsARB(GLsizei n, const GLuint* programs); + extern void APIENTRY glGenProgramsARB(GLsizei n, GLuint* programs); + extern void APIENTRY glProgramEnvParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); + extern void APIENTRY glProgramEnvParameter4dvARB(GLenum target, GLuint index, const GLdouble* params); + extern void APIENTRY glProgramEnvParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); + extern void APIENTRY glProgramEnvParameter4fvARB(GLenum target, GLuint index, const GLfloat* params); + extern void APIENTRY glProgramLocalParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); + extern void APIENTRY glProgramLocalParameter4dvARB(GLenum target, GLuint index, const GLdouble* params); + extern void APIENTRY glProgramLocalParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); + extern void APIENTRY glProgramLocalParameter4fvARB(GLenum target, GLuint index, const GLfloat* params); + extern void APIENTRY glGetProgramEnvParameterdvARB(GLenum target, GLuint index, GLdouble* params); + extern void APIENTRY glGetProgramEnvParameterfvARB(GLenum target, GLuint index, GLfloat* params); + extern void APIENTRY glGetProgramLocalParameterdvARB(GLenum target, GLuint index, GLdouble* params); + extern void APIENTRY glGetProgramLocalParameterfvARB(GLenum target, GLuint index, GLfloat* params); + extern void APIENTRY glGetProgramivARB(GLenum target, GLenum pname, GLint* params); + extern void APIENTRY glGetProgramStringARB(GLenum target, GLenum pname, void* string); + extern void APIENTRY glGetVertexAttribdvARB(GLuint index, GLenum pname, GLdouble* params); + extern void APIENTRY glGetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat* params); + extern void APIENTRY glGetVertexAttribivARB(GLuint index, GLenum pname, GLint* params); + extern void APIENTRY glGetVertexAttribPointervARB(GLuint index, GLenum pname, void** pointer); + extern GLboolean APIENTRY glIsProgramARB(GLuint program); +#endif + typedef void (APIENTRY* PFNGLVERTEXATTRIB1SARBPROC)(GLuint index, GLshort x); + typedef void (APIENTRY* PFNGLVERTEXATTRIB1FARBPROC)(GLuint index, GLfloat x); + typedef void (APIENTRY* PFNGLVERTEXATTRIB1DARBPROC)(GLuint index, GLdouble x); + typedef void (APIENTRY* PFNGLVERTEXATTRIB2SARBPROC)(GLuint index, GLshort x, GLshort y); + typedef void (APIENTRY* PFNGLVERTEXATTRIB2FARBPROC)(GLuint index, GLfloat x, GLfloat y); + typedef void (APIENTRY* PFNGLVERTEXATTRIB2DARBPROC)(GLuint index, GLdouble x, GLdouble y); + typedef void (APIENTRY* PFNGLVERTEXATTRIB3SARBPROC)(GLuint index, GLshort x, GLshort y, GLshort z); + typedef void (APIENTRY* PFNGLVERTEXATTRIB3FARBPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z); + typedef void (APIENTRY* PFNGLVERTEXATTRIB3DARBPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z); + typedef void (APIENTRY* PFNGLVERTEXATTRIB4SARBPROC)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); + typedef void (APIENTRY* PFNGLVERTEXATTRIB4FARBPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); + typedef void (APIENTRY* PFNGLVERTEXATTRIB4DARBPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); + typedef void (APIENTRY* PFNGLVERTEXATTRIB4NUBARBPROC)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); + typedef void (APIENTRY* PFNGLVERTEXATTRIB1SVARBPROC)(GLuint index, const GLshort* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB1FVARBPROC)(GLuint index, const GLfloat* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB1DVARBPROC)(GLuint index, const GLdouble* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB2SVARBPROC)(GLuint index, const GLshort* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB2FVARBPROC)(GLuint index, const GLfloat* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB2DVARBPROC)(GLuint index, const GLdouble* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB3SVARBPROC)(GLuint index, const GLshort* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB3FVARBPROC)(GLuint index, const GLfloat* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB3DVARBPROC)(GLuint index, const GLdouble* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB4BVARBPROC)(GLuint index, const GLbyte* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB4SVARBPROC)(GLuint index, const GLshort* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB4IVARBPROC)(GLuint index, const GLint* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB4UBVARBPROC)(GLuint index, const GLubyte* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB4USVARBPROC)(GLuint index, const GLushort* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB4UIVARBPROC)(GLuint index, const GLuint* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB4FVARBPROC)(GLuint index, const GLfloat* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB4DVARBPROC)(GLuint index, const GLdouble* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB4NBVARBPROC)(GLuint index, const GLbyte* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB4NSVARBPROC)(GLuint index, const GLshort* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB4NIVARBPROC)(GLuint index, const GLint* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB4NUBVARBPROC)(GLuint index, const GLubyte* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB4NUSVARBPROC)(GLuint index, const GLushort* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB4NUIVARBPROC)(GLuint index, const GLuint* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIBPOINTERARBPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer); + typedef void (APIENTRY* PFNGLENABLEVERTEXATTRIBARRAYARBPROC)(GLuint index); + typedef void (APIENTRY* PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)(GLuint index); + typedef void (APIENTRY* PFNGLPROGRAMSTRINGARBPROC)(GLenum target, GLenum format, GLsizei len, const void* string); + typedef void (APIENTRY* PFNGLBINDPROGRAMARBPROC)(GLenum target, GLuint program); + typedef void (APIENTRY* PFNGLDELETEPROGRAMSARBPROC)(GLsizei n, const GLuint* programs); + typedef void (APIENTRY* PFNGLGENPROGRAMSARBPROC)(GLsizei n, GLuint* programs); + typedef void (APIENTRY* PFNGLPROGRAMENVPARAMETER4DARBPROC)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); + typedef void (APIENTRY* PFNGLPROGRAMENVPARAMETER4DVARBPROC)(GLenum target, GLuint index, const GLdouble* params); + typedef void (APIENTRY* PFNGLPROGRAMENVPARAMETER4FARBPROC)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); + typedef void (APIENTRY* PFNGLPROGRAMENVPARAMETER4FVARBPROC)(GLenum target, GLuint index, const GLfloat* params); + typedef void (APIENTRY* PFNGLPROGRAMLOCALPARAMETER4DARBPROC)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); + typedef void (APIENTRY* PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)(GLenum target, GLuint index, const GLdouble* params); + typedef void (APIENTRY* PFNGLPROGRAMLOCALPARAMETER4FARBPROC)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); + typedef void (APIENTRY* PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)(GLenum target, GLuint index, const GLfloat* params); + typedef void (APIENTRY* PFNGLGETPROGRAMENVPARAMETERDVARBPROC)(GLenum target, GLuint index, GLdouble* params); + typedef void (APIENTRY* PFNGLGETPROGRAMENVPARAMETERFVARBPROC)(GLenum target, GLuint index, GLfloat* params); + typedef void (APIENTRY* PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)(GLenum target, GLuint index, GLdouble* params); + typedef void (APIENTRY* PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)(GLenum target, GLuint index, GLfloat* params); + typedef void (APIENTRY* PFNGLGETPROGRAMIVARBPROC)(GLenum target, GLenum pname, GLint* params); + typedef void (APIENTRY* PFNGLGETPROGRAMSTRINGARBPROC)(GLenum target, GLenum pname, void* string); + typedef void (APIENTRY* PFNGLGETVERTEXATTRIBDVARBPROC)(GLuint index, GLenum pname, GLdouble* params); + typedef void (APIENTRY* PFNGLGETVERTEXATTRIBFVARBPROC)(GLuint index, GLenum pname, GLfloat* params); + typedef void (APIENTRY* PFNGLGETVERTEXATTRIBIVARBPROC)(GLuint index, GLenum pname, GLint* params); + typedef void (APIENTRY* PFNGLGETVERTEXATTRIBPOINTERVARBPROC)(GLuint index, GLenum pname, void** pointer); + typedef GLboolean(APIENTRY* PFNGLISPROGRAMARBPROC)(GLuint program); +#endif + +#ifndef GL_ARB_window_pos +#define GL_ARB_window_pos 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glWindowPos2dARB(GLdouble x, GLdouble y); + extern void APIENTRY glWindowPos2fARB(GLfloat x, GLfloat y); + extern void APIENTRY glWindowPos2iARB(GLint x, GLint y); + extern void APIENTRY glWindowPos2sARB(GLshort x, GLshort y); + extern void APIENTRY glWindowPos2dvARB(const GLdouble* p); + extern void APIENTRY glWindowPos2fvARB(const GLfloat* p); + extern void APIENTRY glWindowPos2ivARB(const GLint* p); + extern void APIENTRY glWindowPos2svARB(const GLshort* p); + extern void APIENTRY glWindowPos3dARB(GLdouble x, GLdouble y, GLdouble z); + extern void APIENTRY glWindowPos3fARB(GLfloat x, GLfloat y, GLfloat z); + extern void APIENTRY glWindowPos3iARB(GLint x, GLint y, GLint z); + extern void APIENTRY glWindowPos3sARB(GLshort x, GLshort y, GLshort z); + extern void APIENTRY glWindowPos3dvARB(const GLdouble* p); + extern void APIENTRY glWindowPos3fvARB(const GLfloat* p); + extern void APIENTRY glWindowPos3ivARB(const GLint* p); + extern void APIENTRY glWindowPos3svARB(const GLshort* p); +#endif + typedef void (APIENTRY* PFNGLWINDOWPOS2DARBPROC)(GLdouble x, GLdouble y); + typedef void (APIENTRY* PFNGLWINDOWPOS2FARBPROC)(GLfloat x, GLfloat y); + typedef void (APIENTRY* PFNGLWINDOWPOS2IARBPROC)(GLint x, GLint y); + typedef void (APIENTRY* PFNGLWINDOWPOS2SARBPROC)(GLshort x, GLshort y); + typedef void (APIENTRY* PFNGLWINDOWPOS2DVARBPROC)(const GLdouble* p); + typedef void (APIENTRY* PFNGLWINDOWPOS2FVARBPROC)(const GLfloat* p); + typedef void (APIENTRY* PFNGLWINDOWPOS2IVARBPROC)(const GLint* p); + typedef void (APIENTRY* PFNGLWINDOWPOS2SVARBPROC)(const GLshort* p); + typedef void (APIENTRY* PFNGLWINDOWPOS3DARBPROC)(GLdouble x, GLdouble y, GLdouble z); + typedef void (APIENTRY* PFNGLWINDOWPOS3FARBPROC)(GLfloat x, GLfloat y, GLfloat z); + typedef void (APIENTRY* PFNGLWINDOWPOS3IARBPROC)(GLint x, GLint y, GLint z); + typedef void (APIENTRY* PFNGLWINDOWPOS3SARBPROC)(GLshort x, GLshort y, GLshort z); + typedef void (APIENTRY* PFNGLWINDOWPOS3DVARBPROC)(const GLdouble* p); + typedef void (APIENTRY* PFNGLWINDOWPOS3FVARBPROC)(const GLfloat* p); + typedef void (APIENTRY* PFNGLWINDOWPOS3IVARBPROC)(const GLint* p); + typedef void (APIENTRY* PFNGLWINDOWPOS3SVARBPROC)(const GLshort* p); +#endif + +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 +#endif + +#ifndef GL_EXT_bgra +#define GL_EXT_bgra 1 +#endif + +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glBlendColorEXT(GLclampf, GLclampf, GLclampf, GLclampf); +#endif /* GL_GLEXT_PROTOTYPES */ + typedef void (APIENTRY* PFNGLBLENDCOLOREXTPROC)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +#endif + +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glBlendFuncSeparateEXT(GLenum, GLenum, GLenum, GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ + typedef void (APIENTRY* PFNGLBLENDFUNCSEPARATEEXTPROC)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif + +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glBlendEquationEXT(GLenum); +#endif /* GL_GLEXT_PROTOTYPES */ + typedef void (APIENTRY* PFNGLBLENDEQUATIONEXTPROC)(GLenum mode); +#endif + +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 +#endif + +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glLockArraysEXT(GLint, GLsizei); + extern void APIENTRY glUnlockArraysEXT(void); +#endif /* GL_GLEXT_PROTOTYPES */ + typedef void (APIENTRY* PFNGLLOCKARRAYSEXTPROC)(GLint first, GLsizei count); + typedef void (APIENTRY* PFNGLUNLOCKARRAYSEXTPROC)(void); +#endif + +#ifndef GL_EXT_draw_range_elements +#define GL_EXT_draw_range_elements 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glDrawRangeElementsEXT(GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid*); +#endif /* GL_GLEXT_PROTOTYPES */ + typedef void (APIENTRY* PFNGLDRAWRANGEELEMENTSEXTPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices); +#endif + +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glFogCoordfEXT(GLfloat); + extern void APIENTRY glFogCoordfvEXT(const GLfloat*); + extern void APIENTRY glFogCoorddEXT(GLdouble); + extern void APIENTRY glFogCoorddvEXT(const GLdouble*); + extern void APIENTRY glFogCoordPointerEXT(GLenum, GLsizei, const GLvoid*); +#endif /* GL_GLEXT_PROTOTYPES */ + typedef void (APIENTRY* PFNGLFOGCOORDFEXTPROC)(GLfloat coord); + typedef void (APIENTRY* PFNGLFOGCOORDFVEXTPROC)(const GLfloat* coord); + typedef void (APIENTRY* PFNGLFOGCOORDDEXTPROC)(GLdouble coord); + typedef void (APIENTRY* PFNGLFOGCOORDDVEXTPROC)(const GLdouble* coord); + typedef void (APIENTRY* PFNGLFOGCOORDPOINTEREXTPROC)(GLenum type, GLsizei stride, const GLvoid* pointer); +#endif + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glMultiDrawArraysEXT(GLenum, GLint*, GLsizei*, GLsizei); + extern void APIENTRY glMultiDrawElementsEXT(GLenum, const GLsizei*, GLenum, const GLvoid**, GLsizei); +#endif /* GL_GLEXT_PROTOTYPES */ + typedef void (APIENTRY* PFNGLMULTIDRAWARRAYSEXTPROC)(GLenum mode, GLint* first, GLsizei* count, GLsizei primcount); + typedef void (APIENTRY* PFNGLMULTIDRAWELEMENTSEXTPROC)(GLenum mode, const GLsizei* count, GLenum type, const GLvoid* *indices, GLsizei primcount); +#endif + +#ifndef GL_EXT_packed_pixels +#define GL_EXT_packed_pixels 1 +#endif + +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glColorTableEXT(GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid*); + extern void APIENTRY glColorSubTableEXT(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid* data); + extern void APIENTRY glGetColorTableEXT(GLenum, GLenum, GLenum, GLvoid*); + extern void APIENTRY glGetColorTableParameterivEXT(GLenum, GLenum, GLint*); + extern void APIENTRY glGetColorTableParameterfvEXT(GLenum, GLenum, GLfloat*); +#endif /* GL_GLEXT_PROTOTYPES */ + typedef void (APIENTRY* PFNGLCOLORTABLEEXTPROC)(GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid* table); + typedef void (APIENTRY* PFNGLCOLORSUBTABLEEXTPROC)(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid* data); + typedef void (APIENTRY* PFNGLGETCOLORTABLEEXTPROC)(GLenum target, GLenum format, GLenum type, GLvoid* data); + typedef void (APIENTRY* PFNGLGETCOLORTABLEPARAMETERIVEXTPROC)(GLenum target, GLenum pname, GLint* params); + typedef void (APIENTRY* PFNGLGETCOLORTABLEPARAMETERFVEXTPROC)(GLenum target, GLenum pname, GLfloat* params); +#endif + +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glPointParameterfEXT(GLenum, GLfloat); + extern void APIENTRY glPointParameterfvEXT(GLenum, const GLfloat*); + extern void APIENTRY glPointParameterfSGIS(GLenum, GLfloat); + extern void APIENTRY glPointParameterfvSGIS(GLenum, const GLfloat*); +#endif /* GL_GLEXT_PROTOTYPES */ + typedef void (APIENTRY* PFNGLPOINTPARAMETERFEXTPROC)(GLenum pname, GLfloat param); + typedef void (APIENTRY* PFNGLPOINTPARAMETERFVEXTPROC)(GLenum pname, const GLfloat* params); + typedef void (APIENTRY* PFNGLPOINTPARAMETERFSGISPROC)(GLenum pname, GLfloat param); + typedef void (APIENTRY* PFNGLPOINTPARAMETERFVSGISPROC)(GLenum pname, const GLfloat* params); +#endif + +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 +#endif + +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glSecondaryColor3bEXT(GLbyte, GLbyte, GLbyte); + extern void APIENTRY glSecondaryColor3bvEXT(const GLbyte*); + extern void APIENTRY glSecondaryColor3dEXT(GLdouble, GLdouble, GLdouble); + extern void APIENTRY glSecondaryColor3dvEXT(const GLdouble*); + extern void APIENTRY glSecondaryColor3fEXT(GLfloat, GLfloat, GLfloat); + extern void APIENTRY glSecondaryColor3fvEXT(const GLfloat*); + extern void APIENTRY glSecondaryColor3iEXT(GLint, GLint, GLint); + extern void APIENTRY glSecondaryColor3ivEXT(const GLint*); + extern void APIENTRY glSecondaryColor3sEXT(GLshort, GLshort, GLshort); + extern void APIENTRY glSecondaryColor3svEXT(const GLshort*); + extern void APIENTRY glSecondaryColor3ubEXT(GLubyte, GLubyte, GLubyte); + extern void APIENTRY glSecondaryColor3ubvEXT(const GLubyte*); + extern void APIENTRY glSecondaryColor3uiEXT(GLuint, GLuint, GLuint); + extern void APIENTRY glSecondaryColor3uivEXT(const GLuint*); + extern void APIENTRY glSecondaryColor3usEXT(GLushort, GLushort, GLushort); + extern void APIENTRY glSecondaryColor3usvEXT(const GLushort*); + extern void APIENTRY glSecondaryColorPointerEXT(GLint, GLenum, GLsizei, GLvoid*); +#endif /* GL_GLEXT_PROTOTYPES */ + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3BEXTPROC)(GLbyte red, GLbyte green, GLbyte blue); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3BVEXTPROC)(const GLbyte* v); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3DEXTPROC)(GLdouble red, GLdouble green, GLdouble blue); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3DVEXTPROC)(const GLdouble* v); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3FEXTPROC)(GLfloat red, GLfloat green, GLfloat blue); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3FVEXTPROC)(const GLfloat* v); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3IEXTPROC)(GLint red, GLint green, GLint blue); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3IVEXTPROC)(const GLint* v); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3SEXTPROC)(GLshort red, GLshort green, GLshort blue); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3SVEXTPROC)(const GLshort* v); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3UBEXTPROC)(GLubyte red, GLubyte green, GLubyte blue); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3UBVEXTPROC)(const GLubyte* v); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3UIEXTPROC)(GLuint red, GLuint green, GLuint blue); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3UIVEXTPROC)(const GLuint* v); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3USEXTPROC)(GLushort red, GLushort green, GLushort blue); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3USVEXTPROC)(const GLushort* v); + typedef void (APIENTRY* PFNGLSECONDARYCOLORPOINTEREXTPROC)(GLint size, GLenum type, GLsizei stride, GLvoid* pointer); +#endif + +#ifndef GL_EXT_separate_specular_color +#define GL_EXT_separate_specular_color 1 +#endif + +#ifndef GL_EXT_shadow_funcs +#define GL_EXT_shadow_funcs 1 +#endif + +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 +#endif + +#ifndef GL_EXT_stencil_two_side +#define GL_EXT_stencil_two_side 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void glActiveStencilFaceEXT(GLenum face); +#endif + typedef void (APIENTRY* PFNGLACTIVESTENCILFACEEXTPROC)(GLenum face); +#endif + +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 +#endif + +#ifndef GL_EXT_texture_compression_s3tc +#define GL_EXT_texture_compression_s3tc 1 +#endif + +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 +#endif + +#ifndef GL_EXT_texture_env_combine +#define GL_EXT_texture_env_combine 1 +#endif + +#ifndef GL_EXT_texture_env_dot3 +#define GL_EXT_texture_env_dot3 1 +#endif + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 +#endif + +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 +#endif + +#ifndef GL_EXT_texture_object +#define GL_EXT_texture_object 1 +#ifdef GL_GLEXT_PROTOTYPES + extern GLboolean APIENTRY glAreTexturesResidentEXT(GLsizei, const GLuint*, GLboolean*); + extern void APIENTRY glBindTextureEXT(GLenum, GLuint); + extern void APIENTRY glDeleteTexturesEXT(GLsizei, const GLuint*); + extern void APIENTRY glGenTexturesEXT(GLsizei, GLuint*); + extern GLboolean APIENTRY glIsTextureEXT(GLuint); + extern void APIENTRY glPrioritizeTexturesEXT(GLsizei, const GLuint*, const GLclampf*); +#endif /* GL_GLEXT_PROTOTYPES */ + typedef GLboolean(APIENTRY* PFNGLARETEXTURESRESIDENTEXTPROC)(GLsizei n, const GLuint* textures, GLboolean* residences); + typedef void (APIENTRY* PFNGLBINDTEXTUREEXTPROC)(GLenum target, GLuint texture); + typedef void (APIENTRY* PFNGLDELETETEXTURESEXTPROC)(GLsizei n, const GLuint* textures); + typedef void (APIENTRY* PFNGLGENTEXTURESEXTPROC)(GLsizei n, GLuint* textures); + typedef GLboolean(APIENTRY* PFNGLISTEXTUREEXTPROC)(GLuint texture); + typedef void (APIENTRY* PFNGLPRIORITIZETEXTURESEXTPROC)(GLsizei n, const GLuint* textures, const GLclampf* priorities); +#endif + +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glTexImage3DEXT(GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid*); + extern void APIENTRY glTexSubImage3DEXT(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid*); +#endif /* GL_GLEXT_PROTOTYPES */ + typedef void (APIENTRY* PFNGLTEXIMAGE3DEXTPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels); + typedef void (APIENTRY* PFNGLTEXSUBIMAGE3DEXTPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels); +#endif + +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glArrayElementEXT(GLint); + extern void APIENTRY glColorPointerEXT(GLint, GLenum, GLsizei, GLsizei, const GLvoid*); + extern void APIENTRY glDrawArraysEXT(GLenum, GLint, GLsizei); + extern void APIENTRY glEdgeFlagPointerEXT(GLsizei, GLsizei, const GLboolean*); + extern void APIENTRY glGetPointervEXT(GLenum, GLvoid**); + extern void APIENTRY glIndexPointerEXT(GLenum, GLsizei, GLsizei, const GLvoid*); + extern void APIENTRY glNormalPointerEXT(GLenum, GLsizei, GLsizei, const GLvoid*); + extern void APIENTRY glTexCoordPointerEXT(GLint, GLenum, GLsizei, GLsizei, const GLvoid*); + extern void APIENTRY glVertexPointerEXT(GLint, GLenum, GLsizei, GLsizei, const GLvoid*); +#endif /* GL_GLEXT_PROTOTYPES */ + typedef void (APIENTRY* PFNGLARRAYELEMENTEXTPROC)(GLint i); + typedef void (APIENTRY* PFNGLCOLORPOINTEREXTPROC)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid* pointer); + typedef void (APIENTRY* PFNGLDRAWARRAYSEXTPROC)(GLenum mode, GLint first, GLsizei count); + typedef void (APIENTRY* PFNGLEDGEFLAGPOINTEREXTPROC)(GLsizei stride, GLsizei count, const GLboolean* pointer); + typedef void (APIENTRY* PFNGLGETPOINTERVEXTPROC)(GLenum pname, GLvoid* *params); + typedef void (APIENTRY* PFNGLINDEXPOINTEREXTPROC)(GLenum type, GLsizei stride, GLsizei count, const GLvoid* pointer); + typedef void (APIENTRY* PFNGLNORMALPOINTEREXTPROC)(GLenum type, GLsizei stride, GLsizei count, const GLvoid* pointer); + typedef void (APIENTRY* PFNGLTEXCOORDPOINTEREXTPROC)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid* pointer); + typedef void (APIENTRY* PFNGLVERTEXPOINTEREXTPROC)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid* pointer); +#endif + +#ifndef GL_EXT_vertex_weighting +#define GL_EXT_vertex_weighting 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glVertexWeightfEXT(GLfloat); + extern void APIENTRY glVertexWeightfvEXT(const GLfloat*); + extern void APIENTRY glVertexWeightPointerEXT(GLsizei, GLenum, GLsizei, const GLvoid*); +#endif /* GL_GLEXT_PROTOTYPES */ + typedef void (APIENTRY* PFNGLVERTEXWEIGHTFEXTPROC)(GLfloat weight); + typedef void (APIENTRY* PFNGLVERTEXWEIGHTFVEXTPROC)(const GLfloat* weight); + typedef void (APIENTRY* PFNGLVERTEXWEIGHTPOINTEREXTPROC)(GLsizei size, GLenum type, GLsizei stride, const GLvoid* pointer); +#endif + +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 +#endif + +#ifndef GL_IBM_texture_mirrored_repeat +#define GL_IBM_texture_mirrored_repeat 1 +#endif + +#ifndef GL_NV_blend_square +#define GL_NV_blend_square 1 +#endif + +#ifndef GL_NV_copy_depth_to_color +#define GL_NV_copy_depth_to_color 1 +#endif + +#ifndef GL_NV_depth_clamp +#define GL_NV_depth_clamp 1 +#endif + +#ifndef GL_NV_element_array +#define GL_NV_element_array 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glElementPointerNV(GLenum type, const GLvoid* pointer); + extern void APIENTRY glDrawElementArrayNV(GLenum mode, GLint first, GLsizei count); + extern void APIENTRY glDrawRangeElementArrayNV(GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); + extern void APIENTRY glMultiDrawElementArrayNV(GLenum mode, const GLint* first, const GLsizei* count, GLsizei primcount); + extern void APIENTRY glMultiDrawRangeElementArrayNV(GLenum mode, GLuint start, GLuint end, const GLint* first, const GLsizei* count, GLsizei primcount); +#endif + typedef void (APIENTRY* PFNGLELEMENTPOINTERNVPROC)(GLenum type, const GLvoid* pointer); + typedef void (APIENTRY* PFNGLDRAWELEMENTARRAYNVPROC)(GLenum mode, GLint first, GLsizei count); + typedef void (APIENTRY* PFNGLDRAWRANGEELEMENTARRAYNVPROC)(GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); + typedef void (APIENTRY* PFNGLMULTIDRAWELEMENTARRAYNVPROC)(GLenum mode, const GLint* first, const GLsizei* count, GLsizei primcount); + typedef void (APIENTRY* PFNGLMULTIDRAWRANGEELEMENTARRAYNVPROC)(GLenum mode, GLuint start, GLuint end, const GLint* first, const GLsizei* count, GLsizei primcount); +#endif + +#ifndef GL_NV_fence +#define GL_NV_fence 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glDeleteFencesNV(GLsizei n, const GLuint* fences); + extern void APIENTRY glGenFencesNV(GLsizei n, GLuint* fences); + extern GLboolean APIENTRY glIsFenceNV(GLuint fence); + extern GLboolean APIENTRY glTestFenceNV(GLuint fence); + extern void APIENTRY glGetFenceivNV(GLuint fence, GLenum pname, GLint* params); + extern void APIENTRY glFinishFenceNV(GLuint fence); + extern void APIENTRY glSetFenceNV(GLuint fence, GLenum condition); +#endif + typedef void (APIENTRY* PFNGLDELETEFENCESNVPROC)(GLsizei n, const GLuint* fences); + typedef void (APIENTRY* PFNGLGENFENCESNVPROC)(GLsizei n, GLuint* fences); + typedef GLboolean(APIENTRY* PFNGLISFENCENVPROC)(GLuint fence); + typedef GLboolean(APIENTRY* PFNGLTESTFENCENVPROC)(GLuint fence); + typedef void (APIENTRY* PFNGLGETFENCEIVNVPROC)(GLuint fence, GLenum pname, GLint* params); + typedef void (APIENTRY* PFNGLFINISHFENCENVPROC)(GLuint fence); + typedef void (APIENTRY* PFNGLSETFENCENVPROC)(GLuint fence, GLenum condition); +#endif + +#ifndef GL_NV_float_buffer +#define GL_NV_float_buffer 1 +#endif + +#ifndef GL_NV_fog_distance +#define GL_NV_fog_distance 1 +#endif + +#ifndef GL_NV_fragment_program +#define GL_NV_fragment_program 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte* name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); + extern void APIENTRY glProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte* name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); + extern void APIENTRY glProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte* name, const GLfloat v[]); + extern void APIENTRY glProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte* name, const GLdouble v[]); + extern void APIENTRY glGetProgramNamedParameterfvNV(GLuint id, GLsizei len, const GLubyte* name, GLfloat* params); + extern void APIENTRY glGetProgramNamedParameterdvNV(GLuint id, GLsizei len, const GLubyte* name, GLdouble* params); +#endif + typedef void (APIENTRY* PFNGLPROGRAMNAMEDPARAMETER4FNVPROC)(GLuint id, GLsizei len, const GLubyte* name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); + typedef void (APIENTRY* PFNGLPROGRAMNAMEDPARAMETER4DNVPROC)(GLuint id, GLsizei len, const GLubyte* name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); + typedef void (APIENTRY* PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC)(GLuint id, GLsizei len, const GLubyte* name, const GLfloat v[]); + typedef void (APIENTRY* PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC)(GLuint id, GLsizei len, const GLubyte* name, const GLdouble v[]); + typedef void (APIENTRY* PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC)(GLuint id, GLsizei len, const GLubyte* name, GLfloat* params); + typedef void (APIENTRY* PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC)(GLuint id, GLsizei len, const GLubyte* name, GLdouble* params); +#endif + +#ifndef GL_NV_half_float +#define GL_NV_half_float 1 +#ifndef GLhalf + typedef unsigned short GLhalf; +#endif +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glVertex2hNV(GLhalf x, GLhalf y); + extern void APIENTRY glVertex2hvNV(const GLhalf* v); + extern void APIENTRY glVertex3hNV(GLhalf x, GLhalf y, GLhalf z); + extern void APIENTRY glVertex3hvNV(const GLhalf* v); + extern void APIENTRY glVertex4hNV(GLhalf x, GLhalf y, GLhalf z, GLhalf w); + extern void APIENTRY glVertex4hvNV(const GLhalf* v); + extern void APIENTRY glNormal3hNV(GLhalf nx, GLhalf ny, GLhalf nz); + extern void APIENTRY glNormal3hvNV(const GLhalf* v); + extern void APIENTRY glColor3hNV(GLhalf red, GLhalf green, GLhalf blue); + extern void APIENTRY glColor3hvNV(const GLhalf* v); + extern void APIENTRY glColor4hNV(GLhalf red, GLhalf green, GLhalf blue, GLhalf alpha); + extern void APIENTRY glColor4hvNV(const GLhalf* v); + extern void APIENTRY glTexCoord1hNV(GLhalf s); + extern void APIENTRY glTexCoord1hvNV(const GLhalf* v); + extern void APIENTRY glTexCoord2hNV(GLhalf s, GLhalf t); + extern void APIENTRY glTexCoord2hvNV(const GLhalf* v); + extern void APIENTRY glTexCoord3hNV(GLhalf s, GLhalf t, GLhalf r); + extern void APIENTRY glTexCoord3hvNV(const GLhalf* v); + extern void APIENTRY glTexCoord4hNV(GLhalf s, GLhalf t, GLhalf r, GLhalf q); + extern void APIENTRY glTexCoord4hvNV(const GLhalf* v); + extern void APIENTRY glMultiTexCoord1hNV(GLenum target, GLhalf s); + extern void APIENTRY glMultiTexCoord1hvNV(GLenum target, const GLhalf* v); + extern void APIENTRY glMultiTexCoord2hNV(GLenum target, GLhalf s, GLhalf t); + extern void APIENTRY glMultiTexCoord2hvNV(GLenum target, const GLhalf* v); + extern void APIENTRY glMultiTexCoord3hNV(GLenum target, GLhalf s, GLhalf t, GLhalf r); + extern void APIENTRY glMultiTexCoord3hvNV(GLenum target, const GLhalf* v); + extern void APIENTRY glMultiTexCoord4hNV(GLenum target, GLhalf s, GLhalf t, GLhalf r, GLhalf q); + extern void APIENTRY glMultiTexCoord4hvNV(GLenum target, const GLhalf* v); + extern void APIENTRY glFogCoordhNV(GLhalf fog); + extern void APIENTRY glFogCoordhvNV(const GLhalf* fog); + extern void APIENTRY glSecondaryColor3hNV(GLhalf red, GLhalf green, GLhalf blue); + extern void APIENTRY glSecondaryColor3hvNV(const GLhalf* v); + extern void APIENTRY glVertexWeighthNV(GLhalf weight); + extern void APIENTRY glVertexWeighthvNV(const GLhalf* weight); + extern void APIENTRY glVertexAttrib1hNV(GLuint index, GLhalf x); + extern void APIENTRY glVertexAttrib1hvNV(GLuint index, const GLhalf* v); + extern void APIENTRY glVertexAttrib2hNV(GLuint index, GLhalf x, GLhalf y); + extern void APIENTRY glVertexAttrib2hvNV(GLuint index, const GLhalf* v); + extern void APIENTRY glVertexAttrib3hNV(GLuint index, GLhalf x, GLhalf y, GLhalf z); + extern void APIENTRY glVertexAttrib3hvNV(GLuint index, const GLhalf* v); + extern void APIENTRY glVertexAttrib4hNV(GLuint index, GLhalf x, GLhalf y, GLhalf z, GLhalf w); + extern void APIENTRY glVertexAttrib4hvNV(GLuint index, const GLhalf* v); + extern void APIENTRY glVertexAttribs1hvNV(GLuint index, GLsizei n, const GLhalf* v); + extern void APIENTRY glVertexAttribs2hvNV(GLuint index, GLsizei n, const GLhalf* v); + extern void APIENTRY glVertexAttribs3hvNV(GLuint index, GLsizei n, const GLhalf* v); + extern void APIENTRY glVertexAttribs4hvNV(GLuint index, GLsizei n, const GLhalf* v); +#endif + typedef void (APIENTRY* PFNGLVERTEX2HNVPROC)(GLhalf x, GLhalf y); + typedef void (APIENTRY* PFNGLVERTEX2HVNVPROC)(const GLhalf* v); + typedef void (APIENTRY* PFNGLVERTEX3HNVPROC)(GLhalf x, GLhalf y, GLhalf z); + typedef void (APIENTRY* PFNGLVERTEX3HVNVPROC)(const GLhalf* v); + typedef void (APIENTRY* PFNGLVERTEX4HNVPROC)(GLhalf x, GLhalf y, GLhalf z, GLhalf w); + typedef void (APIENTRY* PFNGLVERTEX4HVNVPROC)(const GLhalf* v); + typedef void (APIENTRY* PFNGLNORMAL3HNVPROC)(GLhalf nx, GLhalf ny, GLhalf nz); + typedef void (APIENTRY* PFNGLNORMAL3HVNVPROC)(const GLhalf* v); + typedef void (APIENTRY* PFNGLCOLOR3HNVPROC)(GLhalf red, GLhalf green, GLhalf blue); + typedef void (APIENTRY* PFNGLCOLOR3HVNVPROC)(const GLhalf* v); + typedef void (APIENTRY* PFNGLCOLOR4HNVPROC)(GLhalf red, GLhalf green, GLhalf blue, GLhalf alpha); + typedef void (APIENTRY* PFNGLCOLOR4HVNVPROC)(const GLhalf* v); + typedef void (APIENTRY* PFNGLTEXCOORD1HNVPROC)(GLhalf s); + typedef void (APIENTRY* PFNGLTEXCOORD1HVNVPROC)(const GLhalf* v); + typedef void (APIENTRY* PFNGLTEXCOORD2HNVPROC)(GLhalf s, GLhalf t); + typedef void (APIENTRY* PFNGLTEXCOORD2HVNVPROC)(const GLhalf* v); + typedef void (APIENTRY* PFNGLTEXCOORD3HNVPROC)(GLhalf s, GLhalf t, GLhalf r); + typedef void (APIENTRY* PFNGLTEXCOORD3HVNVPROC)(const GLhalf* v); + typedef void (APIENTRY* PFNGLTEXCOORD4HNVPROC)(GLhalf s, GLhalf t, GLhalf r, GLhalf q); + typedef void (APIENTRY* PFNGLTEXCOORD4HVNVPROC)(const GLhalf* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD1HNVPROC)(GLenum target, GLhalf s); + typedef void (APIENTRY* PFNGLMULTITEXCOORD1HVNVPROC)(GLenum target, const GLhalf* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD2HNVPROC)(GLenum target, GLhalf s, GLhalf t); + typedef void (APIENTRY* PFNGLMULTITEXCOORD2HVNVPROC)(GLenum target, const GLhalf* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD3HNVPROC)(GLenum target, GLhalf s, GLhalf t, GLhalf r); + typedef void (APIENTRY* PFNGLMULTITEXCOORD3HVNVPROC)(GLenum target, const GLhalf* v); + typedef void (APIENTRY* PFNGLMULTITEXCOORD4HNVPROC)(GLenum target, GLhalf s, GLhalf t, GLhalf r, GLhalf q); + typedef void (APIENTRY* PFNGLMULTITEXCOORD4HVNVPROC)(GLenum target, const GLhalf* v); + typedef void (APIENTRY* PFNGLFOGCOORDHNVPROC)(GLhalf fog); + typedef void (APIENTRY* PFNGLFOGCOORDHVNVPROC)(const GLhalf* fog); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3HNVPROC)(GLhalf red, GLhalf green, GLhalf blue); + typedef void (APIENTRY* PFNGLSECONDARYCOLOR3HVNVPROC)(const GLhalf* v); + typedef void (APIENTRY* PFNGLVERTEXWEIGHTHNVPROC)(GLhalf weight); + typedef void (APIENTRY* PFNGLVERTEXWEIGHTHVNVPROC)(const GLhalf* weight); + typedef void (APIENTRY* PFNGLVERTEXATTRIB1HNVPROC)(GLuint index, GLhalf x); + typedef void (APIENTRY* PFNGLVERTEXATTRIB1HVNVPROC)(GLuint index, const GLhalf* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB2HNVPROC)(GLuint index, GLhalf x, GLhalf y); + typedef void (APIENTRY* PFNGLVERTEXATTRIB2HVNVPROC)(GLuint index, const GLhalf* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB3HNVPROC)(GLuint index, GLhalf x, GLhalf y, GLhalf z); + typedef void (APIENTRY* PFNGLVERTEXATTRIB3HVNVPROC)(GLuint index, const GLhalf* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB4HNVPROC)(GLuint index, GLhalf x, GLhalf y, GLhalf z, GLhalf w); + typedef void (APIENTRY* PFNGLVERTEXATTRIB4HVNVPROC)(GLuint index, const GLhalf* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIBS1HVNVPROC)(GLuint index, GLsizei n, const GLhalf* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIBS2HVNVPROC)(GLuint index, GLsizei n, const GLhalf* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIBS3HVNVPROC)(GLuint index, GLsizei n, const GLhalf* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIBS4HVNVPROC)(GLuint index, GLsizei n, const GLhalf* v); +#endif + +#ifndef GL_NV_light_max_exponent +#define GL_NV_light_max_exponent 1 +#endif + +#ifndef GL_NV_multisample_filter_hint +#define GL_NV_multisample_filter_hint 1 +#endif + +#ifndef GL_NV_occlusion_query +#define GL_NV_occlusion_query 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glGenOcclusionQueriesNV(GLsizei n, GLuint* ids); + extern void APIENTRY glDeleteOcclusionQueriesNV(GLsizei n, const GLuint* ids); + extern void APIENTRY glIsOcclusionQueryNV(GLuint id); + extern void APIENTRY glBeginOcclusionQueryNV(GLuint id); + extern void APIENTRY glEndOcclusionQueryNV(GLvoid); + extern void APIENTRY glGetOcclusionQueryivNV(GLuint id, GLenum pname, GLint* params); + extern void APIENTRY glGetOcclusionQueryuivNV(GLuint id, GLenum pname, GLuint* params); +#endif + typedef void (APIENTRY* PFNGLGENOCCLUSIONQUERIESNVPROC)(GLsizei n, GLuint* ids); + typedef void (APIENTRY* PFNGLDELETEOCCLUSIONQUERIESNVPROC)(GLsizei n, const GLuint* ids); + typedef void (APIENTRY* PFNGLISOCCLUSIONQUERYNVPROC)(GLuint id); + typedef void (APIENTRY* PFNGLBEGINOCCLUSIONQUERYNVPROC)(GLuint id); + typedef void (APIENTRY* PFNGLENDOCCLUSIONQUERYNVPROC)(GLvoid); + typedef void (APIENTRY* PFNGLGETOCCLUSIONQUERYIVNVPROC)(GLuint id, GLenum pname, GLint* params); + typedef void (APIENTRY* PFNGLGETOCCLUSIONQUERYUIVNVPROC)(GLuint id, GLenum pname, GLuint* params); +#endif + +#ifndef GL_NV_packed_depth_stencil +#define GL_NV_packed_depth_stencil 1 +#endif + +#ifndef GL_NV_pixel_data_range +#define GL_NV_pixel_data_range 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glPixelDataRangeNV(GLenum target, GLsizei length, GLvoid* pointer); + extern void APIENTRY glFlushPixelDataRangeNV(GLenum target); +#endif + typedef void (APIENTRY* PFNGLPIXELDATARANGENVPROC)(GLenum target, GLsizei length, GLvoid* pointer); + typedef void (APIENTRY* PFNGLFLUSHPIXELDATARANGENVPROC)(GLenum target); +#endif + +#ifndef GL_NV_point_sprite +#define GL_NV_point_sprite 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glPointParameteriNV(GLenum pname, int param); + extern void APIENTRY glPointParameterivNV(GLenum pname, const int* params); +#endif + typedef void (APIENTRY* PFNGLPOINTPARAMETERINVPROC)(GLenum pname, int param); + typedef void (APIENTRY* PFNGLPOINTPARAMETERIVNVPROC)(GLenum pname, const int* params); +#endif + +#ifndef GL_NV_primitive_restart +#define GL_NV_primitive_restart 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glPrimitiveRestartNV(GLvoid); + extern void APIENTRY glPrimitiveRestartIndexNV(GLuint index); +#endif + typedef void (APIENTRY* PFNGLPRIMITIVERESTARTNVPROC)(GLvoid); + typedef void (APIENTRY* PFNGLPRIMITIVERESTARTINDEXNVPROC)(GLuint index); +#endif + +#ifndef GL_NV_register_combiners +#define GL_NV_register_combiners 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glCombinerParameterfvNV(GLenum, const GLfloat*); + extern void APIENTRY glCombinerParameterfNV(GLenum, GLfloat); + extern void APIENTRY glCombinerParameterivNV(GLenum, const GLint*); + extern void APIENTRY glCombinerParameteriNV(GLenum, GLint); + extern void APIENTRY glCombinerInputNV(GLenum, GLenum, GLenum, GLenum, GLenum, GLenum); + extern void APIENTRY glCombinerOutputNV(GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean); + extern void APIENTRY glFinalCombinerInputNV(GLenum, GLenum, GLenum, GLenum); + extern void APIENTRY glGetCombinerInputParameterfvNV(GLenum, GLenum, GLenum, GLenum, GLfloat*); + extern void APIENTRY glGetCombinerInputParameterivNV(GLenum, GLenum, GLenum, GLenum, GLint*); + extern void APIENTRY glGetCombinerOutputParameterfvNV(GLenum, GLenum, GLenum, GLfloat*); + extern void APIENTRY glGetCombinerOutputParameterivNV(GLenum, GLenum, GLenum, GLint*); + extern void APIENTRY glGetFinalCombinerInputParameterfvNV(GLenum, GLenum, GLfloat*); + extern void APIENTRY glGetFinalCombinerInputParameterivNV(GLenum, GLenum, GLint*); +#endif /* GL_GLEXT_PROTOTYPES */ + typedef void (APIENTRY* PFNGLCOMBINERPARAMETERFVNVPROC)(GLenum pname, const GLfloat* params); + typedef void (APIENTRY* PFNGLCOMBINERPARAMETERFNVPROC)(GLenum pname, GLfloat param); + typedef void (APIENTRY* PFNGLCOMBINERPARAMETERIVNVPROC)(GLenum pname, const GLint* params); + typedef void (APIENTRY* PFNGLCOMBINERPARAMETERINVPROC)(GLenum pname, GLint param); + typedef void (APIENTRY* PFNGLCOMBINERINPUTNVPROC)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); + typedef void (APIENTRY* PFNGLCOMBINEROUTPUTNVPROC)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); + typedef void (APIENTRY* PFNGLFINALCOMBINERINPUTNVPROC)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); + typedef void (APIENTRY* PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat* params); + typedef void (APIENTRY* PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint* params); + typedef void (APIENTRY* PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC)(GLenum stage, GLenum portion, GLenum pname, GLfloat* params); + typedef void (APIENTRY* PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC)(GLenum stage, GLenum portion, GLenum pname, GLint* params); + typedef void (APIENTRY* PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC)(GLenum variable, GLenum pname, GLfloat* params); + typedef void (APIENTRY* PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC)(GLenum variable, GLenum pname, GLint* params); +#endif + +#ifndef GL_NV_register_combiners2 +#define GL_NV_register_combiners2 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void glCombinerStageParameterfvNV(GLenum stage, GLenum pname, const GLfloat* params); + extern void glGetCombinerStageParameterfvNV(GLenum stage, GLenum pname, GLfloat* params); +#endif + typedef void (APIENTRY* PFNGLCOMBINERSTAGEPARAMETERFVNVPROC)(GLenum stage, GLenum pname, const GLfloat* params); + typedef void (APIENTRY* PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC)(GLenum stage, GLenum pname, GLfloat* params); +#endif + +#ifndef GL_NV_stencil_two_side +#define GL_NV_stencil_two_side 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glActiveStencilFaceNV(GLenum face); +#endif + typedef void (APIENTRY* PFNGLACTIVESTENCILFACENVPROC)(GLenum face); +#endif + +#ifndef GL_NV_texgen_emboss +#define GL_NV_texgen_emboss 1 +#endif + +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 +#endif + +#ifndef GL_NV_texture_compression_vtc +#define GL_NV_texture_compression_vtc 1 +#endif + +#ifndef GL_NV_texture_env_combine4 +#define GL_NV_texture_env_combine4 1 +#endif + +#ifndef GL_NV_texture_rectangle +#define GL_NV_texture_rectangle 1 +#endif + +#ifndef GL_NV_texture_shader +#define GL_NV_texture_shader 1 +#endif + +#ifndef GL_NV_texture_shader2 +#define GL_NV_texture_shader2 1 +#endif + +#ifndef GL_NV_texture_shader3 +#define GL_NV_texture_shader3 1 +#endif + +#ifndef GL_NV_vertex_array_range +#define GL_NV_vertex_array_range 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void APIENTRY glFlushVertexArrayRangeNV(void); + extern void APIENTRY glVertexArrayRangeNV(GLsizei, const GLvoid*); +#endif /* GL_GLEXT_PROTOTYPES */ + typedef void (APIENTRY* PFNGLFLUSHVERTEXARRAYRANGENVPROC)(void); + typedef void (APIENTRY* PFNGLVERTEXARRAYRANGENVPROC)(GLsizei size, const GLvoid* pointer); +#endif + +#ifndef GL_NV_vertex_array_range2 +#define GL_NV_vertex_array_range2 1 +#endif + +#ifndef GL_NV_vertex_program +#define GL_NV_vertex_program 1 +#ifdef GL_GLEXT_PROTOTYPES + extern void glBindProgramNV(GLenum target, GLuint id); + extern void glDeleteProgramsNV(GLsizei n, const GLuint* ids); + extern void glExecuteProgramNV(GLenum target, GLuint id, const GLfloat* params); + extern void glGenProgramsNV(GLsizei n, GLuint* ids); + extern GLboolean glAreProgramsResidentNV(GLsizei n, const GLuint* ids, boolean* residences); + extern void glRequestResidentProgramsNV(GLsizei n, GLuint* ids); + extern void glGetProgramParameterfvNV(GLenum target, GLuint index, GLenum pname, GLfloat* params); + extern void glGetProgramParameterdvNV(GLenum target, GLuint index, GLenum pname, GLdouble* params); + extern void glGetProgramivNV(GLuint id, GLenum pname, int* params); + extern void glGetProgramStringNV(GLuint id, GLenum pname, GLubyte* program); + extern void glGetTrackMatrixivNV(GLenum target, GLuint address, GLenum pname, int* params); + extern void glGetVertexAttribdvNV(GLuint index, GLenum pname, GLdouble* params); + extern void glGetVertexAttribfvNV(GLuint index, GLenum pname, GLfloat* params); + extern void glGetVertexAttribivNV(GLuint index, GLenum pname, int* params); + extern void glGetVertexAttribPointervNV(GLuint index, GLenum pname, void** pointer); + extern GLboolean glIsProgramNV(GLuint id); + extern void glLoadProgramNV(GLenum target, GLuint id, GLsizei len, const GLubyte* program); + extern void glProgramParameter4fNV(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); + extern void glProgramParameter4dNV(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); + extern void glProgramParameter4dvNV(GLenum target, GLuint index, const GLdouble* params); + extern void glProgramParameter4fvNV(GLenum target, GLuint index, const GLfloat* params); + extern void glProgramParameters4dvNV(GLenum target, GLuint index, GLuint num, const GLdouble* params); + extern void glProgramParameters4fvNV(GLenum target, GLuint index, GLuint num, const GLfloat* params); + extern void glTrackMatrixNV(GLenum target, GLuint address, GLenum matrix, GLenum transform); + extern void glVertexAttribPointerNV(GLuint index, int size, GLenum type, GLsizei stride, const void* pointer); + extern void glVertexAttrib1sNV(GLuint index, GLshort x); + extern void glVertexAttrib1fNV(GLuint index, GLfloat x); + extern void glVertexAttrib1dNV(GLuint index, GLdouble x); + extern void glVertexAttrib2sNV(GLuint index, GLshort x, GLshort y); + extern void glVertexAttrib2fNV(GLuint index, GLfloat x, GLfloat y); + extern void glVertexAttrib2dNV(GLuint index, GLdouble x, GLdouble y); + extern void glVertexAttrib3sNV(GLuint index, GLshort x, GLshort y, GLshort z); + extern void glVertexAttrib3fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z); + extern void glVertexAttrib3dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z); + extern void glVertexAttrib4sNV(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); + extern void glVertexAttrib4fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); + extern void glVertexAttrib4dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); + extern void glVertexAttrib4ubNV(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); + extern void glVertexAttrib1svNV(GLuint index, const GLshort* v); + extern void glVertexAttrib1fvNV(GLuint index, const GLfloat* v); + extern void glVertexAttrib1dvNV(GLuint index, const GLdouble* v); + extern void glVertexAttrib2svNV(GLuint index, const GLshort* v); + extern void glVertexAttrib2fvNV(GLuint index, const GLfloat* v); + extern void glVertexAttrib2dvNV(GLuint index, const GLdouble* v); + extern void glVertexAttrib3svNV(GLuint index, const GLshort* v); + extern void glVertexAttrib3fvNV(GLuint index, const GLfloat* v); + extern void glVertexAttrib3dvNV(GLuint index, const GLdouble* v); + extern void glVertexAttrib4svNV(GLuint index, const GLshort* v); + extern void glVertexAttrib4fvNV(GLuint index, const GLfloat* v); + extern void glVertexAttrib4dvNV(GLuint index, const GLdouble* v); + extern void glVertexAttrib4ubvNV(GLuint index, const GLubyte* v); + extern void glVertexAttribs1svNV(GLuint index, GLsizei n, const GLshort* v); + extern void glVertexAttribs1fvNV(GLuint index, GLsizei n, const GLfloat* v); + extern void glVertexAttribs1dvNV(GLuint index, GLsizei n, const GLdouble* v); + extern void glVertexAttribs2svNV(GLuint index, GLsizei n, const GLshort* v); + extern void glVertexAttribs2fvNV(GLuint index, GLsizei n, const GLfloat* v); + extern void glVertexAttribs2dvNV(GLuint index, GLsizei n, const GLdouble* v); + extern void glVertexAttribs3svNV(GLuint index, GLsizei n, const GLshort* v); + extern void glVertexAttribs3fvNV(GLuint index, GLsizei n, const GLfloat* v); + extern void glVertexAttribs3dvNV(GLuint index, GLsizei n, const GLdouble* v); + extern void glVertexAttribs4svNV(GLuint index, GLsizei n, const GLshort* v); + extern void glVertexAttribs4fvNV(GLuint index, GLsizei n, const GLfloat* v); + extern void glVertexAttribs4dvNV(GLuint index, GLsizei n, const GLdouble* v); + extern void glVertexAttribs4ubvNV(GLuint index, GLsizei n, const GLubyte* v); +#endif + typedef GLboolean(APIENTRY* PFNGLAREPROGRAMSRESIDENTNVPROC)(GLsizei n, const GLuint* programs, GLboolean* residences); + typedef void (APIENTRY* PFNGLBINDPROGRAMNVPROC)(GLenum target, GLuint id); + typedef void (APIENTRY* PFNGLDELETEPROGRAMSNVPROC)(GLsizei n, const GLuint* programs); + typedef void (APIENTRY* PFNGLEXECUTEPROGRAMNVPROC)(GLenum target, GLuint id, const GLfloat* params); + typedef void (APIENTRY* PFNGLGENPROGRAMSNVPROC)(GLsizei n, GLuint* programs); + typedef void (APIENTRY* PFNGLGETPROGRAMPARAMETERDVNVPROC)(GLenum target, GLuint index, GLenum pname, GLdouble* params); + typedef void (APIENTRY* PFNGLGETPROGRAMPARAMETERFVNVPROC)(GLenum target, GLuint index, GLenum pname, GLfloat* params); + typedef void (APIENTRY* PFNGLGETPROGRAMIVNVPROC)(GLuint id, GLenum pname, GLint* params); + typedef void (APIENTRY* PFNGLGETPROGRAMSTRINGNVPROC)(GLuint id, GLenum pname, GLubyte* program); + typedef void (APIENTRY* PFNGLGETTRACKMATRIXIVNVPROC)(GLenum target, GLuint address, GLenum pname, GLint* params); + typedef void (APIENTRY* PFNGLGETVERTEXATTRIBDVNVPROC)(GLuint index, GLenum pname, GLdouble* params); + typedef void (APIENTRY* PFNGLGETVERTEXATTRIBFVNVPROC)(GLuint index, GLenum pname, GLfloat* params); + typedef void (APIENTRY* PFNGLGETVERTEXATTRIBIVNVPROC)(GLuint index, GLenum pname, GLint* params); + typedef void (APIENTRY* PFNGLGETVERTEXATTRIBPOINTERVNVPROC)(GLuint index, GLenum pname, GLvoid* *pointer); + typedef GLboolean(APIENTRY* PFNGLISPROGRAMNVPROC)(GLuint id); + typedef void (APIENTRY* PFNGLLOADPROGRAMNVPROC)(GLenum target, GLuint id, GLsizei len, const GLubyte* program); + typedef void (APIENTRY* PFNGLPROGRAMPARAMETER4DNVPROC)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); + typedef void (APIENTRY* PFNGLPROGRAMPARAMETER4DVNVPROC)(GLenum target, GLuint index, const GLdouble* v); + typedef void (APIENTRY* PFNGLPROGRAMPARAMETER4FNVPROC)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); + typedef void (APIENTRY* PFNGLPROGRAMPARAMETER4FVNVPROC)(GLenum target, GLuint index, const GLfloat* v); + typedef void (APIENTRY* PFNGLPROGRAMPARAMETERS4DVNVPROC)(GLenum target, GLuint index, GLsizei count, const GLdouble* v); + typedef void (APIENTRY* PFNGLPROGRAMPARAMETERS4FVNVPROC)(GLenum target, GLuint index, GLsizei count, const GLfloat* v); + typedef void (APIENTRY* PFNGLREQUESTRESIDENTPROGRAMSNVPROC)(GLsizei n, const GLuint* programs); + typedef void (APIENTRY* PFNGLTRACKMATRIXNVPROC)(GLenum target, GLuint address, GLenum matrix, GLenum transform); + typedef void (APIENTRY* PFNGLVERTEXATTRIBPOINTERNVPROC)(GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid* pointer); + typedef void (APIENTRY* PFNGLVERTEXATTRIB1DNVPROC)(GLuint index, GLdouble x); + typedef void (APIENTRY* PFNGLVERTEXATTRIB1DVNVPROC)(GLuint index, const GLdouble* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB1FNVPROC)(GLuint index, GLfloat x); + typedef void (APIENTRY* PFNGLVERTEXATTRIB1FVNVPROC)(GLuint index, const GLfloat* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB1SNVPROC)(GLuint index, GLshort x); + typedef void (APIENTRY* PFNGLVERTEXATTRIB1SVNVPROC)(GLuint index, const GLshort* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB2DNVPROC)(GLuint index, GLdouble x, GLdouble y); + typedef void (APIENTRY* PFNGLVERTEXATTRIB2DVNVPROC)(GLuint index, const GLdouble* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB2FNVPROC)(GLuint index, GLfloat x, GLfloat y); + typedef void (APIENTRY* PFNGLVERTEXATTRIB2FVNVPROC)(GLuint index, const GLfloat* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB2SNVPROC)(GLuint index, GLshort x, GLshort y); + typedef void (APIENTRY* PFNGLVERTEXATTRIB2SVNVPROC)(GLuint index, const GLshort* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB3DNVPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z); + typedef void (APIENTRY* PFNGLVERTEXATTRIB3DVNVPROC)(GLuint index, const GLdouble* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB3FNVPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z); + typedef void (APIENTRY* PFNGLVERTEXATTRIB3FVNVPROC)(GLuint index, const GLfloat* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB3SNVPROC)(GLuint index, GLshort x, GLshort y, GLshort z); + typedef void (APIENTRY* PFNGLVERTEXATTRIB3SVNVPROC)(GLuint index, const GLshort* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB4DNVPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); + typedef void (APIENTRY* PFNGLVERTEXATTRIB4DVNVPROC)(GLuint index, const GLdouble* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB4FNVPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); + typedef void (APIENTRY* PFNGLVERTEXATTRIB4FVNVPROC)(GLuint index, const GLfloat* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB4SNVPROC)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); + typedef void (APIENTRY* PFNGLVERTEXATTRIB4SVNVPROC)(GLuint index, const GLshort* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIB4UBNVPROC)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); + typedef void (APIENTRY* PFNGLVERTEXATTRIB4UBVNVPROC)(GLuint index, const GLubyte* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIBS1DVNVPROC)(GLuint index, GLsizei count, const GLdouble* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIBS1FVNVPROC)(GLuint index, GLsizei count, const GLfloat* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIBS1SVNVPROC)(GLuint index, GLsizei count, const GLshort* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIBS2DVNVPROC)(GLuint index, GLsizei count, const GLdouble* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIBS2FVNVPROC)(GLuint index, GLsizei count, const GLfloat* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIBS2SVNVPROC)(GLuint index, GLsizei count, const GLshort* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIBS3DVNVPROC)(GLuint index, GLsizei count, const GLdouble* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIBS3FVNVPROC)(GLuint index, GLsizei count, const GLfloat* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIBS3SVNVPROC)(GLuint index, GLsizei count, const GLshort* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIBS4DVNVPROC)(GLuint index, GLsizei count, const GLdouble* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIBS4FVNVPROC)(GLuint index, GLsizei count, const GLfloat* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIBS4SVNVPROC)(GLuint index, GLsizei count, const GLshort* v); + typedef void (APIENTRY* PFNGLVERTEXATTRIBS4UBVNVPROC)(GLuint index, GLsizei count, const GLubyte* v); +#endif + +#ifndef GL_NV_vertex_program1_1 +#define GL_NV_vertex_program1_1 1 +#endif + +#ifndef GL_NV_vertex_program2 +#define GL_NV_vertex_program2 1 +#endif + +#ifndef GL_SGIS_generate_mipmap +#define GL_SGIS_generate_mipmap 1 +#endif + +#ifndef GL_SGIS_texture_lod +#define GL_SGIS_texture_lod 1 +#endif + +#ifndef GL_SGIX_depth_texture +#define GL_SGIX_depth_texture 1 +#endif + +#ifndef GL_SGIX_shadow +#define GL_SGIX_shadow 1 +#endif + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/APEX_1.4/shared/external/include/GL/glut.h b/APEX_1.4/shared/external/include/GL/glut.h new file mode 100644 index 00000000..77830e3c --- /dev/null +++ b/APEX_1.4/shared/external/include/GL/glut.h @@ -0,0 +1,740 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef __glut_h__ +#define __glut_h__ + +/* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1998. */ + +/* This program is freely distributable without licensing fees and is + provided without guarantee or warrantee expressed or implied. This + program is -not- in the public domain. */ + +#if defined(_WIN32) + +/* GLUT 3.7 now tries to avoid including <windows.h> + to avoid name space pollution, but Win32's <GL/gl.h> + needs APIENTRY and WINGDIAPI defined properly. */ +# if 0 +/* This would put tons of macros and crap in our clean name space. */ +# define WIN32_LEAN_AND_MEAN +# include <windows.h> +# else +/* XXX This is from Win32's <windef.h> */ +# ifndef APIENTRY +# define GLUT_APIENTRY_DEFINED +# if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) || defined(__LCC__) +# define APIENTRY __stdcall +# else +# define APIENTRY +# endif +# endif +/* XXX This is from Win32's <winnt.h> */ +# ifndef CALLBACK +# if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) || defined(__LCC__) +# define CALLBACK __stdcall +# else +# define CALLBACK +# endif +# endif +/* XXX Hack for lcc compiler. It doesn't support __declspec(dllimport), just __stdcall. */ +# if defined( __LCC__ ) +# undef WINGDIAPI +# define WINGDIAPI __stdcall +# else +/* XXX This is from Win32's <wingdi.h> and <winnt.h> */ +# ifndef WINGDIAPI +# define GLUT_WINGDIAPI_DEFINED +# define WINGDIAPI __declspec(dllimport) +# endif +# endif +/* XXX This is from Win32's <ctype.h> */ +# ifndef _WCHAR_T_DEFINED +typedef unsigned short wchar_t; +# define _WCHAR_T_DEFINED +# endif +# endif + +/* To disable automatic library usage for GLUT, define GLUT_NO_LIB_PRAGMA + in your compile preprocessor options. */ +# if !defined(GLUT_BUILDING_LIB) && !defined(GLUT_NO_LIB_PRAGMA) +# pragma comment (lib, "winmm.lib") /* link with Windows MultiMedia lib */ +/* To enable automatic SGI OpenGL for Windows library usage for GLUT, + define GLUT_USE_SGI_OPENGL in your compile preprocessor options. */ +# ifdef GLUT_USE_SGI_OPENGL +# pragma comment (lib, "opengl.lib") /* link with SGI OpenGL for Windows lib */ +# pragma comment (lib, "glu.lib") /* link with SGI OpenGL Utility lib */ +# pragma comment (lib, "glut.lib") /* link with Win32 GLUT for SGI OpenGL lib */ +# else +# pragma comment (lib, "opengl32.lib") /* link with Microsoft OpenGL lib */ +# pragma comment (lib, "glu32.lib") /* link with Microsoft OpenGL Utility lib */ +# pragma comment (lib, "glut32.lib") /* link with Win32 GLUT lib */ +# endif +# endif + +/* To disable supression of annoying warnings about floats being promoted + to doubles, define GLUT_NO_WARNING_DISABLE in your compile preprocessor + options. */ +# ifndef GLUT_NO_WARNING_DISABLE +# pragma warning (disable:4244) /* Disable bogus VC++ 4.2 conversion warnings. */ +# pragma warning (disable:4305) /* VC++ 5.0 version of above warning. */ +# endif + +/* Win32 has an annoying issue where there are multiple C run-time + libraries (CRTs). If the executable is linked with a different CRT + from the GLUT DLL, the GLUT DLL will not share the same CRT static + data seen by the executable. In particular, atexit callbacks registered + in the executable will not be called if GLUT calls its (different) + exit routine). GLUT is typically built with the + "/MD" option (the CRT with multithreading DLL support), but the Visual + C++ linker default is "/ML" (the single threaded CRT). + + One workaround to this issue is requiring users to always link with + the same CRT as GLUT is compiled with. That requires users supply a + non-standard option. GLUT 3.7 has its own built-in workaround where + the executable's "exit" function pointer is covertly passed to GLUT. + GLUT then calls the executable's exit function pointer to ensure that + any "atexit" calls registered by the application are called if GLUT + needs to exit. + + Note that the __glut*WithExit routines should NEVER be called directly. + To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK. */ + +/* XXX This is from Win32's <process.h> */ +# if !defined(_MSC_VER) && !defined(__cdecl) +/* Define __cdecl for non-Microsoft compilers. */ +# define __cdecl +# define GLUT_DEFINED___CDECL +# endif +# ifndef _CRTIMP +# ifdef _NTSDK +/* Definition compatible with NT SDK */ +# define _CRTIMP +# else +/* Current definition */ +# ifdef _DLL +# define _CRTIMP __declspec(dllimport) +# else +# define _CRTIMP +# endif +# endif +# define GLUT_DEFINED__CRTIMP +# endif + +/* GLUT API entry point declarations for Win32. */ +# ifdef GLUT_BUILDING_LIB +# define GLUTAPI __declspec(dllexport) +# else +# ifdef _DLL +# define GLUTAPI __declspec(dllimport) +# else +# define GLUTAPI extern +# endif +# endif + +/* GLUT callback calling convention for Win32. */ +# define GLUTCALLBACK __cdecl + +#endif /* _WIN32 */ + +#include <GL/gl.h> +#include <GL/glu.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(_WIN32) +# ifndef GLUT_BUILDING_LIB +#if _MSC_VER > 1200 + extern _CRTIMP __declspec(noreturn) void __cdecl exit(int); +#else + extern _CRTIMP void __cdecl exit(int); +#endif +# endif +#else + /* non-Win32 case. */ + /* Define APIENTRY and CALLBACK to nothing if we aren't on Win32. */ +# define APIENTRY +# define GLUT_APIENTRY_DEFINED +# define CALLBACK + /* Define GLUTAPI and GLUTCALLBACK as below if we aren't on Win32. */ +# define GLUTAPI extern +# define GLUTCALLBACK + /* Prototype exit for the non-Win32 case (see above). */ + extern void exit(int); +#endif + + /** + GLUT API revision history: + + GLUT_API_VERSION is updated to reflect incompatible GLUT + API changes (interface changes, semantic changes, deletions, + or additions). + + GLUT_API_VERSION=1 First public release of GLUT. 11/29/94 + + GLUT_API_VERSION=2 Added support for OpenGL/GLX multisampling, + extension. Supports new input devices like tablet, dial and button + box, and Spaceball. Easy to query OpenGL extensions. + + GLUT_API_VERSION=3 glutMenuStatus added. + + GLUT_API_VERSION=4 glutInitDisplayString, glutWarpPointer, + glutBitmapLength, glutStrokeLength, glutWindowStatusFunc, dynamic + video resize subAPI, glutPostWindowRedisplay, glutKeyboardUpFunc, + glutSpecialUpFunc, glutIgnoreKeyRepeat, glutSetKeyRepeat, + glutJoystickFunc, glutForceJoystickFunc (NOT FINALIZED!). + **/ +#ifndef GLUT_API_VERSION /* allow this to be overriden */ +#define GLUT_API_VERSION 3 +#endif + + /** + GLUT implementation revision history: + + GLUT_XLIB_IMPLEMENTATION is updated to reflect both GLUT + API revisions and implementation revisions (ie, bug fixes). + + GLUT_XLIB_IMPLEMENTATION=1 mjk's first public release of + GLUT Xlib-based implementation. 11/29/94 + + GLUT_XLIB_IMPLEMENTATION=2 mjk's second public release of + GLUT Xlib-based implementation providing GLUT version 2 + interfaces. + + GLUT_XLIB_IMPLEMENTATION=3 mjk's GLUT 2.2 images. 4/17/95 + + GLUT_XLIB_IMPLEMENTATION=4 mjk's GLUT 2.3 images. 6/?/95 + + GLUT_XLIB_IMPLEMENTATION=5 mjk's GLUT 3.0 images. 10/?/95 + + GLUT_XLIB_IMPLEMENTATION=7 mjk's GLUT 3.1+ with glutWarpPoitner. 7/24/96 + + GLUT_XLIB_IMPLEMENTATION=8 mjk's GLUT 3.1+ with glutWarpPoitner + and video resize. 1/3/97 + + GLUT_XLIB_IMPLEMENTATION=9 mjk's GLUT 3.4 release with early GLUT 4 routines. + + GLUT_XLIB_IMPLEMENTATION=11 Mesa 2.5's GLUT 3.6 release. + + GLUT_XLIB_IMPLEMENTATION=12 mjk's GLUT 3.6 release with early GLUT 4 routines + signal handling. + + GLUT_XLIB_IMPLEMENTATION=13 mjk's GLUT 3.7 beta with GameGLUT support. + + GLUT_XLIB_IMPLEMENTATION=14 mjk's GLUT 3.7 beta with f90gl friend interface. + + GLUT_XLIB_IMPLEMENTATION=15 mjk's GLUT 3.7 beta sync'ed with Mesa <GL/glut.h> + **/ +#ifndef GLUT_XLIB_IMPLEMENTATION /* Allow this to be overriden. */ +#define GLUT_XLIB_IMPLEMENTATION 15 +#endif + + /* Display mode bit masks. */ +#define GLUT_RGB 0 +#define GLUT_RGBA GLUT_RGB +#define GLUT_INDEX 1 +#define GLUT_SINGLE 0 +#define GLUT_DOUBLE 2 +#define GLUT_ACCUM 4 +#define GLUT_ALPHA 8 +#define GLUT_DEPTH 16 +#define GLUT_STENCIL 32 +#if (GLUT_API_VERSION >= 2) +#define GLUT_MULTISAMPLE 128 +#define GLUT_STEREO 256 +#endif +#if (GLUT_API_VERSION >= 3) +#define GLUT_LUMINANCE 512 +#endif + + /* Mouse buttons. */ +#define GLUT_LEFT_BUTTON 0 +#define GLUT_MIDDLE_BUTTON 1 +#define GLUT_RIGHT_BUTTON 2 + + /* Mouse button state. */ +#define GLUT_DOWN 0 +#define GLUT_UP 1 + +#if (GLUT_API_VERSION >= 2) + /* function keys */ +#define GLUT_KEY_F1 1 +#define GLUT_KEY_F2 2 +#define GLUT_KEY_F3 3 +#define GLUT_KEY_F4 4 +#define GLUT_KEY_F5 5 +#define GLUT_KEY_F6 6 +#define GLUT_KEY_F7 7 +#define GLUT_KEY_F8 8 +#define GLUT_KEY_F9 9 +#define GLUT_KEY_F10 10 +#define GLUT_KEY_F11 11 +#define GLUT_KEY_F12 12 + /* directional keys */ +#define GLUT_KEY_LEFT 100 +#define GLUT_KEY_UP 101 +#define GLUT_KEY_RIGHT 102 +#define GLUT_KEY_DOWN 103 +#define GLUT_KEY_PAGE_UP 104 +#define GLUT_KEY_PAGE_DOWN 105 +#define GLUT_KEY_HOME 106 +#define GLUT_KEY_END 107 +#define GLUT_KEY_INSERT 108 +#endif + + /* Entry/exit state. */ +#define GLUT_LEFT 0 +#define GLUT_ENTERED 1 + + /* Menu usage state. */ +#define GLUT_MENU_NOT_IN_USE 0 +#define GLUT_MENU_IN_USE 1 + + /* Visibility state. */ +#define GLUT_NOT_VISIBLE 0 +#define GLUT_VISIBLE 1 + + /* Window status state. */ +#define GLUT_HIDDEN 0 +#define GLUT_FULLY_RETAINED 1 +#define GLUT_PARTIALLY_RETAINED 2 +#define GLUT_FULLY_COVERED 3 + + /* Color index component selection values. */ +#define GLUT_RED 0 +#define GLUT_GREEN 1 +#define GLUT_BLUE 2 + +#if defined(_WIN32) + /* Stroke font constants (use these in GLUT program). */ +#define GLUT_STROKE_ROMAN ((void*)0) +#define GLUT_STROKE_MONO_ROMAN ((void*)1) + + /* Bitmap font constants (use these in GLUT program). */ +#define GLUT_BITMAP_9_BY_15 ((void*)2) +#define GLUT_BITMAP_8_BY_13 ((void*)3) +#define GLUT_BITMAP_TIMES_ROMAN_10 ((void*)4) +#define GLUT_BITMAP_TIMES_ROMAN_24 ((void*)5) +#if (GLUT_API_VERSION >= 3) +#define GLUT_BITMAP_HELVETICA_10 ((void*)6) +#define GLUT_BITMAP_HELVETICA_12 ((void*)7) +#define GLUT_BITMAP_HELVETICA_18 ((void*)8) +#endif +#else + /* Stroke font opaque addresses (use constants instead in source code). */ + GLUTAPI void* glutStrokeRoman; + GLUTAPI void* glutStrokeMonoRoman; + + /* Stroke font constants (use these in GLUT program). */ +#define GLUT_STROKE_ROMAN (&glutStrokeRoman) +#define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman) + + /* Bitmap font opaque addresses (use constants instead in source code). */ + GLUTAPI void* glutBitmap9By15; + GLUTAPI void* glutBitmap8By13; + GLUTAPI void* glutBitmapTimesRoman10; + GLUTAPI void* glutBitmapTimesRoman24; + GLUTAPI void* glutBitmapHelvetica10; + GLUTAPI void* glutBitmapHelvetica12; + GLUTAPI void* glutBitmapHelvetica18; + + /* Bitmap font constants (use these in GLUT program). */ +#define GLUT_BITMAP_9_BY_15 (&glutBitmap9By15) +#define GLUT_BITMAP_8_BY_13 (&glutBitmap8By13) +#define GLUT_BITMAP_TIMES_ROMAN_10 (&glutBitmapTimesRoman10) +#define GLUT_BITMAP_TIMES_ROMAN_24 (&glutBitmapTimesRoman24) +#if (GLUT_API_VERSION >= 3) +#define GLUT_BITMAP_HELVETICA_10 (&glutBitmapHelvetica10) +#define GLUT_BITMAP_HELVETICA_12 (&glutBitmapHelvetica12) +#define GLUT_BITMAP_HELVETICA_18 (&glutBitmapHelvetica18) +#endif +#endif + + /* glutGet parameters. */ +#define GLUT_WINDOW_X ((GLenum) 100) +#define GLUT_WINDOW_Y ((GLenum) 101) +#define GLUT_WINDOW_WIDTH ((GLenum) 102) +#define GLUT_WINDOW_HEIGHT ((GLenum) 103) +#define GLUT_WINDOW_BUFFER_SIZE ((GLenum) 104) +#define GLUT_WINDOW_STENCIL_SIZE ((GLenum) 105) +#define GLUT_WINDOW_DEPTH_SIZE ((GLenum) 106) +#define GLUT_WINDOW_RED_SIZE ((GLenum) 107) +#define GLUT_WINDOW_GREEN_SIZE ((GLenum) 108) +#define GLUT_WINDOW_BLUE_SIZE ((GLenum) 109) +#define GLUT_WINDOW_ALPHA_SIZE ((GLenum) 110) +#define GLUT_WINDOW_ACCUM_RED_SIZE ((GLenum) 111) +#define GLUT_WINDOW_ACCUM_GREEN_SIZE ((GLenum) 112) +#define GLUT_WINDOW_ACCUM_BLUE_SIZE ((GLenum) 113) +#define GLUT_WINDOW_ACCUM_ALPHA_SIZE ((GLenum) 114) +#define GLUT_WINDOW_DOUBLEBUFFER ((GLenum) 115) +#define GLUT_WINDOW_RGBA ((GLenum) 116) +#define GLUT_WINDOW_PARENT ((GLenum) 117) +#define GLUT_WINDOW_NUM_CHILDREN ((GLenum) 118) +#define GLUT_WINDOW_COLORMAP_SIZE ((GLenum) 119) +#if (GLUT_API_VERSION >= 2) +#define GLUT_WINDOW_NUM_SAMPLES ((GLenum) 120) +#define GLUT_WINDOW_STEREO ((GLenum) 121) +#endif +#if (GLUT_API_VERSION >= 3) +#define GLUT_WINDOW_CURSOR ((GLenum) 122) +#endif +#define GLUT_SCREEN_WIDTH ((GLenum) 200) +#define GLUT_SCREEN_HEIGHT ((GLenum) 201) +#define GLUT_SCREEN_WIDTH_MM ((GLenum) 202) +#define GLUT_SCREEN_HEIGHT_MM ((GLenum) 203) +#define GLUT_MENU_NUM_ITEMS ((GLenum) 300) +#define GLUT_DISPLAY_MODE_POSSIBLE ((GLenum) 400) +#define GLUT_INIT_WINDOW_X ((GLenum) 500) +#define GLUT_INIT_WINDOW_Y ((GLenum) 501) +#define GLUT_INIT_WINDOW_WIDTH ((GLenum) 502) +#define GLUT_INIT_WINDOW_HEIGHT ((GLenum) 503) +#define GLUT_INIT_DISPLAY_MODE ((GLenum) 504) +#if (GLUT_API_VERSION >= 2) +#define GLUT_ELAPSED_TIME ((GLenum) 700) +#endif +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13) +#define GLUT_WINDOW_FORMAT_ID ((GLenum) 123) +#endif + +#if (GLUT_API_VERSION >= 2) + /* glutDeviceGet parameters. */ +#define GLUT_HAS_KEYBOARD ((GLenum) 600) +#define GLUT_HAS_MOUSE ((GLenum) 601) +#define GLUT_HAS_SPACEBALL ((GLenum) 602) +#define GLUT_HAS_DIAL_AND_BUTTON_BOX ((GLenum) 603) +#define GLUT_HAS_TABLET ((GLenum) 604) +#define GLUT_NUM_MOUSE_BUTTONS ((GLenum) 605) +#define GLUT_NUM_SPACEBALL_BUTTONS ((GLenum) 606) +#define GLUT_NUM_BUTTON_BOX_BUTTONS ((GLenum) 607) +#define GLUT_NUM_DIALS ((GLenum) 608) +#define GLUT_NUM_TABLET_BUTTONS ((GLenum) 609) +#endif +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13) +#define GLUT_DEVICE_IGNORE_KEY_REPEAT ((GLenum) 610) +#define GLUT_DEVICE_KEY_REPEAT ((GLenum) 611) +#define GLUT_HAS_JOYSTICK ((GLenum) 612) +#define GLUT_OWNS_JOYSTICK ((GLenum) 613) +#define GLUT_JOYSTICK_BUTTONS ((GLenum) 614) +#define GLUT_JOYSTICK_AXES ((GLenum) 615) +#define GLUT_JOYSTICK_POLL_RATE ((GLenum) 616) +#endif + +#if (GLUT_API_VERSION >= 3) + /* glutLayerGet parameters. */ +#define GLUT_OVERLAY_POSSIBLE ((GLenum) 800) +#define GLUT_LAYER_IN_USE ((GLenum) 801) +#define GLUT_HAS_OVERLAY ((GLenum) 802) +#define GLUT_TRANSPARENT_INDEX ((GLenum) 803) +#define GLUT_NORMAL_DAMAGED ((GLenum) 804) +#define GLUT_OVERLAY_DAMAGED ((GLenum) 805) + +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) + /* glutVideoResizeGet parameters. */ +#define GLUT_VIDEO_RESIZE_POSSIBLE ((GLenum) 900) +#define GLUT_VIDEO_RESIZE_IN_USE ((GLenum) 901) +#define GLUT_VIDEO_RESIZE_X_DELTA ((GLenum) 902) +#define GLUT_VIDEO_RESIZE_Y_DELTA ((GLenum) 903) +#define GLUT_VIDEO_RESIZE_WIDTH_DELTA ((GLenum) 904) +#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA ((GLenum) 905) +#define GLUT_VIDEO_RESIZE_X ((GLenum) 906) +#define GLUT_VIDEO_RESIZE_Y ((GLenum) 907) +#define GLUT_VIDEO_RESIZE_WIDTH ((GLenum) 908) +#define GLUT_VIDEO_RESIZE_HEIGHT ((GLenum) 909) +#endif + + /* glutUseLayer parameters. */ +#define GLUT_NORMAL ((GLenum) 0) +#define GLUT_OVERLAY ((GLenum) 1) + + /* glutGetModifiers return mask. */ +#define GLUT_ACTIVE_SHIFT 1 +#define GLUT_ACTIVE_CTRL 2 +#define GLUT_ACTIVE_ALT 4 + + /* glutSetCursor parameters. */ + /* Basic arrows. */ +#define GLUT_CURSOR_RIGHT_ARROW 0 +#define GLUT_CURSOR_LEFT_ARROW 1 + /* Symbolic cursor shapes. */ +#define GLUT_CURSOR_INFO 2 +#define GLUT_CURSOR_DESTROY 3 +#define GLUT_CURSOR_HELP 4 +#define GLUT_CURSOR_CYCLE 5 +#define GLUT_CURSOR_SPRAY 6 +#define GLUT_CURSOR_WAIT 7 +#define GLUT_CURSOR_TEXT 8 +#define GLUT_CURSOR_CROSSHAIR 9 + /* Directional cursors. */ +#define GLUT_CURSOR_UP_DOWN 10 +#define GLUT_CURSOR_LEFT_RIGHT 11 + /* Sizing cursors. */ +#define GLUT_CURSOR_TOP_SIDE 12 +#define GLUT_CURSOR_BOTTOM_SIDE 13 +#define GLUT_CURSOR_LEFT_SIDE 14 +#define GLUT_CURSOR_RIGHT_SIDE 15 +#define GLUT_CURSOR_TOP_LEFT_CORNER 16 +#define GLUT_CURSOR_TOP_RIGHT_CORNER 17 +#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 18 +#define GLUT_CURSOR_BOTTOM_LEFT_CORNER 19 + /* Inherit from parent window. */ +#define GLUT_CURSOR_INHERIT 100 + /* Blank cursor. */ +#define GLUT_CURSOR_NONE 101 + /* Fullscreen crosshair (if available). */ +#define GLUT_CURSOR_FULL_CROSSHAIR 102 +#endif + + /* GLUT initialization sub-API. */ + GLUTAPI void APIENTRY glutInit(int* argcp, char** argv); +#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK) + GLUTAPI void APIENTRY __glutInitWithExit(int* argcp, char** argv, void (__cdecl* exitfunc)(int)); +#ifndef GLUT_BUILDING_LIB + static void APIENTRY glutInit_ATEXIT_HACK(int* argcp, char** argv) + { + __glutInitWithExit(argcp, argv, exit); + } +#define glutInit glutInit_ATEXIT_HACK +#endif +#endif + GLUTAPI void APIENTRY glutInitDisplayMode(unsigned int mode); +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) + GLUTAPI void APIENTRY glutInitDisplayString(const char* string); +#endif + GLUTAPI void APIENTRY glutInitWindowPosition(int x, int y); + GLUTAPI void APIENTRY glutInitWindowSize(int width, int height); + GLUTAPI void APIENTRY glutMainLoop(void); + + /* GLUT window sub-API. */ + GLUTAPI int APIENTRY glutCreateWindow(const char* title); +#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK) + GLUTAPI int APIENTRY __glutCreateWindowWithExit(const char* title, void (__cdecl* exitfunc)(int)); +#ifndef GLUT_BUILDING_LIB + static int APIENTRY glutCreateWindow_ATEXIT_HACK(const char* title) + { + return __glutCreateWindowWithExit(title, exit); + } +#define glutCreateWindow glutCreateWindow_ATEXIT_HACK +#endif +#endif + GLUTAPI int APIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height); + GLUTAPI void APIENTRY glutDestroyWindow(int win); + GLUTAPI void APIENTRY glutPostRedisplay(void); +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11) + GLUTAPI void APIENTRY glutPostWindowRedisplay(int win); +#endif + GLUTAPI void APIENTRY glutSwapBuffers(void); + GLUTAPI int APIENTRY glutGetWindow(void); + GLUTAPI void APIENTRY glutSetWindow(int win); + GLUTAPI void APIENTRY glutSetWindowTitle(const char* title); + GLUTAPI void APIENTRY glutSetIconTitle(const char* title); + GLUTAPI void APIENTRY glutPositionWindow(int x, int y); + GLUTAPI void APIENTRY glutReshapeWindow(int width, int height); + GLUTAPI void APIENTRY glutPopWindow(void); + GLUTAPI void APIENTRY glutPushWindow(void); + GLUTAPI void APIENTRY glutIconifyWindow(void); + GLUTAPI void APIENTRY glutShowWindow(void); + GLUTAPI void APIENTRY glutHideWindow(void); +#if (GLUT_API_VERSION >= 3) + GLUTAPI void APIENTRY glutFullScreen(void); + GLUTAPI void APIENTRY glutSetCursor(int cursor); +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) + GLUTAPI void APIENTRY glutWarpPointer(int x, int y); +#endif + + /* GLUT overlay sub-API. */ + GLUTAPI void APIENTRY glutEstablishOverlay(void); + GLUTAPI void APIENTRY glutRemoveOverlay(void); + GLUTAPI void APIENTRY glutUseLayer(GLenum layer); + GLUTAPI void APIENTRY glutPostOverlayRedisplay(void); +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11) + GLUTAPI void APIENTRY glutPostWindowOverlayRedisplay(int win); +#endif + GLUTAPI void APIENTRY glutShowOverlay(void); + GLUTAPI void APIENTRY glutHideOverlay(void); +#endif + + /* GLUT menu sub-API. */ + GLUTAPI int APIENTRY glutCreateMenu(void (GLUTCALLBACK* func)(int)); +#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK) + GLUTAPI int APIENTRY __glutCreateMenuWithExit(void (GLUTCALLBACK* func)(int), void (__cdecl* exitfunc)(int)); +#ifndef GLUT_BUILDING_LIB + static int APIENTRY glutCreateMenu_ATEXIT_HACK(void (GLUTCALLBACK* func)(int)) + { + return __glutCreateMenuWithExit(func, exit); + } +#define glutCreateMenu glutCreateMenu_ATEXIT_HACK +#endif +#endif + GLUTAPI void APIENTRY glutDestroyMenu(int menu); + GLUTAPI int APIENTRY glutGetMenu(void); + GLUTAPI void APIENTRY glutSetMenu(int menu); + GLUTAPI void APIENTRY glutAddMenuEntry(const char* label, int value); + GLUTAPI void APIENTRY glutAddSubMenu(const char* label, int submenu); + GLUTAPI void APIENTRY glutChangeToMenuEntry(int item, const char* label, int value); + GLUTAPI void APIENTRY glutChangeToSubMenu(int item, const char* label, int submenu); + GLUTAPI void APIENTRY glutRemoveMenuItem(int item); + GLUTAPI void APIENTRY glutAttachMenu(int button); + GLUTAPI void APIENTRY glutDetachMenu(int button); + + /* GLUT window callback sub-API. */ + GLUTAPI void APIENTRY glutDisplayFunc(void (GLUTCALLBACK* func)(void)); + GLUTAPI void APIENTRY glutReshapeFunc(void (GLUTCALLBACK* func)(int width, int height)); + GLUTAPI void APIENTRY glutKeyboardFunc(void (GLUTCALLBACK* func)(unsigned char key, int x, int y)); + GLUTAPI void APIENTRY glutMouseFunc(void (GLUTCALLBACK* func)(int button, int state, int x, int y)); + GLUTAPI void APIENTRY glutMotionFunc(void (GLUTCALLBACK* func)(int x, int y)); + GLUTAPI void APIENTRY glutPassiveMotionFunc(void (GLUTCALLBACK* func)(int x, int y)); + GLUTAPI void APIENTRY glutEntryFunc(void (GLUTCALLBACK* func)(int state)); + GLUTAPI void APIENTRY glutVisibilityFunc(void (GLUTCALLBACK* func)(int state)); + GLUTAPI void APIENTRY glutIdleFunc(void (GLUTCALLBACK* func)(void)); + GLUTAPI void APIENTRY glutTimerFunc(unsigned int millis, void (GLUTCALLBACK* func)(int value), int value); + GLUTAPI void APIENTRY glutMenuStateFunc(void (GLUTCALLBACK* func)(int state)); +#if (GLUT_API_VERSION >= 2) + GLUTAPI void APIENTRY glutSpecialFunc(void (GLUTCALLBACK* func)(int key, int x, int y)); + GLUTAPI void APIENTRY glutSpaceballMotionFunc(void (GLUTCALLBACK* func)(int x, int y, int z)); + GLUTAPI void APIENTRY glutSpaceballRotateFunc(void (GLUTCALLBACK* func)(int x, int y, int z)); + GLUTAPI void APIENTRY glutSpaceballButtonFunc(void (GLUTCALLBACK* func)(int button, int state)); + GLUTAPI void APIENTRY glutButtonBoxFunc(void (GLUTCALLBACK* func)(int button, int state)); + GLUTAPI void APIENTRY glutDialsFunc(void (GLUTCALLBACK* func)(int dial, int value)); + GLUTAPI void APIENTRY glutTabletMotionFunc(void (GLUTCALLBACK* func)(int x, int y)); + GLUTAPI void APIENTRY glutTabletButtonFunc(void (GLUTCALLBACK* func)(int button, int state, int x, int y)); +#if (GLUT_API_VERSION >= 3) + GLUTAPI void APIENTRY glutMenuStatusFunc(void (GLUTCALLBACK* func)(int status, int x, int y)); + GLUTAPI void APIENTRY glutOverlayDisplayFunc(void (GLUTCALLBACK* func)(void)); +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) + GLUTAPI void APIENTRY glutWindowStatusFunc(void (GLUTCALLBACK* func)(int state)); +#endif +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13) + GLUTAPI void APIENTRY glutKeyboardUpFunc(void (GLUTCALLBACK* func)(unsigned char key, int x, int y)); + GLUTAPI void APIENTRY glutSpecialUpFunc(void (GLUTCALLBACK* func)(int key, int x, int y)); + GLUTAPI void APIENTRY glutJoystickFunc(void (GLUTCALLBACK* func)(unsigned int buttonMask, int x, int y, int z), int pollInterval); +#endif +#endif +#endif + + /* GLUT color index sub-API. */ + GLUTAPI void APIENTRY glutSetColor(int, GLfloat red, GLfloat green, GLfloat blue); + GLUTAPI GLfloat APIENTRY glutGetColor(int ndx, int component); + GLUTAPI void APIENTRY glutCopyColormap(int win); + + /* GLUT state retrieval sub-API. */ + GLUTAPI int APIENTRY glutGet(GLenum type); + GLUTAPI int APIENTRY glutDeviceGet(GLenum type); +#if (GLUT_API_VERSION >= 2) + /* GLUT extension support sub-API */ + GLUTAPI int APIENTRY glutExtensionSupported(const char* name); +#endif +#if (GLUT_API_VERSION >= 3) + GLUTAPI int APIENTRY glutGetModifiers(void); + GLUTAPI int APIENTRY glutLayerGet(GLenum type); +#endif + + /* GLUT font sub-API */ + GLUTAPI void APIENTRY glutBitmapCharacter(void* font, int character); + GLUTAPI int APIENTRY glutBitmapWidth(void* font, int character); + GLUTAPI void APIENTRY glutStrokeCharacter(void* font, int character); + GLUTAPI int APIENTRY glutStrokeWidth(void* font, int character); +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) + GLUTAPI int APIENTRY glutBitmapLength(void* font, const unsigned char* string); + GLUTAPI int APIENTRY glutStrokeLength(void* font, const unsigned char* string); +#endif + + /* GLUT pre-built models sub-API */ + GLUTAPI void APIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks); + GLUTAPI void APIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks); + GLUTAPI void APIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); + GLUTAPI void APIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks); + GLUTAPI void APIENTRY glutWireCube(GLdouble size); + GLUTAPI void APIENTRY glutSolidCube(GLdouble size); + GLUTAPI void APIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); + GLUTAPI void APIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings); + GLUTAPI void APIENTRY glutWireDodecahedron(void); + GLUTAPI void APIENTRY glutSolidDodecahedron(void); + GLUTAPI void APIENTRY glutWireTeapot(GLdouble size); + GLUTAPI void APIENTRY glutSolidTeapot(GLdouble size); + GLUTAPI void APIENTRY glutWireOctahedron(void); + GLUTAPI void APIENTRY glutSolidOctahedron(void); + GLUTAPI void APIENTRY glutWireTetrahedron(void); + GLUTAPI void APIENTRY glutSolidTetrahedron(void); + GLUTAPI void APIENTRY glutWireIcosahedron(void); + GLUTAPI void APIENTRY glutSolidIcosahedron(void); + +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9) + /* GLUT video resize sub-API. */ + GLUTAPI int APIENTRY glutVideoResizeGet(GLenum param); + GLUTAPI void APIENTRY glutSetupVideoResizing(void); + GLUTAPI void APIENTRY glutStopVideoResizing(void); + GLUTAPI void APIENTRY glutVideoResize(int x, int y, int width, int height); + GLUTAPI void APIENTRY glutVideoPan(int x, int y, int width, int height); + + /* GLUT debugging sub-API. */ + GLUTAPI void APIENTRY glutReportErrors(void); +#endif + +#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13) + /* GLUT device control sub-API. */ + /* glutSetKeyRepeat modes. */ +#define GLUT_KEY_REPEAT_OFF 0 +#define GLUT_KEY_REPEAT_ON 1 +#define GLUT_KEY_REPEAT_DEFAULT 2 + + /* Joystick button masks. */ +#define GLUT_JOYSTICK_BUTTON_A 1 +#define GLUT_JOYSTICK_BUTTON_B 2 +#define GLUT_JOYSTICK_BUTTON_C 4 +#define GLUT_JOYSTICK_BUTTON_D 8 + + GLUTAPI void APIENTRY glutIgnoreKeyRepeat(int ignore); + GLUTAPI void APIENTRY glutSetKeyRepeat(int repeatMode); + GLUTAPI void APIENTRY glutForceJoystickFunc(void); + + /* GLUT game mode sub-API. */ + /* glutGameModeGet. */ +#define GLUT_GAME_MODE_ACTIVE ((GLenum) 0) +#define GLUT_GAME_MODE_POSSIBLE ((GLenum) 1) +#define GLUT_GAME_MODE_WIDTH ((GLenum) 2) +#define GLUT_GAME_MODE_HEIGHT ((GLenum) 3) +#define GLUT_GAME_MODE_PIXEL_DEPTH ((GLenum) 4) +#define GLUT_GAME_MODE_REFRESH_RATE ((GLenum) 5) +#define GLUT_GAME_MODE_DISPLAY_CHANGED ((GLenum) 6) + + GLUTAPI void APIENTRY glutGameModeString(const char* string); + GLUTAPI int APIENTRY glutEnterGameMode(void); + GLUTAPI void APIENTRY glutLeaveGameMode(void); + GLUTAPI int APIENTRY glutGameModeGet(GLenum mode); +#endif + +#ifdef __cplusplus +} + +#endif + +#ifdef GLUT_APIENTRY_DEFINED +# undef GLUT_APIENTRY_DEFINED +# undef APIENTRY +#endif + +#ifdef GLUT_WINGDIAPI_DEFINED +# undef GLUT_WINGDIAPI_DEFINED +# undef WINGDIAPI +#endif + +#ifdef GLUT_DEFINED___CDECL +# undef GLUT_DEFINED___CDECL +# undef __cdecl +#endif + +#ifdef GLUT_DEFINED__CRTIMP +# undef GLUT_DEFINED__CRTIMP +# undef _CRTIMP +#endif + +#endif /* __glut_h__ */ diff --git a/APEX_1.4/shared/external/include/MaterialLibrary.h b/APEX_1.4/shared/external/include/MaterialLibrary.h new file mode 100644 index 00000000..846057b5 --- /dev/null +++ b/APEX_1.4/shared/external/include/MaterialLibrary.h @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#ifndef MATERIAL_LIBRARY_H +#define MATERIAL_LIBRARY_H + +#include "ApexUsingNamespace.h" +#include "PxVec3.h" + +/** + Texture map types. Currently the MaterialLibrary interface only supports one map of each type. +*/ +enum TextureMapType +{ + DIFFUSE_MAP = 0, + BUMP_MAP, + NORMAL_MAP, + + TEXTURE_MAP_TYPE_COUNT +}; + + +/** + Texture pixel format types, a supported by the Destruction tool's bmp, dds, and tga texture loaders. +*/ +enum PixelFormat +{ + PIXEL_FORMAT_UNKNOWN, + + PIXEL_FORMAT_RGB, + PIXEL_FORMAT_BGR_EXT, + PIXEL_FORMAT_BGRA_EXT, + PIXEL_FORMAT_COMPRESSED_RGBA_S3TC_DXT1_EXT, + PIXEL_FORMAT_COMPRESSED_RGBA_S3TC_DXT3_EXT, + PIXEL_FORMAT_COMPRESSED_RGBA_S3TC_DXT5_EXT, +}; + + +/** + Basic interface to query generic texture map data. +*/ +class TextureMap +{ +public: + + /** The texture pixel format, supported by the Destruction tool's texture loaders. */ + virtual PixelFormat getPixelFormat() const = 0; + + /** The horizontal texture map size, in pixels. */ + virtual uint32_t getWidth() const = 0; + + /** The vertical texture map size, in pixels. */ + virtual uint32_t getHeight() const = 0; + + /** The number of color/alpha/etc. channels. */ + virtual uint32_t getComponentCount() const = 0; + + /** The size, in bytes, of the pixel buffer. */ + virtual uint32_t getPixelBufferSize() const = 0; + + /** The beginning address of the pixel buffer. */ + virtual uint8_t* getPixels() const = 0; +}; + + +/** + Basic interface to query generic render material data. +*/ +class Material +{ +public: + + /** The material's name, used by the named resource provider. */ + virtual const char* getName() const = 0; + + /** Access to the material's texture maps, indexed by TextureMapType. */ + virtual TextureMap* getTextureMap(TextureMapType type) const = 0; + + /** The ambient lighting color of the material. */ + virtual const physx::PxVec3& getAmbient() const = 0; + + /** The diffuse lighting color of the material. */ + virtual const physx::PxVec3& getDiffuse() const = 0; + + /** The specular lighting color of the material. */ + virtual const physx::PxVec3& getSpecular() const = 0; + + /** The opacity of the material. */ + virtual float getAlpha() const = 0; + + /** The shininess (specular power) of the material. */ + virtual float getShininess() const = 0; +}; + + +/** + Material library skeleton interface. +*/ +class MaterialLibrary +{ +public: + + /** Saves the material to an physx::PxFileBuf. */ + virtual void serialize(physx::PxFileBuf& stream) const = 0; + + /** Loads material from an physx::PxFileBuf. */ + virtual void deserialize(physx::PxFileBuf& stream) = 0; + + /** + Query a material by name. + If the material already exists, it is returned and 'created' is set to false. + If the material did not exist before, it is created, returned, and 'created' is set to true. + */ + virtual Material* getMaterial(const char* materialName, bool& created) = 0; + + /** + Remove and delete named material. + Returns true if the material was found, false if it was not. + */ + virtual bool deleteMaterial(const char* materialName) = 0; +}; + + +#endif // #ifndef MATERIAL_LIBRARY_H diff --git a/APEX_1.4/shared/external/include/MaterialList.h b/APEX_1.4/shared/external/include/MaterialList.h new file mode 100644 index 00000000..bd46a8e1 --- /dev/null +++ b/APEX_1.4/shared/external/include/MaterialList.h @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef MATERIAL_LIST_H +#define MATERIAL_LIST_H + +#include <map> +#include <string> +#include <vector> + +namespace Samples +{ + +class MaterialList +{ +public: + MaterialList(); + ~MaterialList(); + + void clear(); + void addPath(const char* path); + + struct MaterialInfo + { + MaterialInfo(); + bool isLit; + bool vshaderStatic; + bool vshader1bone; + bool vshader4bones; + unsigned int fromPath; + + std::string diffuseTexture; + std::string normalTexture; + }; + + struct TextureInfo + { + TextureInfo(); + unsigned int fromPath; + }; + + const MaterialInfo* containsMaterial(const char* materialName) const; + const char* findClosest(const char* materialName) const; + + const TextureInfo* containsTexture(const char* textureName) const; + + void getFirstMaterial(std::string& name, MaterialInfo& info); + bool getNextMaterial(std::string& name, MaterialInfo& info); + +private: + unsigned int addMaterial(const char* directory, const char* prefix, const char* materialName); + unsigned int addTexture(const char* directory, const char* prefix, const char* textureName); + + std::vector<std::string> mPaths; + + typedef std::map<std::string, MaterialInfo> tMaterialNames; + tMaterialNames mMaterialNames; + tMaterialNames::const_iterator mMaterialIterator; + + typedef std::map<std::string, TextureInfo> tTextureNames; + tTextureNames mTextureNames; +}; + +} // namespace Samples + + +#endif // MATERIAL_LIST_H diff --git a/APEX_1.4/shared/external/include/MemTracker.h b/APEX_1.4/shared/external/include/MemTracker.h new file mode 100644 index 00000000..83a817c3 --- /dev/null +++ b/APEX_1.4/shared/external/include/MemTracker.h @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef MEM_TRACKER_H + +#define MEM_TRACKER_H + +#include "PxSimpleTypes.h" +#include "ApexUsingNamespace.h" + +#if PX_WINDOWS_FAMILY // only compile this source code for windows!! + +namespace MEM_TRACKER +{ + +/** +\brief The layout format for the memory report. +*/ +enum MemoryReportFormat +{ + MRF_SIMPLE_HTML, // just a very simple HTML document containing the tables. + MRF_CSV, // Saves the Tables out as comma seperated value text + MRF_TEXT, // Saves the tables out in human readable text format. + MRF_TEXT_EXTENDED, // Saves the tables out in human readable text format, but uses the MS-DOS style extended ASCII character set for the borders. +}; + +/** +\brief This enumeration indicates the type of memory allocation that is being performed. +*/ +enum MemoryType +{ + MT_NEW, // Captured new operator + MT_NEW_ARRAY, // Captured new array operator + MT_MALLOC, // Standard heap allocation + MT_FREE, // Standard heap free + MT_DELETE, // Captured delete operator + MT_DELETE_ARRAY, // Captured array delete + MT_GLOBAL_NEW, // Allocation via Global new + MT_GLOBAL_NEW_ARRAY, // Allocation via global new array + MT_GLOBAL_DELETE, // Deallocation via global delete + MT_GLOBAL_DELETE_ARRAY, // Deallocation via global delete array +}; + +/** +\brief This data structure is used to return the current state of a particular block of allocated memory. +*/ +struct TrackInfo +{ + const void *mMemory; // Address of memory + MemoryType mType; // Type of allocation + size_t mSize; // Size of the memory allocation + const char *mContext; // The context of the memory allocation. + const char *mClassName; // The class or type name of this allocation. + const char *mFileName; // Source code file name where this allocation occured + uint32_t mLineNo; // Source code line number where this allocation occured + size_t mAllocCount; // Indicates which time this allocation occured at this particular source file and line number. +}; + + +class MemTracker +{ +public: + + virtual void trackAlloc(size_t threadId, + void *mem, + size_t size, + MemoryType type, + const char *context, + const char *className, + const char *fileName, + uint32_t lineno) = 0; + + virtual void trackRealloc(size_t threadId, + void *oldMem, + void *newMem, + size_t newSize, + const char *context, + const char *className, + const char *fileName, + uint32_t lineno) = 0; + + virtual void trackFree(size_t threadId, + void *mem, + MemoryType type, + const char *context, + const char *fileName,uint32_t lineno) = 0; + + virtual const char * trackValidateFree(size_t threadId, + void *mem, + MemoryType type, + const char *context, + const char *fileName,uint32_t lineno) = 0; + + + virtual void trackFrame(void) = 0; + + + virtual bool trackInfo(const void *mem,TrackInfo &info) = 0; + + + virtual void *generateReport(MemoryReportFormat format,const char *fname,uint32_t &saveLen,bool reportAllLeaks) = 0; + virtual void releaseReportMemory(void *mem) = 0; + + virtual void usage(void) = 0; + virtual size_t detectLeaks(size_t &acount) = 0; + virtual void setLogLevel(bool logEveryAllocation,bool logEveyFrame,bool verifySingleThreaded) = 0; + +}; + +MemTracker *createMemTracker(void); +void releaseMemTracker(MemTracker *mt); + +}; + +#endif + +#endif diff --git a/APEX_1.4/shared/external/include/MeshPainter.h b/APEX_1.4/shared/external/include/MeshPainter.h new file mode 100644 index 00000000..ce37f2c7 --- /dev/null +++ b/APEX_1.4/shared/external/include/MeshPainter.h @@ -0,0 +1,196 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#ifndef MESH_PAINTER_H +#define MESH_PAINTER_H + +#include "ApexUsingNamespace.h" +#include "PxVec3.h" +#include "PxBounds3.h" + +#if PX_WINDOWS_FAMILY + +#include <vector> + +namespace nvidia +{ +namespace apex +{ +class RenderDebugInterface; +class ClothingPhysicalMesh; +} +} + +namespace SharedTools +{ +struct DistTriPair; +struct PaintFloatBuffer; +struct PaintFlagBuffer; + +class MeshPainter +{ +public: + MeshPainter(); + ~MeshPainter(); + void clear(); + + void initFrom(const nvidia::apex::ClothingPhysicalMesh* mesh); + void initFrom(const physx::PxVec3* vertices, int numVertices, int vertexStride, const uint32_t* indices, int numIndices, int indexStride); + + void clearIndexBufferRange(); + void addIndexBufferRange(uint32_t start, uint32_t end); + + //void allocateFloatBuffer(uint32_t id); + + void setFloatBuffer(unsigned int id, float* buffer, int stride); + void setFlagBuffer(unsigned int id, unsigned int* buffer, int stride); + + void* getFloatBuffer(uint32_t id); + + const std::vector<physx::PxVec3> getVertices() const + { + return mVertices; + } + const std::vector<uint32_t> getIndices() const + { + return mIndices; + } + + void changeRadius(float paintRadius); + void setRayAndRadius(const physx::PxVec3& rayOrig, const physx::PxVec3& rayDir, float paintRadius, int brushMode, float falloffExponent, float scaledTargetValue, float targetColor); + bool raycastHit() + { + return !mLastRaycastNormal.isZero(); + } + + void paintFloat(unsigned int id, float min, float max, float target) const; + void paintFlag(unsigned int id, unsigned int flag, bool useAND) const; + + void smoothFloat(uint32_t id, float smoothingFactor, uint32_t numIterations) const; + void smoothFloatFast(uint32_t id, uint32_t numIterations) const; + + void drawBrush(nvidia::apex::RenderDebugInterface* batcher) const; + +private: + PaintFloatBuffer& MeshPainter::getInternalFloatBuffer(unsigned int id); + PaintFlagBuffer& MeshPainter::getInternalFlagBuffer(unsigned int id); + + void complete(); + void computeNormals(); + void createNeighborInfo(); + bool rayCast(int& triNr, float& t) const; + bool rayTriangleIntersection(const physx::PxVec3& orig, const physx::PxVec3& dir, const physx::PxVec3& a, + const physx::PxVec3& b, const physx::PxVec3& c, float& t, float& u, float& v) const; + + void computeSiblingInfo(float distanceThreshold); + + physx::PxVec3 getTriangleCenter(int triNr) const; + physx::PxVec3 getTriangleNormal(int triNr) const; + void collectTriangles() const; + bool isValidRange(int vertexNumber) const; + + std::vector<physx::PxVec3> mVertices; + std::vector<bool> mVerticesDisabled; + std::vector<uint32_t> mIndices; + struct IndexBufferRange + { + bool isOverlapping(const IndexBufferRange& other) const; + uint32_t start; + uint32_t end; + }; + std::vector<IndexBufferRange> mIndexRanges; + std::vector<int> mNeighbors; + mutable std::vector<int> mTriMarks; + mutable std::vector<DistTriPair> mCollectedTriangles; + mutable std::vector<uint32_t> mCollectedVertices; + mutable std::vector<float> mCollectedVerticesFloats; + mutable std::vector<uint32_t> mSmoothingCollectedIndices; + + std::vector<physx::PxVec3> mNormals; + std::vector<physx::PxVec3> mTetraNormals; + + std::vector<PaintFloatBuffer> mFloatBuffers; + std::vector<PaintFlagBuffer> mFlagBuffers; + + mutable int mCurrentMark; + + physx::PxVec3 mRayOrig, mRayDir; + float mPaintRadius; + mutable float mTargetValue; + float mScaledTargetValue; + int mBrushMode; + float mFalloffExponent; + float mBrushColor; + + mutable int32_t mLastTriangle; + mutable physx::PxVec3 mLastRaycastPos; + mutable physx::PxVec3 mLastRaycastNormal; + + std::vector<int32_t> mFirstSibling; + std::vector<int32_t> mSiblings; +}; + + + +struct DistTriPair +{ + void set(int triNr, float dist) + { + this->triNr = triNr; + this->dist = dist; + } + bool operator < (const DistTriPair& f) const + { + return dist < f.dist; + } + int triNr; + float dist; +}; + + + +struct PaintFloatBuffer +{ + float& operator[](int i) const + { + return *(float*)((char*)buffer + i * stride); + } + float& operator[](unsigned i) const + { + return *(float*)((char*)buffer + i * stride); + } + unsigned int id; + void* buffer; + int stride; + bool allocated; +}; + +struct PaintFlagBuffer +{ + unsigned int& operator[](int i) const + { + return *(unsigned int*)((char*)buffer + i * stride); + } + unsigned int& operator[](unsigned i) const + { + return *(unsigned int*)((char*)buffer + i * stride); + } + + unsigned int id; + void* buffer; + int stride; +}; + +} // namespace SharedTools + + +#endif // PX_WINDOWS_FAMILY + +#endif diff --git a/APEX_1.4/shared/external/include/MultiClientRenderResourceManager.h b/APEX_1.4/shared/external/include/MultiClientRenderResourceManager.h new file mode 100644 index 00000000..0f40ea84 --- /dev/null +++ b/APEX_1.4/shared/external/include/MultiClientRenderResourceManager.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef MULTI_CLIENT_RENDER_RESOURCE_MANAGER_H +#define MULTI_CLIENT_RENDER_RESOURCE_MANAGER_H + + +#include "UserRenderResourceManager.h" +#include "UserRenderer.h" + +#include <vector> + + +class MultiClientRenderResourceManager : public nvidia::apex::UserRenderResourceManager +{ +public: + + MultiClientRenderResourceManager(); + ~MultiClientRenderResourceManager(); + + void addChild(nvidia::apex::UserRenderResourceManager* rrm, bool destroyAutomatic); + + + virtual nvidia::apex::UserRenderVertexBuffer* createVertexBuffer(const nvidia::apex::UserRenderVertexBufferDesc& desc); + virtual void releaseVertexBuffer(nvidia::apex::UserRenderVertexBuffer& buffer); + + virtual nvidia::apex::UserRenderIndexBuffer* createIndexBuffer(const nvidia::apex::UserRenderIndexBufferDesc& desc); + virtual void releaseIndexBuffer(nvidia::apex::UserRenderIndexBuffer& buffer); + + virtual nvidia::apex::UserRenderBoneBuffer* createBoneBuffer(const nvidia::apex::UserRenderBoneBufferDesc& desc); + virtual void releaseBoneBuffer(nvidia::apex::UserRenderBoneBuffer& buffer); + + virtual nvidia::apex::UserRenderInstanceBuffer* createInstanceBuffer(const nvidia::apex::UserRenderInstanceBufferDesc& desc); + virtual void releaseInstanceBuffer(nvidia::apex::UserRenderInstanceBuffer& buffer); + + virtual nvidia::apex::UserRenderSpriteBuffer* createSpriteBuffer(const nvidia::apex::UserRenderSpriteBufferDesc& desc); + virtual void releaseSpriteBuffer(nvidia::apex::UserRenderSpriteBuffer& buffer); + + virtual nvidia::apex::UserRenderSurfaceBuffer* createSurfaceBuffer( const nvidia::apex::UserRenderSurfaceBufferDesc &desc ); + virtual void releaseSurfaceBuffer( nvidia::apex::UserRenderSurfaceBuffer &buffer ); + + virtual nvidia::apex::UserRenderResource* createResource(const nvidia::apex::UserRenderResourceDesc& desc); + + virtual void releaseResource(nvidia::apex::UserRenderResource& resource); + + virtual uint32_t getMaxBonesForMaterial(void* material); + + virtual bool getSpriteLayoutData(uint32_t spriteCount, + uint32_t spriteSemanticsBitmap, + nvidia::apex::UserRenderSpriteBufferDesc* bufferDesc); + virtual bool getInstanceLayoutData(uint32_t particleCount, + uint32_t particleSemanticsBitmap, + nvidia::apex::UserRenderInstanceBufferDesc* bufferDesc); +protected: + + struct Child + { + Child(nvidia::apex::UserRenderResourceManager* _rrm, bool destroy) : rrm(_rrm), destroyRrm(destroy) {} + + nvidia::apex::UserRenderResourceManager* rrm; + bool destroyRrm; + }; + + std::vector<Child> mChildren; +}; + + +class MultiClientUserRenderer : public nvidia::apex::UserRenderer +{ +public: + MultiClientUserRenderer() {} + virtual ~MultiClientUserRenderer() {} + + void addChild(nvidia::apex::UserRenderer* child); + virtual void renderResource(const nvidia::apex::RenderContext& context); + +protected: + std::vector<nvidia::apex::UserRenderer*> mChildren; +}; + + +#endif // MULTI_CLIENT_RENDER_RESOURCE_MANAGER_H diff --git a/APEX_1.4/shared/external/include/NullRenderer.h b/APEX_1.4/shared/external/include/NullRenderer.h new file mode 100644 index 00000000..072df8b9 --- /dev/null +++ b/APEX_1.4/shared/external/include/NullRenderer.h @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#ifndef __NULL_RENDERER_H_ +#define __NULL_RENDERER_H_ + +#include "Apex.h" + +/* This class is intended for use by command line tools that require an + * APEX SDK. Apps which use this renderer should _NOT_ call + * updateRenderResources() or dispatchRenderResources(). You _WILL_ + * crash. + */ + +namespace nvidia +{ +namespace apex +{ + +class NullRenderResourceManager : public UserRenderResourceManager +{ +public: + UserRenderVertexBuffer* createVertexBuffer(const UserRenderVertexBufferDesc&) + { + return NULL; + } + UserRenderIndexBuffer* createIndexBuffer(const UserRenderIndexBufferDesc&) + { + return NULL; + } + UserRenderBoneBuffer* createBoneBuffer(const UserRenderBoneBufferDesc&) + { + return NULL; + } + UserRenderInstanceBuffer* createInstanceBuffer(const UserRenderInstanceBufferDesc&) + { + return NULL; + } + UserRenderSpriteBuffer* createSpriteBuffer(const UserRenderSpriteBufferDesc&) + { + return NULL; + } + UserRenderSurfaceBuffer* createSurfaceBuffer(const UserRenderSurfaceBufferDesc&) + { + return NULL; + } + UserRenderResource* createResource(const UserRenderResourceDesc&) + { + return NULL; + } + void releaseVertexBuffer(UserRenderVertexBuffer&) {} + void releaseIndexBuffer(UserRenderIndexBuffer&) {} + void releaseBoneBuffer(UserRenderBoneBuffer&) {} + void releaseInstanceBuffer(UserRenderInstanceBuffer&) {} + void releaseSpriteBuffer(UserRenderSpriteBuffer&) {} + void releaseSurfaceBuffer(UserRenderSurfaceBuffer&) {} + void releaseResource(UserRenderResource&) {} + uint32_t getMaxBonesForMaterial(void*) + { + return 0; + } + + /** \brief Get the sprite layout data */ + virtual bool getSpriteLayoutData(uint32_t spriteCount, uint32_t spriteSemanticsBitmap, nvidia::apex::UserRenderSpriteBufferDesc* textureDescArray) + { + PX_UNUSED(spriteCount); + PX_UNUSED(spriteSemanticsBitmap); + PX_UNUSED(textureDescArray); + return false; + } + + /** \brief Get the instance layout data */ + virtual bool getInstanceLayoutData(uint32_t particleCount, uint32_t particleSemanticsBitmap, nvidia::apex::UserRenderInstanceBufferDesc* instanceDescArray) + { + PX_UNUSED(particleCount); + PX_UNUSED(particleSemanticsBitmap); + PX_UNUSED(instanceDescArray); + return false; + } + + +}; + +} +} // end namespace nvidia::apex + +#endif diff --git a/APEX_1.4/shared/external/include/RecordingRenderResourceManager.h b/APEX_1.4/shared/external/include/RecordingRenderResourceManager.h new file mode 100644 index 00000000..916a5dbf --- /dev/null +++ b/APEX_1.4/shared/external/include/RecordingRenderResourceManager.h @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef RECORDING_RENDER_RESOURCE_MANAGER_H +#define RECORDING_RENDER_RESOURCE_MANAGER_H + +#include "UserRenderResourceManager.h" +#include "UserRenderer.h" + +#include <string> + +namespace nvidia +{ +namespace apex +{ +class RenderVertexBufferData; +//class RenderBoneBufferData; // not possible, d'oh +} +} + +#include "UserRenderBoneBuffer.h" + + +class RecordingRenderResourceManager : public nvidia::apex::UserRenderResourceManager +{ +public: + + class RecorderInterface + { + public: + virtual ~RecorderInterface() {} + + virtual void createVertexBuffer(unsigned int id, const nvidia::apex::UserRenderVertexBufferDesc& desc) = 0; + virtual void writeVertexBuffer(unsigned int id, const nvidia::apex::RenderVertexBufferData& data, unsigned int firstVertex, unsigned int numVertices) = 0; + virtual void releaseVertexBuffer(unsigned int id) = 0; + + virtual void createIndexBuffer(unsigned int id, const nvidia::apex::UserRenderIndexBufferDesc& desc) = 0; + virtual void writeIndexBuffer(unsigned int id, const void* srcData, uint32_t srcStride, unsigned int firstDestElement, unsigned int numElements, nvidia::apex::RenderDataFormat::Enum format) = 0; + virtual void releaseIndexBuffer(unsigned int id) = 0; + + virtual void createBoneBuffer(unsigned int id, const nvidia::apex::UserRenderBoneBufferDesc& desc) = 0; + virtual void writeBoneBuffer(unsigned int id, const nvidia::apex::RenderBoneBufferData& data, unsigned int firstBone, unsigned int numBones) = 0; + virtual void releaseBoneBuffer(unsigned int id) = 0; + + virtual void createResource(unsigned int id, const nvidia::apex::UserRenderResourceDesc& desc) = 0; + virtual void renderResource(unsigned int id, const nvidia::apex::UserRenderResourceDesc& desc) = 0; + virtual void releaseResource(unsigned int id) = 0; + + virtual void setMaxBonesForMaterial(void* material, unsigned int maxBones) = 0; + + }; + + RecordingRenderResourceManager(nvidia::apex::UserRenderResourceManager* child, bool ownsChild, RecorderInterface* recorder); + ~RecordingRenderResourceManager(); + + + virtual nvidia::apex::UserRenderVertexBuffer* createVertexBuffer(const nvidia::apex::UserRenderVertexBufferDesc& desc); + virtual void releaseVertexBuffer(nvidia::apex::UserRenderVertexBuffer& buffer); + + virtual nvidia::apex::UserRenderIndexBuffer* createIndexBuffer(const nvidia::apex::UserRenderIndexBufferDesc& desc); + virtual void releaseIndexBuffer(nvidia::apex::UserRenderIndexBuffer& buffer); + + virtual nvidia::apex::UserRenderBoneBuffer* createBoneBuffer(const nvidia::apex::UserRenderBoneBufferDesc& desc); + virtual void releaseBoneBuffer(nvidia::apex::UserRenderBoneBuffer& buffer); + + virtual nvidia::apex::UserRenderInstanceBuffer* createInstanceBuffer(const nvidia::apex::UserRenderInstanceBufferDesc& desc); + virtual void releaseInstanceBuffer(nvidia::apex::UserRenderInstanceBuffer& buffer); + + virtual nvidia::apex::UserRenderSpriteBuffer* createSpriteBuffer(const nvidia::apex::UserRenderSpriteBufferDesc& desc); + virtual void releaseSpriteBuffer(nvidia::apex::UserRenderSpriteBuffer& buffer); + + virtual nvidia::apex::UserRenderSurfaceBuffer* createSurfaceBuffer(const nvidia::apex::UserRenderSurfaceBufferDesc& desc); + virtual void releaseSurfaceBuffer(nvidia::apex::UserRenderSurfaceBuffer& buffer); + + virtual nvidia::apex::UserRenderResource* createResource(const nvidia::apex::UserRenderResourceDesc& desc); + + virtual void releaseResource(nvidia::apex::UserRenderResource& resource); + + virtual uint32_t getMaxBonesForMaterial(void* material); + + /** \brief Get the sprite layout data */ + virtual bool getSpriteLayoutData(uint32_t spriteCount, uint32_t spriteSemanticsBitmap, nvidia::apex::UserRenderSpriteBufferDesc* textureDescArray) + { + PX_ALWAYS_ASSERT(); // TODO TODO TODO : This needs to be implemented. + PX_UNUSED(spriteCount); + PX_UNUSED(spriteSemanticsBitmap); + PX_UNUSED(textureDescArray); + return false; + } + + /** \brief Get the instance layout data */ + virtual bool getInstanceLayoutData(uint32_t spriteCount, uint32_t spriteSemanticsBitmap, nvidia::apex::UserRenderInstanceBufferDesc* instanceDescArray) + { + PX_ALWAYS_ASSERT(); // TODO TODO TODO : This needs to be implemented. + PX_UNUSED(spriteCount); + PX_UNUSED(spriteSemanticsBitmap); + PX_UNUSED(instanceDescArray); + return false; + } +protected: + + nvidia::apex::UserRenderResourceManager* mChild; + bool mOwnsChild; + + RecorderInterface* mRecorder; +}; + + +class RecordingRenderer : public nvidia::apex::UserRenderer +{ +public: + RecordingRenderer(nvidia::apex::UserRenderer* child, RecordingRenderResourceManager::RecorderInterface* recorder); + virtual ~RecordingRenderer(); + + virtual void renderResource(const nvidia::apex::RenderContext& context); + +protected: + nvidia::apex::UserRenderer* mChild; + RecordingRenderResourceManager::RecorderInterface* mRecorder; +}; + + +class FileRecorder : public RecordingRenderResourceManager::RecorderInterface +{ +public: + FileRecorder(const char* filename); + ~FileRecorder(); + + virtual void createVertexBuffer(unsigned int id, const nvidia::apex::UserRenderVertexBufferDesc& desc); + virtual void writeVertexBuffer(unsigned int id, const nvidia::apex::RenderVertexBufferData& data, unsigned int firstVertex, unsigned int numVertices); + virtual void releaseVertexBuffer(unsigned int id); + + virtual void createIndexBuffer(unsigned int id, const nvidia::apex::UserRenderIndexBufferDesc& desc); + virtual void writeIndexBuffer(unsigned int id, const void* srcData, uint32_t srcStride, unsigned int firstDestElement, unsigned int numElements, nvidia::apex::RenderDataFormat::Enum format); + virtual void releaseIndexBuffer(unsigned int id); + + virtual void createBoneBuffer(unsigned int id, const nvidia::apex::UserRenderBoneBufferDesc& desc); + virtual void writeBoneBuffer(unsigned int id, const nvidia::apex::RenderBoneBufferData& data, unsigned int firstBone, unsigned int numBones); + virtual void releaseBoneBuffer(unsigned int id); + + virtual void createResource(unsigned int id, const nvidia::apex::UserRenderResourceDesc& desc); + virtual void renderResource(unsigned int id, const nvidia::apex::UserRenderResourceDesc& desc); + virtual void releaseResource(unsigned int id); + + virtual void setMaxBonesForMaterial(void* material, unsigned int maxBones); + +protected: + void writeElem(const char* name, unsigned int value); + + void writeBufferData(const void* data, unsigned int stride, unsigned int numElements, nvidia::apex::RenderDataFormat::Enum format); + void writeBufferDataFloat(const void* data, unsigned int stride, unsigned int numElements, unsigned int numFloatsPerDataSet); + void writeBufferDataShort(const void* data, unsigned int stride, unsigned int numElements, unsigned int numFloatsPerDataSet); + void writeBufferDataLong(const void* data, unsigned int stride, unsigned int numElements, unsigned int numFloatsPerDataSet); + + FILE* mOutputFile; +}; + + +#endif // RECORDING_RENDER_RESOURCE_MANAGER_H diff --git a/APEX_1.4/shared/external/include/Releaser.h b/APEX_1.4/shared/external/include/Releaser.h new file mode 100644 index 00000000..e83c4c20 --- /dev/null +++ b/APEX_1.4/shared/external/include/Releaser.h @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef RELEASER_H +#define RELEASER_H + +#include <stdio.h> + +#include "ApexInterface.h" +#include "nvparameterized/NvParameterized.h" +#include "nvparameterized/NvParameterizedTraits.h" + +#define RELEASE_AT_EXIT(obj, typeName) Releaser<typeName> obj ## Releaser(obj); + +template<typename T> +class Releaser +{ + Releaser(Releaser<T>& rhs); + Releaser<T>& operator =(Releaser<T>& rhs); + +public: + Releaser(T* obj, void* memory = NULL) : mObj(obj), mMemory(memory) + { + } + + ~Releaser() + { + doRelease(); + } + + void doRelease(); + + void reset(T* newObj = NULL, void* newMemory = NULL) + { + if (newObj != mObj) + { + doRelease(mObj); + } + mObj = newObj; + mMemory = newMemory; + } + +private: + T* mObj; + + void* mMemory; +}; + +template<> PX_INLINE void Releaser<NvParameterized::Interface>::doRelease() +{ + if (mObj != NULL) + { + mObj->destroy(); + } +} + +template<> PX_INLINE void Releaser<NvParameterized::Traits>::doRelease() +{ + if (mMemory != NULL) + { + mObj->free(mMemory); + } +} + +template<> PX_INLINE void Releaser<nvidia::apex::ApexInterface>::doRelease() +{ + if (mObj != NULL) + { + mObj->release(); + } +} + +template<> PX_INLINE void Releaser<physx::PxFileBuf>::doRelease() +{ + if (mObj != NULL) + { + mObj->release(); + } +} + +template<> PX_INLINE void Releaser<FILE>::doRelease() +{ + if (mObj != NULL) + { + fclose(mObj); + } +} + +#endif // RESOURCE_MANAGER_H diff --git a/APEX_1.4/shared/external/include/SampleApexRenderResources.h b/APEX_1.4/shared/external/include/SampleApexRenderResources.h new file mode 100644 index 00000000..194bb54b --- /dev/null +++ b/APEX_1.4/shared/external/include/SampleApexRenderResources.h @@ -0,0 +1,371 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +// This define will use RendererMaterial instead of SampleMaterialAsset +#ifndef USE_RENDERER_MATERIAL +#define USE_RENDERER_MATERIAL 0 +#endif + +#include <UserRenderer.h> +#include <UserRenderResourceManager.h> + +#include <RenderContext.h> +#include <UserRenderBoneBuffer.h> +#include <UserRenderIndexBuffer.h> +#include <UserRenderInstanceBuffer.h> +#include <UserRenderResource.h> +#include <UserRenderSpriteBuffer.h> +#include <UserRenderSurfaceBuffer.h> +#include <UserRenderVertexBuffer.h> +#include <UserRenderSpriteBufferDesc.h> + +#include <RendererInstanceBuffer.h> +#include <RendererMeshContext.h> + +#define USE_RENDER_SPRITE_BUFFER 1 +#if USE_RENDER_SPRITE_BUFFER +#include <RendererMaterial.h> +#endif + +#pragma warning(push) +#pragma warning(disable:4512) + +namespace SampleRenderer +{ + class Renderer; + class RendererVertexBuffer; + class RendererIndexBuffer; + class RendererMesh; + class RendererMeshContext; + class RendererTexture; +} + +namespace SampleFramework +{ + class SampleMaterialAsset; +} + +using SampleRenderer::RendererVertexBuffer; +using SampleRenderer::RendererIndexBuffer; +using SampleRenderer::RendererInstanceBuffer; +using SampleRenderer::RendererMesh; +using SampleRenderer::RendererTexture; + + +/********************************* +* SampleApexRendererVertexBuffer * +*********************************/ + +class SampleApexRendererVertexBuffer : public nvidia::apex::UserRenderVertexBuffer +{ + friend class SampleApexRendererMesh; +public: + SampleApexRendererVertexBuffer(SampleRenderer::Renderer& renderer, const nvidia::apex::UserRenderVertexBufferDesc& desc); + virtual ~SampleApexRendererVertexBuffer(void); + + virtual bool getInteropResourceHandle(CUgraphicsResource& handle); + +protected: + void fixUVOrigin(void* uvdata, uint32_t stride, uint32_t num); + void flipColors(void* uvData, uint32_t stride, uint32_t num); + + virtual void writeBuffer(const nvidia::apex::RenderVertexBufferData& data, uint32_t firstVertex, uint32_t numVerts); + + bool writeBufferFastPath(const nvidia::apex::RenderVertexBufferData& data, uint32_t firstVertex, uint32_t numVerts); + +protected: + SampleRenderer::Renderer& m_renderer; + SampleRenderer::RendererVertexBuffer* m_vertexbuffer; + nvidia::apex::TextureUVOrigin::Enum m_uvOrigin; +}; + + +/******************************** +* SampleApexRendererIndexBuffer * +********************************/ + +class SampleApexRendererIndexBuffer : public nvidia::apex::UserRenderIndexBuffer +{ + friend class SampleApexRendererMesh; +public: + SampleApexRendererIndexBuffer(SampleRenderer::Renderer& renderer, const nvidia::apex::UserRenderIndexBufferDesc& desc); + virtual ~SampleApexRendererIndexBuffer(void); + + virtual bool getInteropResourceHandle(CUgraphicsResource& handle); + +private: + virtual void writeBuffer(const void* srcData, uint32_t srcStride, uint32_t firstDestElement, uint32_t numElements); + +private: + SampleRenderer::Renderer& m_renderer; + SampleRenderer::RendererIndexBuffer* m_indexbuffer; + nvidia::apex::RenderPrimitiveType::Enum m_primitives; +}; + + +/******************************** +* SampleApexRendererSurfaceBuffer * +********************************/ + +class SampleApexRendererSurfaceBuffer : public nvidia::apex::UserRenderSurfaceBuffer +{ +public: + SampleApexRendererSurfaceBuffer(SampleRenderer::Renderer& renderer, const nvidia::apex::UserRenderSurfaceBufferDesc& desc); + virtual ~SampleApexRendererSurfaceBuffer(void); + + virtual bool getInteropResourceHandle(CUgraphicsResource& handle); + +private: + virtual void writeBuffer(const void* srcData, uint32_t srcPitch, uint32_t srcHeight, uint32_t dstX, uint32_t dstY, uint32_t dstZ, uint32_t width, uint32_t height, uint32_t depth = 1); + +private: + SampleRenderer::Renderer& m_renderer; + SampleRenderer::RendererTexture* m_texture; +}; + + +/******************************* +* SampleApexRendererBoneBuffer * +*******************************/ + +class SampleApexRendererBoneBuffer : public nvidia::apex::UserRenderBoneBuffer +{ + friend class SampleApexRendererMesh; +public: + SampleApexRendererBoneBuffer(SampleRenderer::Renderer& renderer, const nvidia::apex::UserRenderBoneBufferDesc& desc); + virtual ~SampleApexRendererBoneBuffer(void); + + const physx::PxMat44* getBones() const { return m_bones; } + +public: + virtual void writeBuffer(const nvidia::apex::RenderBoneBufferData& data, uint32_t firstBone, uint32_t numBones); + +private: + SampleRenderer::Renderer& m_renderer; + + SampleRenderer::RendererTexture* m_boneTexture; // Vertex texture to hold bone matrices + uint32_t m_maxBones; + physx::PxMat44* m_bones; +}; + + +/*********************************** +* SampleApexRendererInstanceBuffer * +***********************************/ + +class SampleApexRendererInstanceBuffer : public nvidia::apex::UserRenderInstanceBuffer +{ + friend class SampleApexRendererMesh; +public: + + SampleApexRendererInstanceBuffer(SampleRenderer::Renderer& renderer, const nvidia::apex::UserRenderInstanceBufferDesc& desc); + virtual ~SampleApexRendererInstanceBuffer(void); + + uint32_t getMaxInstances(void) const + { + return m_maxInstances; + } + +public: + virtual void writeBuffer(const void* data, uint32_t firstInstance, uint32_t numInstances); + bool writeBufferFastPath(const nvidia::apex::RenderInstanceBufferData& data, uint32_t firstInstance, uint32_t numInstances); + + virtual bool getInteropResourceHandle(CUgraphicsResource& handle); +protected: + template<typename ElemType> + void internalWriteSemantic(SampleRenderer::RendererInstanceBuffer::Semantic semantic, const void* srcData, uint32_t srcStride, uint32_t firstDestElement, uint32_t numElements) + { + uint32_t destStride = 0; + uint8_t* destData = (uint8_t*)m_instanceBuffer->lockSemantic(semantic, destStride); + if (destData) + { + destData += firstDestElement * destStride; + for (uint32_t i = 0; i < numElements; i++) + { + ElemType* srcElemPtr = (ElemType*)(((uint8_t*)srcData) + srcStride * i); + + *((ElemType*)destData) = *srcElemPtr; + + destData += destStride; + } + m_instanceBuffer->unlockSemantic(semantic); + } + } +private: + void internalWriteBuffer(nvidia::apex::RenderInstanceSemantic::Enum semantic, + const void* srcData, uint32_t srcStride, + uint32_t firstDestElement, uint32_t numElements); + + uint32_t m_maxInstances; + SampleRenderer::RendererInstanceBuffer* m_instanceBuffer; +}; + + +#if USE_RENDER_SPRITE_BUFFER + +/********************************* +* SampleApexRendererSpriteBuffer * +*********************************/ + +/* + * This class is just a wrapper around the vertex buffer class because there is already + * a point sprite implementation using vertex buffers. It takes the sprite buffer semantics + * and just converts them to vertex buffer semantics and ignores everything but position and color. + * Well, not really, it takes the lifetime and translates it to color. + */ +class SampleApexRendererSpriteBuffer : public nvidia::apex::UserRenderSpriteBuffer +{ +public: + SampleApexRendererSpriteBuffer(SampleRenderer::Renderer& renderer, const nvidia::apex::UserRenderSpriteBufferDesc& desc); + virtual ~SampleApexRendererSpriteBuffer(void); + + SampleRenderer::RendererTexture* getTexture(const nvidia::apex::RenderSpriteTextureLayout::Enum e) const; + uint32_t getTexturesCount() const; + + virtual bool getInteropResourceHandle(CUgraphicsResource& handle); + virtual bool getInteropTextureHandleList(CUgraphicsResource* handleList); + virtual void writeBuffer(const void* data, uint32_t firstSprite, uint32_t numSprites); + virtual void writeTexture(uint32_t textureId, uint32_t numSprites, const void* srcData, size_t srcSize); + +private: + void flipColors(void* uvData, uint32_t stride, uint32_t num); +public: + SampleRenderer::Renderer& m_renderer; + SampleRenderer::RendererVertexBuffer* m_vertexbuffer; + SampleRenderer::RendererTexture* m_textures[nvidia::apex::UserRenderSpriteBufferDesc::MAX_SPRITE_TEXTURES]; + uint32_t m_texturesCount; + uint32_t m_textureIndexFromLayoutType[nvidia::apex::RenderSpriteTextureLayout::NUM_LAYOUTS]; +}; + +#endif /* USE_RENDER_SPRITE_BUFFER */ + + +/************************* +* SampleApexRendererMesh * +*************************/ + +/* + * There is some sprite hackery in here now. Basically, if a sprite buffer is used + * we just treat is as a vertex buffer (because it really is a vertex buffer). + */ +class SampleApexRendererMesh : public nvidia::apex::UserRenderResource +{ + friend class SampleApexRenderer; +public: + SampleApexRendererMesh(SampleRenderer::Renderer& renderer, const nvidia::apex::UserRenderResourceDesc& desc); + virtual ~SampleApexRendererMesh(); + + enum BlendType + { + BLENDING_ENABLED = 0, + BLENDING_DISABLED, + BLENDING_ANY, + BLENDING_DEFAULT = BLENDING_ANY + }; + +public: + void setVertexBufferRange(uint32_t firstVertex, uint32_t numVerts); + void setIndexBufferRange(uint32_t firstIndex, uint32_t numIndices); + void setBoneBufferRange(uint32_t firstBone, uint32_t numBones); + void setInstanceBufferRange(uint32_t firstInstance, uint32_t numInstances); + +#if USE_RENDER_SPRITE_BUFFER + void setSpriteBufferRange(uint32_t firstSprite, uint32_t numSprites) + { + setVertexBufferRange(firstSprite, numSprites); + } +#endif + +#if !USE_RENDERER_MATERIAL + static void pickMaterial(SampleRenderer::RendererMeshContext& context, bool hasBones, SampleFramework::SampleMaterialAsset& material, BlendType hasBlending = BLENDING_DEFAULT); +#endif + + virtual void setMaterial(void* material) { setMaterial(material, BLENDING_DEFAULT); } + void setMaterial(void* material, BlendType hasBlending); + void setScreenSpace(bool ss); + + uint32_t getNbVertexBuffers() const + { + return m_numVertexBuffers; + } + + nvidia::apex::UserRenderVertexBuffer* getVertexBuffer(uint32_t index) const + { + nvidia::apex::UserRenderVertexBuffer* buffer = 0; + PX_ASSERT(index < m_numVertexBuffers); + if (index < m_numVertexBuffers) + { + buffer = m_vertexBuffers[index]; + } + return buffer; + } + + nvidia::apex::UserRenderIndexBuffer* getIndexBuffer() const + { + return m_indexBuffer; + } + + nvidia::apex::UserRenderBoneBuffer* getBoneBuffer() const + { + return m_boneBuffer; + } + + nvidia::apex::UserRenderInstanceBuffer* getInstanceBuffer() const + { + return m_instanceBuffer; + } + +#if USE_RENDER_SPRITE_BUFFER + nvidia::apex::UserRenderSpriteBuffer* getSpriteBuffer() const + { + return m_spriteBuffer; + } +#endif + +protected: + void render(const nvidia::apex::RenderContext& context, bool forceWireframe = false, SampleFramework::SampleMaterialAsset* overrideMaterial = NULL); + +protected: + SampleRenderer::Renderer& m_renderer; + +#if USE_RENDER_SPRITE_BUFFER + SampleApexRendererSpriteBuffer* m_spriteBuffer; + + // currently this renderer's sprite shaders take 5 variables: + // particleSize + // windowWidth + // positionTexture + // colorTexture + // transformTexture + // vertexTextureWidth + // vertexTextureHeight + const SampleRenderer::RendererMaterial::Variable* m_spriteShaderVariables[7]; +#endif + + SampleApexRendererVertexBuffer** m_vertexBuffers; + uint32_t m_numVertexBuffers; + + SampleApexRendererIndexBuffer* m_indexBuffer; + + SampleApexRendererBoneBuffer* m_boneBuffer; + uint32_t m_firstBone; + uint32_t m_numBones; + + SampleApexRendererInstanceBuffer* m_instanceBuffer; + + SampleRenderer::RendererMesh* m_mesh; + SampleRenderer::RendererMeshContext m_meshContext; + physx::PxMat44 m_meshTransform; + nvidia::apex::RenderCullMode::Enum m_cullMode; +}; + +#pragma warning(pop) + diff --git a/APEX_1.4/shared/external/include/SampleApexRenderer.h b/APEX_1.4/shared/external/include/SampleApexRenderer.h new file mode 100644 index 00000000..1e043de9 --- /dev/null +++ b/APEX_1.4/shared/external/include/SampleApexRenderer.h @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#ifndef SAMPLE_APEX_RENDERER_H +#define SAMPLE_APEX_RENDERER_H + +#include <UserRenderer.h> +#include <UserRenderResourceManager.h> + + +#pragma warning(push) +#pragma warning(disable:4512) + +class UserRenderSpriteTextureDesc; + +namespace SampleRenderer +{ +class Renderer; +} + +namespace SampleFramework +{ +class SampleMaterialAsset; +} + + +class SampleApexRenderResourceManager : public nvidia::apex::UserRenderResourceManager +{ +public: + /* We either store particle position/color/transform in the texture + and fetch it in the vertex shader OR we store them in the VBO */ + enum ParticleRenderingMechanism { + VERTEX_TEXTURE_FETCH, + VERTEX_BUFFER_OBJECT + }; + + SampleApexRenderResourceManager(SampleRenderer::Renderer& renderer); + virtual ~SampleApexRenderResourceManager(void); + +public: + virtual nvidia::apex::UserRenderVertexBuffer* createVertexBuffer(const nvidia::apex::UserRenderVertexBufferDesc& desc); + virtual void releaseVertexBuffer(nvidia::apex::UserRenderVertexBuffer& buffer); + + virtual nvidia::apex::UserRenderIndexBuffer* createIndexBuffer(const nvidia::apex::UserRenderIndexBufferDesc& desc); + virtual void releaseIndexBuffer(nvidia::apex::UserRenderIndexBuffer& buffer); + + virtual nvidia::apex::UserRenderSurfaceBuffer* createSurfaceBuffer(const nvidia::apex::UserRenderSurfaceBufferDesc& desc); + virtual void releaseSurfaceBuffer(nvidia::apex::UserRenderSurfaceBuffer& buffer); + + virtual nvidia::apex::UserRenderBoneBuffer* createBoneBuffer(const nvidia::apex::UserRenderBoneBufferDesc& desc); + virtual void releaseBoneBuffer(nvidia::apex::UserRenderBoneBuffer& buffer); + + virtual nvidia::apex::UserRenderInstanceBuffer* createInstanceBuffer(const nvidia::apex::UserRenderInstanceBufferDesc& desc); + virtual void releaseInstanceBuffer(nvidia::apex::UserRenderInstanceBuffer& buffer); + + virtual nvidia::apex::UserRenderSpriteBuffer* createSpriteBuffer(const nvidia::apex::UserRenderSpriteBufferDesc& desc); + virtual void releaseSpriteBuffer(nvidia::apex::UserRenderSpriteBuffer& buffer); + + virtual nvidia::apex::UserRenderResource* createResource(const nvidia::apex::UserRenderResourceDesc& desc); + virtual void releaseResource(nvidia::apex::UserRenderResource& resource); + + virtual uint32_t getMaxBonesForMaterial(void* material); + + virtual bool getSpriteLayoutData(uint32_t spriteCount, + uint32_t spriteSemanticsBitmap, + nvidia::apex::UserRenderSpriteBufferDesc* vertexDescArray); + + virtual bool getInstanceLayoutData(uint32_t spriteCount, + uint32_t particleSemanticsBitmap, + nvidia::apex::UserRenderInstanceBufferDesc* instanceDescArray); + + // change the material of a render resource + void setMaterial(nvidia::apex::UserRenderResource& resource, void* material); + + void setParticleRenderingMechanism(ParticleRenderingMechanism m) { m_particleRenderingMechanism = m; } +protected: + SampleRenderer::Renderer& m_renderer; + ParticleRenderingMechanism m_particleRenderingMechanism; + uint32_t m_numVertexBuffers; + uint32_t m_numIndexBuffers; + uint32_t m_numSurfaceBuffers; //? + uint32_t m_numBoneBuffers; + uint32_t m_numInstanceBuffers; + uint32_t m_numResources; +}; + +class SampleApexRenderer : public nvidia::apex::UserRenderer +{ +public: + SampleApexRenderer() : mForceWireframe(false), mOverrideMaterial(NULL) {} + virtual void renderResource(const nvidia::apex::RenderContext& context); + + bool mForceWireframe; + SampleFramework::SampleMaterialAsset* mOverrideMaterial; +}; + +#pragma warning(pop) + +#endif diff --git a/APEX_1.4/shared/external/include/SampleApexResourceCallback.h b/APEX_1.4/shared/external/include/SampleApexResourceCallback.h new file mode 100644 index 00000000..62690452 --- /dev/null +++ b/APEX_1.4/shared/external/include/SampleApexResourceCallback.h @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#ifndef SAMPLE_APEX_RESOURCE_CALLBACK_H +#define SAMPLE_APEX_RESOURCE_CALLBACK_H + +#include <ApexDefs.h> +#include <ApexSDK.h> +#include <PxFiltering.h> +#include <ResourceCallback.h> +#include <PxFileBuf.h> +#include "Find.h" +#include <SampleAsset.h> +#include <vector> + +#pragma warning(push) +#pragma warning(disable:4512) + +class FilterBits; // forward reference the filter bits class + +namespace nvidia +{ +namespace apex +{ +class ApexSDK; +#if APEX_USE_PARTICLES +class ModuleParticles; +#endif +} +} + +namespace SampleRenderer +{ +class Renderer; +} + +namespace SampleFramework +{ +class SampleAssetManager; +} + +// TODO: DISABLE ME!!! +#define WORK_AROUND_BROKEN_ASSET_PATHS 1 + +enum SampleAssetFileType +{ + XML_ASSET, + BIN_ASSET, + ANY_ASSET, +}; + +class SampleApexResourceCallback : public nvidia::apex::ResourceCallback +{ +public: + SampleApexResourceCallback(SampleRenderer::Renderer& renderer, SampleFramework::SampleAssetManager& assetManager); + virtual ~SampleApexResourceCallback(void); + + void addResourceSearchPath(const char* path); + void removeResourceSearchPath(const char* path); + void clearResourceSearchPaths(); + + void registerSimulationFilterData(const char* name, const physx::PxFilterData& simulationFilterData); + void registerPhysicalMaterial(const char* name, physx::PxMaterialTableIndex physicalMaterial); + + void registerGroupsMask64(const char* name, nvidia::apex::GroupsMask64& groupsMask); + + void setApexSupport(nvidia::apex::ApexSDK& apexSDK); + + physx::PxFileBuf* findApexAsset(const char* assetName); + void findFiles(const char* dir, nvidia::apex::FileHandler& handler); + + void setAssetPreference(SampleAssetFileType pref) + { + m_assetPreference = pref; + } + + static bool xmlFileExtension(const char* assetName); + static const char* getFileExtension(const char* assetName); + +private: + SampleFramework::SampleAsset* findSampleAsset(const char* assetName, SampleFramework::SampleAsset::Type type); + +#if WORK_AROUND_BROKEN_ASSET_PATHS + const char* mapHackyPath(const char* path); +#endif + +public: + virtual void* requestResource(const char* nameSpace, const char* name); + virtual void releaseResource(const char* nameSpace, const char* name, void* resource); + + bool doesFileExist(const char* filename, const char* ext); + bool doesFileExist(const char* filename); + bool isFileReadable(const char* fullPath); + +protected: + SampleRenderer::Renderer& m_renderer; + SampleFramework::SampleAssetManager& m_assetManager; + std::vector<char*> m_searchPaths; + std::vector<physx::PxFilterData> m_FilterDatas; + FilterBits *m_FilterBits; + + std::vector<nvidia::apex::GroupsMask64> m_nxGroupsMask64s; +#if APEX_USE_PARTICLES + nvidia::apex::ModuleParticles* mModuleParticles; +#endif + nvidia::apex::ApexSDK* m_apexSDK; + uint32_t m_numGets; + SampleAssetFileType m_assetPreference; +}; + +#pragma warning(pop) + +#endif // SAMPLE_APEX_RESOURCE_CALLBACK_H diff --git a/APEX_1.4/shared/external/include/SampleBoxActor.h b/APEX_1.4/shared/external/include/SampleBoxActor.h new file mode 100644 index 00000000..4919420e --- /dev/null +++ b/APEX_1.4/shared/external/include/SampleBoxActor.h @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#ifndef __SAMPLE_BOX_ACTOR_H__ +#define __SAMPLE_BOX_ACTOR_H__ + +#include "SampleShapeActor.h" +#include "RendererBoxShape.h" + +#include "PxPhysics.h" +#include "PxRigidDynamic.h" +#include "PxRigidStatic.h" +#include "geometry/PxBoxGeometry.h" +#include "extensions/PxExtensionsAPI.h" +namespace physx +{ +class PxMaterial; +} + +#include "RenderDebugInterface.h" +#include <Renderer.h> +#include <RendererMeshContext.h> + +class SampleBoxActor : public SampleShapeActor +{ +public: + SampleBoxActor(SampleRenderer::Renderer* renderer, + SampleFramework::SampleMaterialAsset& material, + physx::PxScene& physxScene, + const physx::PxVec3& pos, + const physx::PxVec3& vel, + const physx::PxVec3& extents, + float density, + physx::PxMaterial* PxMaterial, + bool useGroupsMask, + nvidia::apex::RenderDebugInterface* rdebug = NULL) + : SampleShapeActor(rdebug) + , mRendererBoxShape(NULL) + { + mRenderer = renderer; + if (!PxMaterial) + physxScene.getPhysics().getMaterials(&PxMaterial, 1); + createActor(physxScene, pos, vel, extents, density, PxMaterial, useGroupsMask); + + mRendererBoxShape = new SampleRenderer::RendererBoxShape(*mRenderer, extents); + + mRendererMeshContext.material = material.getMaterial(); + mRendererMeshContext.materialInstance = material.getMaterialInstance(); + mRendererMeshContext.mesh = mRendererBoxShape->getMesh(); + mRendererMeshContext.transform = &mTransform; + + if (rdebug) + { + mBlockId = RENDER_DEBUG_IFACE(rdebug)->beginDrawGroup(mTransform); + RENDER_DEBUG_IFACE(rdebug)->addToCurrentState(RENDER_DEBUG::DebugRenderState::SolidShaded); + static uint32_t bcount /* = 0 */; + RENDER_DEBUG_IFACE(rdebug)->setCurrentColor(0xFFFFFF); + RENDER_DEBUG_IFACE(rdebug)->setCurrentTextScale(0.5f); + RENDER_DEBUG_IFACE(rdebug)->addToCurrentState(RENDER_DEBUG::DebugRenderState::CenterText); + RENDER_DEBUG_IFACE(rdebug)->addToCurrentState(RENDER_DEBUG::DebugRenderState::CameraFacing); + RENDER_DEBUG_IFACE(rdebug)->debugText(physx::PxVec3(0, extents.y + 0.01f, 0), "Sample Box:%d", bcount++); + RENDER_DEBUG_IFACE(rdebug)->endDrawGroup(); + } + } + + virtual ~SampleBoxActor() + { + if (mRendererBoxShape) + { + delete mRendererBoxShape; + mRendererBoxShape = NULL; + } + } + +private: + void createActor(physx::PxScene& physxScene, + const physx::PxVec3& pos, + const physx::PxVec3& vel, + const physx::PxVec3& extents, + float density, + physx::PxMaterial* PxMaterial, + bool useGroupsMask) + { + mTransform = physx::PxMat44(physx::PxIdentity); + mTransform.setPosition(pos); + + physx::PxRigidActor* actor = NULL; + if (density > 0) + { + actor = physxScene.getPhysics().createRigidDynamic(physx::PxTransform(mTransform)); + ((physx::PxRigidDynamic*)actor)->setAngularDamping(0.5f); + ((physx::PxRigidDynamic*)actor)->setLinearVelocity(vel); + } + else + { + actor = physxScene.getPhysics().createRigidStatic(physx::PxTransform(mTransform)); + } + + PX_ASSERT(actor); + + physx::PxBoxGeometry boxGeom(extents); + physx::PxShape* shape = actor->createShape(boxGeom, *PxMaterial); + PX_ASSERT(shape); + if (shape && useGroupsMask) + { + shape->setSimulationFilterData(physx::PxFilterData(1u, 0u, ~0u, 0u)); + shape->setQueryFilterData(physx::PxFilterData(1u, 0u, ~0u, 0u)); + } + + if (density > 0) + { + physx::PxRigidBodyExt::updateMassAndInertia(*((physx::PxRigidDynamic*)actor), density); + } + SCOPED_PHYSX_LOCK_WRITE(&physxScene); + physxScene.addActor(*actor); + mPhysxActor = actor; + } + +private: + SampleRenderer::RendererBoxShape* mRendererBoxShape; +}; + +#endif diff --git a/APEX_1.4/shared/external/include/SampleCapsuleActor.h b/APEX_1.4/shared/external/include/SampleCapsuleActor.h new file mode 100644 index 00000000..1a057d95 --- /dev/null +++ b/APEX_1.4/shared/external/include/SampleCapsuleActor.h @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#ifndef __SAMPLE_CAPSULE_ACTOR_H__ +#define __SAMPLE_CAPSULE_ACTOR_H__ + +#include "SampleShapeActor.h" + +#include "PxRigidDynamic.h" +#include "geometry/PxCapsuleGeometry.h" +#include "extensions/PxExtensionsAPI.h" +namespace physx +{ +class PxMaterial; +} + +#include <Renderer.h> +#include <RendererMeshContext.h> + +class SampleCapsuleActor : public SampleShapeActor +{ +public: + SampleCapsuleActor(SampleRenderer::Renderer* renderer, + SampleFramework::SampleMaterialAsset& material, + physx::PxScene& physxScene, + const physx::PxVec3& pos, + const physx::PxVec3& vel, + float height, + float radius, + float density, + physx::PxMaterial* PxMaterial, + bool useGroupsMask, + nvidia::apex::RenderDebugInterface* rdebug = NULL) + : SampleShapeActor(rdebug) + , mRendererCapsuleShape(NULL) + , mRadius(radius) + , mHeight(height) + { + mRenderer = renderer; + if (!PxMaterial) + physxScene.getPhysics().getMaterials(&PxMaterial, 1); + createActor(physxScene, pos, vel, radius, height, density, PxMaterial, useGroupsMask); + + mRendererCapsuleShape = new SampleRenderer::RendererCapsuleShape(*mRenderer, mHeight / 2, mRadius); + + mRendererMeshContext.material = material.getMaterial(); + mRendererMeshContext.materialInstance = material.getMaterialInstance(); + mRendererMeshContext.mesh = mRendererCapsuleShape->getMesh(); + mRendererMeshContext.transform = &mTransform; + + if (rdebug) + { + mBlockId = RENDER_DEBUG_IFACE(rdebug)->beginDrawGroup(mTransform); + RENDER_DEBUG_IFACE(rdebug)->addToCurrentState(RENDER_DEBUG::DebugRenderState::SolidShaded); + static uint32_t ccount /* = 0 */; + RENDER_DEBUG_IFACE(rdebug)->setCurrentColor(0xFFFFFF); + RENDER_DEBUG_IFACE(rdebug)->setCurrentTextScale(0.5f); + RENDER_DEBUG_IFACE(rdebug)->addToCurrentState(RENDER_DEBUG::DebugRenderState::CenterText); + RENDER_DEBUG_IFACE(rdebug)->addToCurrentState(RENDER_DEBUG::DebugRenderState::CameraFacing); + RENDER_DEBUG_IFACE(rdebug)->debugText(physx::PxVec3(0, 1.0f + 0.01f, 0), "Sample Sphere:%d", ccount++); + RENDER_DEBUG_IFACE(rdebug)->endDrawGroup(); + } + } + + virtual ~SampleCapsuleActor() + { + if (mRendererCapsuleShape) + { + delete mRendererCapsuleShape; + mRendererCapsuleShape = NULL; + } + } + +private: + void createActor(physx::PxScene& physxScene, + const physx::PxVec3& pos, + const physx::PxVec3& vel, + float radius, + float height, + float density, + physx::PxMaterial* PxMaterial, + bool useGroupsMask) + { + mTransform = physx::PxMat44(physx::PxIdentity); + mTransform.setPosition(pos); + + physx::PxRigidDynamic* actor = physxScene.getPhysics().createRigidDynamic(physx::PxTransform(mTransform)); + PX_ASSERT(actor); + actor->setAngularDamping(0.5f); + actor->setLinearVelocity(vel); + + physx::PxCapsuleGeometry capsuleGeom(radius, height * 0.5f); + physx::PxShape* shape = actor->createShape(capsuleGeom, *PxMaterial); + PX_ASSERT(shape); + if (shape && useGroupsMask) + { + shape->setSimulationFilterData(physx::PxFilterData(1, 0, ~0u, 0)); + shape->setQueryFilterData(physx::PxFilterData(1, 0, ~0u, 0)); + } + + if (density > 0) + { + physx::PxRigidBodyExt::updateMassAndInertia(*actor, density); + } + else + { + actor->setMass(1.0f); + } + + SCOPED_PHYSX_LOCK_WRITE(&physxScene); + physxScene.addActor(*actor); + mPhysxActor = actor; + } + + /*virtual*/ physx::PxMat44 convertToGraphicalCoordinates(const physx::PxTransform & physicsPose) const + { + static const physx::PxTransform rotCcwRhZ = physx::PxTransform(physx::PxQuat(physx::PxHalfPi, physx::PxVec3(0.0f, 0.0f, 1.0f))); + return physx::PxMat44(physicsPose * rotCcwRhZ); + } + + /*virtual*/ physx::PxTransform convertToPhysicalCoordinates(const physx::PxMat44 & graphicsPose) const + { + static const physx::PxTransform rotCwRhZ = physx::PxTransform(physx::PxQuat(-1.0f * physx::PxHalfPi, physx::PxVec3(0.0f, 0.0f, 1.0f))); + return physx::PxTransform(graphicsPose * rotCwRhZ); + } + +private: + SampleRenderer::RendererCapsuleShape* mRendererCapsuleShape; + float mRadius, mHeight; +}; + +#endif diff --git a/APEX_1.4/shared/external/include/SampleConvexMeshActor.h b/APEX_1.4/shared/external/include/SampleConvexMeshActor.h new file mode 100644 index 00000000..9e520c05 --- /dev/null +++ b/APEX_1.4/shared/external/include/SampleConvexMeshActor.h @@ -0,0 +1,232 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#ifndef __SAMPLE_CONVEX_MESH_ACTOR_H__ +#define __SAMPLE_CONVEX_MESH_ACTOR_H__ + +#include "SampleShapeActor.h" +#include "RendererMeshShape.h" +#include "PsMemoryBuffer.h" +#include "PsArray.h" +#include "PxStreamFromFileBuf.h" +#include "ApexSDK.h" + +#include "cooking/PxCooking.h" +#include "cooking/PxConvexMeshDesc.h" +#include "geometry/PxConvexMeshGeometry.h" + +#include "PxRigidDynamic.h" +#include "PxRigidStatic.h" +#include "extensions/PxExtensionsAPI.h" + + + +namespace physx +{ +class PxMaterial; +} + +#include "RenderDebugInterface.h" +#include <Renderer.h> +#include <RendererMeshContext.h> + +typedef physx::PxConvexMesh ConvexMesh; + +class SampleConvexMeshActor : public SampleShapeActor +{ +public: + SampleConvexMeshActor(SampleRenderer::Renderer* renderer, + SampleFramework::SampleMaterialAsset& material, + physx::PxScene& physxScene, + physx::PxCooking& cooking, + const physx::PxVec3* verts, + const uint32_t nbVerts, + const physx::PxVec3& pos, + const physx::PxVec3& vel, + float density, + physx::PxMaterial* PxMaterial, + bool useGroupsMask, + nvidia::apex::RenderDebugInterface* rdebug = NULL) + : SampleShapeActor(rdebug) + , mVerts(NULL) + , mNormals(NULL) + , mUvs(NULL) + , mFaces(NULL) + , mNbVerts(0) + , mNbFaces(0) + , mConvexMesh(NULL) + , mRendererMeshShape(NULL) + { + mRenderer = renderer; + + createActor(physxScene, cooking, verts, nbVerts, pos, vel, density, PxMaterial, useGroupsMask); + + const uint32_t nbPolygons = mConvexMesh->getNbPolygons(); + const uint8_t* indexBuffer = mConvexMesh->getIndexBuffer(); + const physx::PxVec3* vertices = mConvexMesh->getVertices(); + + for (uint32_t i = 0; i < nbPolygons; i++) + { + physx::PxHullPolygon data; + bool status = mConvexMesh->getPolygonData(i, data); + PX_ASSERT(status); + PX_UNUSED(status); + + uint32_t nbPolyVerts = data.mNbVerts; + mNbVerts += nbPolyVerts; + mNbFaces += (nbPolyVerts - 2)*3; + } + + mVerts = new physx::PxVec3[mNbVerts]; + mNormals = new physx::PxVec3[mNbVerts]; + mFaces = new uint16_t[mNbFaces]; + + uint32_t vertCounter = 0; + uint32_t facesCounter = 0; + for (uint32_t i = 0; i < nbPolygons; i++) + { + physx::PxHullPolygon data; + bool status = mConvexMesh->getPolygonData(i, data); + PX_ASSERT(status); + PX_UNUSED(status); + + physx::PxVec3 normal(data.mPlane[0], data.mPlane[1], data.mPlane[2]); + + uint32_t vI0 = vertCounter; + for (uint32_t vI = 0; vI < data.mNbVerts; vI++) + { + mVerts[vertCounter] = vertices[indexBuffer[data.mIndexBase + vI]]; + mNormals[vertCounter] = normal; + vertCounter++; + } + + for (uint32_t vI = 1; vI < uint32_t(data.mNbVerts) - 1; vI++) + { + mFaces[facesCounter++] = uint16_t(vI0); + mFaces[facesCounter++] = uint16_t(vI0 + vI + 1); + mFaces[facesCounter++] = uint16_t(vI0 + vI); + } + } + + mRendererMeshShape = new SampleRenderer::RendererMeshShape(*mRenderer, mVerts, mNbVerts, mNormals, mUvs, mFaces, mNbFaces / 3); + + mRendererMeshContext.material = material.getMaterial(); + mRendererMeshContext.materialInstance = material.getMaterialInstance(); + mRendererMeshContext.mesh = mRendererMeshShape->getMesh(); + mRendererMeshContext.transform = &mTransform; + + if (rdebug) + { + mBlockId = RENDER_DEBUG_IFACE(rdebug)->beginDrawGroup(mTransform); + RENDER_DEBUG_IFACE(rdebug)->addToCurrentState(RENDER_DEBUG::DebugRenderState::SolidShaded); + static uint32_t bcount /* = 0 */; + RENDER_DEBUG_IFACE(rdebug)->setCurrentColor(0xFFFFFF); + RENDER_DEBUG_IFACE(rdebug)->setCurrentTextScale(0.5f); + RENDER_DEBUG_IFACE(rdebug)->addToCurrentState(RENDER_DEBUG::DebugRenderState::CenterText); + RENDER_DEBUG_IFACE(rdebug)->addToCurrentState(RENDER_DEBUG::DebugRenderState::CameraFacing); + RENDER_DEBUG_IFACE(rdebug)->debugText(physx::PxVec3(0, 1.0f + 0.01f, 0), "Sample Convex Mesh:%d", bcount++); + RENDER_DEBUG_IFACE(rdebug)->endDrawGroup(); + } + } + + virtual ~SampleConvexMeshActor() + { + if (mRendererMeshShape) + { + delete[] mVerts; + delete[] mNormals; + + delete mRendererMeshShape; + mRendererMeshShape = NULL; + } + } + +private: + + void createActor(physx::PxScene& physxScene, + physx::PxCooking& cooking, + const physx::PxVec3* verts, + const uint32_t nbVerts, + const physx::PxVec3& pos, + const physx::PxVec3& vel, + float density, + physx::PxMaterial* PxMaterial, + bool useGroupsMask) + { + if (!PxMaterial) + { + physxScene.getPhysics().getMaterials(&PxMaterial, 1); + } + + mTransform = physx::PxMat44(physx::PxIdentity); + mTransform.setPosition(pos); + + physx::PxRigidActor* actor = NULL; + if (density > 0) + { + actor = physxScene.getPhysics().createRigidDynamic(physx::PxTransform(mTransform)); + (static_cast<physx::PxRigidDynamic*>(actor))->setAngularDamping(0.5f); // Is it correct? + (static_cast<physx::PxRigidDynamic*>(actor))->setLinearVelocity(vel); + } + else + { + actor = physxScene.getPhysics().createRigidStatic(physx::PxTransform(mTransform)); + } + PX_ASSERT(actor); + + physx::PxConvexMeshDesc convexMeshDesc; + convexMeshDesc.points.count = nbVerts; + convexMeshDesc.points.data = verts; + convexMeshDesc.points.stride = sizeof(physx::PxVec3); + convexMeshDesc.flags = physx::PxConvexFlag::eCOMPUTE_CONVEX; + + physx::PsMemoryBuffer stream; + stream.setEndianMode(physx::PxFileBuf::ENDIAN_NONE); + nvidia::apex::PxStreamFromFileBuf nvs(stream); + + if (cooking.cookConvexMesh(convexMeshDesc, nvs)) + { + mConvexMesh = physxScene.getPhysics().createConvexMesh(nvs); + PX_ASSERT(mConvexMesh); + } + + physx::PxConvexMeshGeometry convexMeshGeom(mConvexMesh); + physx::PxShape* shape = actor->createShape(convexMeshGeom, *PxMaterial); + PX_ASSERT(shape); + if (shape && useGroupsMask) + { + shape->setSimulationFilterData(physx::PxFilterData(1, 0, ~0u, 0)); + shape->setQueryFilterData(physx::PxFilterData(1, 0, ~0u, 0)); + } + + if (density > 0) + { + physx::PxRigidBodyExt::updateMassAndInertia(*(static_cast<physx::PxRigidDynamic*>(actor)), density); // () -> static_cast + } + SCOPED_PHYSX_LOCK_WRITE(&physxScene); + physxScene.addActor(*actor); + mPhysxActor = actor; + } + +private: + physx::PxVec3* mVerts; + physx::PxVec3* mNormals; + float* mUvs; + uint16_t* mFaces; + + uint32_t mNbVerts; + uint32_t mNbFaces; + + ConvexMesh* mConvexMesh; + + SampleRenderer::RendererMeshShape* mRendererMeshShape; +}; + +#endif diff --git a/APEX_1.4/shared/external/include/SamplePlaneActor.h b/APEX_1.4/shared/external/include/SamplePlaneActor.h new file mode 100644 index 00000000..65b7b2f0 --- /dev/null +++ b/APEX_1.4/shared/external/include/SamplePlaneActor.h @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#ifndef __SAMPLE_PLANE_ACTOR_H__ +#define __SAMPLE_PLANE_ACTOR_H__ + +#include "SampleShapeActor.h" + +#include "PxScene.h" +#include "PxRigidStatic.h" +#include "geometry/PxPlaneGeometry.h" +namespace physx +{ +class PxMaterial; +} + +#include <PsMathUtils.h> + +#include <Renderer.h> +#include <RendererMeshContext.h> +#include <RendererGridShape.h> + + +class SamplePlaneActor : public SampleShapeActor +{ +public: + SamplePlaneActor(SampleRenderer::Renderer* renderer, + SampleFramework::SampleMaterialAsset& material, + physx::PxScene& physxScene, + const physx::PxVec3& pos, + const physx::PxVec3& normal, + physx::PxMaterial* PxMaterial, + bool useGroupsMask, + nvidia::apex::RenderDebugInterface* rdebug = NULL) + : SampleShapeActor(rdebug) + , mRendererGridShape(NULL) + { + mRenderer = renderer; + if (!PxMaterial) + physxScene.getPhysics().getMaterials(&PxMaterial, 1); + createActor(physxScene, pos, normal, PxMaterial, useGroupsMask); + + // default is X_UP + mRendererGridShape = new SampleRenderer::RendererGridShape(*mRenderer, 10, 1.0f, false, SampleRenderer::RendererGridShape::UP_X); + + mRendererMeshContext.material = material.getMaterial(); + mRendererMeshContext.materialInstance = material.getMaterialInstance(); + mRendererMeshContext.mesh = mRendererGridShape->getMesh(); + mRendererMeshContext.transform = &mTransform; + + if (rdebug) + { + mBlockId = RENDER_DEBUG_IFACE(rdebug)->beginDrawGroup(mTransform); + RENDER_DEBUG_IFACE(rdebug)->addToCurrentState(RENDER_DEBUG::DebugRenderState::SolidShaded); + static uint32_t pcount /* = 0 */; + RENDER_DEBUG_IFACE(rdebug)->setCurrentColor(0xFFFFFF); + RENDER_DEBUG_IFACE(rdebug)->setCurrentTextScale(0.5f); + RENDER_DEBUG_IFACE(rdebug)->addToCurrentState(RENDER_DEBUG::DebugRenderState::CenterText); + RENDER_DEBUG_IFACE(rdebug)->addToCurrentState(RENDER_DEBUG::DebugRenderState::CameraFacing); + RENDER_DEBUG_IFACE(rdebug)->debugText(physx::PxVec3(0, 1.0f + 0.01f, 0), "Sample Plane:%d", pcount++); + RENDER_DEBUG_IFACE(rdebug)->endDrawGroup(); + } + } + + virtual ~SamplePlaneActor() + { + if (mRendererGridShape) + { + delete mRendererGridShape; + mRendererGridShape = NULL; + } + } + +private: + void createActor(physx::PxScene& physxScene, + const physx::PxVec3& pos, + const physx::PxVec3& normal, + physx::PxMaterial* PxMaterial, + bool useGroupsMask) + { + //physx::PxMat33 m33(nvidia::rotFrom2Vectors(physx::PxVec3(0, 1, 0), normal)); + physx::PxMat33 m33(physx::shdfnd::rotFrom2Vectors(physx::PxVec3(1, 0, 0), normal)); + mTransform = physx::PxMat44(m33, pos); + + //physx::PxTransform pose(pos, physx::PxQuat(nvidia::rotFrom2Vectors(physx::PxVec3(1, 0, 0), normal))); + physx::PxTransform pose = physx::PxTransform(mTransform); + pose.q.normalize(); + physx::PxRigidStatic* actor = physxScene.getPhysics().createRigidStatic(pose); + PX_ASSERT(actor); + + physx::PxPlaneGeometry planeGeom; + physx::PxShape* shape = actor->createShape(planeGeom, *PxMaterial); + PX_ASSERT(shape); + if (shape && useGroupsMask) + { + shape->setSimulationFilterData(physx::PxFilterData(1, 0, ~0u, 0)); + shape->setQueryFilterData(physx::PxFilterData(1, 0, ~0u, 0)); + } + SCOPED_PHYSX_LOCK_WRITE(&physxScene); + physxScene.addActor(*actor); + mPhysxActor = actor; + } + +private: + SampleRenderer::RendererGridShape* mRendererGridShape; +}; + +#endif diff --git a/APEX_1.4/shared/external/include/SampleShapeActor.h b/APEX_1.4/shared/external/include/SampleShapeActor.h new file mode 100644 index 00000000..87988445 --- /dev/null +++ b/APEX_1.4/shared/external/include/SampleShapeActor.h @@ -0,0 +1,204 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#ifndef __SAMPLE_SHAPE_ACTOR_H__ +#define __SAMPLE_SHAPE_ACTOR_H__ + +#include "SampleActor.h" +#include "ApexDefs.h" +#include "PxActor.h" +#include "PxRigidDynamic.h" +#include "PxScene.h" + +#if PX_PHYSICS_VERSION_MAJOR == 3 +#include "ScopedPhysXLock.h" +#endif +#include "RenderDebugInterface.h" +#include <Renderer.h> +#include <RendererMeshContext.h> + + +#if PX_PHYSICS_VERSION_MAJOR == 0 +namespace physx +{ +namespace apex +{ +/** +\brief A scoped object for acquiring/releasing read/write lock of a PhysX scene +*/ +class ScopedPhysXLockRead +{ +public: + /** + \brief Ctor + */ + ScopedPhysXLockRead(PxScene *scene,const char *fileName,int lineno) : mScene(scene) + { + if ( mScene ) + { + mScene->lockRead(fileName, (physx::PxU32)lineno); + } + } + ~ScopedPhysXLockRead() + { + if ( mScene ) + { + mScene->unlockRead(); + } + } +private: + PxScene* mScene; +}; + +/** +\brief A scoped object for acquiring/releasing read/write lock of a PhysX scene +*/ +class ScopedPhysXLockWrite +{ +public: + /** + \brief Ctor + */ + ScopedPhysXLockWrite(PxScene *scene,const char *fileName,int lineno) : mScene(scene) + { + if ( mScene ) + { + mScene->lockWrite(fileName, (physx::PxU32)lineno); + } + } + ~ScopedPhysXLockWrite() + { + if ( mScene ) + { + mScene->unlockWrite(); + } + } +private: + PxScene* mScene; +}; + +}; // end apx namespace +}; // end physx namespace + + +#if defined(_DEBUG) || defined(PX_CHECKED) +#define SCOPED_PHYSX_LOCK_WRITE(x) physx::apex::ScopedPhysXLockWrite _wlock(x,__FILE__,__LINE__); +#else +#define SCOPED_PHYSX_LOCK_WRITE(x) physx::apex::ScopedPhysXLockWrite _wlock(x,"",__LINE__); +#endif + +#if defined(_DEBUG) || defined(PX_CHECKED) +#define SCOPED_PHYSX_LOCK_READ(x) physx::apex::ScopedPhysXLockRead _rlock(x,__FILE__,__LINE__); +#else +#define SCOPED_PHYSX_LOCK_READ(x) physx::apex::ScopedPhysXLockRead _rlock(x,"",__LINE__); +#endif + +#endif // PX_PHYSICS_VERSION_MAJOR + + + +class SampleShapeActor : public SampleFramework::SampleActor +{ +public: + SampleShapeActor(nvidia::apex::RenderDebugInterface* rdebug) + : mBlockId(-1) + , mApexRenderDebug(rdebug) + , mRenderer(NULL) + , mPhysxActor(NULL) + { + } + + virtual ~SampleShapeActor(void) + { + if (mApexRenderDebug != NULL) + { + RENDER_DEBUG_IFACE(mApexRenderDebug)->reset(mBlockId); + } + + if (mPhysxActor) + { + SCOPED_PHYSX_LOCK_WRITE(mPhysxActor->getScene()); + mPhysxActor->release(); + } + } + + physx::PxTransform getPose() const + { + return physx::PxTransform(mTransform); + } + + void setPose(const physx::PxTransform& pose) + { + mTransform = physx::PxMat44(pose); + if (mPhysxActor) + { + SCOPED_PHYSX_LOCK_WRITE(mPhysxActor->getScene()); + if (physx::PxRigidDynamic* rd = mPhysxActor->is<physx::PxRigidDynamic>()) + { + rd->setGlobalPose(this->convertToPhysicalCoordinates(mTransform)); + } + } + if (mApexRenderDebug != NULL) + { + RENDER_DEBUG_IFACE(mApexRenderDebug)->setDrawGroupPose(mBlockId, mTransform); + } + } + + virtual void tick(float dtime, bool rewriteBuffers = false) + { + if (mPhysxActor) + { + physx::PxRigidDynamic* rd = mPhysxActor->is<physx::PxRigidDynamic>(); + SCOPED_PHYSX_LOCK_READ(mPhysxActor->getScene()); + if (rd && !rd->isSleeping()) + { + mTransform = this->convertToGraphicalCoordinates(rd->getGlobalPose()); + if (mApexRenderDebug != NULL) + { + RENDER_DEBUG_IFACE(mApexRenderDebug)->setDrawGroupPose(mBlockId, mTransform); + } + } + } + } + + physx::PxActor* getPhysXActor() + { + return mPhysxActor; + } + + virtual void render(bool /*rewriteBuffers*/ = false) + { + if (mRenderer) + { + mRenderer->queueMeshForRender(mRendererMeshContext); + } + } + +protected: + int32_t mBlockId; + nvidia::apex::RenderDebugInterface* mApexRenderDebug; + SampleRenderer::Renderer* mRenderer; + SampleRenderer::RendererMeshContext mRendererMeshContext; + physx::PxMat44 mTransform; + physx::PxActor* mPhysxActor; + +private: + virtual physx::PxMat44 convertToGraphicalCoordinates(const physx::PxTransform & physicsPose) const + { + return physx::PxMat44(physicsPose); + } + + virtual physx::PxTransform convertToPhysicalCoordinates(const physx::PxMat44 & graphicsPose) const + { + return physx::PxTransform(graphicsPose); + } +}; + +#endif diff --git a/APEX_1.4/shared/external/include/SampleSphereActor.h b/APEX_1.4/shared/external/include/SampleSphereActor.h new file mode 100644 index 00000000..3bd68204 --- /dev/null +++ b/APEX_1.4/shared/external/include/SampleSphereActor.h @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#ifndef __SAMPLE_SPHERE_ACTOR_H__ +#define __SAMPLE_SPHERE_ACTOR_H__ + +#include "SampleShapeActor.h" +#include "RendererCapsuleShape.h" + +#include "PxRigidDynamic.h" +#include "geometry/PxSphereGeometry.h" +#include "extensions/PxExtensionsAPI.h" +namespace physx +{ +class PxMaterial; +} + +#include <Renderer.h> +#include <RendererMeshContext.h> + + +class SampleSphereActor : public SampleShapeActor +{ +public: + SampleSphereActor(SampleRenderer::Renderer* renderer, + SampleFramework::SampleMaterialAsset& material, + physx::PxScene& physxScene, + const physx::PxVec3& pos, + const physx::PxVec3& vel, + const physx::PxVec3& radius, + float density, + physx::PxMaterial* PxMaterial, + bool useGroupsMask, + nvidia::apex::RenderDebugInterface* rdebug = NULL) + : SampleShapeActor(rdebug) + , mRendererCapsuleShape(NULL) + , mRadius(radius) + { + mRenderer = renderer; + if (!PxMaterial) + physxScene.getPhysics().getMaterials(&PxMaterial, 1); + createActor(physxScene, pos, vel, mRadius, density, PxMaterial, useGroupsMask); + + mRendererCapsuleShape = new SampleRenderer::RendererCapsuleShape(*mRenderer, 0, radius.x); + + mRendererMeshContext.material = material.getMaterial(); + mRendererMeshContext.materialInstance = material.getMaterialInstance(); + mRendererMeshContext.mesh = mRendererCapsuleShape->getMesh(); + mRendererMeshContext.transform = &mTransform; + + if (rdebug) + { + mBlockId = RENDER_DEBUG_IFACE(rdebug)->beginDrawGroup(mTransform); + RENDER_DEBUG_IFACE(rdebug)->addToCurrentState(RENDER_DEBUG::DebugRenderState::SolidShaded); + static uint32_t scount /* = 0 */; + RENDER_DEBUG_IFACE(rdebug)->setCurrentColor(0xFFFFFF); + RENDER_DEBUG_IFACE(rdebug)->setCurrentTextScale(0.5f); + RENDER_DEBUG_IFACE(rdebug)->addToCurrentState(RENDER_DEBUG::DebugRenderState::CenterText); + RENDER_DEBUG_IFACE(rdebug)->addToCurrentState(RENDER_DEBUG::DebugRenderState::CameraFacing); + RENDER_DEBUG_IFACE(rdebug)->debugText(physx::PxVec3(0, 1.0f + 0.01f, 0), "Sample Sphere:%d", scount++); + RENDER_DEBUG_IFACE(rdebug)->endDrawGroup(); + } + } + + virtual ~SampleSphereActor() + { + if (mRendererCapsuleShape) + { + delete mRendererCapsuleShape; + mRendererCapsuleShape = NULL; + } + } + +private: + void createActor(physx::PxScene& physxScene, + const physx::PxVec3& pos, + const physx::PxVec3& vel, + const physx::PxVec3& extents, + float density, + physx::PxMaterial* PxMaterial, + bool useGroupsMask) + { + mTransform = physx::PxMat44(physx::PxIdentity); + mTransform.setPosition(pos); + + physx::PxRigidDynamic* actor = physxScene.getPhysics().createRigidDynamic(physx::PxTransform(mTransform)); + PX_ASSERT(actor); + actor->setAngularDamping(0.5f); + actor->setLinearVelocity(vel); + + physx::PxSphereGeometry sphereGeom(extents.x); + physx::PxShape* shape = actor->createShape(sphereGeom, *PxMaterial); + PX_ASSERT(shape); + if (shape && useGroupsMask) + { + shape->setSimulationFilterData(physx::PxFilterData(1, 0, ~0u, 0)); + shape->setQueryFilterData(physx::PxFilterData(1, 0, ~0u, 0)); + } + + if (density > 0) + { + physx::PxRigidBodyExt::updateMassAndInertia(*actor, density); + } + else + { + actor->setMass(1.0f); + } + SCOPED_PHYSX_LOCK_WRITE(&physxScene); + physxScene.addActor(*actor); + mPhysxActor = actor; + } + +private: + SampleRenderer::RendererCapsuleShape* mRendererCapsuleShape; + physx::PxVec3 mRadius; +}; + +#endif diff --git a/APEX_1.4/shared/external/include/SampleTriMeshActor.h b/APEX_1.4/shared/external/include/SampleTriMeshActor.h new file mode 100644 index 00000000..c18772cd --- /dev/null +++ b/APEX_1.4/shared/external/include/SampleTriMeshActor.h @@ -0,0 +1,264 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#ifndef __SAMPLE_TRI_MESH_ACTOR_H__ +#define __SAMPLE_TRI_MESH_ACTOR_H__ + +#include "SampleShapeActor.h" +#include "RendererMeshShape.h" +#include "PsMemoryBuffer.h" +#include "PsArray.h" +#include "PxStreamFromFileBuf.h" +#include "ApexSDK.h" + +#include "cooking/PxCooking.h" +#include "cooking/PxConvexMeshDesc.h" +#include "geometry/PxConvexMeshGeometry.h" + +#include "geometry/PxTriangleMesh.h" +#include "cooking/PxTriangleMeshDesc.h" +#include "geometry/PxTriangleMeshGeometry.h" + +#include "PxRigidDynamic.h" +#include "PxRigidStatic.h" +#include "extensions/PxExtensionsAPI.h" + + + +namespace physx +{ +class PxMaterial; +} + +#include "RenderDebugInterface.h" +#include <Renderer.h> +#include <RendererMeshContext.h> + +//typedef physx::PxConvexMesh ConvexMesh; +typedef physx::PxTriangleMesh TriMesh; + +class SampleTriMeshActor : public SampleShapeActor +{ +public: + + SampleTriMeshActor(SampleRenderer::Renderer* renderer, + SampleFramework::SampleMaterialAsset& material, + physx::PxScene& physxScene, + physx::PxCooking& cooking, + const physx::PxVec3* verts, + const uint32_t nbVerts, + const uint32_t* indices, + const uint32_t nbIndices, + float* uvs, + const physx::PxVec3& pos, + const physx::PxVec3& vel, + float density, + physx::PxMaterial* PxMaterial, + bool useGroupsMask, + nvidia::apex::RenderDebugInterface* rdebug = NULL) + : SampleShapeActor(rdebug) + , mVerts(NULL) + , mNormals(NULL) + , mUvs(NULL) + , mFaces(NULL) + , mNbVerts(0) + , mNbFaces(0) + , mTriMesh(NULL) + , mRendererMeshShape(NULL) + { + mRenderer = renderer; + + createActor(physxScene, cooking, verts, nbVerts, indices, nbIndices, pos, vel, density, PxMaterial, useGroupsMask); + + const bool has16BitIndices = (mTriMesh->getTriangleMeshFlags() & physx::PxTriangleMeshFlag::e16_BIT_INDICES); + + const uint32_t nbTris = mTriMesh->getNbTriangles(); + const uint32_t* indexBuffer = (uint32_t*) (has16BitIndices ? NULL : mTriMesh->getTriangles()); + const uint16_t* indexBuffer16 = (uint16_t*) (has16BitIndices ? mTriMesh->getTriangles() : NULL); + const physx::PxVec3* vertices = mTriMesh->getVertices(); + + mNbVerts = 3*nbTris; + mNbFaces = 3*nbTris; + + mVerts = new physx::PxVec3[mNbVerts]; + mNormals = new physx::PxVec3[mNbVerts]; + mFaces = new uint16_t[mNbFaces]; + if (uvs != NULL) + { + mUvs = new float[mNbVerts * 2]; + } + + if(indexBuffer) + { + for (uint32_t i = 0; i < nbTris; i++) + { + const physx::PxVec3& A( vertices[indexBuffer[3*i+0]] ); + const physx::PxVec3& B( vertices[indexBuffer[3*i+1]] ); + const physx::PxVec3& C( vertices[indexBuffer[3*i+2]] ); + + physx::PxVec3 a(B-A),b(C-A); + physx::PxVec3 normal = a.cross(b); + normal.normalize(); + + mVerts[3*i+0] = A; + mVerts[3*i+1] = C; + mVerts[3*i+2] = B; + mNormals[3*i+0] = normal; + mNormals[3*i+1] = normal; + mNormals[3*i+2] = normal; + mFaces[3*i+0] = uint16_t(3*i+0); + mFaces[3*i+1] = uint16_t(3*i+1); + mFaces[3*i+2] = uint16_t(3*i+2); + } + } + else if(indexBuffer16) + { + for (uint32_t i = 0; i < nbTris; i++) + { + const physx::PxVec3& A( verts[indices[3*i+0]] ); + const physx::PxVec3& B( verts[indices[3*i+1]] ); + const physx::PxVec3& C( verts[indices[3*i+2]] ); + + physx::PxVec3 a(B-A),b(C-A); + physx::PxVec3 normal = a.cross(b); + normal.normalize(); + + mVerts[3*i+0] = A; + mVerts[3*i+1] = C; + mVerts[3*i+2] = B; + if (uvs != NULL) + { + mUvs[6*i+0] = uvs[2*indices[3*i+0]]; + mUvs[6*i+1] = uvs[2*indices[3*i+0] + 1]; + mUvs[6*i+2] = uvs[2*indices[3*i+2]]; + mUvs[6*i+3] = uvs[2*indices[3*i+2] + 1]; + mUvs[6*i+4] = uvs[2*indices[3*i+1]]; + mUvs[6*i+5] = uvs[2*indices[3*i+1] + 1]; + } + mNormals[3*i+0] = normal; + mNormals[3*i+1] = normal; + mNormals[3*i+2] = normal; + mFaces[3*i+0] = uint16_t(3*i+0); + mFaces[3*i+1] = uint16_t(3*i+1); + mFaces[3*i+2] = uint16_t(3*i+2); + } + } + else + { + PX_ASSERT(0 && "Invalid Index Data"); + } + + mRendererMeshShape = new SampleRenderer::RendererMeshShape(*mRenderer, mVerts, mNbVerts, mNormals, mUvs, mFaces, mNbFaces / 3); + + mRendererMeshContext.material = material.getMaterial(); + mRendererMeshContext.materialInstance = material.getMaterialInstance(); + mRendererMeshContext.mesh = mRendererMeshShape->getMesh(); + mRendererMeshContext.transform = &mTransform; + + if (RENDER_DEBUG_IFACE(rdebug)) + { + mBlockId = RENDER_DEBUG_IFACE(rdebug)->beginDrawGroup(mTransform); + RENDER_DEBUG_IFACE(rdebug)->addToCurrentState(RENDER_DEBUG::DebugRenderState::SolidShaded); + static uint32_t bcount /* = 0 */; + RENDER_DEBUG_IFACE(rdebug)->setCurrentColor(0xFFFFFF); + RENDER_DEBUG_IFACE(rdebug)->setCurrentTextScale(0.5f); + RENDER_DEBUG_IFACE(rdebug)->addToCurrentState(RENDER_DEBUG::DebugRenderState::CenterText); + RENDER_DEBUG_IFACE(rdebug)->addToCurrentState(RENDER_DEBUG::DebugRenderState::CameraFacing); + RENDER_DEBUG_IFACE(rdebug)->debugText(physx::PxVec3(0, 1.0f + 0.01f, 0), "Sample Triangle Mesh:%d", bcount++); + RENDER_DEBUG_IFACE(rdebug)->endDrawGroup(); + } + } + + virtual ~SampleTriMeshActor() + { + if (mRendererMeshShape) + { + delete[] mVerts; + delete[] mNormals; + + delete mRendererMeshShape; + mRendererMeshShape = NULL; + } + } + +private: + + void createActor(physx::PxScene& physxScene, + physx::PxCooking& cooking, + const physx::PxVec3* verts, + const uint32_t nbVerts, + const uint32_t* indices, + const uint32_t nbIndices, + const physx::PxVec3& pos, + const physx::PxVec3& vel, + float density, + physx::PxMaterial* PxMaterial, + bool useGroupsMask) + { + if (!PxMaterial) + { + physxScene.getPhysics().getMaterials(&PxMaterial, 1); + } + + mTransform = physx::PxMat44(physx::PxIdentity); + mTransform.setPosition(pos); + + physx::PxRigidActor* actor = NULL; + actor = physxScene.getPhysics().createRigidStatic(physx::PxTransform(mTransform)); + + physx::PxTriangleMeshDesc triMeshDesc; + triMeshDesc.points.count = nbVerts; + triMeshDesc.points.data = verts; + triMeshDesc.points.stride = sizeof(physx::PxVec3); + triMeshDesc.triangles.count = nbIndices/3; + triMeshDesc.triangles.data = indices; + triMeshDesc.triangles.stride = 3*sizeof(uint32_t); + + physx::PsMemoryBuffer stream; + stream.setEndianMode(physx::PxFileBuf::ENDIAN_NONE); + nvidia::apex::PxStreamFromFileBuf nvs(stream); + + if (cooking.cookTriangleMesh(triMeshDesc, nvs)) + { + mTriMesh = physxScene.getPhysics().createTriangleMesh(nvs); + PX_ASSERT(mTriMesh); + } + + physx::PxTriangleMeshGeometry triMeshGeom(mTriMesh); + physx::PxShape* shape = actor->createShape(triMeshGeom, *PxMaterial); + PX_ASSERT(shape); + if (shape && useGroupsMask) + { + shape->setSimulationFilterData(physx::PxFilterData(1, 0, ~0u, 0)); + shape->setQueryFilterData(physx::PxFilterData(1, 0, ~0u, 0)); + } + { + physxScene.lockWrite(__FILE__, __LINE__); + physxScene.addActor(*actor); + physxScene.unlockWrite(); + } + mPhysxActor = actor; + } + +private: + physx::PxVec3* mVerts; + physx::PxVec3* mNormals; + float* mUvs; + uint16_t* mFaces; + + uint32_t mNbVerts; + uint32_t mNbFaces; + + TriMesh* mTriMesh; + + SampleRenderer::RendererMeshShape* mRendererMeshShape; +}; + +#endif diff --git a/APEX_1.4/shared/external/include/SimpleErrorStream.h b/APEX_1.4/shared/external/include/SimpleErrorStream.h new file mode 100644 index 00000000..0d8d52bd --- /dev/null +++ b/APEX_1.4/shared/external/include/SimpleErrorStream.h @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#include "PxErrorCallback.h" + +#include <ApexDefs.h> + +class SimplePxErrorStream : public physx::PxErrorCallback +{ + virtual void reportError(physx::PxErrorCode::Enum code, const char* message, const char* file, int line) + { + const char* errorCode = NULL; + switch (code) + { + case physx::PxErrorCode::eNO_ERROR : + return; + case physx::PxErrorCode::eINVALID_PARAMETER: + errorCode = "Invalid Parameter"; + break; + case physx::PxErrorCode::eINVALID_OPERATION: + errorCode = "Invalid Operation"; + break; + case physx::PxErrorCode::eOUT_OF_MEMORY: + errorCode = "Out of Memory"; + break; + case physx::PxErrorCode::eINTERNAL_ERROR : + errorCode = "Internal Error"; + break; +// case physx::PxErrorCode::eASSERTION: +// errorCode = "Assertion"; +// break; + case physx::PxErrorCode::eDEBUG_INFO: + errorCode = "Debug Info"; + break; + case physx::PxErrorCode::eDEBUG_WARNING: + errorCode = "Debug Warning"; + break; +// case physx::PxErrorCode::eSERIALIZATION_ERROR: +// errorCode = "Serialization Error"; +// break; + default: + errorCode = "Unknown Error Code"; + } + + if (errorCode != NULL) + { + printf("PhysX error: %s %s:%d\n%s\n", errorCode, file, line, message); + } + else + { + printf("PhysX error: physx::PxErrorCode is %d in %s:%d\n%s\n", code, file, line, message); + } + } + + virtual void print(const char* message) + { + printf("%s", message); + } +}; diff --git a/APEX_1.4/shared/external/include/SkeletalAnim.h b/APEX_1.4/shared/external/include/SkeletalAnim.h new file mode 100644 index 00000000..3942e242 --- /dev/null +++ b/APEX_1.4/shared/external/include/SkeletalAnim.h @@ -0,0 +1,229 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#ifndef SKELETAL_ANIM +#define SKELETAL_ANIM + +#include <PsFastXml.h> +#include <vector> +#include "TriangleMesh.h" + +#include "ApexDefs.h" + +namespace MESHIMPORT +{ +}; + +namespace nvidia +{ +namespace apex +{ +class RenderDebugInterface; +class RenderMeshAssetAuthoring; +} +} + +namespace mimp +{ + class MeshSystemContainer; +}; + +namespace Samples +{ + +class TriangleMesh; + +// --------------------------------------------------------------------------- +struct SkeletalBone +{ + void clear(); + + std::string name; + int id; + physx::PxTransform pose; + physx::PxVec3 scale; + int parent; + int firstChild; + int numChildren; + int firstVertex; + + physx::PxMat44 bindWorldPose; + physx::PxMat44 invBindWorldPose; + physx::PxMat44 currentWorldPose; + int boneOption; + float inflateConvex; + float minimalBoneWeight; + int numShapes; + bool selected; + bool isRoot; // this is used for localspace sim + bool isRootLock; // this is used to lock the translation of the rootbone + bool allowPrimitives; + bool dirtyParams; + bool manualShapes; +}; + +struct BoneKeyFrame +{ + void clear(); + physx::PxTransform relPose; + float time; + physx::PxVec3 scale; +}; + +struct BoneTrack +{ + void clear(); + int firstFrame; + int numFrames; +}; + +struct SkeletalAnimation +{ + void clear(); + std::string name; + std::vector<BoneTrack> mBoneTracks; + float minTime; + float maxTime; +}; + +// --------------------------------------------------------------------------- +class SkeletalAnim : public physx::shdfnd::FastXml::Callback +{ +public: + SkeletalAnim(); + virtual ~SkeletalAnim(); + + void clear(); + void copyFrom(const SkeletalAnim& anim); + + bool loadFromXML(const std::string& xmlFile, std::string& error); + bool saveToXML(const std::string& xmlFile) const; + bool loadFromParent(const SkeletalAnim* parent); + bool loadFromMeshImport(mimp::MeshSystemContainer* msc, std::string& error, bool onlyAddAnimation); + bool saveToMeshImport(mimp::MeshSystemContainer* msc); + bool initFrom(nvidia::apex::RenderMeshAssetAuthoring& rma); + + void setBindPose(); + void setAnimPose(int animNr, float time, bool lockRootbone = false); + const std::vector<SkeletalBone> &getBones() const + { + return mBones; + } + void setBoneCollision(uint32_t boneNr, int option); + void setBoneSelected(uint32_t boneNr, bool selected) + { + mBones[boneNr].selected = selected; + } + void setBoneRoot(uint32_t boneNr, bool isRoot) + { + mBones[boneNr].isRoot = isRoot; + } + void setBoneAllowPrimitives(uint32_t boneNr, bool on) + { + mBones[boneNr].dirtyParams |= mBones[boneNr].allowPrimitives != on; + mBones[boneNr].allowPrimitives = on; + } + void setBoneInflation(uint32_t boneNr, float value) + { + mBones[boneNr].inflateConvex = value; + } + void setBoneMinimalWeight(uint32_t boneNr, float value) + { + mBones[boneNr].dirtyParams |= mBones[boneNr].minimalBoneWeight != value; + mBones[boneNr].minimalBoneWeight = value; + } + void setBoneDirty(uint32_t boneNr, bool on) + { + mBones[boneNr].dirtyParams = on; + } + void setBoneManualShapes(uint32_t boneNr, bool on) + { + mBones[boneNr].manualShapes = on; + } + const std::vector<int> &getChildren() const + { + return mChildren; + } + const std::vector<physx::PxMat44>& getSkinningMatrices() const + { + return mSkinningMatrices; + } + const std::vector<physx::PxMat44>& getSkinningMatricesWorld() const + { + return mSkinningMatricesWorld; + } + const std::vector<SkeletalAnimation*> &getAnimations() const + { + if (mParent != NULL) + { + return mParent->getAnimations(); + } + return mAnimations; + } + + void draw(nvidia::RenderDebugInterface* batcher); + + void clearShapeCount(int boneIndex = -1); + void incShapeCount(int boneIndex); + void decShapeCount(int boneIndex); + + void setRagdoll(bool on); + + virtual bool processElement(const char* elementName, const char* elementData, const physx::shdfnd::FastXml::AttributePairs& attr, int lineno); + virtual bool processComment(const char* comment) // encountered a comment in the XML + { + PX_UNUSED(comment); + return true; + } + + virtual bool processClose(const char* element, uint32_t depth, bool& isError) // process the 'close' indicator for a previously encountered element + { + PX_UNUSED(element); + PX_UNUSED(depth); + isError = false; + return true; + } + + virtual void* fastxml_malloc(uint32_t size) + { + return ::malloc(size); + } + virtual void fastxml_free(void* mem) + { + ::free(mem); + } + +private: + void init(bool firstTime); + void initBindPoses(int boneNr, const physx::PxVec3& scale); + void setAnimPoseRec(int animNr, int boneNr, float time, bool lockBoneTranslation); + + void interpolateBonePose(int animNr, int boneNr, float time, physx::PxTransform& pose, physx::PxVec3& scale); + int findBone(const std::string& name); + void setupConnectivity(); + + // skeleton + std::vector<SkeletalBone> mBones; + std::vector<physx::PxMat44> mSkinningMatrices; + std::vector<physx::PxMat44> mSkinningMatricesWorld; + std::vector<int> mChildren; + + // animation + std::vector<SkeletalAnimation*> mAnimations; + std::vector<BoneKeyFrame> mKeyFrames; + + const SkeletalAnim* mParent; + + bool ragdollMode; +}; + +} // namespace Samples + +#endif diff --git a/APEX_1.4/shared/external/include/SubmitComplete.h b/APEX_1.4/shared/external/include/SubmitComplete.h new file mode 100644 index 00000000..dc865be0 --- /dev/null +++ b/APEX_1.4/shared/external/include/SubmitComplete.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef SUBMITCOMPLETE_H +#define SUBMITCOMPLETE_H + +#if PX_PS4 +#include "PS4/SubmitCompletePS4.h" +#else +#define SUBMIT_COMPLETE +#endif + +#endif //SUBMITCOMPLETE_H diff --git a/APEX_1.4/shared/external/include/TextRenderResourceManager.h b/APEX_1.4/shared/external/include/TextRenderResourceManager.h new file mode 100644 index 00000000..290d866c --- /dev/null +++ b/APEX_1.4/shared/external/include/TextRenderResourceManager.h @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef TEXT_RENDER_RESOURCE_MANAGER_H +#define TEXT_RENDER_RESOURCE_MANAGER_H + +#include "UserRenderVertexBuffer.h" +#include "UserRenderIndexBuffer.h" +#include "UserRenderIndexBufferDesc.h" +#include "UserRenderBoneBuffer.h" +#include "UserRenderInstanceBuffer.h" +#include "UserRenderSpriteBuffer.h" +#include "UserRenderSurfaceBuffer.h" + +#include "UserRenderResourceManager.h" +#include "UserRenderer.h" + +#include <stdio.h> +#include <map> + +class Writer +{ +public: + Writer(FILE* outputFile); + virtual ~Writer(); + + virtual void printAndScan(const char* format); + virtual void printAndScan(const char* format, const char* arg); + virtual void printAndScan(const char* format, int arg); + virtual void printAndScan(float tolerance, nvidia::apex::RenderVertexSemantic::Enum s, const char* format, float arg); + + const char* semanticToString(nvidia::apex::RenderVertexSemantic::Enum semantic); + const char* semanticToString(nvidia::apex::RenderBoneSemantic::Enum semantic); + + void writeElem(const char* name, unsigned int val); + void writeArray(nvidia::apex::RenderDataFormat::Enum format, unsigned int stride, unsigned int numElements, const void* data, float tolerance, nvidia::apex::RenderVertexSemantic::Enum s); + +protected: + FILE* mReferenceFile; + FILE* mOutputFile; + bool mIsStdout; +}; + + + +class TextRenderResourceManager : public nvidia::apex::UserRenderResourceManager +{ +protected: + TextRenderResourceManager(); + +public: + + TextRenderResourceManager(int verbosity, const char* outputFilename); + ~TextRenderResourceManager(); + + virtual nvidia::apex::UserRenderVertexBuffer* createVertexBuffer(const nvidia::apex::UserRenderVertexBufferDesc& desc); + virtual void releaseVertexBuffer(nvidia::apex::UserRenderVertexBuffer& buffer); + + virtual nvidia::apex::UserRenderIndexBuffer* createIndexBuffer(const nvidia::apex::UserRenderIndexBufferDesc& desc); + virtual void releaseIndexBuffer(nvidia::apex::UserRenderIndexBuffer& buffer); + + virtual nvidia::apex::UserRenderBoneBuffer* createBoneBuffer(const nvidia::apex::UserRenderBoneBufferDesc& desc); + virtual void releaseBoneBuffer(nvidia::apex::UserRenderBoneBuffer& buffer); + + virtual nvidia::apex::UserRenderInstanceBuffer* createInstanceBuffer(const nvidia::apex::UserRenderInstanceBufferDesc& desc); + virtual void releaseInstanceBuffer(nvidia::apex::UserRenderInstanceBuffer& buffer); + + virtual nvidia::apex::UserRenderSpriteBuffer* createSpriteBuffer(const nvidia::apex::UserRenderSpriteBufferDesc& desc); + virtual void releaseSpriteBuffer(nvidia::apex::UserRenderSpriteBuffer& buffer); + + virtual nvidia::apex::UserRenderSurfaceBuffer* createSurfaceBuffer( const nvidia::apex::UserRenderSurfaceBufferDesc &desc ); + virtual void releaseSurfaceBuffer( nvidia::apex::UserRenderSurfaceBuffer &buffer ); + + virtual nvidia::apex::UserRenderResource* createResource(const nvidia::apex::UserRenderResourceDesc& desc); + virtual void releaseResource(nvidia::apex::UserRenderResource& resource); + + virtual uint32_t getMaxBonesForMaterial(void* material); + + unsigned int material2Id(void* material); + + void setVerbosity(int v) { mVerbosity = v; } + int getVerbosity() { return mVerbosity; } + + virtual float getVBTolerance(nvidia::apex::RenderVertexSemantic::Enum /*s*/) + { + return 0.0f; + } + virtual float getRenderPoseTolerance() { return 0.0f; } + virtual float getBonePoseTolerance() { return 0.0f; } + + virtual bool getSpriteLayoutData(uint32_t spriteCount, + uint32_t spriteSemanticsBitmap, + nvidia::apex::UserRenderSpriteBufferDesc* bufferDesc); + virtual bool getInstanceLayoutData(uint32_t particleCount, + uint32_t particleSemanticsBitmap, + nvidia::apex::UserRenderInstanceBufferDesc* bufferDesc); +protected: + + int mVerbosity; + FILE* mOutputFile; + Writer* mIO; + + std::map<void*, unsigned int> mMaterial2Id; + + int mVertexBufferCount; + int mIndexBufferCount; + int mBoneBufferCount; + int mInstanceBufferCount; + int mSpriteBufferCount; + int mRenderResourceCount; + int mSurfaceBufferCount; +}; + + + +class TextUserRenderer : public nvidia::apex::UserRenderer +{ +public: + TextUserRenderer() {} + virtual ~TextUserRenderer() {} + + virtual void renderResource(const nvidia::apex::RenderContext& context); +}; + +#endif // TEXT_RENDER_RESOURCE_MANAGER_H diff --git a/APEX_1.4/shared/external/include/TriangleMesh.h b/APEX_1.4/shared/external/include/TriangleMesh.h new file mode 100644 index 00000000..ea513091 --- /dev/null +++ b/APEX_1.4/shared/external/include/TriangleMesh.h @@ -0,0 +1,529 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#ifndef TRIANGLE_MESH_H +#define TRIANGLE_MESH_H + + +#include <RenderMeshAsset.h> +#include <UserRenderResourceManager.h> + +#include <vector> +#include <string> + +#include "PsFastXml.h" +#include "PsAllocator.h" + +#ifdef __ORBIS__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-private-field" +#endif + +namespace nvidia +{ +namespace apex +{ +class ClothingPhysicalMesh; +class RenderMeshAssetAuthoring; + +class ResourceCallback; + +class UserRenderer; +class UserRenderResourceManager; +class UserRenderResource; +class UserRenderVertexBuffer; +class UserRenderIndexBuffer; +class UserRenderBoneBuffer; +} +} + +namespace mimp +{ +class MeshSystemContainer; +}; + +namespace SampleRenderer +{ +class Renderer; + +class RendererVertexBuffer; +class RendererIndexBuffer; +class RendererMaterial; +class RendererMaterialInstance; +class RendererMesh; +class RendererMeshContext; +} + +namespace SampleFramework +{ +class SampleMaterialAsset; +} + + +namespace Samples +{ + +class SkeletalAnim; + +enum PaintChannelType +{ + PC_MAX_DISTANCE, + PC_COLLISION_DISTANCE, + PC_LATCH_TO_NEAREST_SLAVE, + PC_LATCH_TO_NEAREST_MASTER, + PC_NUM_CHANNELS, +}; + +struct MaterialResource +{ + physx::PxVec3 color; + uint32_t handle; + bool hasAlpha; + std::string name; +}; + +PX_INLINE void PxVec3FromArray(physx::PxVec3& out, const float arr[3]) +{ + out = physx::PxVec3(arr[0], arr[1], arr[2]); +}; + +PX_INLINE void PxQuatFromArray(physx::PxQuat& out, const float arr[4]) +{ + out.x = arr[0]; + out.y = arr[1]; + out.z = arr[2]; + out.w = arr[3]; +}; + +//------------------------------------------------------------------------------------ +struct TriangleSubMesh +{ + void init() + { + name = ""; + materialName = ""; + originalMaterialName = ""; + mRendererMesh = NULL; + mRendererMeshContext = NULL; + mSampleMaterial = NULL; + mRendererMaterialReference = NULL; + mRendererMaterialInstance = NULL; + firstIndex = (uint32_t) - 1; + numIndices = 0; + color = 0xfefefeff; + materialResource = NULL; + maxBoneIndex = -1; + maxBonesShader = 0; + mRenderResource = NULL; + cullMode = nvidia::RenderCullMode::NONE; + show = true; + selected = false; + selectionActivated = false; + usedForCollision = false; + hasApexAsset = false; + invisible = false; + resourceNeedsUpdate = false; + } + + void setMaterialReference(SampleRenderer::RendererMaterial* material, SampleRenderer::RendererMaterialInstance* materialInstance); + std::string name; + std::string materialName; + std::string originalMaterialName; + + SampleRenderer::RendererMesh* mRendererMesh; + SampleRenderer::RendererMeshContext* mRendererMeshContext; + SampleFramework::SampleMaterialAsset* mSampleMaterial; + SampleRenderer::RendererMaterial* mRendererMaterialReference; // reference from the mSampleMaterial + SampleRenderer::RendererMaterialInstance* mRendererMaterialInstance; // clone from the mSampleMaterial + + unsigned int firstIndex; + unsigned int numIndices; + unsigned int color; + MaterialResource* materialResource; + int maxBoneIndex; + unsigned int maxBonesShader; + nvidia::apex::UserRenderResource* mRenderResource; + nvidia::apex::RenderCullMode::Enum cullMode; + bool show; + bool selected; + bool selectionActivated; + bool usedForCollision; + bool hasApexAsset; + bool invisible; + bool resourceNeedsUpdate; + bool operator<(const TriangleSubMesh& other) const + { + if (name == other.name) + { + return materialName < other.materialName; + } + return name < other.name; + } +}; + +// ---------------------------------------------------------------------- +struct float4 +{ + float4() {} + float4(float R, float G, float B, float A) : r(R), g(G), b(B), a(A) {} + float r; + float g; + float b; + float a; +}; + +//------------------------------------------------------------------------------------ +struct ushort4 +{ + unsigned short elem[4]; +}; + +//------------------------------------------------------------------------------------ +struct TriangleEdgeSplit // for mesh subdivision +{ + int adjVertNr; + int newVertNr; + int next; +}; + +//------------------------------------------------------------------------------------ +struct PaintedVertex +{ + explicit PaintedVertex() : paintValueF32(0.0f), paintValueU32(0), color(0) {} + explicit PaintedVertex(unsigned int u) : paintValueF32(0.0f), paintValueU32(u), color(0) {} + explicit PaintedVertex(float f) : paintValueF32(f), paintValueU32(0), color(0) {} + explicit PaintedVertex(unsigned int u, float f) : paintValueF32(f), paintValueU32(u), color(0) {} + + void setColor(float r, float g, float b) + { + union + { + unsigned int ucolor; + unsigned char ccolor[4]; + }; + ccolor[0] = (unsigned char)(r * 255); + ccolor[1] = (unsigned char)(g * 255); + ccolor[2] = (unsigned char)(b * 255); + ccolor[3] = 0xff; + color = ucolor; + } + float paintValueF32; + unsigned int paintValueU32; + unsigned int color; +}; + +//------------------------------------------------------------------------------------ +class TriangleMesh : public physx::shdfnd::FastXml::Callback +{ +public: + TriangleMesh(uint32_t moduleIdentifier, SampleRenderer::Renderer* renderer = NULL); + virtual ~TriangleMesh(); + + void setRenderer(SampleRenderer::Renderer* renderer); + + void clear(nvidia::apex::UserRenderResourceManager* rrm, nvidia::apex::ResourceCallback* rcb); + void loadMaterials(nvidia::apex::ResourceCallback* resourceCallback, nvidia::apex::UserRenderResourceManager* rrm, + bool dummyMaterial = false, const char* materialPrefix = NULL, const char* materialSuffix = NULL, + bool onlyVisibleMaterials = false); + void moveAboveGround(float level); + void initSingleMesh(); + + void copyFrom(const TriangleMesh& mesh); + void copyFromSubMesh(const TriangleMesh& mesh, int subMeshNr = -1, bool filterVertices = false); + + bool loadFromObjFile(const std::string& filename, bool useCustomChannels); + bool saveToObjFile(const std::string& filename) const; + bool loadFromXML(const std::string& filename, bool loadCustomChannels); + bool saveToXML(const std::string& filename); + bool loadFromParent(TriangleMesh* parent); + bool loadFromMeshImport(mimp::MeshSystemContainer* msc, bool useCustomChannels); + bool saveToMeshImport(mimp::MeshSystemContainer* msc); + + void initPlane(float length, float uvDist, const char* materialName); + void initFrom(nvidia::apex::ClothingPhysicalMesh& mesh, bool initCustomChannels); + void initFrom(nvidia::apex::RenderMeshAssetAuthoring& mesh, bool initCustomChannels); + + void applyMorphDisplacements(const std::vector<physx::PxVec3>& displacements); + + void drawPainting(PaintChannelType channelType, bool skinned, nvidia::apex::RenderDebugInterface* batcher); + void drawVertices(PaintChannelType channelType, float maxDistanceScaling, float collisionDistanceScaling, float pointScaling, + float vmin, float vmax, nvidia::apex::RenderDebugInterface* batcher); + void drawVertices(size_t boneNr, float minWeight, float pointScaling, nvidia::apex::RenderDebugInterface* batcher) const; + void drawNormals(float normalScale, bool activeVerticesOnly, nvidia::apex::RenderDebugInterface* batcher) const; + void drawTangents(float tangentScale, nvidia::apex::RenderDebugInterface* batcher) const; + void drawMaxDistancePartitions(float paintingScale, const float* partitions, size_t numPartitions, nvidia::apex::RenderDebugInterface* batcher); + void drawTetrahedrons(bool wireframe, float scale, nvidia::apex::RenderDebugInterface* batcher); + + void updateRenderResources(bool rewriteBuffers, nvidia::apex::UserRenderResourceManager& rrm, void* userRenderData = 0); + void updateRenderResourcesInternal(bool rewriteBuffers, nvidia::apex::UserRenderResourceManager& rrm, void* userRenderData, bool createResource); + void dispatchRenderResources(nvidia::apex::UserRenderer& r, const physx::PxMat44& currentPose); + + void updateRenderer(bool rewriteBuffers, bool overrideMaterial, bool sharedOnly = false); + void queueForRendering(const physx::PxMat44& currentPose, bool wireframe); + + void skin(const SkeletalAnim& anim, float scale = 1.0f); + void unskin(); + + enum + { + NUM_TEXCOORDS = 4, + }; + + // accessors + size_t getNumSubmeshes() const + { + return mSubMeshes.size(); + } + const TriangleSubMesh* getSubMesh(size_t i) const + { + if (i < mSubMeshes.size()) + { + return &mSubMeshes[i]; + } + return NULL; + } + + void showSubmesh(size_t index, bool on); + void selectSubMesh(size_t index, bool selected); + void hideSubMesh(const char* submeshName, const char* materialName); + size_t getNumTriangles(size_t subMeshNr) const; + size_t getNumIndices() const + { + return mIndices.size(); + } + size_t getNumVertices() const + { + return mVertices.size(); + } + const std::vector<physx::PxVec3> &getVertices() const + { + return mVertices; + } + const std::vector<physx::PxVec3> &getNormals() const + { + return mNormals; + } + const std::vector<physx::PxVec3> &getTangents() const + { + return mTangents; + } + const std::vector<physx::PxVec3> &getBitangents() const + { + return mBitangents; + } + std::vector<PaintedVertex> &getPaintChannel(PaintChannelType channelType); + const std::vector<PaintedVertex> &getPaintChannel(PaintChannelType channelType) const; + float getMaximalMaxDistance() const; + + const std::vector<nvidia::VertexUV> &getTexCoords(int index) const + { + PX_ASSERT(index >= 0); + PX_ASSERT(index < NUM_TEXCOORDS); + return mTexCoords[index]; + } + const std::vector<unsigned short> &getBoneIndices() const + { + return mBoneIndicesExternal; + } + const std::vector<physx::PxVec4> &getBoneWeights() const + { + return mBoneWeights; + } + + const std::vector<uint32_t> &getIndices() const + { + return mIndices; + } + + const std::vector<bool>& getActiveSubmeshVertices() const + { + return mActiveSubmeshVertices; + } + + void getBounds(physx::PxBounds3& bounds) const + { + bounds = mBounds; + } + + int getBoneAssignments(uint32_t vertNr, const uint16_t* &bones, const float* &weights) const; + bool hasBoneAssignments() const + { + return mBoneIndicesExternal.size() == mVertices.size() * 4; + } + + int getMaxBoneIndex() + { + return mMaxBoneIndexExternal; + } + // manipulators + + void displaceAlongNormal(float displacement); + bool generateTangentSpace(); + + void updateBounds(); + + void setSubMeshColor(size_t subMeshNr, uint32_t color); + void setSubMeshMaterialName(size_t subMeshNr, const char* materialName, nvidia::ResourceCallback* resourceCallback); + void setSubMeshUsedForCollision(size_t subMeshNr, bool enable); + void setSubMeshHasPhysics(size_t subMeshNr, bool enable); + void setAllColors(unsigned int color); + + void subdivideSubMesh(int subMeshNr, int subdivision, bool evenOutVertexDegrees); + void evenOutVertexDegree(int subMeshNr, int numIters); + + void setCullMode(nvidia::RenderCullMode::Enum cullMode, int32_t submeshIndex); + + void updatePaintingColors(PaintChannelType channelType, float maxDistMin, float maxDistMax, unsigned int flag, nvidia::apex::RenderDebugInterface* batcher); + + virtual bool processElement(const char* elementName, const char* elementData, const physx::shdfnd::FastXml::AttributePairs& attr, int lineno); + virtual bool processComment(const char* comment) // encountered a comment in the XML + { + PX_UNUSED(comment); + return true; + } + + virtual bool processClose(const char* element, uint32_t depth, bool& isError) // process the 'close' indicator for a previously encountered element + { + PX_UNUSED(element); + PX_UNUSED(depth); + isError = false; + return true; + } + + virtual void* fastxml_malloc(uint32_t size) + { + return ::malloc(size); + } + virtual void fastxml_free(void* mem) + { + ::free(mem); + } + + + void setTextureUVOrigin(nvidia::TextureUVOrigin::Enum origin) + { + textureUvOriginChanged |= mTextureUVOrigin != origin; + mTextureUVOrigin = origin; + } + nvidia::TextureUVOrigin::Enum getTextureUVOrigin() const + { + return mTextureUVOrigin; + } + + bool hasSkinningVertices(); +private: + void operator=(const TriangleMesh& other) + { + *this = other; /* empty */ + } + void updateNormals(int subMeshNr); + void updateTangents(); + void updateBoneWeights(); + void optimizeForRendering(); + void complete(bool useCustomChannels); + void hasRandomColors(size_t howmany); + + void updateSubmeshInfo(); + + enum ParserState + { + PS_Uninitialized, + PS_Mesh, + PS_Submeshes, + PS_Skeleton, + }; + ParserState mParserState; + + // vertices + nvidia::UserRenderVertexBuffer* mDynamicVertexBuffer; + nvidia::UserRenderVertexBuffer* mStaticVertexBuffer; + nvidia::UserRenderIndexBuffer* mIndexBuffer; + nvidia::UserRenderBoneBuffer* mBoneBuffer; + + std::vector<physx::PxVec3> mVertices; + std::vector<physx::PxVec3> mNormals; + std::vector<physx::PxVec3> mTangents; + std::vector<physx::PxVec3> mBitangents; + + std::vector<PaintedVertex> mPaintChannels[PC_NUM_CHANNELS]; + + std::vector<nvidia::VertexUV> mTexCoords[NUM_TEXCOORDS]; + + // triangles + std::vector<TriangleSubMesh> mSubMeshes; + std::vector<uint32_t> mIndices; + + // skeleton binding + std::string mSkeletonFile; + std::vector<unsigned short> mBoneIndicesExternal; + std::vector<unsigned short> mBoneIndicesInternal; + std::vector<physx::PxVec4> mBoneWeights; + std::vector<uint32_t> mNumBoneWeights; + + std::vector<physx::PxVec3> mSkinnedVertices; + std::vector<physx::PxVec3> mSkinnedNormals; + + std::vector<int> mBoneMappingInt2Ext; + std::vector<physx::PxMat44> mSkinningMatrices; // PH: VERY CAREFUL WHEN CHANGING THIS!!! The bone buffer doesn't validate types in writeBuffer calls! + + // others + std::string mName; + physx::PxBounds3 mBounds; + + int mMaxBoneIndexInternal; + int mMaxBoneIndexExternal; + + // submesh info for per-vertex drawing + std::vector<bool> mActiveSubmeshVertices; + + // temporary, used in painting + std::vector<int> mTriangleMarks; + std::vector<int> mVertexMarks; + int mNextMark; + + TriangleMesh* mParent; + + // temporary, subdivision data structures + int addSplitVert(int vertNr0, int vertNr1); + std::vector<int> mVertexFirstSplit; + std::vector<TriangleEdgeSplit> mVertexSplits; + + bool vertexValuesChangedDynamic; + bool vertexValuesChangedStatic; + bool vertexCountChanged; + bool indicesChanged; + bool skinningMatricesChanged; + bool oneCullModeChanged; + bool textureUvOriginChanged; + + std::vector<uint32_t> mRandomColors; + + std::string mMaterialPrefix; + std::string mMaterialSuffix; + + nvidia::apex::TextureUVOrigin::Enum mTextureUVOrigin; + + SampleRenderer::Renderer* mRenderer; + SampleRenderer::RendererVertexBuffer* mRendererVertexBufferDynamic; + SampleRenderer::RendererVertexBuffer* mRendererVertexBufferShared; + SampleRenderer::RendererIndexBuffer* mRendererIndexBuffer; + physx::PxMat44 mRendererTransform; + + SampleFramework::SampleMaterialAsset* mOverrideMaterial; + bool mUseGpuSkinning; +}; + +} // namespace Samples + +#ifdef __ORBIS__ +#pragma clang diagnostic pop +#endif + +#endif diff --git a/APEX_1.4/shared/external/include/UserAllocator.h b/APEX_1.4/shared/external/include/UserAllocator.h new file mode 100644 index 00000000..ad633259 --- /dev/null +++ b/APEX_1.4/shared/external/include/UserAllocator.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef USERALLOCATOR_H +#define USERALLOCATOR_H + +#include "ApexDefs.h" +#include "PxAllocatorCallback.h" +#include "ApexUsingNamespace.h" + +#pragma warning(push) +#pragma warning(disable:4512) + +#if PX_CHECKED || defined(_DEBUG) +#if PX_WINDOWS_FAMILY +#define USE_MEM_TRACKER +#endif +#endif + +namespace MEM_TRACKER +{ + class MemTracker; +}; + +/* User allocator for APEX and 3.0 PhysX SDK */ +class UserPxAllocator : public physx::PxAllocatorCallback +{ +public: + UserPxAllocator(const char* context, const char* dllName, bool useTrackerIfSupported = true); + virtual ~UserPxAllocator(); + + uint32_t getHandle(const char* name); + + + void* allocate(size_t size, const char* typeName, const char* filename, int line); + void deallocate(void* ptr); + + size_t getAllocatedMemoryBytes() + { + return mMemoryAllocated; + } + + static bool dumpMemoryLeaks(const char* filename); + +private: + bool trackerEnabled() const { return mUseTracker && (NULL != mMemoryTracker); } + + const char* mContext; + size_t mMemoryAllocated; + const bool mUseTracker; + + static MEM_TRACKER::MemTracker *mMemoryTracker; + static int gMemoryTrackerClients; + + // Poor man's memory leak check + static unsigned int mNumAllocations; + static unsigned int mNumFrees; +}; + +#pragma warning(pop) + +#endif diff --git a/APEX_1.4/shared/external/include/UserErrorCallback.h b/APEX_1.4/shared/external/include/UserErrorCallback.h new file mode 100644 index 00000000..14fe7651 --- /dev/null +++ b/APEX_1.4/shared/external/include/UserErrorCallback.h @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef USER_ERROR_CALLBACK_H +#define USER_ERROR_CALLBACK_H + +#include "PxErrorCallback.h" +#include "PxErrors.h" +#include <PsString.h> +#include <ApexUsingNamespace.h> + +#include <map> +#include <string> +#include <vector> + + +class UserErrorCallback : public physx::PxErrorCallback +{ +public: + UserErrorCallback(const char* filename, const char* mode, bool header, bool reportErrors); + ~UserErrorCallback(); + + void printError(const char* message, const char* errorCode = NULL, const char* file = NULL, int line = 0); + void reportError(physx::PxErrorCode::Enum code, const char* message, const char* file, int line); + void printError(physx::PxErrorCode::Enum code, const char* file, int line, const char* fmt, ...); + int getNumErrors(); + void clearErrorCounter(); + const char* getFirstEror(); + void addFilteredMessage(const char* msg, bool fullMatch, bool* trigger = NULL); + + void reportErrors(bool enabled); + + static UserErrorCallback* instance() + { + if (!s_instance) + { + // Allocate a stub (bitbucket) error handler + s_instance = ::new UserErrorCallback(NULL, NULL, false, false); + } + return s_instance; + } + +private: + bool messageFiltered(const char * code, const char * msg); + void openFile(); + + uint32_t mNumErrors; + FILE* mOutFile; + std::string mOutFileName; + const char* mOutFileMode; + bool mOutFileHeader; + bool mReportErrors; + char mFirstErrorBuffer[2048]; + bool mFirstErrorBufferUpdated; + + std::map<std::string, bool*> mFilteredMessages; + std::vector<std::pair<std::string, bool*> > mFilteredParts; + + static UserErrorCallback* s_instance; +}; + +// gcc uses names ...s +#define ERRORSTREAM_INVALID_PARAMETER(_A, ...) \ + UserErrorCallback::instance()->printError(physx::PxErrorCode::eINVALID_PARAMETER, __FILE__, __LINE__, _A, ##__VA_ARGS__) +#define ERRORSTREAM_INVALID_OPERATION(_A, ...) \ + UserErrorCallback::instance()->printError(physx::PxErrorCode::eINVALID_OPERATION, __FILE__, __LINE__, _A, ##__VA_ARGS__) +#define ERRORSTREAM_DEBUG_ERROR(_A, ...) \ + UserErrorCallback::instance()->printError(physx::PxErrorCode::eINTERNAL_ERROR , __FILE__, __LINE__, _A, ##__VA_ARGS__) +#define ERRORSTREAM_DEBUG_INFO(_A, ...) \ + UserErrorCallback::instance()->printError(physx::PxErrorCode::eDEBUG_INFO , __FILE__, __LINE__, _A, ##__VA_ARGS__) +#define ERRORSTREAM_DEBUG_WARNING(_A, ...) \ + UserErrorCallback::instance()->printError(physx::PxErrorCode::eDEBUG_WARNING , __FILE__, __LINE__, _A, ##__VA_ARGS__) + +#endif diff --git a/APEX_1.4/shared/external/include/htmltable.h b/APEX_1.4/shared/external/include/htmltable.h new file mode 100644 index 00000000..1cc25a06 --- /dev/null +++ b/APEX_1.4/shared/external/include/htmltable.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef HTML_TABLE_H + +#define HTML_TABLE_H + +#include "PxSimpleTypes.h" + +// only compile this source code under windows! + +#if PX_WINDOWS_FAMILY +// A simple code snippet to create an HTML document with multiple tables in it. +// + +namespace nvidia +{ + +enum HtmlSaveType +{ + HST_SIMPLE_HTML, // just a very simple HTML document containing the tables. + HST_CSV, // Saves the Tables out as comma seperated value text + HST_TEXT, // Saves the tables out in human readable text format. + HST_TEXT_EXTENDED, // Saves the tables out in human readable text format, but uses the MS-DOS style extended ASCII character set for the borders. + HST_CPP, // Save the document out as C++ code that can re-create it. This is used for debugging the system. + HST_XML, // Save the document into an easily digestable XML format. +}; + +class HtmlDocument; +class HtmlTableInterface; + +class HtmlTable +{ +public: + virtual void setColumnColor(unsigned int column,unsigned int color) = 0; // set a color for a specific column. + virtual void setHeaderColor(unsigned int color) = 0; // color for header lines + virtual void setFooterColor(unsigned int color) = 0; // color for footer lines + virtual void setBodyColor(unsigned int color) = 0; + virtual void addHeader(const char *fmt,...) = 0; // Add a column header, each column designtated by CSV. If any single colum has a forward slash, it is treated as a multi-line header. + virtual void addColumn(const char *data) = 0 ; // add this single string to the next column. Also an optional 'color' that will control the background color of this column, starting with the current row. + virtual void addColumn(float v) = 0 ; // will add this floating point number, nicely formatted + virtual void addColumn(int v) = 0; // will add this integer number nicely formatted. + virtual void addColumn(unsigned int v) = 0; // will add this integer number nicely formatted. + virtual void addColumnHex(unsigned int v) = 0; // will add this as a hex string. + virtual void addCSV(bool newRow,const char *fmt,...) = 0; // add this line of data as a set of columns, using the comma character as a seperator. + virtual void nextRow(void) = 0; // advance to the next row. + virtual HtmlDocument *getDocument(void) = 0; // return the parent document. + virtual HtmlTableInterface *getHtmlTableInterface(void) = 0; + virtual void computeTotals(void) = 0; // compute and display totals of numeric columns when displaying this table. + virtual void excludeTotals(unsigned int column) = 0; // Column's are 1 base indexing. Specifies a column to *excude* from totals, even if it contains numeric data. + virtual void addSort(const char *sort_name,unsigned int primary_key,bool primary_ascending,unsigned int secondary_key,bool secondary_ascending) = 0; // adds a sorted result. You can set up mulitple sort requests for a single table. + virtual unsigned int getColor(unsigned int column,bool isHeader,bool isFooter)= 0; // returns color for this column, or header, or footer + virtual void setOrder(unsigned int order) = 0; +}; + +class HtmlDocument +{ +public: + virtual HtmlTable * createHtmlTable(const char *heading) = 0; // create a table and add it to the HTML document. + virtual const char * saveDocument(size_t &len,HtmlSaveType type) =0; // save the document to memory, return a pointer to that memory and the length of the file. + virtual bool saveExcel(const char *fname) = 0; // excel format can only be saved directly to files on disk, as it needs to create a sub-directory for the intermediate files. + virtual void releaseDocumentMemory(const char *mem) = 0; // release memory previously allocated for a document save. + virtual HtmlTableInterface *getHtmlTableInterface(void) = 0; +}; + +class HtmlTableInterface +{ +public: + virtual HtmlDocument * createHtmlDocument(const char *document_name) = 0; // create an HTML document. + virtual void releaseHtmlDocument(HtmlDocument *document) = 0; // release a previously created HTML document +}; // end of namespace + + +HtmlTableInterface *getHtmlTableInterface(void); +int getHtmlMemoryUsage(void); + + +}; + +#endif + +#endif diff --git a/APEX_1.4/shared/external/include/linux/DirEntry.h b/APEX_1.4/shared/external/include/linux/DirEntry.h new file mode 100644 index 00000000..19721f3e --- /dev/null +++ b/APEX_1.4/shared/external/include/linux/DirEntry.h @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#ifndef DIR_ENTRY_H +#define DIR_ENTRY_H + +#include "foundation/PxPreprocessor.h" + +#if defined PX_LINUX || defined PX_ANDROID +# include <dirent.h> +# include <sys/types.h> +# include <sys/stat.h> +# include <string> +# include <sstream> +#else +# error Unsupported platform +#endif + +namespace physx +{ + class DirEntry + { + public: + + DirEntry() + { + mDir = NULL; + mEntry = NULL; + mIdx = 0; + mCount = 0; + } + + ~DirEntry() + { + if (!isDone()) + { + while (next()); + } + + // The Find.cpp loop behaves badly and doesn't cleanup the DIR pointer + if (mDir) + { + closedir(mDir); + mDir = NULL; + } + } + + // Get successive element of directory. + // Returns true on success, error otherwise. + bool next() + { + if (mIdx < mCount) + { + mEntry = readdir(mDir); + ++mIdx; + } + else + { + bool ret = (0 == closedir(mDir)); + mDir = NULL; + mEntry = NULL; + return ret; + } + return true; + } + + // No more entries in directory? + bool isDone() const + { + return mIdx >= mCount; + + } + + // Is this entry a directory? + bool isDirectory() const + { + if (mEntry) + { + if(DT_UNKNOWN == mEntry->d_type) + { + // on some fs d_type is DT_UNKNOWN, so we need to use stat instead + std::ostringstream path; + path << mDirPath << "/" << mEntry->d_name; + struct stat s; + if(stat(path.str().c_str(), &s) == 0) + { + return S_ISDIR(s.st_mode); + } + else + { + return false; + } + } + else + { + return DT_DIR == mEntry->d_type; + } + } + else + { + return false; + } + } + + // Get name of this entry. + const char* getName() const + { + if (mEntry) + { + return mEntry->d_name; + } + else + { + return NULL; + } + } + + // Get first entry in directory. + static bool GetFirstEntry(const char* path, DirEntry& dentry) + { + dentry.mDir = opendir(path); + dentry.mDirPath.assign(path, strlen(path)); + if (!dentry.mDir) + { + return false; + } + + dentry.mIdx = 0; + + // count files + dentry.mCount = 0; + if (dentry.mDir != NULL) + { + while (readdir(dentry.mDir)) + { + dentry.mCount++; + } + } + closedir(dentry.mDir); + dentry.mDir = opendir(path); + dentry.mEntry = readdir(dentry.mDir); + return true; + } + + private: + + DIR* mDir; + std::string mDirPath; + struct dirent* mEntry; + long mIdx, mCount; + }; +} + +#endif |