From 7aa8691ca3df433a244e5138f3fb2955949de781 Mon Sep 17 00:00:00 2001 From: pandamicro Date: Thu, 17 Oct 2019 14:50:54 +0800 Subject: [PATCH] Cleanup and add 3d renderer sources --- .../cocos2d_libs.xcodeproj/project.pbxproj | 3540 +-- .../xcshareddata/IDEWorkspaceChecks.plist | 8 + native/cocos/editor-support/Android.mk | 155 - native/cocos/editor-support/IOBuffer.cpp | 45 - native/cocos/editor-support/IOBuffer.h | 268 - native/cocos/editor-support/IOTypedArray.cpp | 110 - native/cocos/editor-support/IOTypedArray.h | 60 - native/cocos/editor-support/MeshBuffer.cpp | 140 - native/cocos/editor-support/MeshBuffer.h | 74 - native/cocos/editor-support/MiddlewareMacro.h | 48 - .../editor-support/MiddlewareManager.cpp | 178 - .../cocos/editor-support/MiddlewareManager.h | 118 - .../cocos/editor-support/TypedArrayPool.cpp | 194 - native/cocos/editor-support/TypedArrayPool.h | 96 - .../ArmatureCache.cpp | 447 - .../ArmatureCache.h | 141 - .../ArmatureCacheMgr.cpp | 57 - .../ArmatureCacheMgr.h | 57 - .../CCArmatureCacheDisplay.cpp | 432 - .../CCArmatureCacheDisplay.h | 131 - .../CCArmatureDisplay.cpp | 440 - .../CCArmatureDisplay.h | 214 - .../CCDragonBonesHeaders.h | 33 - .../dragonbones-creator-support/CCFactory.cpp | 240 - .../dragonbones-creator-support/CCFactory.h | 270 - .../dragonbones-creator-support/CCSlot.cpp | 526 - .../dragonbones-creator-support/CCSlot.h | 88 - .../CCTextureAtlasData.cpp | 99 - .../CCTextureAtlasData.h | 107 - .../dragonbones/DragonBonesHeaders.h | 82 - .../dragonbones/animation/Animation.cpp | 602 - .../dragonbones/animation/Animation.h | 478 - .../dragonbones/animation/AnimationState.cpp | 952 - .../dragonbones/animation/AnimationState.h | 534 - .../animation/BaseTimelineState.cpp | 344 - .../dragonbones/animation/BaseTimelineState.h | 199 - .../dragonbones/animation/IAnimatable.h | 103 - .../dragonbones/animation/TimelineState.cpp | 1036 - .../dragonbones/animation/TimelineState.h | 205 - .../dragonbones/animation/WorldClock.cpp | 158 - .../dragonbones/animation/WorldClock.h | 209 - .../dragonbones/armature/Armature.cpp | 554 - .../dragonbones/armature/Armature.h | 559 - .../dragonbones/armature/Bone.cpp | 432 - .../dragonbones/armature/Bone.h | 235 - .../dragonbones/armature/Constraint.cpp | 183 - .../dragonbones/armature/Constraint.h | 119 - .../dragonbones/armature/DeformVertices.cpp | 75 - .../dragonbones/armature/DeformVertices.h | 52 - .../dragonbones/armature/IArmatureProxy.h | 112 - .../dragonbones/armature/Slot.cpp | 919 - .../dragonbones/armature/Slot.h | 507 - .../dragonbones/armature/TransformObject.cpp | 34 - .../dragonbones/armature/TransformObject.h | 161 - .../dragonbones/core/BaseObject.cpp | 160 - .../dragonbones/core/BaseObject.h | 161 - .../dragonbones/core/DragonBones.cpp | 99 - .../dragonbones/core/DragonBones.h | 487 - .../dragonbones/event/EventObject.cpp | 57 - .../dragonbones/event/EventObject.h | 267 - .../dragonbones/event/IEventDispatcher.h | 113 - .../dragonbones/factory/BaseFactory.cpp | 659 - .../dragonbones/factory/BaseFactory.h | 592 - .../dragonbones/geom/ColorTransform.h | 80 - .../editor-support/dragonbones/geom/Matrix.h | 317 - .../editor-support/dragonbones/geom/Point.cpp | 10 - .../editor-support/dragonbones/geom/Point.h | 121 - .../dragonbones/geom/Rectangle.h | 137 - .../dragonbones/geom/Transform.cpp | 13 - .../dragonbones/geom/Transform.h | 289 - .../dragonbones/model/AnimationConfig.cpp | 141 - .../dragonbones/model/AnimationConfig.h | 320 - .../dragonbones/model/AnimationData.cpp | 121 - .../dragonbones/model/AnimationData.h | 256 - .../dragonbones/model/ArmatureData.cpp | 320 - .../dragonbones/model/ArmatureData.h | 513 - .../dragonbones/model/BoundingBoxData.cpp | 644 - .../dragonbones/model/BoundingBoxData.h | 289 - .../dragonbones/model/CanvasData.cpp | 12 - .../dragonbones/model/CanvasData.h | 46 - .../dragonbones/model/ConstraintData.cpp | 27 - .../dragonbones/model/ConstraintData.h | 77 - .../dragonbones/model/DisplayData.cpp | 103 - .../dragonbones/model/DisplayData.h | 192 - .../dragonbones/model/DragonBonesData.cpp | 56 - .../dragonbones/model/DragonBonesData.h | 193 - .../dragonbones/model/SkinData.cpp | 51 - .../dragonbones/model/SkinData.h | 89 - .../dragonbones/model/TextureAtlasData.cpp | 105 - .../dragonbones/model/TextureAtlasData.h | 148 - .../dragonbones/model/UserData.cpp | 56 - .../dragonbones/model/UserData.h | 175 - .../dragonbones/parser/BinaryDataParser.cpp | 237 - .../dragonbones/parser/BinaryDataParser.h | 72 - .../dragonbones/parser/DataParser.cpp | 319 - .../dragonbones/parser/DataParser.h | 182 - .../dragonbones/parser/JSONDataParser.cpp | 2039 -- .../dragonbones/parser/JSONDataParser.h | 270 - .../editor-support/middleware-adapter.cpp | 166 - .../cocos/editor-support/middleware-adapter.h | 219 - .../particle/ParticleSimulator.cpp | 462 - .../particle/ParticleSimulator.h | 281 - .../AttachmentVertices.cpp | 51 - .../AttachmentVertices.h | 47 - .../SkeletonAnimation.cpp | 342 - .../spine-creator-support/SkeletonAnimation.h | 118 - .../spine-creator-support/SkeletonCache.cpp | 532 - .../spine-creator-support/SkeletonCache.h | 136 - .../SkeletonCacheAnimation.cpp | 477 - .../SkeletonCacheAnimation.h | 132 - .../SkeletonCacheMgr.cpp | 51 - .../spine-creator-support/SkeletonCacheMgr.h | 59 - .../spine-creator-support/SkeletonDataMgr.cpp | 115 - .../spine-creator-support/SkeletonDataMgr.h | 78 - .../SkeletonRenderer.cpp | 1065 - .../spine-creator-support/SkeletonRenderer.h | 191 - .../VertexEffectDelegate.cpp | 85 - .../VertexEffectDelegate.h | 59 - .../spine-creator-support/spine-cocos2dx.cpp | 167 - .../spine-creator-support/spine-cocos2dx.h | 76 - .../cocos/editor-support/spine/Animation.cpp | 141 - native/cocos/editor-support/spine/Animation.h | 119 - .../editor-support/spine/AnimationState.cpp | 1031 - .../editor-support/spine/AnimationState.h | 450 - .../spine/AnimationStateData.cpp | 86 - .../editor-support/spine/AnimationStateData.h | 88 - native/cocos/editor-support/spine/Atlas.cpp | 357 - native/cocos/editor-support/spine/Atlas.h | 159 - .../spine/AtlasAttachmentLoader.cpp | 129 - .../spine/AtlasAttachmentLoader.h | 74 - .../cocos/editor-support/spine/Attachment.cpp | 52 - .../cocos/editor-support/spine/Attachment.h | 54 - .../editor-support/spine/AttachmentLoader.cpp | 53 - .../editor-support/spine/AttachmentLoader.h | 76 - .../spine/AttachmentTimeline.cpp | 125 - .../editor-support/spine/AttachmentTimeline.h | 74 - .../editor-support/spine/AttachmentType.h | 46 - native/cocos/editor-support/spine/BlendMode.h | 43 - native/cocos/editor-support/spine/Bone.cpp | 541 - native/cocos/editor-support/spine/Bone.h | 249 - .../cocos/editor-support/spine/BoneData.cpp | 140 - native/cocos/editor-support/spine/BoneData.h | 120 - .../spine/BoundingBoxAttachment.cpp | 42 - .../spine/BoundingBoxAttachment.h | 46 - .../spine/ClippingAttachment.cpp | 52 - .../editor-support/spine/ClippingAttachment.h | 58 - native/cocos/editor-support/spine/Color.h | 94 - .../editor-support/spine/ColorTimeline.cpp | 144 - .../editor-support/spine/ColorTimeline.h | 81 - .../cocos/editor-support/spine/Constraint.cpp | 45 - .../cocos/editor-support/spine/Constraint.h | 53 - .../editor-support/spine/ContainerUtil.h | 128 - .../editor-support/spine/CurveTimeline.cpp | 129 - .../editor-support/spine/CurveTimeline.h | 77 - native/cocos/editor-support/spine/Debug.h | 117 - .../editor-support/spine/DeformTimeline.cpp | 297 - .../editor-support/spine/DeformTimeline.h | 70 - .../spine/DrawOrderTimeline.cpp | 130 - .../editor-support/spine/DrawOrderTimeline.h | 64 - native/cocos/editor-support/spine/Event.cpp | 96 - native/cocos/editor-support/spine/Event.h | 87 - .../cocos/editor-support/spine/EventData.cpp | 102 - native/cocos/editor-support/spine/EventData.h | 87 - .../editor-support/spine/EventTimeline.cpp | 116 - .../editor-support/spine/EventTimeline.h | 65 - .../cocos/editor-support/spine/Extension.cpp | 128 - native/cocos/editor-support/spine/Extension.h | 118 - .../editor-support/spine/HasRendererObject.h | 59 - native/cocos/editor-support/spine/HashMap.h | 185 - .../editor-support/spine/IkConstraint.cpp | 297 - .../cocos/editor-support/spine/IkConstraint.h | 106 - .../editor-support/spine/IkConstraintData.cpp | 115 - .../editor-support/spine/IkConstraintData.h | 93 - .../spine/IkConstraintTimeline.cpp | 157 - .../spine/IkConstraintTimeline.h | 72 - native/cocos/editor-support/spine/Json.cpp | 544 - native/cocos/editor-support/spine/Json.h | 114 - .../cocos/editor-support/spine/LinkedMesh.cpp | 46 - .../cocos/editor-support/spine/LinkedMesh.h | 56 - .../cocos/editor-support/spine/MathUtil.cpp | 129 - native/cocos/editor-support/spine/MathUtil.h | 130 - .../editor-support/spine/MeshAttachment.cpp | 264 - .../editor-support/spine/MeshAttachment.h | 142 - native/cocos/editor-support/spine/MixBlend.h | 46 - .../cocos/editor-support/spine/MixDirection.h | 44 - .../editor-support/spine/PathAttachment.cpp | 62 - .../editor-support/spine/PathAttachment.h | 60 - .../editor-support/spine/PathConstraint.cpp | 571 - .../editor-support/spine/PathConstraint.h | 110 - .../spine/PathConstraintData.cpp | 145 - .../editor-support/spine/PathConstraintData.h | 105 - .../spine/PathConstraintMixTimeline.cpp | 124 - .../spine/PathConstraintMixTimeline.h | 69 - .../spine/PathConstraintPositionTimeline.cpp | 114 - .../spine/PathConstraintPositionTimeline.h | 68 - .../spine/PathConstraintSpacingTimeline.cpp | 100 - .../spine/PathConstraintSpacingTimeline.h | 52 - .../editor-support/spine/PointAttachment.cpp | 83 - .../editor-support/spine/PointAttachment.h | 73 - native/cocos/editor-support/spine/Pool.h | 75 - .../cocos/editor-support/spine/PositionMode.h | 41 - native/cocos/editor-support/spine/RTTI.cpp | 66 - native/cocos/editor-support/spine/RTTI.h | 76 - .../editor-support/spine/RegionAttachment.cpp | 284 - .../editor-support/spine/RegionAttachment.h | 133 - .../cocos/editor-support/spine/RotateMode.h | 42 - .../editor-support/spine/RotateTimeline.cpp | 139 - .../editor-support/spine/RotateTimeline.h | 71 - .../editor-support/spine/ScaleTimeline.cpp | 151 - .../editor-support/spine/ScaleTimeline.h | 52 - .../editor-support/spine/ShearTimeline.cpp | 111 - .../editor-support/spine/ShearTimeline.h | 52 - .../cocos/editor-support/spine/Skeleton.cpp | 653 - native/cocos/editor-support/spine/Skeleton.h | 247 - .../editor-support/spine/SkeletonBinary.cpp | 1053 - .../editor-support/spine/SkeletonBinary.h | 130 - .../editor-support/spine/SkeletonBounds.cpp | 238 - .../editor-support/spine/SkeletonBounds.h | 108 - .../editor-support/spine/SkeletonClipping.cpp | 336 - .../editor-support/spine/SkeletonClipping.h | 80 - .../editor-support/spine/SkeletonData.cpp | 222 - .../cocos/editor-support/spine/SkeletonData.h | 184 - .../editor-support/spine/SkeletonJson.cpp | 1251 -- .../cocos/editor-support/spine/SkeletonJson.h | 92 - native/cocos/editor-support/spine/Skin.cpp | 147 - native/cocos/editor-support/spine/Skin.h | 149 - native/cocos/editor-support/spine/Slot.cpp | 116 - native/cocos/editor-support/spine/Slot.h | 127 - .../cocos/editor-support/spine/SlotData.cpp | 96 - native/cocos/editor-support/spine/SlotData.h | 114 - .../cocos/editor-support/spine/SpacingMode.h | 42 - .../editor-support/spine/SpineObject.cpp | 67 - .../cocos/editor-support/spine/SpineObject.h | 60 - .../cocos/editor-support/spine/SpineString.h | 213 - .../editor-support/spine/TextureLoader.cpp | 43 - .../editor-support/spine/TextureLoader.h | 52 - .../cocos/editor-support/spine/Timeline.cpp | 49 - native/cocos/editor-support/spine/Timeline.h | 72 - .../cocos/editor-support/spine/TimelineType.h | 54 - .../spine/TransformConstraint.cpp | 383 - .../spine/TransformConstraint.h | 93 - .../spine/TransformConstraintData.cpp | 123 - .../spine/TransformConstraintData.h | 82 - .../spine/TransformConstraintTimeline.cpp | 147 - .../spine/TransformConstraintTimeline.h | 71 - .../editor-support/spine/TransformMode.h | 45 - .../spine/TranslateTimeline.cpp | 130 - .../editor-support/spine/TranslateTimeline.h | 73 - .../editor-support/spine/Triangulator.cpp | 302 - .../cocos/editor-support/spine/Triangulator.h | 65 - .../editor-support/spine/TwoColorTimeline.cpp | 181 - .../editor-support/spine/TwoColorTimeline.h | 81 - .../cocos/editor-support/spine/Updatable.cpp | 45 - native/cocos/editor-support/spine/Updatable.h | 50 - native/cocos/editor-support/spine/Vector.h | 223 - .../editor-support/spine/VertexAttachment.cpp | 163 - .../editor-support/spine/VertexAttachment.h | 91 - .../editor-support/spine/VertexEffect.cpp | 160 - .../cocos/editor-support/spine/VertexEffect.h | 106 - native/cocos/editor-support/spine/Vertices.h | 44 - native/cocos/editor-support/spine/dll.h | 52 - native/cocos/editor-support/spine/spine.h | 114 - native/cocos/renderer/Macro.h | 192 - native/cocos/renderer/Types.cpp | 68 - native/cocos/renderer/Types.h | 203 - native/cocos/renderer/core/Core.h | 27 + native/cocos/renderer/core/CoreDef.h | 344 + native/cocos/renderer/core/CoreStd.cc | 1 + native/cocos/renderer/core/CoreStd.h | 40 + native/cocos/renderer/core/TypeDef.h | 19 + .../renderer/core/gfx/GFXBindingLayout.cc | 64 + .../renderer/core/gfx/GFXBindingLayout.h | 33 + native/cocos/renderer/core/gfx/GFXBuffer.cc | 19 + native/cocos/renderer/core/gfx/GFXBuffer.h | 41 + .../renderer/core/gfx/GFXCommandAllocator.cc | 13 + .../renderer/core/gfx/GFXCommandAllocator.h | 26 + .../renderer/core/gfx/GFXCommandBuffer.cc | 17 + .../renderer/core/gfx/GFXCommandBuffer.h | 52 + native/cocos/renderer/core/gfx/GFXContext.cc | 18 + native/cocos/renderer/core/gfx/GFXContext.h | 35 + native/cocos/renderer/core/gfx/GFXDef.cc | 210 + native/cocos/renderer/core/gfx/GFXDef.h | 952 + native/cocos/renderer/core/gfx/GFXDevice.cc | 25 + native/cocos/renderer/core/gfx/GFXDevice.h | 67 + .../cocos/renderer/core/gfx/GFXFramebuffer.cc | 16 + .../cocos/renderer/core/gfx/GFXFramebuffer.h | 33 + .../renderer/core/gfx/GFXInputAssembler.cc | 22 + .../renderer/core/gfx/GFXInputAssembler.h | 55 + .../renderer/core/gfx/GFXPipelineLayout.cc | 13 + .../renderer/core/gfx/GFXPipelineLayout.h | 29 + .../renderer/core/gfx/GFXPipelineState.cc | 17 + .../renderer/core/gfx/GFXPipelineState.h | 43 + native/cocos/renderer/core/gfx/GFXQueue.cc | 13 + native/cocos/renderer/core/gfx/GFXQueue.h | 28 + .../cocos/renderer/core/gfx/GFXRenderPass.cc | 13 + .../cocos/renderer/core/gfx/GFXRenderPass.h | 31 + native/cocos/renderer/core/gfx/GFXSampler.cc | 28 + native/cocos/renderer/core/gfx/GFXSampler.h | 51 + native/cocos/renderer/core/gfx/GFXShader.cc | 14 + native/cocos/renderer/core/gfx/GFXShader.h | 35 + native/cocos/renderer/core/gfx/GFXTexture.cc | 25 + native/cocos/renderer/core/gfx/GFXTexture.h | 49 + .../cocos/renderer/core/gfx/GFXTextureView.cc | 20 + .../cocos/renderer/core/gfx/GFXTextureView.h | 39 + native/cocos/renderer/core/gfx/GFXWindow.cc | 29 + native/cocos/renderer/core/gfx/GFXWindow.h | 59 + .../cocos/renderer/core/kernel/Assertion.cc | 154 + .../cocos/renderer/core/kernel/CachedArray.h | 77 + native/cocos/renderer/core/kernel/Log.cc | 145 + native/cocos/renderer/core/kernel/Log.h | 43 + native/cocos/renderer/core/kernel/Object.h | 11 + .../cocos/renderer/core/kernel/UTFString.cc | 591 + native/cocos/renderer/core/kernel/UTFString.h | 1565 ++ native/cocos/renderer/core/kernel/assertion.h | 32 + native/cocos/renderer/core/math/CCMath.cc | 156 + native/cocos/renderer/core/math/CCMath.h | 66 + .../renderer/core/memory/AllocatedObj.cc | 15 + .../cocos/renderer/core/memory/AllocatedObj.h | 79 + native/cocos/renderer/core/memory/JeAlloc.cc | 153 + native/cocos/renderer/core/memory/JeAlloc.h | 60 + native/cocos/renderer/core/memory/MemDef.h | 177 + .../cocos/renderer/core/memory/MemTracker.cc | 268 + .../cocos/renderer/core/memory/MemTracker.h | 64 + native/cocos/renderer/core/memory/Memory.cc | 13 + native/cocos/renderer/core/memory/Memory.h | 51 + .../cocos/renderer/core/memory/NedPooling.cc | 203 + .../cocos/renderer/core/memory/NedPooling.h | 57 + native/cocos/renderer/core/memory/StdAlloc.h | 142 + native/cocos/renderer/core/memory/StlAlloc.h | 345 + native/cocos/renderer/core/util/StringUtil.cc | 96 + native/cocos/renderer/core/util/StringUtil.h | 16 + native/cocos/renderer/gfx-gl/GLStd.cpp | 1 + native/cocos/renderer/gfx-gl/GLStd.h | 16 + native/cocos/renderer/gfx-gl/gl/glew.h | 18062 ++++++++++++++++ native/cocos/renderer/gfx-gl/gl/wglew.h | 1421 ++ native/cocos/renderer/gfx-gles2/GFXGLES2.h | 7 + .../renderer/gfx-gles2/GLES2BindingLayout.cc | 78 + .../renderer/gfx-gles2/GLES2BindingLayout.h | 26 + .../cocos/renderer/gfx-gles2/GLES2Buffer.cc | 92 + native/cocos/renderer/gfx-gles2/GLES2Buffer.h | 27 + .../gfx-gles2/GLES2CommandAllocator.cc | 40 + .../gfx-gles2/GLES2CommandAllocator.h | 36 + .../renderer/gfx-gles2/GLES2CommandBuffer.cc | 324 + .../renderer/gfx-gles2/GLES2CommandBuffer.h | 64 + .../renderer/gfx-gles2/GLES2CommandPool.h | 89 + .../cocos/renderer/gfx-gles2/GLES2Commands.cc | 2039 ++ .../cocos/renderer/gfx-gles2/GLES2Commands.h | 193 + .../cocos/renderer/gfx-gles2/GLES2Device.cc | 270 + native/cocos/renderer/gfx-gles2/GLES2Device.h | 58 + .../renderer/gfx-gles2/GLES2EGLContext.cc | 430 + .../renderer/gfx-gles2/GLES2EGLContext.h | 71 + .../renderer/gfx-gles2/GLES2Framebuffer.cc | 54 + .../renderer/gfx-gles2/GLES2Framebuffer.h | 25 + .../renderer/gfx-gles2/GLES2GPUObjects.h | 221 + .../renderer/gfx-gles2/GLES2InputAssembler.cc | 60 + .../renderer/gfx-gles2/GLES2InputAssembler.h | 28 + .../renderer/gfx-gles2/GLES2PipelineLayout.cc | 31 + .../renderer/gfx-gles2/GLES2PipelineLayout.h | 24 + .../renderer/gfx-gles2/GLES2PipelineState.cc | 67 + .../renderer/gfx-gles2/GLES2PipelineState.h | 25 + native/cocos/renderer/gfx-gles2/GLES2Queue.cc | 36 + native/cocos/renderer/gfx-gles2/GLES2Queue.h | 28 + .../renderer/gfx-gles2/GLES2RenderPass.cc | 34 + .../renderer/gfx-gles2/GLES2RenderPass.h | 25 + .../cocos/renderer/gfx-gles2/GLES2Sampler.cc | 53 + .../cocos/renderer/gfx-gles2/GLES2Sampler.h | 38 + .../cocos/renderer/gfx-gles2/GLES2Shader.cc | 35 + native/cocos/renderer/gfx-gles2/GLES2Shader.h | 24 + .../renderer/gfx-gles2/GLES2StateCache.h | 36 + native/cocos/renderer/gfx-gles2/GLES2Std.cc | 1 + native/cocos/renderer/gfx-gles2/GLES2Std.h | 16 + .../cocos/renderer/gfx-gles2/GLES2Texture.cc | 129 + .../cocos/renderer/gfx-gles2/GLES2Texture.h | 26 + .../renderer/gfx-gles2/GLES2TextureView.cc | 44 + .../renderer/gfx-gles2/GLES2TextureView.h | 25 + .../cocos/renderer/gfx-gles2/GLES2Window.cc | 155 + native/cocos/renderer/gfx-gles2/GLES2Window.h | 19 + native/cocos/renderer/gfx-gles2/gles2w.c | 796 + native/cocos/renderer/gfx-gles2/gles2w.h | 971 + native/cocos/renderer/gfx-gles2/gles2w.mm | 796 + native/cocos/renderer/gfx-gles3/GFXGLES3.h | 7 + .../renderer/gfx-gles3/GLES3BindingLayout.cc | 78 + .../renderer/gfx-gles3/GLES3BindingLayout.h | 26 + .../cocos/renderer/gfx-gles3/GLES3Buffer.cc | 92 + native/cocos/renderer/gfx-gles3/GLES3Buffer.h | 27 + .../gfx-gles3/GLES3CommandAllocator.cc | 40 + .../gfx-gles3/GLES3CommandAllocator.h | 36 + .../renderer/gfx-gles3/GLES3CommandBuffer.cc | 324 + .../renderer/gfx-gles3/GLES3CommandBuffer.h | 64 + .../renderer/gfx-gles3/GLES3CommandPool.h | 89 + .../cocos/renderer/gfx-gles3/GLES3Commands.cc | 1985 ++ .../cocos/renderer/gfx-gles3/GLES3Commands.h | 193 + .../cocos/renderer/gfx-gles3/GLES3Device.cc | 262 + native/cocos/renderer/gfx-gles3/GLES3Device.h | 52 + .../renderer/gfx-gles3/GLES3EGLContext.cc | 441 + .../renderer/gfx-gles3/GLES3EGLContext.h | 71 + .../renderer/gfx-gles3/GLES3Framebuffer.cc | 54 + .../renderer/gfx-gles3/GLES3Framebuffer.h | 25 + .../renderer/gfx-gles3/GLES3GPUObjects.h | 216 + .../renderer/gfx-gles3/GLES3InputAssembler.cc | 60 + .../renderer/gfx-gles3/GLES3InputAssembler.h | 28 + .../renderer/gfx-gles3/GLES3PipelineLayout.cc | 31 + .../renderer/gfx-gles3/GLES3PipelineLayout.h | 24 + .../renderer/gfx-gles3/GLES3PipelineState.cc | 67 + .../renderer/gfx-gles3/GLES3PipelineState.h | 25 + native/cocos/renderer/gfx-gles3/GLES3Queue.cc | 36 + native/cocos/renderer/gfx-gles3/GLES3Queue.h | 28 + .../renderer/gfx-gles3/GLES3RenderPass.cc | 34 + .../renderer/gfx-gles3/GLES3RenderPass.h | 25 + .../cocos/renderer/gfx-gles3/GLES3Sampler.cc | 53 + .../cocos/renderer/gfx-gles3/GLES3Sampler.h | 25 + .../cocos/renderer/gfx-gles3/GLES3Shader.cc | 35 + native/cocos/renderer/gfx-gles3/GLES3Shader.h | 24 + .../renderer/gfx-gles3/GLES3StateCache.h | 36 + native/cocos/renderer/gfx-gles3/GLES3Std.cc | 1 + native/cocos/renderer/gfx-gles3/GLES3Std.h | 16 + .../cocos/renderer/gfx-gles3/GLES3Texture.cc | 129 + .../cocos/renderer/gfx-gles3/GLES3Texture.h | 26 + .../renderer/gfx-gles3/GLES3TextureView.cc | 44 + .../renderer/gfx-gles3/GLES3TextureView.h | 25 + .../cocos/renderer/gfx-gles3/GLES3Window.cc | 155 + native/cocos/renderer/gfx-gles3/GLES3Window.h | 19 + native/cocos/renderer/gfx-gles3/gles3w.c | 772 + native/cocos/renderer/gfx-gles3/gles3w.h | 933 + native/cocos/renderer/gfx-gles3/gles3w.mm | 772 + native/cocos/renderer/gfx-metal/MTLbuffer.h | 10 + native/cocos/renderer/gfx-metal/MTLbuffer.mm | 7 + native/cocos/renderer/gfx-metal/MetalStd.h | 13 + native/cocos/renderer/gfx-metal/MetalStd.mm | 1 + native/cocos/renderer/gfx/DeviceGraphics.cpp | 1168 - native/cocos/renderer/gfx/DeviceGraphics.h | 359 - native/cocos/renderer/gfx/FrameBuffer.cpp | 140 - native/cocos/renderer/gfx/FrameBuffer.h | 128 - native/cocos/renderer/gfx/GFX.cpp | 25 - native/cocos/renderer/gfx/GFX.h | 35 - native/cocos/renderer/gfx/GFXUtils.cpp | 57 - native/cocos/renderer/gfx/GFXUtils.h | 30 - native/cocos/renderer/gfx/GraphicsHandle.cpp | 40 - native/cocos/renderer/gfx/GraphicsHandle.h | 60 - native/cocos/renderer/gfx/IndexBuffer.cpp | 123 - native/cocos/renderer/gfx/IndexBuffer.h | 157 - native/cocos/renderer/gfx/Program.cpp | 395 - native/cocos/renderer/gfx/Program.h | 165 - native/cocos/renderer/gfx/RenderBuffer.cpp | 66 - native/cocos/renderer/gfx/RenderBuffer.h | 83 - native/cocos/renderer/gfx/RenderTarget.cpp | 25 - native/cocos/renderer/gfx/RenderTarget.h | 53 - native/cocos/renderer/gfx/State.cpp | 224 - native/cocos/renderer/gfx/State.h | 277 - native/cocos/renderer/gfx/Texture.cpp | 125 - native/cocos/renderer/gfx/Texture.h | 294 - native/cocos/renderer/gfx/Texture2D.cpp | 293 - native/cocos/renderer/gfx/Texture2D.h | 92 - native/cocos/renderer/gfx/VertexBuffer.cpp | 141 - native/cocos/renderer/gfx/VertexBuffer.h | 149 - native/cocos/renderer/gfx/VertexFormat.cpp | 164 - native/cocos/renderer/gfx/VertexFormat.h | 197 - native/cocos/renderer/memop/RecyclePool.hpp | 128 - .../cocos/renderer/renderer/BaseRenderer.cpp | 387 - native/cocos/renderer/renderer/BaseRenderer.h | 163 - native/cocos/renderer/renderer/Camera.cpp | 230 - native/cocos/renderer/renderer/Camera.h | 252 - native/cocos/renderer/renderer/Config.cpp | 68 - native/cocos/renderer/renderer/Config.h | 71 - .../renderer/renderer/CustomProperties.cpp | 101 - .../renderer/renderer/CustomProperties.hpp | 62 - native/cocos/renderer/renderer/Effect.cpp | 176 - native/cocos/renderer/renderer/Effect.h | 209 - .../renderer/renderer/ForwardRenderer.cpp | 480 - .../cocos/renderer/renderer/ForwardRenderer.h | 97 - native/cocos/renderer/renderer/INode.h | 42 - .../renderer/renderer/InputAssembler.cpp | 144 - .../cocos/renderer/renderer/InputAssembler.h | 126 - native/cocos/renderer/renderer/Light.cpp | 287 - native/cocos/renderer/renderer/Light.h | 316 - native/cocos/renderer/renderer/Model.cpp | 149 - native/cocos/renderer/renderer/Model.h | 150 - native/cocos/renderer/renderer/Pass.cpp | 151 - native/cocos/renderer/renderer/Pass.h | 189 - native/cocos/renderer/renderer/ProgramLib.cpp | 341 - native/cocos/renderer/renderer/ProgramLib.h | 107 - native/cocos/renderer/renderer/Renderer.h | 40 - .../cocos/renderer/renderer/RendererUtils.cpp | 91 - .../cocos/renderer/renderer/RendererUtils.h | 47 - native/cocos/renderer/renderer/Scene.cpp | 127 - native/cocos/renderer/renderer/Scene.h | 176 - native/cocos/renderer/renderer/Technique.cpp | 497 - native/cocos/renderer/renderer/Technique.h | 264 - native/cocos/renderer/renderer/View.cpp | 49 - native/cocos/renderer/renderer/View.h | 92 - native/cocos/renderer/scene/MemPool.cpp | 179 - native/cocos/renderer/scene/MemPool.hpp | 99 - native/cocos/renderer/scene/MeshBuffer.cpp | 207 - native/cocos/renderer/scene/MeshBuffer.hpp | 185 - native/cocos/renderer/scene/ModelBatcher.cpp | 387 - native/cocos/renderer/scene/ModelBatcher.hpp | 160 - native/cocos/renderer/scene/NodeMemPool.cpp | 179 - native/cocos/renderer/scene/NodeMemPool.hpp | 181 - native/cocos/renderer/scene/NodeProxy.cpp | 539 - native/cocos/renderer/scene/NodeProxy.hpp | 324 - native/cocos/renderer/scene/ParallelTask.cpp | 176 - native/cocos/renderer/scene/ParallelTask.hpp | 78 - native/cocos/renderer/scene/RenderFlow.cpp | 372 - native/cocos/renderer/scene/RenderFlow.hpp | 180 - .../cocos/renderer/scene/StencilManager.cpp | 182 - .../cocos/renderer/scene/StencilManager.hpp | 113 - .../renderer/scene/assembler/Assembler.cpp | 264 - .../renderer/scene/assembler/Assembler.hpp | 207 - .../scene/assembler/AssemblerBase.cpp | 67 - .../scene/assembler/AssemblerBase.hpp | 146 - .../scene/assembler/AssemblerSprite.cpp | 158 - .../scene/assembler/AssemblerSprite.hpp | 48 - .../scene/assembler/CustomAssembler.cpp | 133 - .../scene/assembler/CustomAssembler.hpp | 133 - .../scene/assembler/MaskAssembler.cpp | 90 - .../scene/assembler/MaskAssembler.hpp | 62 - .../scene/assembler/MeshAssembler.cpp | 69 - .../scene/assembler/MeshAssembler.hpp | 48 - .../renderer/scene/assembler/RenderData.cpp | 126 - .../renderer/scene/assembler/RenderData.hpp | 66 - .../scene/assembler/RenderDataList.cpp | 63 - .../scene/assembler/RenderDataList.hpp | 68 - .../scene/assembler/SimpleSprite2D.cpp | 103 - .../scene/assembler/SimpleSprite2D.hpp | 39 - .../scene/assembler/SimpleSprite3D.cpp | 80 - .../scene/assembler/SimpleSprite3D.hpp | 39 - .../scene/assembler/SlicedSprite2D.cpp | 57 - .../scene/assembler/SlicedSprite2D.hpp | 39 - .../scene/assembler/SlicedSprite3D.cpp | 57 - .../scene/assembler/SlicedSprite3D.hpp | 39 - .../scene/assembler/TiledMapAssembler.cpp | 88 - .../scene/assembler/TiledMapAssembler.hpp | 49 - native/cocos/renderer/scene/scene-bindings.h | 42 - native/cocos/renderer/soa-mgr/CMakeLists.txt | 39 + .../cocos/renderer/soa-mgr/SceneManager.cpp | 154 + native/cocos/renderer/soa-mgr/SceneManager.h | 34 + .../renderer/soa-mgr/SceneMemManager.cpp | 200 + .../cocos/renderer/soa-mgr/SceneMemManager.h | 61 + .../cocos/renderer/soa-mgr/SoAMemManager.cpp | 494 + native/cocos/renderer/soa-mgr/SoAMemManager.h | 176 + native/cocos/renderer/soa-mgr/Transform.cpp | 2 + native/cocos/renderer/soa-mgr/Transform.h | 356 + native/cocos/renderer/soa-mgr/build/build.sh | 38 + .../renderer/soa-mgr/build/libtransform.so | Bin 0 -> 194076 bytes .../cocos/renderer/soa-mgr/build/transform.js | 4017 ++++ .../renderer/soa-mgr/build/transform.wasm | Bin 0 -> 168555 bytes native/cocos/renderer/soa-mgr/core/CoreDef.h | 387 + .../cocos/renderer/soa-mgr/core/CoreStd.cpp | 1 + native/cocos/renderer/soa-mgr/core/CoreStd.h | 57 + native/cocos/renderer/soa-mgr/core/TypeDef.h | 67 + native/cocos/renderer/soa-mgr/math/Mat4-inl.h | 1249 ++ native/cocos/renderer/soa-mgr/math/Mat4.cpp | 42 + native/cocos/renderer/soa-mgr/math/Mat4.h | 155 + .../cocos/renderer/soa-mgr/math/MathLib.cpp | 228 + native/cocos/renderer/soa-mgr/math/MathLib.h | 761 + native/cocos/renderer/soa-mgr/math/Quat-inl.h | 1052 + native/cocos/renderer/soa-mgr/math/Quat.cpp | 39 + native/cocos/renderer/soa-mgr/math/Quat.h | 165 + native/cocos/renderer/soa-mgr/math/Vec2-inl.h | 463 + native/cocos/renderer/soa-mgr/math/Vec2.cpp | 37 + native/cocos/renderer/soa-mgr/math/Vec2.h | 152 + native/cocos/renderer/soa-mgr/math/Vec3-inl.h | 625 + native/cocos/renderer/soa-mgr/math/Vec3.cpp | 106 + native/cocos/renderer/soa-mgr/math/Vec3.h | 174 + native/cocos/renderer/soa-mgr/math/Vec4-inl.h | 555 + native/cocos/renderer/soa-mgr/math/Vec4.cpp | 47 + native/cocos/renderer/soa-mgr/math/Vec4.h | 167 + native/cocos/renderer/soa-mgr/soa.idl | 113 + .../renderer/soa-mgr/soa/C/SoABoolMask-inl.h | 19 + .../renderer/soa-mgr/soa/C/SoABoolMask.cpp | 2 + .../renderer/soa-mgr/soa/C/SoABoolMask.h | 39 + .../renderer/soa-mgr/soa/C/SoAMat4-inl.h | 247 + .../cocos/renderer/soa-mgr/soa/C/SoAMat4.cpp | 12 + native/cocos/renderer/soa-mgr/soa/C/SoAMat4.h | 141 + .../renderer/soa-mgr/soa/C/SoAMathLib.cpp | 24 + .../cocos/renderer/soa-mgr/soa/C/SoAMathLib.h | 455 + .../renderer/soa-mgr/soa/C/SoAQuat-inl.h | 404 + .../cocos/renderer/soa-mgr/soa/C/SoAQuat.cpp | 9 + native/cocos/renderer/soa-mgr/soa/C/SoAQuat.h | 161 + .../renderer/soa-mgr/soa/C/SoAVec3-inl.h | 291 + .../cocos/renderer/soa-mgr/soa/C/SoAVec3.cpp | 15 + native/cocos/renderer/soa-mgr/soa/C/SoAVec3.h | 234 + native/cocos/renderer/soa-mgr/soa/SoADef.h | 176 + native/cocos/renderer/soa-mgr/soa/SoAMath.h | 11 + .../auto/jsb_cocos2dx_dragonbones_auto.cpp | 7911 ------- .../auto/jsb_cocos2dx_dragonbones_auto.hpp | 440 - .../auto/jsb_cocos2dx_editor_support_auto.cpp | 429 - .../auto/jsb_cocos2dx_editor_support_auto.hpp | 36 - .../auto/jsb_cocos2dx_particle_auto.cpp | 1432 -- .../auto/jsb_cocos2dx_particle_auto.hpp | 35 - .../auto/jsb_cocos2dx_spine_auto.cpp | 15139 ------------- .../auto/jsb_cocos2dx_spine_auto.hpp | 992 - .../js-bindings/auto/jsb_gfx_auto.cpp | 1681 -- .../js-bindings/auto/jsb_gfx_auto.hpp | 135 - .../js-bindings/auto/jsb_renderer_auto.cpp | 4794 ---- .../js-bindings/auto/jsb_renderer_auto.hpp | 339 - .../manual/jsb_dragonbones_manual.cpp | 525 - .../manual/jsb_dragonbones_manual.hpp | 33 - .../js-bindings/manual/jsb_gfx_manual.cpp | 925 - .../js-bindings/manual/jsb_gfx_manual.hpp | 32 - .../manual/jsb_renderer_manual.cpp | 676 - .../manual/jsb_renderer_manual.hpp | 32 - .../js-bindings/manual/jsb_spine_manual.cpp | 284 - .../js-bindings/manual/jsb_spine_manual.hpp | 33 - 604 files changed, 57479 insertions(+), 105845 deletions(-) create mode 100644 native/build/cocos2d_libs.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 native/cocos/editor-support/Android.mk delete mode 100644 native/cocos/editor-support/IOBuffer.cpp delete mode 100644 native/cocos/editor-support/IOBuffer.h delete mode 100644 native/cocos/editor-support/IOTypedArray.cpp delete mode 100644 native/cocos/editor-support/IOTypedArray.h delete mode 100644 native/cocos/editor-support/MeshBuffer.cpp delete mode 100644 native/cocos/editor-support/MeshBuffer.h delete mode 100644 native/cocos/editor-support/MiddlewareMacro.h delete mode 100644 native/cocos/editor-support/MiddlewareManager.cpp delete mode 100644 native/cocos/editor-support/MiddlewareManager.h delete mode 100644 native/cocos/editor-support/TypedArrayPool.cpp delete mode 100644 native/cocos/editor-support/TypedArrayPool.h delete mode 100644 native/cocos/editor-support/dragonbones-creator-support/ArmatureCache.cpp delete mode 100644 native/cocos/editor-support/dragonbones-creator-support/ArmatureCache.h delete mode 100644 native/cocos/editor-support/dragonbones-creator-support/ArmatureCacheMgr.cpp delete mode 100644 native/cocos/editor-support/dragonbones-creator-support/ArmatureCacheMgr.h delete mode 100644 native/cocos/editor-support/dragonbones-creator-support/CCArmatureCacheDisplay.cpp delete mode 100644 native/cocos/editor-support/dragonbones-creator-support/CCArmatureCacheDisplay.h delete mode 100644 native/cocos/editor-support/dragonbones-creator-support/CCArmatureDisplay.cpp delete mode 100644 native/cocos/editor-support/dragonbones-creator-support/CCArmatureDisplay.h delete mode 100644 native/cocos/editor-support/dragonbones-creator-support/CCDragonBonesHeaders.h delete mode 100644 native/cocos/editor-support/dragonbones-creator-support/CCFactory.cpp delete mode 100644 native/cocos/editor-support/dragonbones-creator-support/CCFactory.h delete mode 100644 native/cocos/editor-support/dragonbones-creator-support/CCSlot.cpp delete mode 100644 native/cocos/editor-support/dragonbones-creator-support/CCSlot.h delete mode 100644 native/cocos/editor-support/dragonbones-creator-support/CCTextureAtlasData.cpp delete mode 100644 native/cocos/editor-support/dragonbones-creator-support/CCTextureAtlasData.h delete mode 100644 native/cocos/editor-support/dragonbones/DragonBonesHeaders.h delete mode 100644 native/cocos/editor-support/dragonbones/animation/Animation.cpp delete mode 100644 native/cocos/editor-support/dragonbones/animation/Animation.h delete mode 100644 native/cocos/editor-support/dragonbones/animation/AnimationState.cpp delete mode 100644 native/cocos/editor-support/dragonbones/animation/AnimationState.h delete mode 100644 native/cocos/editor-support/dragonbones/animation/BaseTimelineState.cpp delete mode 100644 native/cocos/editor-support/dragonbones/animation/BaseTimelineState.h delete mode 100644 native/cocos/editor-support/dragonbones/animation/IAnimatable.h delete mode 100644 native/cocos/editor-support/dragonbones/animation/TimelineState.cpp delete mode 100644 native/cocos/editor-support/dragonbones/animation/TimelineState.h delete mode 100644 native/cocos/editor-support/dragonbones/animation/WorldClock.cpp delete mode 100644 native/cocos/editor-support/dragonbones/animation/WorldClock.h delete mode 100644 native/cocos/editor-support/dragonbones/armature/Armature.cpp delete mode 100644 native/cocos/editor-support/dragonbones/armature/Armature.h delete mode 100644 native/cocos/editor-support/dragonbones/armature/Bone.cpp delete mode 100644 native/cocos/editor-support/dragonbones/armature/Bone.h delete mode 100644 native/cocos/editor-support/dragonbones/armature/Constraint.cpp delete mode 100644 native/cocos/editor-support/dragonbones/armature/Constraint.h delete mode 100644 native/cocos/editor-support/dragonbones/armature/DeformVertices.cpp delete mode 100644 native/cocos/editor-support/dragonbones/armature/DeformVertices.h delete mode 100644 native/cocos/editor-support/dragonbones/armature/IArmatureProxy.h delete mode 100644 native/cocos/editor-support/dragonbones/armature/Slot.cpp delete mode 100644 native/cocos/editor-support/dragonbones/armature/Slot.h delete mode 100644 native/cocos/editor-support/dragonbones/armature/TransformObject.cpp delete mode 100644 native/cocos/editor-support/dragonbones/armature/TransformObject.h delete mode 100644 native/cocos/editor-support/dragonbones/core/BaseObject.cpp delete mode 100644 native/cocos/editor-support/dragonbones/core/BaseObject.h delete mode 100644 native/cocos/editor-support/dragonbones/core/DragonBones.cpp delete mode 100644 native/cocos/editor-support/dragonbones/core/DragonBones.h delete mode 100644 native/cocos/editor-support/dragonbones/event/EventObject.cpp delete mode 100644 native/cocos/editor-support/dragonbones/event/EventObject.h delete mode 100644 native/cocos/editor-support/dragonbones/event/IEventDispatcher.h delete mode 100644 native/cocos/editor-support/dragonbones/factory/BaseFactory.cpp delete mode 100644 native/cocos/editor-support/dragonbones/factory/BaseFactory.h delete mode 100644 native/cocos/editor-support/dragonbones/geom/ColorTransform.h delete mode 100644 native/cocos/editor-support/dragonbones/geom/Matrix.h delete mode 100644 native/cocos/editor-support/dragonbones/geom/Point.cpp delete mode 100644 native/cocos/editor-support/dragonbones/geom/Point.h delete mode 100644 native/cocos/editor-support/dragonbones/geom/Rectangle.h delete mode 100644 native/cocos/editor-support/dragonbones/geom/Transform.cpp delete mode 100644 native/cocos/editor-support/dragonbones/geom/Transform.h delete mode 100644 native/cocos/editor-support/dragonbones/model/AnimationConfig.cpp delete mode 100644 native/cocos/editor-support/dragonbones/model/AnimationConfig.h delete mode 100644 native/cocos/editor-support/dragonbones/model/AnimationData.cpp delete mode 100644 native/cocos/editor-support/dragonbones/model/AnimationData.h delete mode 100644 native/cocos/editor-support/dragonbones/model/ArmatureData.cpp delete mode 100644 native/cocos/editor-support/dragonbones/model/ArmatureData.h delete mode 100644 native/cocos/editor-support/dragonbones/model/BoundingBoxData.cpp delete mode 100644 native/cocos/editor-support/dragonbones/model/BoundingBoxData.h delete mode 100644 native/cocos/editor-support/dragonbones/model/CanvasData.cpp delete mode 100644 native/cocos/editor-support/dragonbones/model/CanvasData.h delete mode 100644 native/cocos/editor-support/dragonbones/model/ConstraintData.cpp delete mode 100644 native/cocos/editor-support/dragonbones/model/ConstraintData.h delete mode 100644 native/cocos/editor-support/dragonbones/model/DisplayData.cpp delete mode 100644 native/cocos/editor-support/dragonbones/model/DisplayData.h delete mode 100644 native/cocos/editor-support/dragonbones/model/DragonBonesData.cpp delete mode 100644 native/cocos/editor-support/dragonbones/model/DragonBonesData.h delete mode 100644 native/cocos/editor-support/dragonbones/model/SkinData.cpp delete mode 100644 native/cocos/editor-support/dragonbones/model/SkinData.h delete mode 100644 native/cocos/editor-support/dragonbones/model/TextureAtlasData.cpp delete mode 100644 native/cocos/editor-support/dragonbones/model/TextureAtlasData.h delete mode 100644 native/cocos/editor-support/dragonbones/model/UserData.cpp delete mode 100644 native/cocos/editor-support/dragonbones/model/UserData.h delete mode 100644 native/cocos/editor-support/dragonbones/parser/BinaryDataParser.cpp delete mode 100644 native/cocos/editor-support/dragonbones/parser/BinaryDataParser.h delete mode 100644 native/cocos/editor-support/dragonbones/parser/DataParser.cpp delete mode 100644 native/cocos/editor-support/dragonbones/parser/DataParser.h delete mode 100644 native/cocos/editor-support/dragonbones/parser/JSONDataParser.cpp delete mode 100644 native/cocos/editor-support/dragonbones/parser/JSONDataParser.h delete mode 100644 native/cocos/editor-support/middleware-adapter.cpp delete mode 100644 native/cocos/editor-support/middleware-adapter.h delete mode 100644 native/cocos/editor-support/particle/ParticleSimulator.cpp delete mode 100644 native/cocos/editor-support/particle/ParticleSimulator.h delete mode 100644 native/cocos/editor-support/spine-creator-support/AttachmentVertices.cpp delete mode 100644 native/cocos/editor-support/spine-creator-support/AttachmentVertices.h delete mode 100644 native/cocos/editor-support/spine-creator-support/SkeletonAnimation.cpp delete mode 100644 native/cocos/editor-support/spine-creator-support/SkeletonAnimation.h delete mode 100644 native/cocos/editor-support/spine-creator-support/SkeletonCache.cpp delete mode 100644 native/cocos/editor-support/spine-creator-support/SkeletonCache.h delete mode 100644 native/cocos/editor-support/spine-creator-support/SkeletonCacheAnimation.cpp delete mode 100644 native/cocos/editor-support/spine-creator-support/SkeletonCacheAnimation.h delete mode 100644 native/cocos/editor-support/spine-creator-support/SkeletonCacheMgr.cpp delete mode 100644 native/cocos/editor-support/spine-creator-support/SkeletonCacheMgr.h delete mode 100644 native/cocos/editor-support/spine-creator-support/SkeletonDataMgr.cpp delete mode 100644 native/cocos/editor-support/spine-creator-support/SkeletonDataMgr.h delete mode 100644 native/cocos/editor-support/spine-creator-support/SkeletonRenderer.cpp delete mode 100644 native/cocos/editor-support/spine-creator-support/SkeletonRenderer.h delete mode 100644 native/cocos/editor-support/spine-creator-support/VertexEffectDelegate.cpp delete mode 100644 native/cocos/editor-support/spine-creator-support/VertexEffectDelegate.h delete mode 100644 native/cocos/editor-support/spine-creator-support/spine-cocos2dx.cpp delete mode 100644 native/cocos/editor-support/spine-creator-support/spine-cocos2dx.h delete mode 100644 native/cocos/editor-support/spine/Animation.cpp delete mode 100644 native/cocos/editor-support/spine/Animation.h delete mode 100644 native/cocos/editor-support/spine/AnimationState.cpp delete mode 100644 native/cocos/editor-support/spine/AnimationState.h delete mode 100644 native/cocos/editor-support/spine/AnimationStateData.cpp delete mode 100644 native/cocos/editor-support/spine/AnimationStateData.h delete mode 100644 native/cocos/editor-support/spine/Atlas.cpp delete mode 100644 native/cocos/editor-support/spine/Atlas.h delete mode 100644 native/cocos/editor-support/spine/AtlasAttachmentLoader.cpp delete mode 100644 native/cocos/editor-support/spine/AtlasAttachmentLoader.h delete mode 100644 native/cocos/editor-support/spine/Attachment.cpp delete mode 100644 native/cocos/editor-support/spine/Attachment.h delete mode 100644 native/cocos/editor-support/spine/AttachmentLoader.cpp delete mode 100644 native/cocos/editor-support/spine/AttachmentLoader.h delete mode 100644 native/cocos/editor-support/spine/AttachmentTimeline.cpp delete mode 100644 native/cocos/editor-support/spine/AttachmentTimeline.h delete mode 100644 native/cocos/editor-support/spine/AttachmentType.h delete mode 100644 native/cocos/editor-support/spine/BlendMode.h delete mode 100644 native/cocos/editor-support/spine/Bone.cpp delete mode 100644 native/cocos/editor-support/spine/Bone.h delete mode 100644 native/cocos/editor-support/spine/BoneData.cpp delete mode 100644 native/cocos/editor-support/spine/BoneData.h delete mode 100644 native/cocos/editor-support/spine/BoundingBoxAttachment.cpp delete mode 100644 native/cocos/editor-support/spine/BoundingBoxAttachment.h delete mode 100644 native/cocos/editor-support/spine/ClippingAttachment.cpp delete mode 100644 native/cocos/editor-support/spine/ClippingAttachment.h delete mode 100644 native/cocos/editor-support/spine/Color.h delete mode 100644 native/cocos/editor-support/spine/ColorTimeline.cpp delete mode 100644 native/cocos/editor-support/spine/ColorTimeline.h delete mode 100644 native/cocos/editor-support/spine/Constraint.cpp delete mode 100644 native/cocos/editor-support/spine/Constraint.h delete mode 100644 native/cocos/editor-support/spine/ContainerUtil.h delete mode 100644 native/cocos/editor-support/spine/CurveTimeline.cpp delete mode 100644 native/cocos/editor-support/spine/CurveTimeline.h delete mode 100644 native/cocos/editor-support/spine/Debug.h delete mode 100644 native/cocos/editor-support/spine/DeformTimeline.cpp delete mode 100644 native/cocos/editor-support/spine/DeformTimeline.h delete mode 100644 native/cocos/editor-support/spine/DrawOrderTimeline.cpp delete mode 100644 native/cocos/editor-support/spine/DrawOrderTimeline.h delete mode 100644 native/cocos/editor-support/spine/Event.cpp delete mode 100644 native/cocos/editor-support/spine/Event.h delete mode 100644 native/cocos/editor-support/spine/EventData.cpp delete mode 100644 native/cocos/editor-support/spine/EventData.h delete mode 100644 native/cocos/editor-support/spine/EventTimeline.cpp delete mode 100644 native/cocos/editor-support/spine/EventTimeline.h delete mode 100644 native/cocos/editor-support/spine/Extension.cpp delete mode 100644 native/cocos/editor-support/spine/Extension.h delete mode 100644 native/cocos/editor-support/spine/HasRendererObject.h delete mode 100755 native/cocos/editor-support/spine/HashMap.h delete mode 100644 native/cocos/editor-support/spine/IkConstraint.cpp delete mode 100644 native/cocos/editor-support/spine/IkConstraint.h delete mode 100644 native/cocos/editor-support/spine/IkConstraintData.cpp delete mode 100644 native/cocos/editor-support/spine/IkConstraintData.h delete mode 100644 native/cocos/editor-support/spine/IkConstraintTimeline.cpp delete mode 100644 native/cocos/editor-support/spine/IkConstraintTimeline.h delete mode 100644 native/cocos/editor-support/spine/Json.cpp delete mode 100644 native/cocos/editor-support/spine/Json.h delete mode 100644 native/cocos/editor-support/spine/LinkedMesh.cpp delete mode 100644 native/cocos/editor-support/spine/LinkedMesh.h delete mode 100644 native/cocos/editor-support/spine/MathUtil.cpp delete mode 100644 native/cocos/editor-support/spine/MathUtil.h delete mode 100644 native/cocos/editor-support/spine/MeshAttachment.cpp delete mode 100644 native/cocos/editor-support/spine/MeshAttachment.h delete mode 100644 native/cocos/editor-support/spine/MixBlend.h delete mode 100644 native/cocos/editor-support/spine/MixDirection.h delete mode 100644 native/cocos/editor-support/spine/PathAttachment.cpp delete mode 100644 native/cocos/editor-support/spine/PathAttachment.h delete mode 100644 native/cocos/editor-support/spine/PathConstraint.cpp delete mode 100644 native/cocos/editor-support/spine/PathConstraint.h delete mode 100644 native/cocos/editor-support/spine/PathConstraintData.cpp delete mode 100644 native/cocos/editor-support/spine/PathConstraintData.h delete mode 100644 native/cocos/editor-support/spine/PathConstraintMixTimeline.cpp delete mode 100644 native/cocos/editor-support/spine/PathConstraintMixTimeline.h delete mode 100644 native/cocos/editor-support/spine/PathConstraintPositionTimeline.cpp delete mode 100644 native/cocos/editor-support/spine/PathConstraintPositionTimeline.h delete mode 100644 native/cocos/editor-support/spine/PathConstraintSpacingTimeline.cpp delete mode 100644 native/cocos/editor-support/spine/PathConstraintSpacingTimeline.h delete mode 100644 native/cocos/editor-support/spine/PointAttachment.cpp delete mode 100644 native/cocos/editor-support/spine/PointAttachment.h delete mode 100644 native/cocos/editor-support/spine/Pool.h delete mode 100644 native/cocos/editor-support/spine/PositionMode.h delete mode 100644 native/cocos/editor-support/spine/RTTI.cpp delete mode 100644 native/cocos/editor-support/spine/RTTI.h delete mode 100644 native/cocos/editor-support/spine/RegionAttachment.cpp delete mode 100644 native/cocos/editor-support/spine/RegionAttachment.h delete mode 100644 native/cocos/editor-support/spine/RotateMode.h delete mode 100644 native/cocos/editor-support/spine/RotateTimeline.cpp delete mode 100644 native/cocos/editor-support/spine/RotateTimeline.h delete mode 100644 native/cocos/editor-support/spine/ScaleTimeline.cpp delete mode 100644 native/cocos/editor-support/spine/ScaleTimeline.h delete mode 100644 native/cocos/editor-support/spine/ShearTimeline.cpp delete mode 100644 native/cocos/editor-support/spine/ShearTimeline.h delete mode 100644 native/cocos/editor-support/spine/Skeleton.cpp delete mode 100644 native/cocos/editor-support/spine/Skeleton.h delete mode 100644 native/cocos/editor-support/spine/SkeletonBinary.cpp delete mode 100644 native/cocos/editor-support/spine/SkeletonBinary.h delete mode 100644 native/cocos/editor-support/spine/SkeletonBounds.cpp delete mode 100644 native/cocos/editor-support/spine/SkeletonBounds.h delete mode 100644 native/cocos/editor-support/spine/SkeletonClipping.cpp delete mode 100644 native/cocos/editor-support/spine/SkeletonClipping.h delete mode 100644 native/cocos/editor-support/spine/SkeletonData.cpp delete mode 100644 native/cocos/editor-support/spine/SkeletonData.h delete mode 100644 native/cocos/editor-support/spine/SkeletonJson.cpp delete mode 100644 native/cocos/editor-support/spine/SkeletonJson.h delete mode 100644 native/cocos/editor-support/spine/Skin.cpp delete mode 100644 native/cocos/editor-support/spine/Skin.h delete mode 100644 native/cocos/editor-support/spine/Slot.cpp delete mode 100644 native/cocos/editor-support/spine/Slot.h delete mode 100644 native/cocos/editor-support/spine/SlotData.cpp delete mode 100644 native/cocos/editor-support/spine/SlotData.h delete mode 100644 native/cocos/editor-support/spine/SpacingMode.h delete mode 100644 native/cocos/editor-support/spine/SpineObject.cpp delete mode 100644 native/cocos/editor-support/spine/SpineObject.h delete mode 100644 native/cocos/editor-support/spine/SpineString.h delete mode 100644 native/cocos/editor-support/spine/TextureLoader.cpp delete mode 100644 native/cocos/editor-support/spine/TextureLoader.h delete mode 100644 native/cocos/editor-support/spine/Timeline.cpp delete mode 100644 native/cocos/editor-support/spine/Timeline.h delete mode 100644 native/cocos/editor-support/spine/TimelineType.h delete mode 100644 native/cocos/editor-support/spine/TransformConstraint.cpp delete mode 100644 native/cocos/editor-support/spine/TransformConstraint.h delete mode 100644 native/cocos/editor-support/spine/TransformConstraintData.cpp delete mode 100644 native/cocos/editor-support/spine/TransformConstraintData.h delete mode 100644 native/cocos/editor-support/spine/TransformConstraintTimeline.cpp delete mode 100644 native/cocos/editor-support/spine/TransformConstraintTimeline.h delete mode 100644 native/cocos/editor-support/spine/TransformMode.h delete mode 100644 native/cocos/editor-support/spine/TranslateTimeline.cpp delete mode 100644 native/cocos/editor-support/spine/TranslateTimeline.h delete mode 100644 native/cocos/editor-support/spine/Triangulator.cpp delete mode 100644 native/cocos/editor-support/spine/Triangulator.h delete mode 100644 native/cocos/editor-support/spine/TwoColorTimeline.cpp delete mode 100644 native/cocos/editor-support/spine/TwoColorTimeline.h delete mode 100644 native/cocos/editor-support/spine/Updatable.cpp delete mode 100644 native/cocos/editor-support/spine/Updatable.h delete mode 100644 native/cocos/editor-support/spine/Vector.h delete mode 100644 native/cocos/editor-support/spine/VertexAttachment.cpp delete mode 100644 native/cocos/editor-support/spine/VertexAttachment.h delete mode 100644 native/cocos/editor-support/spine/VertexEffect.cpp delete mode 100644 native/cocos/editor-support/spine/VertexEffect.h delete mode 100644 native/cocos/editor-support/spine/Vertices.h delete mode 100644 native/cocos/editor-support/spine/dll.h delete mode 100644 native/cocos/editor-support/spine/spine.h delete mode 100644 native/cocos/renderer/Macro.h delete mode 100644 native/cocos/renderer/Types.cpp delete mode 100644 native/cocos/renderer/Types.h create mode 100644 native/cocos/renderer/core/Core.h create mode 100755 native/cocos/renderer/core/CoreDef.h create mode 100644 native/cocos/renderer/core/CoreStd.cc create mode 100644 native/cocos/renderer/core/CoreStd.h create mode 100755 native/cocos/renderer/core/TypeDef.h create mode 100755 native/cocos/renderer/core/gfx/GFXBindingLayout.cc create mode 100755 native/cocos/renderer/core/gfx/GFXBindingLayout.h create mode 100755 native/cocos/renderer/core/gfx/GFXBuffer.cc create mode 100755 native/cocos/renderer/core/gfx/GFXBuffer.h create mode 100755 native/cocos/renderer/core/gfx/GFXCommandAllocator.cc create mode 100755 native/cocos/renderer/core/gfx/GFXCommandAllocator.h create mode 100755 native/cocos/renderer/core/gfx/GFXCommandBuffer.cc create mode 100755 native/cocos/renderer/core/gfx/GFXCommandBuffer.h create mode 100755 native/cocos/renderer/core/gfx/GFXContext.cc create mode 100755 native/cocos/renderer/core/gfx/GFXContext.h create mode 100755 native/cocos/renderer/core/gfx/GFXDef.cc create mode 100755 native/cocos/renderer/core/gfx/GFXDef.h create mode 100755 native/cocos/renderer/core/gfx/GFXDevice.cc create mode 100755 native/cocos/renderer/core/gfx/GFXDevice.h create mode 100755 native/cocos/renderer/core/gfx/GFXFramebuffer.cc create mode 100755 native/cocos/renderer/core/gfx/GFXFramebuffer.h create mode 100755 native/cocos/renderer/core/gfx/GFXInputAssembler.cc create mode 100755 native/cocos/renderer/core/gfx/GFXInputAssembler.h create mode 100755 native/cocos/renderer/core/gfx/GFXPipelineLayout.cc create mode 100755 native/cocos/renderer/core/gfx/GFXPipelineLayout.h create mode 100755 native/cocos/renderer/core/gfx/GFXPipelineState.cc create mode 100755 native/cocos/renderer/core/gfx/GFXPipelineState.h create mode 100755 native/cocos/renderer/core/gfx/GFXQueue.cc create mode 100755 native/cocos/renderer/core/gfx/GFXQueue.h create mode 100755 native/cocos/renderer/core/gfx/GFXRenderPass.cc create mode 100755 native/cocos/renderer/core/gfx/GFXRenderPass.h create mode 100755 native/cocos/renderer/core/gfx/GFXSampler.cc create mode 100755 native/cocos/renderer/core/gfx/GFXSampler.h create mode 100755 native/cocos/renderer/core/gfx/GFXShader.cc create mode 100755 native/cocos/renderer/core/gfx/GFXShader.h create mode 100755 native/cocos/renderer/core/gfx/GFXTexture.cc create mode 100755 native/cocos/renderer/core/gfx/GFXTexture.h create mode 100755 native/cocos/renderer/core/gfx/GFXTextureView.cc create mode 100755 native/cocos/renderer/core/gfx/GFXTextureView.h create mode 100755 native/cocos/renderer/core/gfx/GFXWindow.cc create mode 100755 native/cocos/renderer/core/gfx/GFXWindow.h create mode 100755 native/cocos/renderer/core/kernel/Assertion.cc create mode 100755 native/cocos/renderer/core/kernel/CachedArray.h create mode 100755 native/cocos/renderer/core/kernel/Log.cc create mode 100755 native/cocos/renderer/core/kernel/Log.h create mode 100755 native/cocos/renderer/core/kernel/Object.h create mode 100755 native/cocos/renderer/core/kernel/UTFString.cc create mode 100755 native/cocos/renderer/core/kernel/UTFString.h create mode 100755 native/cocos/renderer/core/kernel/assertion.h create mode 100755 native/cocos/renderer/core/math/CCMath.cc create mode 100755 native/cocos/renderer/core/math/CCMath.h create mode 100755 native/cocos/renderer/core/memory/AllocatedObj.cc create mode 100755 native/cocos/renderer/core/memory/AllocatedObj.h create mode 100755 native/cocos/renderer/core/memory/JeAlloc.cc create mode 100755 native/cocos/renderer/core/memory/JeAlloc.h create mode 100755 native/cocos/renderer/core/memory/MemDef.h create mode 100755 native/cocos/renderer/core/memory/MemTracker.cc create mode 100755 native/cocos/renderer/core/memory/MemTracker.h create mode 100755 native/cocos/renderer/core/memory/Memory.cc create mode 100755 native/cocos/renderer/core/memory/Memory.h create mode 100755 native/cocos/renderer/core/memory/NedPooling.cc create mode 100755 native/cocos/renderer/core/memory/NedPooling.h create mode 100755 native/cocos/renderer/core/memory/StdAlloc.h create mode 100755 native/cocos/renderer/core/memory/StlAlloc.h create mode 100755 native/cocos/renderer/core/util/StringUtil.cc create mode 100755 native/cocos/renderer/core/util/StringUtil.h create mode 100644 native/cocos/renderer/gfx-gl/GLStd.cpp create mode 100644 native/cocos/renderer/gfx-gl/GLStd.h create mode 100644 native/cocos/renderer/gfx-gl/gl/glew.h create mode 100644 native/cocos/renderer/gfx-gl/gl/wglew.h create mode 100644 native/cocos/renderer/gfx-gles2/GFXGLES2.h create mode 100644 native/cocos/renderer/gfx-gles2/GLES2BindingLayout.cc create mode 100644 native/cocos/renderer/gfx-gles2/GLES2BindingLayout.h create mode 100644 native/cocos/renderer/gfx-gles2/GLES2Buffer.cc create mode 100644 native/cocos/renderer/gfx-gles2/GLES2Buffer.h create mode 100644 native/cocos/renderer/gfx-gles2/GLES2CommandAllocator.cc create mode 100644 native/cocos/renderer/gfx-gles2/GLES2CommandAllocator.h create mode 100644 native/cocos/renderer/gfx-gles2/GLES2CommandBuffer.cc create mode 100644 native/cocos/renderer/gfx-gles2/GLES2CommandBuffer.h create mode 100644 native/cocos/renderer/gfx-gles2/GLES2CommandPool.h create mode 100644 native/cocos/renderer/gfx-gles2/GLES2Commands.cc create mode 100644 native/cocos/renderer/gfx-gles2/GLES2Commands.h create mode 100644 native/cocos/renderer/gfx-gles2/GLES2Device.cc create mode 100644 native/cocos/renderer/gfx-gles2/GLES2Device.h create mode 100644 native/cocos/renderer/gfx-gles2/GLES2EGLContext.cc create mode 100644 native/cocos/renderer/gfx-gles2/GLES2EGLContext.h create mode 100644 native/cocos/renderer/gfx-gles2/GLES2Framebuffer.cc create mode 100644 native/cocos/renderer/gfx-gles2/GLES2Framebuffer.h create mode 100644 native/cocos/renderer/gfx-gles2/GLES2GPUObjects.h create mode 100644 native/cocos/renderer/gfx-gles2/GLES2InputAssembler.cc create mode 100644 native/cocos/renderer/gfx-gles2/GLES2InputAssembler.h create mode 100644 native/cocos/renderer/gfx-gles2/GLES2PipelineLayout.cc create mode 100644 native/cocos/renderer/gfx-gles2/GLES2PipelineLayout.h create mode 100644 native/cocos/renderer/gfx-gles2/GLES2PipelineState.cc create mode 100644 native/cocos/renderer/gfx-gles2/GLES2PipelineState.h create mode 100644 native/cocos/renderer/gfx-gles2/GLES2Queue.cc create mode 100644 native/cocos/renderer/gfx-gles2/GLES2Queue.h create mode 100644 native/cocos/renderer/gfx-gles2/GLES2RenderPass.cc create mode 100644 native/cocos/renderer/gfx-gles2/GLES2RenderPass.h create mode 100644 native/cocos/renderer/gfx-gles2/GLES2Sampler.cc create mode 100644 native/cocos/renderer/gfx-gles2/GLES2Sampler.h create mode 100644 native/cocos/renderer/gfx-gles2/GLES2Shader.cc create mode 100644 native/cocos/renderer/gfx-gles2/GLES2Shader.h create mode 100644 native/cocos/renderer/gfx-gles2/GLES2StateCache.h create mode 100644 native/cocos/renderer/gfx-gles2/GLES2Std.cc create mode 100644 native/cocos/renderer/gfx-gles2/GLES2Std.h create mode 100644 native/cocos/renderer/gfx-gles2/GLES2Texture.cc create mode 100644 native/cocos/renderer/gfx-gles2/GLES2Texture.h create mode 100644 native/cocos/renderer/gfx-gles2/GLES2TextureView.cc create mode 100644 native/cocos/renderer/gfx-gles2/GLES2TextureView.h create mode 100644 native/cocos/renderer/gfx-gles2/GLES2Window.cc create mode 100644 native/cocos/renderer/gfx-gles2/GLES2Window.h create mode 100755 native/cocos/renderer/gfx-gles2/gles2w.c create mode 100755 native/cocos/renderer/gfx-gles2/gles2w.h create mode 100755 native/cocos/renderer/gfx-gles2/gles2w.mm create mode 100644 native/cocos/renderer/gfx-gles3/GFXGLES3.h create mode 100644 native/cocos/renderer/gfx-gles3/GLES3BindingLayout.cc create mode 100644 native/cocos/renderer/gfx-gles3/GLES3BindingLayout.h create mode 100644 native/cocos/renderer/gfx-gles3/GLES3Buffer.cc create mode 100644 native/cocos/renderer/gfx-gles3/GLES3Buffer.h create mode 100644 native/cocos/renderer/gfx-gles3/GLES3CommandAllocator.cc create mode 100644 native/cocos/renderer/gfx-gles3/GLES3CommandAllocator.h create mode 100644 native/cocos/renderer/gfx-gles3/GLES3CommandBuffer.cc create mode 100644 native/cocos/renderer/gfx-gles3/GLES3CommandBuffer.h create mode 100644 native/cocos/renderer/gfx-gles3/GLES3CommandPool.h create mode 100644 native/cocos/renderer/gfx-gles3/GLES3Commands.cc create mode 100644 native/cocos/renderer/gfx-gles3/GLES3Commands.h create mode 100644 native/cocos/renderer/gfx-gles3/GLES3Device.cc create mode 100644 native/cocos/renderer/gfx-gles3/GLES3Device.h create mode 100644 native/cocos/renderer/gfx-gles3/GLES3EGLContext.cc create mode 100644 native/cocos/renderer/gfx-gles3/GLES3EGLContext.h create mode 100644 native/cocos/renderer/gfx-gles3/GLES3Framebuffer.cc create mode 100644 native/cocos/renderer/gfx-gles3/GLES3Framebuffer.h create mode 100644 native/cocos/renderer/gfx-gles3/GLES3GPUObjects.h create mode 100644 native/cocos/renderer/gfx-gles3/GLES3InputAssembler.cc create mode 100644 native/cocos/renderer/gfx-gles3/GLES3InputAssembler.h create mode 100644 native/cocos/renderer/gfx-gles3/GLES3PipelineLayout.cc create mode 100644 native/cocos/renderer/gfx-gles3/GLES3PipelineLayout.h create mode 100644 native/cocos/renderer/gfx-gles3/GLES3PipelineState.cc create mode 100644 native/cocos/renderer/gfx-gles3/GLES3PipelineState.h create mode 100644 native/cocos/renderer/gfx-gles3/GLES3Queue.cc create mode 100644 native/cocos/renderer/gfx-gles3/GLES3Queue.h create mode 100644 native/cocos/renderer/gfx-gles3/GLES3RenderPass.cc create mode 100644 native/cocos/renderer/gfx-gles3/GLES3RenderPass.h create mode 100644 native/cocos/renderer/gfx-gles3/GLES3Sampler.cc create mode 100644 native/cocos/renderer/gfx-gles3/GLES3Sampler.h create mode 100644 native/cocos/renderer/gfx-gles3/GLES3Shader.cc create mode 100644 native/cocos/renderer/gfx-gles3/GLES3Shader.h create mode 100644 native/cocos/renderer/gfx-gles3/GLES3StateCache.h create mode 100644 native/cocos/renderer/gfx-gles3/GLES3Std.cc create mode 100644 native/cocos/renderer/gfx-gles3/GLES3Std.h create mode 100644 native/cocos/renderer/gfx-gles3/GLES3Texture.cc create mode 100644 native/cocos/renderer/gfx-gles3/GLES3Texture.h create mode 100644 native/cocos/renderer/gfx-gles3/GLES3TextureView.cc create mode 100644 native/cocos/renderer/gfx-gles3/GLES3TextureView.h create mode 100644 native/cocos/renderer/gfx-gles3/GLES3Window.cc create mode 100644 native/cocos/renderer/gfx-gles3/GLES3Window.h create mode 100755 native/cocos/renderer/gfx-gles3/gles3w.c create mode 100755 native/cocos/renderer/gfx-gles3/gles3w.h create mode 100755 native/cocos/renderer/gfx-gles3/gles3w.mm create mode 100644 native/cocos/renderer/gfx-metal/MTLbuffer.h create mode 100644 native/cocos/renderer/gfx-metal/MTLbuffer.mm create mode 100644 native/cocos/renderer/gfx-metal/MetalStd.h create mode 100644 native/cocos/renderer/gfx-metal/MetalStd.mm delete mode 100644 native/cocos/renderer/gfx/DeviceGraphics.cpp delete mode 100644 native/cocos/renderer/gfx/DeviceGraphics.h delete mode 100644 native/cocos/renderer/gfx/FrameBuffer.cpp delete mode 100644 native/cocos/renderer/gfx/FrameBuffer.h delete mode 100644 native/cocos/renderer/gfx/GFX.cpp delete mode 100644 native/cocos/renderer/gfx/GFX.h delete mode 100644 native/cocos/renderer/gfx/GFXUtils.cpp delete mode 100644 native/cocos/renderer/gfx/GFXUtils.h delete mode 100644 native/cocos/renderer/gfx/GraphicsHandle.cpp delete mode 100644 native/cocos/renderer/gfx/GraphicsHandle.h delete mode 100644 native/cocos/renderer/gfx/IndexBuffer.cpp delete mode 100644 native/cocos/renderer/gfx/IndexBuffer.h delete mode 100644 native/cocos/renderer/gfx/Program.cpp delete mode 100644 native/cocos/renderer/gfx/Program.h delete mode 100644 native/cocos/renderer/gfx/RenderBuffer.cpp delete mode 100644 native/cocos/renderer/gfx/RenderBuffer.h delete mode 100644 native/cocos/renderer/gfx/RenderTarget.cpp delete mode 100644 native/cocos/renderer/gfx/RenderTarget.h delete mode 100644 native/cocos/renderer/gfx/State.cpp delete mode 100644 native/cocos/renderer/gfx/State.h delete mode 100644 native/cocos/renderer/gfx/Texture.cpp delete mode 100644 native/cocos/renderer/gfx/Texture.h delete mode 100644 native/cocos/renderer/gfx/Texture2D.cpp delete mode 100644 native/cocos/renderer/gfx/Texture2D.h delete mode 100644 native/cocos/renderer/gfx/VertexBuffer.cpp delete mode 100644 native/cocos/renderer/gfx/VertexBuffer.h delete mode 100644 native/cocos/renderer/gfx/VertexFormat.cpp delete mode 100644 native/cocos/renderer/gfx/VertexFormat.h delete mode 100644 native/cocos/renderer/memop/RecyclePool.hpp delete mode 100644 native/cocos/renderer/renderer/BaseRenderer.cpp delete mode 100644 native/cocos/renderer/renderer/BaseRenderer.h delete mode 100644 native/cocos/renderer/renderer/Camera.cpp delete mode 100644 native/cocos/renderer/renderer/Camera.h delete mode 100644 native/cocos/renderer/renderer/Config.cpp delete mode 100644 native/cocos/renderer/renderer/Config.h delete mode 100644 native/cocos/renderer/renderer/CustomProperties.cpp delete mode 100644 native/cocos/renderer/renderer/CustomProperties.hpp delete mode 100644 native/cocos/renderer/renderer/Effect.cpp delete mode 100644 native/cocos/renderer/renderer/Effect.h delete mode 100644 native/cocos/renderer/renderer/ForwardRenderer.cpp delete mode 100644 native/cocos/renderer/renderer/ForwardRenderer.h delete mode 100644 native/cocos/renderer/renderer/INode.h delete mode 100644 native/cocos/renderer/renderer/InputAssembler.cpp delete mode 100644 native/cocos/renderer/renderer/InputAssembler.h delete mode 100644 native/cocos/renderer/renderer/Light.cpp delete mode 100644 native/cocos/renderer/renderer/Light.h delete mode 100644 native/cocos/renderer/renderer/Model.cpp delete mode 100644 native/cocos/renderer/renderer/Model.h delete mode 100644 native/cocos/renderer/renderer/Pass.cpp delete mode 100644 native/cocos/renderer/renderer/Pass.h delete mode 100644 native/cocos/renderer/renderer/ProgramLib.cpp delete mode 100644 native/cocos/renderer/renderer/ProgramLib.h delete mode 100644 native/cocos/renderer/renderer/Renderer.h delete mode 100644 native/cocos/renderer/renderer/RendererUtils.cpp delete mode 100644 native/cocos/renderer/renderer/RendererUtils.h delete mode 100644 native/cocos/renderer/renderer/Scene.cpp delete mode 100644 native/cocos/renderer/renderer/Scene.h delete mode 100644 native/cocos/renderer/renderer/Technique.cpp delete mode 100644 native/cocos/renderer/renderer/Technique.h delete mode 100644 native/cocos/renderer/renderer/View.cpp delete mode 100644 native/cocos/renderer/renderer/View.h delete mode 100644 native/cocos/renderer/scene/MemPool.cpp delete mode 100644 native/cocos/renderer/scene/MemPool.hpp delete mode 100644 native/cocos/renderer/scene/MeshBuffer.cpp delete mode 100644 native/cocos/renderer/scene/MeshBuffer.hpp delete mode 100644 native/cocos/renderer/scene/ModelBatcher.cpp delete mode 100644 native/cocos/renderer/scene/ModelBatcher.hpp delete mode 100644 native/cocos/renderer/scene/NodeMemPool.cpp delete mode 100644 native/cocos/renderer/scene/NodeMemPool.hpp delete mode 100644 native/cocos/renderer/scene/NodeProxy.cpp delete mode 100644 native/cocos/renderer/scene/NodeProxy.hpp delete mode 100644 native/cocos/renderer/scene/ParallelTask.cpp delete mode 100644 native/cocos/renderer/scene/ParallelTask.hpp delete mode 100644 native/cocos/renderer/scene/RenderFlow.cpp delete mode 100644 native/cocos/renderer/scene/RenderFlow.hpp delete mode 100644 native/cocos/renderer/scene/StencilManager.cpp delete mode 100644 native/cocos/renderer/scene/StencilManager.hpp delete mode 100644 native/cocos/renderer/scene/assembler/Assembler.cpp delete mode 100644 native/cocos/renderer/scene/assembler/Assembler.hpp delete mode 100644 native/cocos/renderer/scene/assembler/AssemblerBase.cpp delete mode 100644 native/cocos/renderer/scene/assembler/AssemblerBase.hpp delete mode 100644 native/cocos/renderer/scene/assembler/AssemblerSprite.cpp delete mode 100644 native/cocos/renderer/scene/assembler/AssemblerSprite.hpp delete mode 100644 native/cocos/renderer/scene/assembler/CustomAssembler.cpp delete mode 100644 native/cocos/renderer/scene/assembler/CustomAssembler.hpp delete mode 100644 native/cocos/renderer/scene/assembler/MaskAssembler.cpp delete mode 100644 native/cocos/renderer/scene/assembler/MaskAssembler.hpp delete mode 100644 native/cocos/renderer/scene/assembler/MeshAssembler.cpp delete mode 100644 native/cocos/renderer/scene/assembler/MeshAssembler.hpp delete mode 100644 native/cocos/renderer/scene/assembler/RenderData.cpp delete mode 100644 native/cocos/renderer/scene/assembler/RenderData.hpp delete mode 100644 native/cocos/renderer/scene/assembler/RenderDataList.cpp delete mode 100644 native/cocos/renderer/scene/assembler/RenderDataList.hpp delete mode 100644 native/cocos/renderer/scene/assembler/SimpleSprite2D.cpp delete mode 100644 native/cocos/renderer/scene/assembler/SimpleSprite2D.hpp delete mode 100644 native/cocos/renderer/scene/assembler/SimpleSprite3D.cpp delete mode 100644 native/cocos/renderer/scene/assembler/SimpleSprite3D.hpp delete mode 100644 native/cocos/renderer/scene/assembler/SlicedSprite2D.cpp delete mode 100644 native/cocos/renderer/scene/assembler/SlicedSprite2D.hpp delete mode 100644 native/cocos/renderer/scene/assembler/SlicedSprite3D.cpp delete mode 100644 native/cocos/renderer/scene/assembler/SlicedSprite3D.hpp delete mode 100644 native/cocos/renderer/scene/assembler/TiledMapAssembler.cpp delete mode 100644 native/cocos/renderer/scene/assembler/TiledMapAssembler.hpp delete mode 100644 native/cocos/renderer/scene/scene-bindings.h create mode 100644 native/cocos/renderer/soa-mgr/CMakeLists.txt create mode 100644 native/cocos/renderer/soa-mgr/SceneManager.cpp create mode 100644 native/cocos/renderer/soa-mgr/SceneManager.h create mode 100644 native/cocos/renderer/soa-mgr/SceneMemManager.cpp create mode 100644 native/cocos/renderer/soa-mgr/SceneMemManager.h create mode 100644 native/cocos/renderer/soa-mgr/SoAMemManager.cpp create mode 100644 native/cocos/renderer/soa-mgr/SoAMemManager.h create mode 100644 native/cocos/renderer/soa-mgr/Transform.cpp create mode 100644 native/cocos/renderer/soa-mgr/Transform.h create mode 100755 native/cocos/renderer/soa-mgr/build/build.sh create mode 100644 native/cocos/renderer/soa-mgr/build/libtransform.so create mode 100644 native/cocos/renderer/soa-mgr/build/transform.js create mode 100644 native/cocos/renderer/soa-mgr/build/transform.wasm create mode 100644 native/cocos/renderer/soa-mgr/core/CoreDef.h create mode 100644 native/cocos/renderer/soa-mgr/core/CoreStd.cpp create mode 100644 native/cocos/renderer/soa-mgr/core/CoreStd.h create mode 100644 native/cocos/renderer/soa-mgr/core/TypeDef.h create mode 100644 native/cocos/renderer/soa-mgr/math/Mat4-inl.h create mode 100644 native/cocos/renderer/soa-mgr/math/Mat4.cpp create mode 100644 native/cocos/renderer/soa-mgr/math/Mat4.h create mode 100644 native/cocos/renderer/soa-mgr/math/MathLib.cpp create mode 100644 native/cocos/renderer/soa-mgr/math/MathLib.h create mode 100644 native/cocos/renderer/soa-mgr/math/Quat-inl.h create mode 100644 native/cocos/renderer/soa-mgr/math/Quat.cpp create mode 100644 native/cocos/renderer/soa-mgr/math/Quat.h create mode 100644 native/cocos/renderer/soa-mgr/math/Vec2-inl.h create mode 100644 native/cocos/renderer/soa-mgr/math/Vec2.cpp create mode 100644 native/cocos/renderer/soa-mgr/math/Vec2.h create mode 100644 native/cocos/renderer/soa-mgr/math/Vec3-inl.h create mode 100644 native/cocos/renderer/soa-mgr/math/Vec3.cpp create mode 100644 native/cocos/renderer/soa-mgr/math/Vec3.h create mode 100644 native/cocos/renderer/soa-mgr/math/Vec4-inl.h create mode 100644 native/cocos/renderer/soa-mgr/math/Vec4.cpp create mode 100644 native/cocos/renderer/soa-mgr/math/Vec4.h create mode 100644 native/cocos/renderer/soa-mgr/soa.idl create mode 100644 native/cocos/renderer/soa-mgr/soa/C/SoABoolMask-inl.h create mode 100644 native/cocos/renderer/soa-mgr/soa/C/SoABoolMask.cpp create mode 100644 native/cocos/renderer/soa-mgr/soa/C/SoABoolMask.h create mode 100644 native/cocos/renderer/soa-mgr/soa/C/SoAMat4-inl.h create mode 100644 native/cocos/renderer/soa-mgr/soa/C/SoAMat4.cpp create mode 100644 native/cocos/renderer/soa-mgr/soa/C/SoAMat4.h create mode 100644 native/cocos/renderer/soa-mgr/soa/C/SoAMathLib.cpp create mode 100644 native/cocos/renderer/soa-mgr/soa/C/SoAMathLib.h create mode 100644 native/cocos/renderer/soa-mgr/soa/C/SoAQuat-inl.h create mode 100644 native/cocos/renderer/soa-mgr/soa/C/SoAQuat.cpp create mode 100644 native/cocos/renderer/soa-mgr/soa/C/SoAQuat.h create mode 100644 native/cocos/renderer/soa-mgr/soa/C/SoAVec3-inl.h create mode 100644 native/cocos/renderer/soa-mgr/soa/C/SoAVec3.cpp create mode 100644 native/cocos/renderer/soa-mgr/soa/C/SoAVec3.h create mode 100644 native/cocos/renderer/soa-mgr/soa/SoADef.h create mode 100644 native/cocos/renderer/soa-mgr/soa/SoAMath.h delete mode 100644 native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_dragonbones_auto.cpp delete mode 100644 native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_dragonbones_auto.hpp delete mode 100644 native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_editor_support_auto.cpp delete mode 100644 native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_editor_support_auto.hpp delete mode 100644 native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_particle_auto.cpp delete mode 100644 native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_particle_auto.hpp delete mode 100644 native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_spine_auto.cpp delete mode 100644 native/cocos/scripting/js-bindings/auto/jsb_cocos2dx_spine_auto.hpp delete mode 100644 native/cocos/scripting/js-bindings/auto/jsb_gfx_auto.cpp delete mode 100644 native/cocos/scripting/js-bindings/auto/jsb_gfx_auto.hpp delete mode 100644 native/cocos/scripting/js-bindings/auto/jsb_renderer_auto.cpp delete mode 100644 native/cocos/scripting/js-bindings/auto/jsb_renderer_auto.hpp delete mode 100644 native/cocos/scripting/js-bindings/manual/jsb_dragonbones_manual.cpp delete mode 100644 native/cocos/scripting/js-bindings/manual/jsb_dragonbones_manual.hpp delete mode 100644 native/cocos/scripting/js-bindings/manual/jsb_gfx_manual.cpp delete mode 100644 native/cocos/scripting/js-bindings/manual/jsb_gfx_manual.hpp delete mode 100644 native/cocos/scripting/js-bindings/manual/jsb_renderer_manual.cpp delete mode 100644 native/cocos/scripting/js-bindings/manual/jsb_renderer_manual.hpp delete mode 100644 native/cocos/scripting/js-bindings/manual/jsb_spine_manual.cpp delete mode 100644 native/cocos/scripting/js-bindings/manual/jsb_spine_manual.hpp diff --git a/native/build/cocos2d_libs.xcodeproj/project.pbxproj b/native/build/cocos2d_libs.xcodeproj/project.pbxproj index 532bd07a4c..72118fd0b1 100644 --- a/native/build/cocos2d_libs.xcodeproj/project.pbxproj +++ b/native/build/cocos2d_libs.xcodeproj/project.pbxproj @@ -7,622 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 0418549F228D7E5700F8DF31 /* ParticleSimulator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0418549D228D7E5700F8DF31 /* ParticleSimulator.cpp */; }; - 041854A0228D7E5700F8DF31 /* ParticleSimulator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0418549D228D7E5700F8DF31 /* ParticleSimulator.cpp */; }; - 041854A1228D7E5700F8DF31 /* ParticleSimulator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0418549E228D7E5700F8DF31 /* ParticleSimulator.h */; }; - 041854A2228D7E5700F8DF31 /* ParticleSimulator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0418549E228D7E5700F8DF31 /* ParticleSimulator.h */; }; - 041854A5228D7E7300F8DF31 /* jsb_cocos2dx_particle_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 041854A3228D7E7200F8DF31 /* jsb_cocos2dx_particle_auto.hpp */; }; - 041854A6228D7E7300F8DF31 /* jsb_cocos2dx_particle_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 041854A3228D7E7200F8DF31 /* jsb_cocos2dx_particle_auto.hpp */; }; - 041854A7228D7E7300F8DF31 /* jsb_cocos2dx_particle_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 041854A4228D7E7300F8DF31 /* jsb_cocos2dx_particle_auto.cpp */; }; - 041854A8228D7E7300F8DF31 /* jsb_cocos2dx_particle_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 041854A4228D7E7300F8DF31 /* jsb_cocos2dx_particle_auto.cpp */; }; - 042058CD22A61B340092DE5D /* RenderDataList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 042058CB22A61B340092DE5D /* RenderDataList.cpp */; }; - 042058CE22A61B340092DE5D /* RenderDataList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 042058CB22A61B340092DE5D /* RenderDataList.cpp */; }; - 042058CF22A61B340092DE5D /* RenderDataList.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 042058CC22A61B340092DE5D /* RenderDataList.hpp */; }; - 042058D022A61B340092DE5D /* RenderDataList.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 042058CC22A61B340092DE5D /* RenderDataList.hpp */; }; - 0431A06922CCA441003356C9 /* AssemblerSprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0431A06722CCA441003356C9 /* AssemblerSprite.cpp */; }; - 0431A06A22CCA441003356C9 /* AssemblerSprite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0431A06722CCA441003356C9 /* AssemblerSprite.cpp */; }; - 0431A06B22CCA441003356C9 /* AssemblerSprite.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 0431A06822CCA441003356C9 /* AssemblerSprite.hpp */; }; - 0431A06C22CCA441003356C9 /* AssemblerSprite.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 0431A06822CCA441003356C9 /* AssemblerSprite.hpp */; }; - 0431A06F22CCA7C1003356C9 /* SimpleSprite2D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0431A06D22CCA7C1003356C9 /* SimpleSprite2D.cpp */; }; - 0431A07022CCA7C1003356C9 /* SimpleSprite2D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0431A06D22CCA7C1003356C9 /* SimpleSprite2D.cpp */; }; - 0431A07122CCA7C1003356C9 /* SimpleSprite2D.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 0431A06E22CCA7C1003356C9 /* SimpleSprite2D.hpp */; }; - 0431A07222CCA7C1003356C9 /* SimpleSprite2D.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 0431A06E22CCA7C1003356C9 /* SimpleSprite2D.hpp */; }; - 04355816217EADF300B9C056 /* IOBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04355814217EADF300B9C056 /* IOBuffer.cpp */; }; - 04355817217EADF300B9C056 /* IOBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04355814217EADF300B9C056 /* IOBuffer.cpp */; }; - 04355818217EADF300B9C056 /* IOBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 04355815217EADF300B9C056 /* IOBuffer.h */; }; - 04355819217EADF300B9C056 /* IOBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 04355815217EADF300B9C056 /* IOBuffer.h */; }; - 044597F422D332D800924443 /* Extension.h in Headers */ = {isa = PBXBuildFile; fileRef = 044597F322D332D700924443 /* Extension.h */; }; - 044597F522D332D800924443 /* Extension.h in Headers */ = {isa = PBXBuildFile; fileRef = 044597F322D332D700924443 /* Extension.h */; }; - 045F672822A50A8D0033F7BD /* RenderData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 045F672622A50A8C0033F7BD /* RenderData.cpp */; }; - 045F672922A50A8D0033F7BD /* RenderData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 045F672622A50A8C0033F7BD /* RenderData.cpp */; }; - 045F672A22A50A8D0033F7BD /* RenderData.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 045F672722A50A8C0033F7BD /* RenderData.hpp */; }; - 045F672B22A50A8D0033F7BD /* RenderData.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 045F672722A50A8C0033F7BD /* RenderData.hpp */; }; - 046B688A219FA61200B33469 /* MiddlewareManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046B6888219FA61200B33469 /* MiddlewareManager.cpp */; }; - 046B688B219FA61200B33469 /* MiddlewareManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046B6888219FA61200B33469 /* MiddlewareManager.cpp */; }; - 046B688C219FA61200B33469 /* MiddlewareManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 046B6889219FA61200B33469 /* MiddlewareManager.h */; }; - 046B688D219FA61200B33469 /* MiddlewareManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 046B6889219FA61200B33469 /* MiddlewareManager.h */; }; - 046B689021A00F5600B33469 /* IOTypedArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046B688E21A00F5600B33469 /* IOTypedArray.cpp */; }; - 046B689121A00F5600B33469 /* IOTypedArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046B688E21A00F5600B33469 /* IOTypedArray.cpp */; }; - 046B689221A00F5600B33469 /* IOTypedArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 046B688F21A00F5600B33469 /* IOTypedArray.h */; }; - 046B689321A00F5600B33469 /* IOTypedArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 046B688F21A00F5600B33469 /* IOTypedArray.h */; }; - 046B689521A10D5800B33469 /* MiddlewareMacro.h in Headers */ = {isa = PBXBuildFile; fileRef = 046B689421A10D5800B33469 /* MiddlewareMacro.h */; }; - 046B689621A10D5800B33469 /* MiddlewareMacro.h in Headers */ = {isa = PBXBuildFile; fileRef = 046B689421A10D5800B33469 /* MiddlewareMacro.h */; }; - 046B68A621A292D300B33469 /* jsb_spine_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046B68A421A292D200B33469 /* jsb_spine_manual.cpp */; }; - 046B68A721A292D300B33469 /* jsb_spine_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046B68A421A292D200B33469 /* jsb_spine_manual.cpp */; }; - 046B68A821A292D300B33469 /* jsb_spine_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 046B68A521A292D200B33469 /* jsb_spine_manual.hpp */; }; - 046B68A921A292D300B33469 /* jsb_spine_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 046B68A521A292D200B33469 /* jsb_spine_manual.hpp */; }; - 046B68AC21A294B100B33469 /* jsb_cocos2dx_spine_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 046B68AA21A294B100B33469 /* jsb_cocos2dx_spine_auto.hpp */; }; - 046B68AD21A294B100B33469 /* jsb_cocos2dx_spine_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 046B68AA21A294B100B33469 /* jsb_cocos2dx_spine_auto.hpp */; }; - 046B68AE21A294B100B33469 /* jsb_cocos2dx_spine_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046B68AB21A294B100B33469 /* jsb_cocos2dx_spine_auto.cpp */; }; - 046B68AF21A294B100B33469 /* jsb_cocos2dx_spine_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046B68AB21A294B100B33469 /* jsb_cocos2dx_spine_auto.cpp */; }; - 046E06142185B37100B24E2D /* CCArmatureDisplay.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E060B2185B37000B24E2D /* CCArmatureDisplay.h */; }; - 046E06152185B37100B24E2D /* CCArmatureDisplay.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E060B2185B37000B24E2D /* CCArmatureDisplay.h */; }; - 046E06162185B37100B24E2D /* CCSlot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E060C2185B37000B24E2D /* CCSlot.cpp */; }; - 046E06172185B37100B24E2D /* CCSlot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E060C2185B37000B24E2D /* CCSlot.cpp */; }; - 046E06182185B37100B24E2D /* CCTextureAtlasData.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E060D2185B37000B24E2D /* CCTextureAtlasData.h */; }; - 046E06192185B37100B24E2D /* CCTextureAtlasData.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E060D2185B37000B24E2D /* CCTextureAtlasData.h */; }; - 046E061A2185B37100B24E2D /* CCFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E060E2185B37000B24E2D /* CCFactory.h */; }; - 046E061B2185B37100B24E2D /* CCFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E060E2185B37000B24E2D /* CCFactory.h */; }; - 046E061C2185B37100B24E2D /* CCFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E060F2185B37100B24E2D /* CCFactory.cpp */; }; - 046E061D2185B37100B24E2D /* CCFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E060F2185B37100B24E2D /* CCFactory.cpp */; }; - 046E061E2185B37100B24E2D /* CCDragonBonesHeaders.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06102185B37100B24E2D /* CCDragonBonesHeaders.h */; }; - 046E061F2185B37100B24E2D /* CCDragonBonesHeaders.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06102185B37100B24E2D /* CCDragonBonesHeaders.h */; }; - 046E06202185B37100B24E2D /* CCArmatureDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06112185B37100B24E2D /* CCArmatureDisplay.cpp */; }; - 046E06212185B37100B24E2D /* CCArmatureDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06112185B37100B24E2D /* CCArmatureDisplay.cpp */; }; - 046E06222185B37100B24E2D /* CCTextureAtlasData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06122185B37100B24E2D /* CCTextureAtlasData.cpp */; }; - 046E06232185B37100B24E2D /* CCTextureAtlasData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06122185B37100B24E2D /* CCTextureAtlasData.cpp */; }; - 046E06242185B37100B24E2D /* CCSlot.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06132185B37100B24E2D /* CCSlot.h */; }; - 046E06252185B37100B24E2D /* CCSlot.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06132185B37100B24E2D /* CCSlot.h */; }; - 046E06312185B41100B24E2D /* BaseTimelineState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06262185B40F00B24E2D /* BaseTimelineState.cpp */; }; - 046E06322185B41100B24E2D /* BaseTimelineState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06262185B40F00B24E2D /* BaseTimelineState.cpp */; }; - 046E06332185B41100B24E2D /* Animation.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06272185B41000B24E2D /* Animation.h */; }; - 046E06342185B41100B24E2D /* Animation.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06272185B41000B24E2D /* Animation.h */; }; - 046E06352185B41100B24E2D /* TimelineState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06282185B41000B24E2D /* TimelineState.cpp */; }; - 046E06362185B41100B24E2D /* TimelineState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06282185B41000B24E2D /* TimelineState.cpp */; }; - 046E06372185B41100B24E2D /* AnimationState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06292185B41000B24E2D /* AnimationState.cpp */; }; - 046E06382185B41100B24E2D /* AnimationState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06292185B41000B24E2D /* AnimationState.cpp */; }; - 046E06392185B41100B24E2D /* WorldClock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E062A2185B41000B24E2D /* WorldClock.cpp */; }; - 046E063A2185B41100B24E2D /* WorldClock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E062A2185B41000B24E2D /* WorldClock.cpp */; }; - 046E063B2185B41100B24E2D /* WorldClock.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E062B2185B41000B24E2D /* WorldClock.h */; }; - 046E063C2185B41100B24E2D /* WorldClock.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E062B2185B41000B24E2D /* WorldClock.h */; }; - 046E063D2185B41100B24E2D /* TimelineState.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E062C2185B41000B24E2D /* TimelineState.h */; }; - 046E063E2185B41100B24E2D /* TimelineState.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E062C2185B41000B24E2D /* TimelineState.h */; }; - 046E063F2185B41100B24E2D /* AnimationState.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E062D2185B41000B24E2D /* AnimationState.h */; }; - 046E06402185B41100B24E2D /* AnimationState.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E062D2185B41000B24E2D /* AnimationState.h */; }; - 046E06412185B41100B24E2D /* BaseTimelineState.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E062E2185B41000B24E2D /* BaseTimelineState.h */; }; - 046E06422185B41100B24E2D /* BaseTimelineState.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E062E2185B41000B24E2D /* BaseTimelineState.h */; }; - 046E06432185B41100B24E2D /* Animation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E062F2185B41000B24E2D /* Animation.cpp */; }; - 046E06442185B41100B24E2D /* Animation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E062F2185B41000B24E2D /* Animation.cpp */; }; - 046E06452185B41100B24E2D /* IAnimatable.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06302185B41100B24E2D /* IAnimatable.h */; }; - 046E06462185B41100B24E2D /* IAnimatable.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06302185B41100B24E2D /* IAnimatable.h */; }; - 046E06542185B41B00B24E2D /* Bone.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06472185B41A00B24E2D /* Bone.h */; }; - 046E06552185B41B00B24E2D /* Bone.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06472185B41A00B24E2D /* Bone.h */; }; - 046E06562185B41B00B24E2D /* TransformObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06482185B41A00B24E2D /* TransformObject.cpp */; }; - 046E06572185B41B00B24E2D /* TransformObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06482185B41A00B24E2D /* TransformObject.cpp */; }; - 046E06582185B41B00B24E2D /* Armature.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06492185B41A00B24E2D /* Armature.cpp */; }; - 046E06592185B41B00B24E2D /* Armature.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06492185B41A00B24E2D /* Armature.cpp */; }; - 046E065A2185B41B00B24E2D /* DeformVertices.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E064A2185B41A00B24E2D /* DeformVertices.cpp */; }; - 046E065B2185B41B00B24E2D /* DeformVertices.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E064A2185B41A00B24E2D /* DeformVertices.cpp */; }; - 046E065C2185B41B00B24E2D /* Constraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E064B2185B41A00B24E2D /* Constraint.cpp */; }; - 046E065D2185B41B00B24E2D /* Constraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E064B2185B41A00B24E2D /* Constraint.cpp */; }; - 046E065E2185B41B00B24E2D /* TransformObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E064C2185B41A00B24E2D /* TransformObject.h */; }; - 046E065F2185B41B00B24E2D /* TransformObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E064C2185B41A00B24E2D /* TransformObject.h */; }; - 046E06602185B41B00B24E2D /* DeformVertices.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E064D2185B41A00B24E2D /* DeformVertices.h */; }; - 046E06612185B41B00B24E2D /* DeformVertices.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E064D2185B41A00B24E2D /* DeformVertices.h */; }; - 046E06622185B41B00B24E2D /* Slot.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E064E2185B41A00B24E2D /* Slot.h */; }; - 046E06632185B41B00B24E2D /* Slot.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E064E2185B41A00B24E2D /* Slot.h */; }; - 046E06642185B41B00B24E2D /* Armature.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E064F2185B41A00B24E2D /* Armature.h */; }; - 046E06652185B41B00B24E2D /* Armature.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E064F2185B41A00B24E2D /* Armature.h */; }; - 046E06662185B41B00B24E2D /* Bone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06502185B41B00B24E2D /* Bone.cpp */; }; - 046E06672185B41B00B24E2D /* Bone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06502185B41B00B24E2D /* Bone.cpp */; }; - 046E06682185B41B00B24E2D /* Constraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06512185B41B00B24E2D /* Constraint.h */; }; - 046E06692185B41B00B24E2D /* Constraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06512185B41B00B24E2D /* Constraint.h */; }; - 046E066A2185B41B00B24E2D /* IArmatureProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06522185B41B00B24E2D /* IArmatureProxy.h */; }; - 046E066B2185B41B00B24E2D /* IArmatureProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06522185B41B00B24E2D /* IArmatureProxy.h */; }; - 046E066C2185B41B00B24E2D /* Slot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06532185B41B00B24E2D /* Slot.cpp */; }; - 046E066D2185B41B00B24E2D /* Slot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06532185B41B00B24E2D /* Slot.cpp */; }; - 046E06722185B42500B24E2D /* BaseObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E066E2185B42400B24E2D /* BaseObject.cpp */; }; - 046E06732185B42500B24E2D /* BaseObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E066E2185B42400B24E2D /* BaseObject.cpp */; }; - 046E06742185B42500B24E2D /* DragonBones.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E066F2185B42400B24E2D /* DragonBones.cpp */; }; - 046E06752185B42500B24E2D /* DragonBones.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E066F2185B42400B24E2D /* DragonBones.cpp */; }; - 046E06762185B42500B24E2D /* DragonBones.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06702185B42500B24E2D /* DragonBones.h */; }; - 046E06772185B42500B24E2D /* DragonBones.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06702185B42500B24E2D /* DragonBones.h */; }; - 046E06782185B42500B24E2D /* BaseObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06712185B42500B24E2D /* BaseObject.h */; }; - 046E06792185B42500B24E2D /* BaseObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06712185B42500B24E2D /* BaseObject.h */; }; - 046E067B2185B42F00B24E2D /* DragonBonesHeaders.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E067A2185B42F00B24E2D /* DragonBonesHeaders.h */; }; - 046E067C2185B42F00B24E2D /* DragonBonesHeaders.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E067A2185B42F00B24E2D /* DragonBonesHeaders.h */; }; - 046E06802185B43B00B24E2D /* IEventDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E067D2185B43B00B24E2D /* IEventDispatcher.h */; }; - 046E06812185B43B00B24E2D /* IEventDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E067D2185B43B00B24E2D /* IEventDispatcher.h */; }; - 046E06822185B43B00B24E2D /* EventObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E067E2185B43B00B24E2D /* EventObject.cpp */; }; - 046E06832185B43B00B24E2D /* EventObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E067E2185B43B00B24E2D /* EventObject.cpp */; }; - 046E06842185B43B00B24E2D /* EventObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E067F2185B43B00B24E2D /* EventObject.h */; }; - 046E06852185B43B00B24E2D /* EventObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E067F2185B43B00B24E2D /* EventObject.h */; }; - 046E06882185B44A00B24E2D /* BaseFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06862185B44A00B24E2D /* BaseFactory.cpp */; }; - 046E06892185B44A00B24E2D /* BaseFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06862185B44A00B24E2D /* BaseFactory.cpp */; }; - 046E068A2185B44A00B24E2D /* BaseFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06872185B44A00B24E2D /* BaseFactory.h */; }; - 046E068B2185B44A00B24E2D /* BaseFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06872185B44A00B24E2D /* BaseFactory.h */; }; - 046E06932185B45300B24E2D /* Rectangle.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E068C2185B45200B24E2D /* Rectangle.h */; }; - 046E06942185B45300B24E2D /* Rectangle.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E068C2185B45200B24E2D /* Rectangle.h */; }; - 046E06952185B45300B24E2D /* ColorTransform.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E068D2185B45200B24E2D /* ColorTransform.h */; }; - 046E06962185B45300B24E2D /* ColorTransform.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E068D2185B45200B24E2D /* ColorTransform.h */; }; - 046E06972185B45300B24E2D /* Transform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E068E2185B45200B24E2D /* Transform.cpp */; }; - 046E06982185B45300B24E2D /* Transform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E068E2185B45200B24E2D /* Transform.cpp */; }; - 046E06992185B45300B24E2D /* Matrix.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E068F2185B45200B24E2D /* Matrix.h */; }; - 046E069A2185B45300B24E2D /* Matrix.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E068F2185B45200B24E2D /* Matrix.h */; }; - 046E069B2185B45300B24E2D /* Point.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06902185B45300B24E2D /* Point.cpp */; }; - 046E069C2185B45300B24E2D /* Point.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06902185B45300B24E2D /* Point.cpp */; }; - 046E069D2185B45300B24E2D /* Transform.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06912185B45300B24E2D /* Transform.h */; }; - 046E069E2185B45300B24E2D /* Transform.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06912185B45300B24E2D /* Transform.h */; }; - 046E069F2185B45300B24E2D /* Point.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06922185B45300B24E2D /* Point.h */; }; - 046E06A02185B45300B24E2D /* Point.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06922185B45300B24E2D /* Point.h */; }; - 046E06B72185B49F00B24E2D /* AnimationData.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06A12185B49B00B24E2D /* AnimationData.h */; }; - 046E06B82185B49F00B24E2D /* AnimationData.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06A12185B49B00B24E2D /* AnimationData.h */; }; - 046E06B92185B49F00B24E2D /* ConstraintData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06A22185B49B00B24E2D /* ConstraintData.cpp */; }; - 046E06BA2185B49F00B24E2D /* ConstraintData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06A22185B49B00B24E2D /* ConstraintData.cpp */; }; - 046E06BB2185B49F00B24E2D /* TextureAtlasData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06A32185B49B00B24E2D /* TextureAtlasData.cpp */; }; - 046E06BC2185B49F00B24E2D /* TextureAtlasData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06A32185B49B00B24E2D /* TextureAtlasData.cpp */; }; - 046E06BD2185B49F00B24E2D /* UserData.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06A42185B49C00B24E2D /* UserData.h */; }; - 046E06BE2185B49F00B24E2D /* UserData.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06A42185B49C00B24E2D /* UserData.h */; }; - 046E06BF2185B49F00B24E2D /* BoundingBoxData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06A52185B49C00B24E2D /* BoundingBoxData.cpp */; }; - 046E06C02185B49F00B24E2D /* BoundingBoxData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06A52185B49C00B24E2D /* BoundingBoxData.cpp */; }; - 046E06C12185B49F00B24E2D /* TextureAtlasData.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06A62185B49C00B24E2D /* TextureAtlasData.h */; }; - 046E06C22185B49F00B24E2D /* TextureAtlasData.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06A62185B49C00B24E2D /* TextureAtlasData.h */; }; - 046E06C32185B49F00B24E2D /* ArmatureData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06A72185B49C00B24E2D /* ArmatureData.cpp */; }; - 046E06C42185B49F00B24E2D /* ArmatureData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06A72185B49C00B24E2D /* ArmatureData.cpp */; }; - 046E06C52185B49F00B24E2D /* AnimationConfig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06A82185B49C00B24E2D /* AnimationConfig.cpp */; }; - 046E06C62185B49F00B24E2D /* AnimationConfig.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06A82185B49C00B24E2D /* AnimationConfig.cpp */; }; - 046E06C72185B49F00B24E2D /* DisplayData.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06A92185B49C00B24E2D /* DisplayData.h */; }; - 046E06C82185B49F00B24E2D /* DisplayData.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06A92185B49C00B24E2D /* DisplayData.h */; }; - 046E06C92185B49F00B24E2D /* UserData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06AA2185B49C00B24E2D /* UserData.cpp */; }; - 046E06CA2185B49F00B24E2D /* UserData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06AA2185B49C00B24E2D /* UserData.cpp */; }; - 046E06CB2185B49F00B24E2D /* SkinData.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06AB2185B49D00B24E2D /* SkinData.h */; }; - 046E06CC2185B49F00B24E2D /* SkinData.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06AB2185B49D00B24E2D /* SkinData.h */; }; - 046E06CD2185B49F00B24E2D /* CanvasData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06AC2185B49D00B24E2D /* CanvasData.cpp */; }; - 046E06CE2185B49F00B24E2D /* CanvasData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06AC2185B49D00B24E2D /* CanvasData.cpp */; }; - 046E06CF2185B49F00B24E2D /* BoundingBoxData.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06AD2185B49D00B24E2D /* BoundingBoxData.h */; }; - 046E06D02185B49F00B24E2D /* BoundingBoxData.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06AD2185B49D00B24E2D /* BoundingBoxData.h */; }; - 046E06D12185B49F00B24E2D /* DisplayData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06AE2185B49D00B24E2D /* DisplayData.cpp */; }; - 046E06D22185B49F00B24E2D /* DisplayData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06AE2185B49D00B24E2D /* DisplayData.cpp */; }; - 046E06D32185B49F00B24E2D /* SkinData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06AF2185B49D00B24E2D /* SkinData.cpp */; }; - 046E06D42185B49F00B24E2D /* SkinData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06AF2185B49D00B24E2D /* SkinData.cpp */; }; - 046E06D52185B49F00B24E2D /* ArmatureData.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06B02185B49D00B24E2D /* ArmatureData.h */; }; - 046E06D62185B49F00B24E2D /* ArmatureData.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06B02185B49D00B24E2D /* ArmatureData.h */; }; - 046E06D72185B49F00B24E2D /* AnimationConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06B12185B49D00B24E2D /* AnimationConfig.h */; }; - 046E06D82185B49F00B24E2D /* AnimationConfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06B12185B49D00B24E2D /* AnimationConfig.h */; }; - 046E06D92185B49F00B24E2D /* CanvasData.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06B22185B49E00B24E2D /* CanvasData.h */; }; - 046E06DA2185B49F00B24E2D /* CanvasData.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06B22185B49E00B24E2D /* CanvasData.h */; }; - 046E06DB2185B49F00B24E2D /* ConstraintData.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06B32185B49E00B24E2D /* ConstraintData.h */; }; - 046E06DC2185B49F00B24E2D /* ConstraintData.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06B32185B49E00B24E2D /* ConstraintData.h */; }; - 046E06DD2185B49F00B24E2D /* AnimationData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06B42185B49E00B24E2D /* AnimationData.cpp */; }; - 046E06DE2185B49F00B24E2D /* AnimationData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06B42185B49E00B24E2D /* AnimationData.cpp */; }; - 046E06DF2185B49F00B24E2D /* DragonBonesData.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06B52185B49E00B24E2D /* DragonBonesData.h */; }; - 046E06E02185B49F00B24E2D /* DragonBonesData.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06B52185B49E00B24E2D /* DragonBonesData.h */; }; - 046E06E12185B49F00B24E2D /* DragonBonesData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06B62185B49E00B24E2D /* DragonBonesData.cpp */; }; - 046E06E22185B49F00B24E2D /* DragonBonesData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06B62185B49E00B24E2D /* DragonBonesData.cpp */; }; - 046E06E92185B4A500B24E2D /* JSONDataParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06E32185B4A500B24E2D /* JSONDataParser.cpp */; }; - 046E06EA2185B4A500B24E2D /* JSONDataParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06E32185B4A500B24E2D /* JSONDataParser.cpp */; }; - 046E06EB2185B4A500B24E2D /* DataParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06E42185B4A500B24E2D /* DataParser.cpp */; }; - 046E06EC2185B4A500B24E2D /* DataParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06E42185B4A500B24E2D /* DataParser.cpp */; }; - 046E06ED2185B4A500B24E2D /* JSONDataParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06E52185B4A500B24E2D /* JSONDataParser.h */; }; - 046E06EE2185B4A500B24E2D /* JSONDataParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06E52185B4A500B24E2D /* JSONDataParser.h */; }; - 046E06EF2185B4A500B24E2D /* BinaryDataParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06E62185B4A500B24E2D /* BinaryDataParser.cpp */; }; - 046E06F02185B4A500B24E2D /* BinaryDataParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06E62185B4A500B24E2D /* BinaryDataParser.cpp */; }; - 046E06F12185B4A500B24E2D /* BinaryDataParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06E72185B4A500B24E2D /* BinaryDataParser.h */; }; - 046E06F22185B4A500B24E2D /* BinaryDataParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06E72185B4A500B24E2D /* BinaryDataParser.h */; }; - 046E06F32185B4A500B24E2D /* DataParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06E82185B4A500B24E2D /* DataParser.h */; }; - 046E06F42185B4A500B24E2D /* DataParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06E82185B4A500B24E2D /* DataParser.h */; }; - 046E06F72189990700B24E2D /* middleware-adapter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06F52189990700B24E2D /* middleware-adapter.cpp */; }; - 046E06F82189990700B24E2D /* middleware-adapter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06F52189990700B24E2D /* middleware-adapter.cpp */; }; - 046E06F92189990700B24E2D /* middleware-adapter.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06F62189990700B24E2D /* middleware-adapter.h */; }; - 046E06FA2189990700B24E2D /* middleware-adapter.h in Headers */ = {isa = PBXBuildFile; fileRef = 046E06F62189990700B24E2D /* middleware-adapter.h */; }; - 046E06FD2189999600B24E2D /* jsb_cocos2dx_editor_support_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06FB2189999500B24E2D /* jsb_cocos2dx_editor_support_auto.cpp */; }; - 046E06FE2189999600B24E2D /* jsb_cocos2dx_editor_support_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E06FB2189999500B24E2D /* jsb_cocos2dx_editor_support_auto.cpp */; }; - 046E06FF2189999600B24E2D /* jsb_cocos2dx_editor_support_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 046E06FC2189999600B24E2D /* jsb_cocos2dx_editor_support_auto.hpp */; }; - 046E07002189999600B24E2D /* jsb_cocos2dx_editor_support_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 046E06FC2189999600B24E2D /* jsb_cocos2dx_editor_support_auto.hpp */; }; - 046E0709218B015100B24E2D /* jsb_cocos2dx_dragonbones_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E0707218B015000B24E2D /* jsb_cocos2dx_dragonbones_auto.cpp */; }; - 046E070A218B015100B24E2D /* jsb_cocos2dx_dragonbones_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E0707218B015000B24E2D /* jsb_cocos2dx_dragonbones_auto.cpp */; }; - 046E070B218B015100B24E2D /* jsb_cocos2dx_dragonbones_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 046E0708218B015000B24E2D /* jsb_cocos2dx_dragonbones_auto.hpp */; }; - 046E070C218B015100B24E2D /* jsb_cocos2dx_dragonbones_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 046E0708218B015000B24E2D /* jsb_cocos2dx_dragonbones_auto.hpp */; }; - 046E070F218B01EF00B24E2D /* jsb_dragonbones_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E070D218B01EF00B24E2D /* jsb_dragonbones_manual.cpp */; }; - 046E0710218B01EF00B24E2D /* jsb_dragonbones_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 046E070D218B01EF00B24E2D /* jsb_dragonbones_manual.cpp */; }; - 046E0711218B01EF00B24E2D /* jsb_dragonbones_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 046E070E218B01EF00B24E2D /* jsb_dragonbones_manual.hpp */; }; - 046E0712218B01EF00B24E2D /* jsb_dragonbones_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 046E070E218B01EF00B24E2D /* jsb_dragonbones_manual.hpp */; }; - 0482F199228D87970019ECF7 /* RenderFlow.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 0482F184228D87900019ECF7 /* RenderFlow.hpp */; }; - 0482F19A228D87970019ECF7 /* RenderFlow.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 0482F184228D87900019ECF7 /* RenderFlow.hpp */; }; - 0482F19B228D87970019ECF7 /* ModelBatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0482F185228D87910019ECF7 /* ModelBatcher.cpp */; }; - 0482F19C228D87970019ECF7 /* ModelBatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0482F185228D87910019ECF7 /* ModelBatcher.cpp */; }; - 0482F19D228D87970019ECF7 /* scene-bindings.h in Headers */ = {isa = PBXBuildFile; fileRef = 0482F186228D87910019ECF7 /* scene-bindings.h */; }; - 0482F19E228D87970019ECF7 /* scene-bindings.h in Headers */ = {isa = PBXBuildFile; fileRef = 0482F186228D87910019ECF7 /* scene-bindings.h */; }; - 0482F19F228D87970019ECF7 /* Assembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0482F187228D87920019ECF7 /* Assembler.cpp */; }; - 0482F1A0228D87970019ECF7 /* Assembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0482F187228D87920019ECF7 /* Assembler.cpp */; }; - 0482F1A1228D87970019ECF7 /* NodeProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0482F188228D87920019ECF7 /* NodeProxy.cpp */; }; - 0482F1A2228D87970019ECF7 /* NodeProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0482F188228D87920019ECF7 /* NodeProxy.cpp */; }; - 0482F1A3228D87970019ECF7 /* CustomAssembler.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 0482F189228D87920019ECF7 /* CustomAssembler.hpp */; }; - 0482F1A4228D87970019ECF7 /* CustomAssembler.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 0482F189228D87920019ECF7 /* CustomAssembler.hpp */; }; - 0482F1A5228D87970019ECF7 /* MeshBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0482F18A228D87920019ECF7 /* MeshBuffer.cpp */; }; - 0482F1A6228D87970019ECF7 /* MeshBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0482F18A228D87920019ECF7 /* MeshBuffer.cpp */; }; - 0482F1A7228D87970019ECF7 /* NodeProxy.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 0482F18B228D87930019ECF7 /* NodeProxy.hpp */; }; - 0482F1A8228D87970019ECF7 /* NodeProxy.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 0482F18B228D87930019ECF7 /* NodeProxy.hpp */; }; - 0482F1A9228D87970019ECF7 /* StencilManager.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 0482F18C228D87930019ECF7 /* StencilManager.hpp */; }; - 0482F1AA228D87970019ECF7 /* StencilManager.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 0482F18C228D87930019ECF7 /* StencilManager.hpp */; }; - 0482F1AB228D87970019ECF7 /* AssemblerBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0482F18D228D87930019ECF7 /* AssemblerBase.cpp */; }; - 0482F1AC228D87970019ECF7 /* AssemblerBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0482F18D228D87930019ECF7 /* AssemblerBase.cpp */; }; - 0482F1AD228D87970019ECF7 /* MaskAssembler.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 0482F18E228D87940019ECF7 /* MaskAssembler.hpp */; }; - 0482F1AE228D87970019ECF7 /* MaskAssembler.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 0482F18E228D87940019ECF7 /* MaskAssembler.hpp */; }; - 0482F1B1228D87970019ECF7 /* ModelBatcher.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 0482F190228D87940019ECF7 /* ModelBatcher.hpp */; }; - 0482F1B2228D87970019ECF7 /* ModelBatcher.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 0482F190228D87940019ECF7 /* ModelBatcher.hpp */; }; - 0482F1B3228D87970019ECF7 /* MaskAssembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0482F191228D87950019ECF7 /* MaskAssembler.cpp */; }; - 0482F1B4228D87970019ECF7 /* MaskAssembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0482F191228D87950019ECF7 /* MaskAssembler.cpp */; }; - 0482F1B5228D87970019ECF7 /* RenderFlow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0482F192228D87950019ECF7 /* RenderFlow.cpp */; }; - 0482F1B6228D87970019ECF7 /* RenderFlow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0482F192228D87950019ECF7 /* RenderFlow.cpp */; }; - 0482F1B7228D87970019ECF7 /* StencilManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0482F193228D87950019ECF7 /* StencilManager.cpp */; }; - 0482F1B8228D87970019ECF7 /* StencilManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0482F193228D87950019ECF7 /* StencilManager.cpp */; }; - 0482F1BB228D87970019ECF7 /* MeshBuffer.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 0482F195228D87960019ECF7 /* MeshBuffer.hpp */; }; - 0482F1BC228D87970019ECF7 /* MeshBuffer.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 0482F195228D87960019ECF7 /* MeshBuffer.hpp */; }; - 0482F1BD228D87970019ECF7 /* CustomAssembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0482F196228D87960019ECF7 /* CustomAssembler.cpp */; }; - 0482F1BE228D87970019ECF7 /* CustomAssembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0482F196228D87960019ECF7 /* CustomAssembler.cpp */; }; - 0482F1BF228D87970019ECF7 /* Assembler.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 0482F197228D87960019ECF7 /* Assembler.hpp */; }; - 0482F1C0228D87970019ECF7 /* Assembler.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 0482F197228D87960019ECF7 /* Assembler.hpp */; }; - 0482F1C1228D87970019ECF7 /* AssemblerBase.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 0482F198228D87970019ECF7 /* AssemblerBase.hpp */; }; - 0482F1C2228D87970019ECF7 /* AssemblerBase.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 0482F198228D87970019ECF7 /* AssemblerBase.hpp */; }; - 04886B4122CE22F2008CEB66 /* SlicedSprite2D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04886B3F22CE22F2008CEB66 /* SlicedSprite2D.cpp */; }; - 04886B4222CE22F2008CEB66 /* SlicedSprite2D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04886B3F22CE22F2008CEB66 /* SlicedSprite2D.cpp */; }; - 04886B4322CE22F2008CEB66 /* SlicedSprite2D.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 04886B4022CE22F2008CEB66 /* SlicedSprite2D.hpp */; }; - 04886B4422CE22F2008CEB66 /* SlicedSprite2D.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 04886B4022CE22F2008CEB66 /* SlicedSprite2D.hpp */; }; - 0494CFD422BEFC6D00B73B79 /* ParallelTask.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0494CFD222BEFC6D00B73B79 /* ParallelTask.cpp */; }; - 0494CFD522BEFC6D00B73B79 /* ParallelTask.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0494CFD222BEFC6D00B73B79 /* ParallelTask.cpp */; }; - 0494CFD622BEFC6D00B73B79 /* ParallelTask.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 0494CFD322BEFC6D00B73B79 /* ParallelTask.hpp */; }; - 0494CFD722BEFC6D00B73B79 /* ParallelTask.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 0494CFD322BEFC6D00B73B79 /* ParallelTask.hpp */; }; - 049B31FB2313B6240004909A /* SkeletonCacheMgr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 049B31F92313B6240004909A /* SkeletonCacheMgr.cpp */; }; - 049B31FC2313B6240004909A /* SkeletonCacheMgr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 049B31F92313B6240004909A /* SkeletonCacheMgr.cpp */; }; - 049B31FD2313B6240004909A /* SkeletonCacheMgr.h in Headers */ = {isa = PBXBuildFile; fileRef = 049B31FA2313B6240004909A /* SkeletonCacheMgr.h */; }; - 049B31FE2313B6240004909A /* SkeletonCacheMgr.h in Headers */ = {isa = PBXBuildFile; fileRef = 049B31FA2313B6240004909A /* SkeletonCacheMgr.h */; }; - 049B32072314DF1C0004909A /* SkeletonCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 049B32052314DF1C0004909A /* SkeletonCache.cpp */; }; - 049B32082314DF1C0004909A /* SkeletonCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 049B32052314DF1C0004909A /* SkeletonCache.cpp */; }; - 049B32092314DF1C0004909A /* SkeletonCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 049B32062314DF1C0004909A /* SkeletonCache.h */; }; - 049B320A2314DF1C0004909A /* SkeletonCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 049B32062314DF1C0004909A /* SkeletonCache.h */; }; - 049B320D231533BF0004909A /* SkeletonCacheAnimation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 049B320B231533BF0004909A /* SkeletonCacheAnimation.cpp */; }; - 049B320E231533BF0004909A /* SkeletonCacheAnimation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 049B320B231533BF0004909A /* SkeletonCacheAnimation.cpp */; }; - 049B320F231533BF0004909A /* SkeletonCacheAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 049B320C231533BF0004909A /* SkeletonCacheAnimation.h */; }; - 049B3210231533BF0004909A /* SkeletonCacheAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 049B320C231533BF0004909A /* SkeletonCacheAnimation.h */; }; - 04AF62FF219190ED00AED9DE /* TypedArrayPool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04AF62FD219190ED00AED9DE /* TypedArrayPool.cpp */; }; - 04AF6300219190ED00AED9DE /* TypedArrayPool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04AF62FD219190ED00AED9DE /* TypedArrayPool.cpp */; }; - 04AF6301219190ED00AED9DE /* TypedArrayPool.h in Headers */ = {isa = PBXBuildFile; fileRef = 04AF62FE219190ED00AED9DE /* TypedArrayPool.h */; }; - 04AF6302219190ED00AED9DE /* TypedArrayPool.h in Headers */ = {isa = PBXBuildFile; fileRef = 04AF62FE219190ED00AED9DE /* TypedArrayPool.h */; }; - 04DBD31522AE2D8200DBE4CD /* VertexEffectDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD30922AE2D8000DBE4CD /* VertexEffectDelegate.h */; }; - 04DBD31622AE2D8200DBE4CD /* VertexEffectDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD30922AE2D8000DBE4CD /* VertexEffectDelegate.h */; }; - 04DBD31722AE2D8200DBE4CD /* SkeletonRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD30A22AE2D8000DBE4CD /* SkeletonRenderer.h */; }; - 04DBD31822AE2D8200DBE4CD /* SkeletonRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD30A22AE2D8000DBE4CD /* SkeletonRenderer.h */; }; - 04DBD31922AE2D8200DBE4CD /* AttachmentVertices.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD30B22AE2D8000DBE4CD /* AttachmentVertices.cpp */; }; - 04DBD31A22AE2D8200DBE4CD /* AttachmentVertices.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD30B22AE2D8000DBE4CD /* AttachmentVertices.cpp */; }; - 04DBD31B22AE2D8200DBE4CD /* SkeletonAnimation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD30C22AE2D8000DBE4CD /* SkeletonAnimation.cpp */; }; - 04DBD31C22AE2D8200DBE4CD /* SkeletonAnimation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD30C22AE2D8000DBE4CD /* SkeletonAnimation.cpp */; }; - 04DBD31D22AE2D8200DBE4CD /* SkeletonAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD30D22AE2D8100DBE4CD /* SkeletonAnimation.h */; }; - 04DBD31E22AE2D8200DBE4CD /* SkeletonAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD30D22AE2D8100DBE4CD /* SkeletonAnimation.h */; }; - 04DBD31F22AE2D8200DBE4CD /* AttachmentVertices.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD30E22AE2D8100DBE4CD /* AttachmentVertices.h */; }; - 04DBD32022AE2D8200DBE4CD /* AttachmentVertices.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD30E22AE2D8100DBE4CD /* AttachmentVertices.h */; }; - 04DBD32122AE2D8200DBE4CD /* VertexEffectDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD30F22AE2D8100DBE4CD /* VertexEffectDelegate.cpp */; }; - 04DBD32222AE2D8200DBE4CD /* VertexEffectDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD30F22AE2D8100DBE4CD /* VertexEffectDelegate.cpp */; }; - 04DBD32322AE2D8200DBE4CD /* SkeletonDataMgr.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD31022AE2D8100DBE4CD /* SkeletonDataMgr.h */; }; - 04DBD32422AE2D8200DBE4CD /* SkeletonDataMgr.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD31022AE2D8100DBE4CD /* SkeletonDataMgr.h */; }; - 04DBD32522AE2D8200DBE4CD /* SkeletonRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD31122AE2D8100DBE4CD /* SkeletonRenderer.cpp */; }; - 04DBD32622AE2D8200DBE4CD /* SkeletonRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD31122AE2D8100DBE4CD /* SkeletonRenderer.cpp */; }; - 04DBD32722AE2D8200DBE4CD /* SkeletonDataMgr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD31222AE2D8100DBE4CD /* SkeletonDataMgr.cpp */; }; - 04DBD32822AE2D8200DBE4CD /* SkeletonDataMgr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD31222AE2D8100DBE4CD /* SkeletonDataMgr.cpp */; }; - 04DBD32922AE2D8200DBE4CD /* spine-cocos2dx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD31322AE2D8100DBE4CD /* spine-cocos2dx.cpp */; }; - 04DBD32A22AE2D8200DBE4CD /* spine-cocos2dx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD31322AE2D8100DBE4CD /* spine-cocos2dx.cpp */; }; - 04DBD32B22AE2D8200DBE4CD /* spine-cocos2dx.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD31422AE2D8100DBE4CD /* spine-cocos2dx.h */; }; - 04DBD32C22AE2D8200DBE4CD /* spine-cocos2dx.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD31422AE2D8100DBE4CD /* spine-cocos2dx.h */; }; - 04DBD3BB22AE2DBD00DBE4CD /* Pool.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD32D22AE2DA200DBE4CD /* Pool.h */; }; - 04DBD3BC22AE2DBD00DBE4CD /* Pool.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD32D22AE2DA200DBE4CD /* Pool.h */; }; - 04DBD3BD22AE2DBD00DBE4CD /* Attachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD32E22AE2DA200DBE4CD /* Attachment.h */; }; - 04DBD3BE22AE2DBD00DBE4CD /* Attachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD32E22AE2DA200DBE4CD /* Attachment.h */; }; - 04DBD3BF22AE2DBD00DBE4CD /* AnimationStateData.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD32F22AE2DA300DBE4CD /* AnimationStateData.h */; }; - 04DBD3C022AE2DBD00DBE4CD /* AnimationStateData.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD32F22AE2DA300DBE4CD /* AnimationStateData.h */; }; - 04DBD3C122AE2DBD00DBE4CD /* TextureLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD33022AE2DA300DBE4CD /* TextureLoader.h */; }; - 04DBD3C222AE2DBD00DBE4CD /* TextureLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD33022AE2DA300DBE4CD /* TextureLoader.h */; }; - 04DBD3C322AE2DBD00DBE4CD /* VertexEffect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD33122AE2DA300DBE4CD /* VertexEffect.cpp */; }; - 04DBD3C422AE2DBD00DBE4CD /* VertexEffect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD33122AE2DA300DBE4CD /* VertexEffect.cpp */; }; - 04DBD3C522AE2DBD00DBE4CD /* MixDirection.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD33222AE2DA300DBE4CD /* MixDirection.h */; }; - 04DBD3C622AE2DBD00DBE4CD /* MixDirection.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD33222AE2DA300DBE4CD /* MixDirection.h */; }; - 04DBD3C722AE2DBD00DBE4CD /* HasRendererObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD33322AE2DA300DBE4CD /* HasRendererObject.h */; }; - 04DBD3C822AE2DBD00DBE4CD /* HasRendererObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD33322AE2DA300DBE4CD /* HasRendererObject.h */; }; - 04DBD3C922AE2DBD00DBE4CD /* AtlasAttachmentLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD33422AE2DA300DBE4CD /* AtlasAttachmentLoader.cpp */; }; - 04DBD3CA22AE2DBD00DBE4CD /* AtlasAttachmentLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD33422AE2DA300DBE4CD /* AtlasAttachmentLoader.cpp */; }; - 04DBD3CB22AE2DBD00DBE4CD /* Atlas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD33522AE2DA300DBE4CD /* Atlas.cpp */; }; - 04DBD3CC22AE2DBD00DBE4CD /* Atlas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD33522AE2DA300DBE4CD /* Atlas.cpp */; }; - 04DBD3CD22AE2DBD00DBE4CD /* Bone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD33622AE2DA300DBE4CD /* Bone.cpp */; }; - 04DBD3CE22AE2DBD00DBE4CD /* Bone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD33622AE2DA300DBE4CD /* Bone.cpp */; }; - 04DBD3CF22AE2DBD00DBE4CD /* Triangulator.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD33722AE2DA300DBE4CD /* Triangulator.h */; }; - 04DBD3D022AE2DBD00DBE4CD /* Triangulator.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD33722AE2DA300DBE4CD /* Triangulator.h */; }; - 04DBD3D122AE2DBD00DBE4CD /* EventData.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD33822AE2DA400DBE4CD /* EventData.h */; }; - 04DBD3D222AE2DBD00DBE4CD /* EventData.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD33822AE2DA400DBE4CD /* EventData.h */; }; - 04DBD3D322AE2DBD00DBE4CD /* RotateTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD33922AE2DA400DBE4CD /* RotateTimeline.h */; }; - 04DBD3D422AE2DBD00DBE4CD /* RotateTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD33922AE2DA400DBE4CD /* RotateTimeline.h */; }; - 04DBD3D522AE2DBD00DBE4CD /* ColorTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD33A22AE2DA400DBE4CD /* ColorTimeline.h */; }; - 04DBD3D622AE2DBD00DBE4CD /* ColorTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD33A22AE2DA400DBE4CD /* ColorTimeline.h */; }; - 04DBD3D722AE2DBD00DBE4CD /* PathAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD33B22AE2DA400DBE4CD /* PathAttachment.cpp */; }; - 04DBD3D822AE2DBD00DBE4CD /* PathAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD33B22AE2DA400DBE4CD /* PathAttachment.cpp */; }; - 04DBD3D922AE2DBD00DBE4CD /* Constraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD33C22AE2DA400DBE4CD /* Constraint.h */; }; - 04DBD3DA22AE2DBD00DBE4CD /* Constraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD33C22AE2DA400DBE4CD /* Constraint.h */; }; - 04DBD3DB22AE2DBD00DBE4CD /* TranslateTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD33D22AE2DA400DBE4CD /* TranslateTimeline.h */; }; - 04DBD3DC22AE2DBD00DBE4CD /* TranslateTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD33D22AE2DA400DBE4CD /* TranslateTimeline.h */; }; - 04DBD3DD22AE2DBD00DBE4CD /* SkeletonData.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD33E22AE2DA400DBE4CD /* SkeletonData.h */; }; - 04DBD3DE22AE2DBD00DBE4CD /* SkeletonData.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD33E22AE2DA400DBE4CD /* SkeletonData.h */; }; - 04DBD3DF22AE2DBD00DBE4CD /* RotateTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD33F22AE2DA500DBE4CD /* RotateTimeline.cpp */; }; - 04DBD3E022AE2DBD00DBE4CD /* RotateTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD33F22AE2DA500DBE4CD /* RotateTimeline.cpp */; }; - 04DBD3E122AE2DBD00DBE4CD /* AttachmentTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD34022AE2DA500DBE4CD /* AttachmentTimeline.h */; }; - 04DBD3E222AE2DBD00DBE4CD /* AttachmentTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD34022AE2DA500DBE4CD /* AttachmentTimeline.h */; }; - 04DBD3E322AE2DBD00DBE4CD /* BlendMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD34122AE2DA500DBE4CD /* BlendMode.h */; }; - 04DBD3E422AE2DBD00DBE4CD /* BlendMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD34122AE2DA500DBE4CD /* BlendMode.h */; }; - 04DBD3E522AE2DBD00DBE4CD /* PointAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD34222AE2DA500DBE4CD /* PointAttachment.cpp */; }; - 04DBD3E622AE2DBD00DBE4CD /* PointAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD34222AE2DA500DBE4CD /* PointAttachment.cpp */; }; - 04DBD3E722AE2DBD00DBE4CD /* PathConstraintMixTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD34322AE2DA500DBE4CD /* PathConstraintMixTimeline.h */; }; - 04DBD3E822AE2DBD00DBE4CD /* PathConstraintMixTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD34322AE2DA500DBE4CD /* PathConstraintMixTimeline.h */; }; - 04DBD3E922AE2DBD00DBE4CD /* Debug.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD34422AE2DA500DBE4CD /* Debug.h */; }; - 04DBD3EA22AE2DBD00DBE4CD /* Debug.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD34422AE2DA500DBE4CD /* Debug.h */; }; - 04DBD3EB22AE2DBD00DBE4CD /* CurveTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD34522AE2DA600DBE4CD /* CurveTimeline.h */; }; - 04DBD3EC22AE2DBD00DBE4CD /* CurveTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD34522AE2DA600DBE4CD /* CurveTimeline.h */; }; - 04DBD3ED22AE2DBD00DBE4CD /* Timeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD34622AE2DA600DBE4CD /* Timeline.cpp */; }; - 04DBD3EE22AE2DBD00DBE4CD /* Timeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD34622AE2DA600DBE4CD /* Timeline.cpp */; }; - 04DBD3EF22AE2DBD00DBE4CD /* Extension.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD34722AE2DA600DBE4CD /* Extension.cpp */; }; - 04DBD3F022AE2DBD00DBE4CD /* Extension.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD34722AE2DA600DBE4CD /* Extension.cpp */; }; - 04DBD3F122AE2DBD00DBE4CD /* MathUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD34822AE2DA600DBE4CD /* MathUtil.h */; }; - 04DBD3F222AE2DBD00DBE4CD /* MathUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD34822AE2DA600DBE4CD /* MathUtil.h */; }; - 04DBD3F322AE2DBD00DBE4CD /* TimelineType.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD34922AE2DA600DBE4CD /* TimelineType.h */; }; - 04DBD3F422AE2DBD00DBE4CD /* TimelineType.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD34922AE2DA600DBE4CD /* TimelineType.h */; }; - 04DBD3F522AE2DBD00DBE4CD /* ClippingAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD34A22AE2DA600DBE4CD /* ClippingAttachment.h */; }; - 04DBD3F622AE2DBD00DBE4CD /* ClippingAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD34A22AE2DA600DBE4CD /* ClippingAttachment.h */; }; - 04DBD3F722AE2DBD00DBE4CD /* PathConstraintMixTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD34B22AE2DA700DBE4CD /* PathConstraintMixTimeline.cpp */; }; - 04DBD3F822AE2DBD00DBE4CD /* PathConstraintMixTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD34B22AE2DA700DBE4CD /* PathConstraintMixTimeline.cpp */; }; - 04DBD3F922AE2DBD00DBE4CD /* Event.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD34C22AE2DA700DBE4CD /* Event.h */; }; - 04DBD3FA22AE2DBD00DBE4CD /* Event.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD34C22AE2DA700DBE4CD /* Event.h */; }; - 04DBD3FB22AE2DBD00DBE4CD /* Animation.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD34D22AE2DA700DBE4CD /* Animation.h */; }; - 04DBD3FC22AE2DBD00DBE4CD /* Animation.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD34D22AE2DA700DBE4CD /* Animation.h */; }; - 04DBD3FD22AE2DBD00DBE4CD /* HashMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD34E22AE2DA700DBE4CD /* HashMap.h */; }; - 04DBD3FE22AE2DBD00DBE4CD /* HashMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD34E22AE2DA700DBE4CD /* HashMap.h */; }; - 04DBD3FF22AE2DBD00DBE4CD /* EventTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD34F22AE2DA700DBE4CD /* EventTimeline.h */; }; - 04DBD40022AE2DBD00DBE4CD /* EventTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD34F22AE2DA700DBE4CD /* EventTimeline.h */; }; - 04DBD40122AE2DBD00DBE4CD /* AtlasAttachmentLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD35022AE2DA800DBE4CD /* AtlasAttachmentLoader.h */; }; - 04DBD40222AE2DBD00DBE4CD /* AtlasAttachmentLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD35022AE2DA800DBE4CD /* AtlasAttachmentLoader.h */; }; - 04DBD40322AE2DBD00DBE4CD /* Skin.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD35122AE2DA800DBE4CD /* Skin.h */; }; - 04DBD40422AE2DBD00DBE4CD /* Skin.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD35122AE2DA800DBE4CD /* Skin.h */; }; - 04DBD40522AE2DBD00DBE4CD /* BoundingBoxAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD35222AE2DA800DBE4CD /* BoundingBoxAttachment.h */; }; - 04DBD40622AE2DBD00DBE4CD /* BoundingBoxAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD35222AE2DA800DBE4CD /* BoundingBoxAttachment.h */; }; - 04DBD40722AE2DBD00DBE4CD /* SkeletonClipping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD35322AE2DA800DBE4CD /* SkeletonClipping.cpp */; }; - 04DBD40822AE2DBD00DBE4CD /* SkeletonClipping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD35322AE2DA800DBE4CD /* SkeletonClipping.cpp */; }; - 04DBD40922AE2DBD00DBE4CD /* IkConstraintData.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD35422AE2DA800DBE4CD /* IkConstraintData.h */; }; - 04DBD40A22AE2DBD00DBE4CD /* IkConstraintData.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD35422AE2DA800DBE4CD /* IkConstraintData.h */; }; - 04DBD40B22AE2DBD00DBE4CD /* SpineString.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD35522AE2DA800DBE4CD /* SpineString.h */; }; - 04DBD40C22AE2DBD00DBE4CD /* SpineString.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD35522AE2DA800DBE4CD /* SpineString.h */; }; - 04DBD40D22AE2DBD00DBE4CD /* VertexAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD35622AE2DA900DBE4CD /* VertexAttachment.cpp */; }; - 04DBD40E22AE2DBD00DBE4CD /* VertexAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD35622AE2DA900DBE4CD /* VertexAttachment.cpp */; }; - 04DBD40F22AE2DBD00DBE4CD /* TransformConstraintTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD35722AE2DA900DBE4CD /* TransformConstraintTimeline.h */; }; - 04DBD41022AE2DBD00DBE4CD /* TransformConstraintTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD35722AE2DA900DBE4CD /* TransformConstraintTimeline.h */; }; - 04DBD41122AE2DBD00DBE4CD /* Constraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD35822AE2DA900DBE4CD /* Constraint.cpp */; }; - 04DBD41222AE2DBD00DBE4CD /* Constraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD35822AE2DA900DBE4CD /* Constraint.cpp */; }; - 04DBD41322AE2DBD00DBE4CD /* Triangulator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD35922AE2DA900DBE4CD /* Triangulator.cpp */; }; - 04DBD41422AE2DBD00DBE4CD /* Triangulator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD35922AE2DA900DBE4CD /* Triangulator.cpp */; }; - 04DBD41522AE2DBD00DBE4CD /* MathUtil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD35A22AE2DA900DBE4CD /* MathUtil.cpp */; }; - 04DBD41622AE2DBD00DBE4CD /* MathUtil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD35A22AE2DA900DBE4CD /* MathUtil.cpp */; }; - 04DBD41722AE2DBD00DBE4CD /* BoneData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD35B22AE2DAA00DBE4CD /* BoneData.cpp */; }; - 04DBD41822AE2DBD00DBE4CD /* BoneData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD35B22AE2DAA00DBE4CD /* BoneData.cpp */; }; - 04DBD41922AE2DBD00DBE4CD /* IkConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD35C22AE2DAA00DBE4CD /* IkConstraint.cpp */; }; - 04DBD41A22AE2DBD00DBE4CD /* IkConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD35C22AE2DAA00DBE4CD /* IkConstraint.cpp */; }; - 04DBD41B22AE2DBD00DBE4CD /* SlotData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD35D22AE2DAA00DBE4CD /* SlotData.cpp */; }; - 04DBD41C22AE2DBD00DBE4CD /* SlotData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD35D22AE2DAA00DBE4CD /* SlotData.cpp */; }; - 04DBD41D22AE2DBD00DBE4CD /* TextureLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD35E22AE2DAA00DBE4CD /* TextureLoader.cpp */; }; - 04DBD41E22AE2DBD00DBE4CD /* TextureLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD35E22AE2DAA00DBE4CD /* TextureLoader.cpp */; }; - 04DBD41F22AE2DBD00DBE4CD /* Animation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD35F22AE2DAA00DBE4CD /* Animation.cpp */; }; - 04DBD42022AE2DBD00DBE4CD /* Animation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD35F22AE2DAA00DBE4CD /* Animation.cpp */; }; - 04DBD42122AE2DBD00DBE4CD /* SkeletonData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD36022AE2DAB00DBE4CD /* SkeletonData.cpp */; }; - 04DBD42222AE2DBD00DBE4CD /* SkeletonData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD36022AE2DAB00DBE4CD /* SkeletonData.cpp */; }; - 04DBD42322AE2DBD00DBE4CD /* SlotData.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD36122AE2DAB00DBE4CD /* SlotData.h */; }; - 04DBD42422AE2DBD00DBE4CD /* SlotData.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD36122AE2DAB00DBE4CD /* SlotData.h */; }; - 04DBD42522AE2DBD00DBE4CD /* PathConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD36222AE2DAB00DBE4CD /* PathConstraint.cpp */; }; - 04DBD42622AE2DBD00DBE4CD /* PathConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD36222AE2DAB00DBE4CD /* PathConstraint.cpp */; }; - 04DBD42722AE2DBD00DBE4CD /* VertexEffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD36322AE2DAB00DBE4CD /* VertexEffect.h */; }; - 04DBD42822AE2DBD00DBE4CD /* VertexEffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD36322AE2DAB00DBE4CD /* VertexEffect.h */; }; - 04DBD42922AE2DBD00DBE4CD /* RegionAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD36422AE2DAC00DBE4CD /* RegionAttachment.cpp */; }; - 04DBD42A22AE2DBD00DBE4CD /* RegionAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD36422AE2DAC00DBE4CD /* RegionAttachment.cpp */; }; - 04DBD42B22AE2DBD00DBE4CD /* IkConstraintData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD36522AE2DAC00DBE4CD /* IkConstraintData.cpp */; }; - 04DBD42C22AE2DBD00DBE4CD /* IkConstraintData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD36522AE2DAC00DBE4CD /* IkConstraintData.cpp */; }; - 04DBD42D22AE2DBD00DBE4CD /* PathConstraintSpacingTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD36622AE2DAC00DBE4CD /* PathConstraintSpacingTimeline.h */; }; - 04DBD42E22AE2DBD00DBE4CD /* PathConstraintSpacingTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD36622AE2DAC00DBE4CD /* PathConstraintSpacingTimeline.h */; }; - 04DBD42F22AE2DBD00DBE4CD /* Json.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD36722AE2DAC00DBE4CD /* Json.cpp */; }; - 04DBD43022AE2DBD00DBE4CD /* Json.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD36722AE2DAC00DBE4CD /* Json.cpp */; }; - 04DBD43122AE2DBD00DBE4CD /* Color.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD36822AE2DAC00DBE4CD /* Color.h */; }; - 04DBD43222AE2DBD00DBE4CD /* Color.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD36822AE2DAC00DBE4CD /* Color.h */; }; - 04DBD43322AE2DBD00DBE4CD /* Skin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD36922AE2DAD00DBE4CD /* Skin.cpp */; }; - 04DBD43422AE2DBD00DBE4CD /* Skin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD36922AE2DAD00DBE4CD /* Skin.cpp */; }; - 04DBD43522AE2DBD00DBE4CD /* RotateMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD36A22AE2DAD00DBE4CD /* RotateMode.h */; }; - 04DBD43622AE2DBD00DBE4CD /* RotateMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD36A22AE2DAD00DBE4CD /* RotateMode.h */; }; - 04DBD43722AE2DBD00DBE4CD /* TranslateTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD36B22AE2DAD00DBE4CD /* TranslateTimeline.cpp */; }; - 04DBD43822AE2DBD00DBE4CD /* TranslateTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD36B22AE2DAD00DBE4CD /* TranslateTimeline.cpp */; }; - 04DBD43922AE2DBD00DBE4CD /* Updatable.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD36C22AE2DAD00DBE4CD /* Updatable.h */; }; - 04DBD43A22AE2DBD00DBE4CD /* Updatable.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD36C22AE2DAD00DBE4CD /* Updatable.h */; }; - 04DBD43B22AE2DBD00DBE4CD /* TransformConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD36D22AE2DAD00DBE4CD /* TransformConstraint.cpp */; }; - 04DBD43C22AE2DBD00DBE4CD /* TransformConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD36D22AE2DAD00DBE4CD /* TransformConstraint.cpp */; }; - 04DBD43D22AE2DBD00DBE4CD /* SkeletonBinary.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD36E22AE2DAE00DBE4CD /* SkeletonBinary.h */; }; - 04DBD43E22AE2DBD00DBE4CD /* SkeletonBinary.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD36E22AE2DAE00DBE4CD /* SkeletonBinary.h */; }; - 04DBD43F22AE2DBD00DBE4CD /* DrawOrderTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD36F22AE2DAE00DBE4CD /* DrawOrderTimeline.cpp */; }; - 04DBD44022AE2DBD00DBE4CD /* DrawOrderTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD36F22AE2DAE00DBE4CD /* DrawOrderTimeline.cpp */; }; - 04DBD44122AE2DBD00DBE4CD /* PathAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD37022AE2DAE00DBE4CD /* PathAttachment.h */; }; - 04DBD44222AE2DBD00DBE4CD /* PathAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD37022AE2DAE00DBE4CD /* PathAttachment.h */; }; - 04DBD44322AE2DBD00DBE4CD /* PathConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD37122AE2DAE00DBE4CD /* PathConstraint.h */; }; - 04DBD44422AE2DBD00DBE4CD /* PathConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD37122AE2DAE00DBE4CD /* PathConstraint.h */; }; - 04DBD44522AE2DBD00DBE4CD /* AnimationState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD37222AE2DAE00DBE4CD /* AnimationState.cpp */; }; - 04DBD44622AE2DBD00DBE4CD /* AnimationState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD37222AE2DAE00DBE4CD /* AnimationState.cpp */; }; - 04DBD44722AE2DBD00DBE4CD /* Skeleton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD37322AE2DAF00DBE4CD /* Skeleton.cpp */; }; - 04DBD44822AE2DBD00DBE4CD /* Skeleton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD37322AE2DAF00DBE4CD /* Skeleton.cpp */; }; - 04DBD44922AE2DBD00DBE4CD /* DrawOrderTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD37422AE2DAF00DBE4CD /* DrawOrderTimeline.h */; }; - 04DBD44A22AE2DBD00DBE4CD /* DrawOrderTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD37422AE2DAF00DBE4CD /* DrawOrderTimeline.h */; }; - 04DBD44B22AE2DBD00DBE4CD /* IkConstraintTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD37522AE2DAF00DBE4CD /* IkConstraintTimeline.h */; }; - 04DBD44C22AE2DBD00DBE4CD /* IkConstraintTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD37522AE2DAF00DBE4CD /* IkConstraintTimeline.h */; }; - 04DBD44D22AE2DBD00DBE4CD /* SpacingMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD37622AE2DAF00DBE4CD /* SpacingMode.h */; }; - 04DBD44E22AE2DBD00DBE4CD /* SpacingMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD37622AE2DAF00DBE4CD /* SpacingMode.h */; }; - 04DBD44F22AE2DBD00DBE4CD /* Json.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD37722AE2DAF00DBE4CD /* Json.h */; }; - 04DBD45022AE2DBD00DBE4CD /* Json.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD37722AE2DAF00DBE4CD /* Json.h */; }; - 04DBD45122AE2DBD00DBE4CD /* AnimationStateData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD37822AE2DAF00DBE4CD /* AnimationStateData.cpp */; }; - 04DBD45222AE2DBD00DBE4CD /* AnimationStateData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD37822AE2DAF00DBE4CD /* AnimationStateData.cpp */; }; - 04DBD45322AE2DBD00DBE4CD /* TransformConstraintTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD37922AE2DB000DBE4CD /* TransformConstraintTimeline.cpp */; }; - 04DBD45422AE2DBD00DBE4CD /* TransformConstraintTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD37922AE2DB000DBE4CD /* TransformConstraintTimeline.cpp */; }; - 04DBD45522AE2DBD00DBE4CD /* Vertices.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD37A22AE2DB000DBE4CD /* Vertices.h */; }; - 04DBD45622AE2DBD00DBE4CD /* Vertices.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD37A22AE2DB000DBE4CD /* Vertices.h */; }; - 04DBD45722AE2DBD00DBE4CD /* AttachmentLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD37B22AE2DB000DBE4CD /* AttachmentLoader.h */; }; - 04DBD45822AE2DBD00DBE4CD /* AttachmentLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD37B22AE2DB000DBE4CD /* AttachmentLoader.h */; }; - 04DBD45922AE2DBD00DBE4CD /* PointAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD37C22AE2DB000DBE4CD /* PointAttachment.h */; }; - 04DBD45A22AE2DBD00DBE4CD /* PointAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD37C22AE2DB000DBE4CD /* PointAttachment.h */; }; - 04DBD45B22AE2DBD00DBE4CD /* Timeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD37D22AE2DB000DBE4CD /* Timeline.h */; }; - 04DBD45C22AE2DBD00DBE4CD /* Timeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD37D22AE2DB000DBE4CD /* Timeline.h */; }; - 04DBD45D22AE2DBD00DBE4CD /* SkeletonBinary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD37E22AE2DB100DBE4CD /* SkeletonBinary.cpp */; }; - 04DBD45E22AE2DBD00DBE4CD /* SkeletonBinary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD37E22AE2DB100DBE4CD /* SkeletonBinary.cpp */; }; - 04DBD45F22AE2DBD00DBE4CD /* Event.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD37F22AE2DB100DBE4CD /* Event.cpp */; }; - 04DBD46022AE2DBD00DBE4CD /* Event.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD37F22AE2DB100DBE4CD /* Event.cpp */; }; - 04DBD46122AE2DBD00DBE4CD /* TwoColorTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD38022AE2DB100DBE4CD /* TwoColorTimeline.h */; }; - 04DBD46222AE2DBD00DBE4CD /* TwoColorTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD38022AE2DB100DBE4CD /* TwoColorTimeline.h */; }; - 04DBD46322AE2DBD00DBE4CD /* PathConstraintData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD38122AE2DB100DBE4CD /* PathConstraintData.cpp */; }; - 04DBD46422AE2DBD00DBE4CD /* PathConstraintData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD38122AE2DB100DBE4CD /* PathConstraintData.cpp */; }; - 04DBD46522AE2DBD00DBE4CD /* ScaleTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD38222AE2DB100DBE4CD /* ScaleTimeline.h */; }; - 04DBD46622AE2DBD00DBE4CD /* ScaleTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD38222AE2DB100DBE4CD /* ScaleTimeline.h */; }; - 04DBD46722AE2DBD00DBE4CD /* TransformConstraintData.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD38322AE2DB200DBE4CD /* TransformConstraintData.h */; }; - 04DBD46822AE2DBD00DBE4CD /* TransformConstraintData.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD38322AE2DB200DBE4CD /* TransformConstraintData.h */; }; - 04DBD46922AE2DBD00DBE4CD /* ShearTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD38422AE2DB200DBE4CD /* ShearTimeline.cpp */; }; - 04DBD46A22AE2DBD00DBE4CD /* ShearTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD38422AE2DB200DBE4CD /* ShearTimeline.cpp */; }; - 04DBD46B22AE2DBD00DBE4CD /* AttachmentTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD38522AE2DB200DBE4CD /* AttachmentTimeline.cpp */; }; - 04DBD46C22AE2DBD00DBE4CD /* AttachmentTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD38522AE2DB200DBE4CD /* AttachmentTimeline.cpp */; }; - 04DBD46D22AE2DBD00DBE4CD /* ScaleTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD38622AE2DB200DBE4CD /* ScaleTimeline.cpp */; }; - 04DBD46E22AE2DBD00DBE4CD /* ScaleTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD38622AE2DB200DBE4CD /* ScaleTimeline.cpp */; }; - 04DBD46F22AE2DBD00DBE4CD /* TransformConstraintData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD38722AE2DB200DBE4CD /* TransformConstraintData.cpp */; }; - 04DBD47022AE2DBD00DBE4CD /* TransformConstraintData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD38722AE2DB200DBE4CD /* TransformConstraintData.cpp */; }; - 04DBD47122AE2DBD00DBE4CD /* Bone.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD38822AE2DB300DBE4CD /* Bone.h */; }; - 04DBD47222AE2DBD00DBE4CD /* Bone.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD38822AE2DB300DBE4CD /* Bone.h */; }; - 04DBD47322AE2DBD00DBE4CD /* AttachmentType.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD38922AE2DB300DBE4CD /* AttachmentType.h */; }; - 04DBD47422AE2DBD00DBE4CD /* AttachmentType.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD38922AE2DB300DBE4CD /* AttachmentType.h */; }; - 04DBD47522AE2DBD00DBE4CD /* MeshAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD38A22AE2DB300DBE4CD /* MeshAttachment.h */; }; - 04DBD47622AE2DBD00DBE4CD /* MeshAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD38A22AE2DB300DBE4CD /* MeshAttachment.h */; }; - 04DBD47722AE2DBD00DBE4CD /* Atlas.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD38B22AE2DB300DBE4CD /* Atlas.h */; }; - 04DBD47822AE2DBD00DBE4CD /* Atlas.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD38B22AE2DB300DBE4CD /* Atlas.h */; }; - 04DBD47922AE2DBD00DBE4CD /* PositionMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD38C22AE2DB300DBE4CD /* PositionMode.h */; }; - 04DBD47A22AE2DBD00DBE4CD /* PositionMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD38C22AE2DB300DBE4CD /* PositionMode.h */; }; - 04DBD47B22AE2DBD00DBE4CD /* AnimationState.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD38D22AE2DB400DBE4CD /* AnimationState.h */; }; - 04DBD47C22AE2DBD00DBE4CD /* AnimationState.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD38D22AE2DB400DBE4CD /* AnimationState.h */; }; - 04DBD47D22AE2DBD00DBE4CD /* DeformTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD38E22AE2DB400DBE4CD /* DeformTimeline.cpp */; }; - 04DBD47E22AE2DBD00DBE4CD /* DeformTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD38E22AE2DB400DBE4CD /* DeformTimeline.cpp */; }; - 04DBD47F22AE2DBD00DBE4CD /* PathConstraintSpacingTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD38F22AE2DB400DBE4CD /* PathConstraintSpacingTimeline.cpp */; }; - 04DBD48022AE2DBD00DBE4CD /* PathConstraintSpacingTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD38F22AE2DB400DBE4CD /* PathConstraintSpacingTimeline.cpp */; }; - 04DBD48122AE2DBD00DBE4CD /* PathConstraintPositionTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD39022AE2DB400DBE4CD /* PathConstraintPositionTimeline.h */; }; - 04DBD48222AE2DBD00DBE4CD /* PathConstraintPositionTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD39022AE2DB400DBE4CD /* PathConstraintPositionTimeline.h */; }; - 04DBD48322AE2DBD00DBE4CD /* PathConstraintData.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD39122AE2DB400DBE4CD /* PathConstraintData.h */; }; - 04DBD48422AE2DBD00DBE4CD /* PathConstraintData.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD39122AE2DB400DBE4CD /* PathConstraintData.h */; }; - 04DBD48522AE2DBD00DBE4CD /* EventTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD39222AE2DB500DBE4CD /* EventTimeline.cpp */; }; - 04DBD48622AE2DBD00DBE4CD /* EventTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD39222AE2DB500DBE4CD /* EventTimeline.cpp */; }; - 04DBD48722AE2DBD00DBE4CD /* MixBlend.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD39322AE2DB500DBE4CD /* MixBlend.h */; }; - 04DBD48822AE2DBD00DBE4CD /* MixBlend.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD39322AE2DB500DBE4CD /* MixBlend.h */; }; - 04DBD48922AE2DBD00DBE4CD /* IkConstraintTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD39422AE2DB500DBE4CD /* IkConstraintTimeline.cpp */; }; - 04DBD48A22AE2DBD00DBE4CD /* IkConstraintTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD39422AE2DB500DBE4CD /* IkConstraintTimeline.cpp */; }; - 04DBD48B22AE2DBD00DBE4CD /* CurveTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD39522AE2DB500DBE4CD /* CurveTimeline.cpp */; }; - 04DBD48C22AE2DBD00DBE4CD /* CurveTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD39522AE2DB500DBE4CD /* CurveTimeline.cpp */; }; - 04DBD48D22AE2DBD00DBE4CD /* Slot.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD39622AE2DB500DBE4CD /* Slot.h */; }; - 04DBD48E22AE2DBD00DBE4CD /* Slot.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD39622AE2DB500DBE4CD /* Slot.h */; }; - 04DBD48F22AE2DBD00DBE4CD /* Vector.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD39722AE2DB600DBE4CD /* Vector.h */; }; - 04DBD49022AE2DBD00DBE4CD /* Vector.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD39722AE2DB600DBE4CD /* Vector.h */; }; - 04DBD49122AE2DBD00DBE4CD /* ShearTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD39822AE2DB600DBE4CD /* ShearTimeline.h */; }; - 04DBD49222AE2DBD00DBE4CD /* ShearTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD39822AE2DB600DBE4CD /* ShearTimeline.h */; }; - 04DBD49322AE2DBD00DBE4CD /* SkeletonJson.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD39922AE2DB600DBE4CD /* SkeletonJson.h */; }; - 04DBD49422AE2DBD00DBE4CD /* SkeletonJson.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD39922AE2DB600DBE4CD /* SkeletonJson.h */; }; - 04DBD49522AE2DBD00DBE4CD /* SpineObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD39A22AE2DB600DBE4CD /* SpineObject.h */; }; - 04DBD49622AE2DBD00DBE4CD /* SpineObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD39A22AE2DB600DBE4CD /* SpineObject.h */; }; - 04DBD49922AE2DBD00DBE4CD /* TransformMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD39C22AE2DB700DBE4CD /* TransformMode.h */; }; - 04DBD49A22AE2DBD00DBE4CD /* TransformMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD39C22AE2DB700DBE4CD /* TransformMode.h */; }; - 04DBD49B22AE2DBD00DBE4CD /* EventData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD39D22AE2DB700DBE4CD /* EventData.cpp */; }; - 04DBD49C22AE2DBD00DBE4CD /* EventData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD39D22AE2DB700DBE4CD /* EventData.cpp */; }; - 04DBD49D22AE2DBD00DBE4CD /* SkeletonJson.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD39E22AE2DB700DBE4CD /* SkeletonJson.cpp */; }; - 04DBD49E22AE2DBD00DBE4CD /* SkeletonJson.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD39E22AE2DB700DBE4CD /* SkeletonJson.cpp */; }; - 04DBD49F22AE2DBD00DBE4CD /* ColorTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD39F22AE2DB700DBE4CD /* ColorTimeline.cpp */; }; - 04DBD4A022AE2DBD00DBE4CD /* ColorTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD39F22AE2DB700DBE4CD /* ColorTimeline.cpp */; }; - 04DBD4A122AE2DBD00DBE4CD /* Attachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD3A022AE2DB700DBE4CD /* Attachment.cpp */; }; - 04DBD4A222AE2DBD00DBE4CD /* Attachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD3A022AE2DB700DBE4CD /* Attachment.cpp */; }; - 04DBD4A322AE2DBD00DBE4CD /* AttachmentLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD3A122AE2DB800DBE4CD /* AttachmentLoader.cpp */; }; - 04DBD4A422AE2DBD00DBE4CD /* AttachmentLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD3A122AE2DB800DBE4CD /* AttachmentLoader.cpp */; }; - 04DBD4A522AE2DBD00DBE4CD /* LinkedMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD3A222AE2DB800DBE4CD /* LinkedMesh.cpp */; }; - 04DBD4A622AE2DBD00DBE4CD /* LinkedMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD3A222AE2DB800DBE4CD /* LinkedMesh.cpp */; }; - 04DBD4A722AE2DBD00DBE4CD /* RegionAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD3A322AE2DB800DBE4CD /* RegionAttachment.h */; }; - 04DBD4A822AE2DBD00DBE4CD /* RegionAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD3A322AE2DB800DBE4CD /* RegionAttachment.h */; }; - 04DBD4A922AE2DBD00DBE4CD /* SpineObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD3A422AE2DB800DBE4CD /* SpineObject.cpp */; }; - 04DBD4AA22AE2DBD00DBE4CD /* SpineObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD3A422AE2DB800DBE4CD /* SpineObject.cpp */; }; - 04DBD4AB22AE2DBD00DBE4CD /* Slot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD3A522AE2DB800DBE4CD /* Slot.cpp */; }; - 04DBD4AC22AE2DBD00DBE4CD /* Slot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD3A522AE2DB800DBE4CD /* Slot.cpp */; }; - 04DBD4AD22AE2DBD00DBE4CD /* BoundingBoxAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD3A622AE2DB800DBE4CD /* BoundingBoxAttachment.cpp */; }; - 04DBD4AE22AE2DBD00DBE4CD /* BoundingBoxAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD3A622AE2DB800DBE4CD /* BoundingBoxAttachment.cpp */; }; - 04DBD4AF22AE2DBD00DBE4CD /* MeshAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD3A722AE2DB900DBE4CD /* MeshAttachment.cpp */; }; - 04DBD4B022AE2DBD00DBE4CD /* MeshAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD3A722AE2DB900DBE4CD /* MeshAttachment.cpp */; }; - 04DBD4B122AE2DBD00DBE4CD /* TwoColorTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD3A822AE2DB900DBE4CD /* TwoColorTimeline.cpp */; }; - 04DBD4B222AE2DBD00DBE4CD /* TwoColorTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD3A822AE2DB900DBE4CD /* TwoColorTimeline.cpp */; }; - 04DBD4B322AE2DBD00DBE4CD /* ContainerUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD3A922AE2DB900DBE4CD /* ContainerUtil.h */; }; - 04DBD4B422AE2DBD00DBE4CD /* ContainerUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD3A922AE2DB900DBE4CD /* ContainerUtil.h */; }; - 04DBD4B522AE2DBD00DBE4CD /* RTTI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD3AA22AE2DB900DBE4CD /* RTTI.cpp */; }; - 04DBD4B622AE2DBD00DBE4CD /* RTTI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD3AA22AE2DB900DBE4CD /* RTTI.cpp */; }; - 04DBD4B722AE2DBD00DBE4CD /* SkeletonBounds.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD3AB22AE2DB900DBE4CD /* SkeletonBounds.cpp */; }; - 04DBD4B822AE2DBD00DBE4CD /* SkeletonBounds.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD3AB22AE2DB900DBE4CD /* SkeletonBounds.cpp */; }; - 04DBD4B922AE2DBD00DBE4CD /* Skeleton.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD3AC22AE2DBA00DBE4CD /* Skeleton.h */; }; - 04DBD4BA22AE2DBD00DBE4CD /* Skeleton.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD3AC22AE2DBA00DBE4CD /* Skeleton.h */; }; - 04DBD4BB22AE2DBD00DBE4CD /* PathConstraintPositionTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD3AD22AE2DBA00DBE4CD /* PathConstraintPositionTimeline.cpp */; }; - 04DBD4BC22AE2DBD00DBE4CD /* PathConstraintPositionTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD3AD22AE2DBA00DBE4CD /* PathConstraintPositionTimeline.cpp */; }; - 04DBD4BD22AE2DBD00DBE4CD /* spine.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD3AE22AE2DBA00DBE4CD /* spine.h */; }; - 04DBD4BE22AE2DBD00DBE4CD /* spine.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD3AE22AE2DBA00DBE4CD /* spine.h */; }; - 04DBD4BF22AE2DBD00DBE4CD /* DeformTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD3AF22AE2DBA00DBE4CD /* DeformTimeline.h */; }; - 04DBD4C022AE2DBD00DBE4CD /* DeformTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD3AF22AE2DBA00DBE4CD /* DeformTimeline.h */; }; - 04DBD4C122AE2DBD00DBE4CD /* Updatable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD3B022AE2DBA00DBE4CD /* Updatable.cpp */; }; - 04DBD4C222AE2DBD00DBE4CD /* Updatable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD3B022AE2DBA00DBE4CD /* Updatable.cpp */; }; - 04DBD4C322AE2DBD00DBE4CD /* BoneData.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD3B122AE2DBB00DBE4CD /* BoneData.h */; }; - 04DBD4C422AE2DBD00DBE4CD /* BoneData.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD3B122AE2DBB00DBE4CD /* BoneData.h */; }; - 04DBD4C522AE2DBD00DBE4CD /* dll.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD3B222AE2DBB00DBE4CD /* dll.h */; }; - 04DBD4C622AE2DBD00DBE4CD /* dll.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD3B222AE2DBB00DBE4CD /* dll.h */; }; - 04DBD4C722AE2DBD00DBE4CD /* SkeletonBounds.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD3B322AE2DBB00DBE4CD /* SkeletonBounds.h */; }; - 04DBD4C822AE2DBD00DBE4CD /* SkeletonBounds.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD3B322AE2DBB00DBE4CD /* SkeletonBounds.h */; }; - 04DBD4C922AE2DBD00DBE4CD /* TransformConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD3B422AE2DBB00DBE4CD /* TransformConstraint.h */; }; - 04DBD4CA22AE2DBD00DBE4CD /* TransformConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD3B422AE2DBB00DBE4CD /* TransformConstraint.h */; }; - 04DBD4CB22AE2DBD00DBE4CD /* VertexAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD3B522AE2DBB00DBE4CD /* VertexAttachment.h */; }; - 04DBD4CC22AE2DBD00DBE4CD /* VertexAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD3B522AE2DBB00DBE4CD /* VertexAttachment.h */; }; - 04DBD4CD22AE2DBD00DBE4CD /* ClippingAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD3B622AE2DBC00DBE4CD /* ClippingAttachment.cpp */; }; - 04DBD4CE22AE2DBD00DBE4CD /* ClippingAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD3B622AE2DBC00DBE4CD /* ClippingAttachment.cpp */; }; - 04DBD4CF22AE2DBD00DBE4CD /* SkeletonClipping.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD3B722AE2DBC00DBE4CD /* SkeletonClipping.h */; }; - 04DBD4D022AE2DBD00DBE4CD /* SkeletonClipping.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD3B722AE2DBC00DBE4CD /* SkeletonClipping.h */; }; - 04DBD4D122AE2DBD00DBE4CD /* LinkedMesh.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD3B822AE2DBC00DBE4CD /* LinkedMesh.h */; }; - 04DBD4D222AE2DBD00DBE4CD /* LinkedMesh.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD3B822AE2DBC00DBE4CD /* LinkedMesh.h */; }; - 04DBD4D322AE2DBD00DBE4CD /* RTTI.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD3B922AE2DBC00DBE4CD /* RTTI.h */; }; - 04DBD4D422AE2DBD00DBE4CD /* RTTI.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD3B922AE2DBC00DBE4CD /* RTTI.h */; }; - 04DBD4D522AE2DBD00DBE4CD /* IkConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD3BA22AE2DBC00DBE4CD /* IkConstraint.h */; }; - 04DBD4D622AE2DBD00DBE4CD /* IkConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD3BA22AE2DBC00DBE4CD /* IkConstraint.h */; }; - 04DBD4DB22B51EA300DBE4CD /* MemPool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD4D922B51EA300DBE4CD /* MemPool.cpp */; }; - 04DBD4DC22B51EA300DBE4CD /* MemPool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD4D922B51EA300DBE4CD /* MemPool.cpp */; }; - 04DBD4DD22B51EA300DBE4CD /* MemPool.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD4DA22B51EA300DBE4CD /* MemPool.hpp */; }; - 04DBD4DE22B51EA300DBE4CD /* MemPool.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD4DA22B51EA300DBE4CD /* MemPool.hpp */; }; - 04DBD4E122B51EB300DBE4CD /* NodeMemPool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD4DF22B51EB300DBE4CD /* NodeMemPool.cpp */; }; - 04DBD4E222B51EB300DBE4CD /* NodeMemPool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04DBD4DF22B51EB300DBE4CD /* NodeMemPool.cpp */; }; - 04DBD4E322B51EB300DBE4CD /* NodeMemPool.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD4E022B51EB300DBE4CD /* NodeMemPool.hpp */; }; - 04DBD4E422B51EB300DBE4CD /* NodeMemPool.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 04DBD4E022B51EB300DBE4CD /* NodeMemPool.hpp */; }; - 04ED68D821F8188F006E82F8 /* MeshBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04ED68D621F8188F006E82F8 /* MeshBuffer.cpp */; }; - 04ED68D921F8188F006E82F8 /* MeshBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04ED68D621F8188F006E82F8 /* MeshBuffer.cpp */; }; - 04ED68DA21F8188F006E82F8 /* MeshBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 04ED68D721F8188F006E82F8 /* MeshBuffer.h */; }; - 04ED68DB21F8188F006E82F8 /* MeshBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 04ED68D721F8188F006E82F8 /* MeshBuffer.h */; }; - 04F8563422ABCB9900063A20 /* TiledMapAssembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04F8563222ABCB9900063A20 /* TiledMapAssembler.cpp */; }; - 04F8563522ABCB9900063A20 /* TiledMapAssembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04F8563222ABCB9900063A20 /* TiledMapAssembler.cpp */; }; - 04F8563622ABCB9900063A20 /* TiledMapAssembler.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 04F8563322ABCB9900063A20 /* TiledMapAssembler.hpp */; }; - 04F8563722ABCB9900063A20 /* TiledMapAssembler.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 04F8563322ABCB9900063A20 /* TiledMapAssembler.hpp */; }; - 04FB24092328D42A0021DD02 /* CCArmatureCacheDisplay.h in Headers */ = {isa = PBXBuildFile; fileRef = 04FB24032328D42A0021DD02 /* CCArmatureCacheDisplay.h */; }; - 04FB240A2328D42A0021DD02 /* CCArmatureCacheDisplay.h in Headers */ = {isa = PBXBuildFile; fileRef = 04FB24032328D42A0021DD02 /* CCArmatureCacheDisplay.h */; }; - 04FB240B2328D42A0021DD02 /* ArmatureCacheMgr.h in Headers */ = {isa = PBXBuildFile; fileRef = 04FB24042328D42A0021DD02 /* ArmatureCacheMgr.h */; }; - 04FB240C2328D42A0021DD02 /* ArmatureCacheMgr.h in Headers */ = {isa = PBXBuildFile; fileRef = 04FB24042328D42A0021DD02 /* ArmatureCacheMgr.h */; }; - 04FB240D2328D42A0021DD02 /* ArmatureCacheMgr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04FB24052328D42A0021DD02 /* ArmatureCacheMgr.cpp */; }; - 04FB240E2328D42A0021DD02 /* ArmatureCacheMgr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04FB24052328D42A0021DD02 /* ArmatureCacheMgr.cpp */; }; - 04FB240F2328D42A0021DD02 /* ArmatureCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04FB24062328D42A0021DD02 /* ArmatureCache.cpp */; }; - 04FB24102328D42A0021DD02 /* ArmatureCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04FB24062328D42A0021DD02 /* ArmatureCache.cpp */; }; - 04FB24112328D42A0021DD02 /* ArmatureCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 04FB24072328D42A0021DD02 /* ArmatureCache.h */; }; - 04FB24122328D42A0021DD02 /* ArmatureCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 04FB24072328D42A0021DD02 /* ArmatureCache.h */; }; - 04FB24132328D42A0021DD02 /* CCArmatureCacheDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04FB24082328D42A0021DD02 /* CCArmatureCacheDisplay.cpp */; }; - 04FB24142328D42A0021DD02 /* CCArmatureCacheDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 04FB24082328D42A0021DD02 /* CCArmatureCacheDisplay.cpp */; }; 1A14FD912080B4E300E10ABE /* CCGLUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A14FD8F2080B4E300E10ABE /* CCGLUtils.cpp */; }; 1A14FD922080B4E300E10ABE /* CCGLUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A14FD8F2080B4E300E10ABE /* CCGLUtils.cpp */; }; 1A14FD932080B4E300E10ABE /* CCGLUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A14FD902080B4E300E10ABE /* CCGLUtils.h */; }; @@ -862,28 +246,10 @@ 40CEAEBA20CFDE19007A3281 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 40CEAEB920CFDE19007A3281 /* SystemConfiguration.framework */; }; 40FF7AA1216B29CC00E73029 /* VideoPlayer-ios.mm in Sources */ = {isa = PBXBuildFile; fileRef = 40FF7A9E216B29CB00E73029 /* VideoPlayer-ios.mm */; }; 40FF7AA2216B29CC00E73029 /* VideoPlayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 40FF7A9F216B29CB00E73029 /* VideoPlayer.h */; }; - 4233799F22BB43B900E5D8A2 /* RecyclePool.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 4233799C22BB43B900E5D8A2 /* RecyclePool.hpp */; }; - 423379A022BB43B900E5D8A2 /* RecyclePool.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 4233799C22BB43B900E5D8A2 /* RecyclePool.hpp */; }; - 423379A322BB8DEA00E5D8A2 /* CustomProperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 423379A122BB8DEA00E5D8A2 /* CustomProperties.cpp */; }; - 423379A422BB8DEA00E5D8A2 /* CustomProperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 423379A122BB8DEA00E5D8A2 /* CustomProperties.cpp */; }; - 423379A522BB8DEA00E5D8A2 /* CustomProperties.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 423379A222BB8DEA00E5D8A2 /* CustomProperties.hpp */; }; - 423379A622BB8DEA00E5D8A2 /* CustomProperties.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 423379A222BB8DEA00E5D8A2 /* CustomProperties.hpp */; }; 425D3FF122D86BEF00BCED11 /* Mat3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 425D3FEF22D86BEF00BCED11 /* Mat3.cpp */; }; 425D3FF222D86BEF00BCED11 /* Mat3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 425D3FEF22D86BEF00BCED11 /* Mat3.cpp */; }; 425D3FF322D86BEF00BCED11 /* Mat3.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 425D3FF022D86BEF00BCED11 /* Mat3.hpp */; }; 425D3FF422D86BEF00BCED11 /* Mat3.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 425D3FF022D86BEF00BCED11 /* Mat3.hpp */; }; - 426947B9234ED0130044C66E /* SimpleSprite3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 426947B7234ED0130044C66E /* SimpleSprite3D.cpp */; }; - 426947BA234ED0130044C66E /* SimpleSprite3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 426947B7234ED0130044C66E /* SimpleSprite3D.cpp */; }; - 426947BB234ED0130044C66E /* SimpleSprite3D.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 426947B8234ED0130044C66E /* SimpleSprite3D.hpp */; }; - 426947BC234ED0130044C66E /* SimpleSprite3D.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 426947B8234ED0130044C66E /* SimpleSprite3D.hpp */; }; - 426947BF234ED02E0044C66E /* SlicedSprite3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 426947BD234ED02E0044C66E /* SlicedSprite3D.cpp */; }; - 426947C0234ED02E0044C66E /* SlicedSprite3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 426947BD234ED02E0044C66E /* SlicedSprite3D.cpp */; }; - 426947C1234ED02E0044C66E /* SlicedSprite3D.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 426947BE234ED02E0044C66E /* SlicedSprite3D.hpp */; }; - 426947C2234ED02E0044C66E /* SlicedSprite3D.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 426947BE234ED02E0044C66E /* SlicedSprite3D.hpp */; }; - 427475F923214E2A00139DF8 /* MeshAssembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 427475F723214E2900139DF8 /* MeshAssembler.cpp */; }; - 427475FA23214E2A00139DF8 /* MeshAssembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 427475F723214E2900139DF8 /* MeshAssembler.cpp */; }; - 427475FB23214E2A00139DF8 /* MeshAssembler.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 427475F823214E2A00139DF8 /* MeshAssembler.hpp */; }; - 427475FC23214E2A00139DF8 /* MeshAssembler.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 427475F823214E2A00139DF8 /* MeshAssembler.hpp */; }; 4617861920522469008256E1 /* SocketIO.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 461785FE20522468008256E1 /* SocketIO.cpp */; }; 4617861A20522469008256E1 /* SocketIO.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 461785FE20522468008256E1 /* SocketIO.cpp */; }; 4617862120522469008256E1 /* HttpCookie.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4617860220522468008256E1 /* HttpCookie.cpp */; }; @@ -1023,14 +389,6 @@ 469303AD2046AE05004A3D6C /* Utils.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 4693024F2046AE05004A3D6C /* Utils.hpp */; }; 469303AE2046AE05004A3D6C /* Base.h in Headers */ = {isa = PBXBuildFile; fileRef = 469302502046AE05004A3D6C /* Base.h */; }; 469303AF2046AE05004A3D6C /* Base.h in Headers */ = {isa = PBXBuildFile; fileRef = 469302502046AE05004A3D6C /* Base.h */; }; - 469303BE2046AE05004A3D6C /* jsb_renderer_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 469302592046AE05004A3D6C /* jsb_renderer_auto.cpp */; }; - 469303BF2046AE05004A3D6C /* jsb_renderer_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 469302592046AE05004A3D6C /* jsb_renderer_auto.cpp */; }; - 469303C62046AE05004A3D6C /* jsb_gfx_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4693025D2046AE05004A3D6C /* jsb_gfx_auto.cpp */; }; - 469303C72046AE05004A3D6C /* jsb_gfx_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4693025D2046AE05004A3D6C /* jsb_gfx_auto.cpp */; }; - 469303D22046AE05004A3D6C /* jsb_gfx_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 469302632046AE05004A3D6C /* jsb_gfx_auto.hpp */; }; - 469303D32046AE05004A3D6C /* jsb_gfx_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 469302632046AE05004A3D6C /* jsb_gfx_auto.hpp */; }; - 469303EE2046AE05004A3D6C /* jsb_renderer_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 469302822046AE05004A3D6C /* jsb_renderer_auto.hpp */; }; - 469303EF2046AE05004A3D6C /* jsb_renderer_auto.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 469302822046AE05004A3D6C /* jsb_renderer_auto.hpp */; }; 469304002046AE06004A3D6C /* jsb_global.h in Headers */ = {isa = PBXBuildFile; fileRef = 469302C72046AE05004A3D6C /* jsb_global.h */; }; 469304012046AE06004A3D6C /* jsb_global.h in Headers */ = {isa = PBXBuildFile; fileRef = 469302C72046AE05004A3D6C /* jsb_global.h */; }; 469304082046AE06004A3D6C /* jsb_global.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 469302CB2046AE05004A3D6C /* jsb_global.cpp */; }; @@ -1039,20 +397,12 @@ 469304112046AE06004A3D6C /* jsb_helper.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 469302CF2046AE05004A3D6C /* jsb_helper.hpp */; }; 469304122046AE06004A3D6C /* jsb_classtype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 469302D02046AE05004A3D6C /* jsb_classtype.cpp */; }; 469304132046AE06004A3D6C /* jsb_classtype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 469302D02046AE05004A3D6C /* jsb_classtype.cpp */; }; - 469304142046AE06004A3D6C /* jsb_renderer_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 469302D12046AE05004A3D6C /* jsb_renderer_manual.hpp */; }; - 469304152046AE06004A3D6C /* jsb_renderer_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 469302D12046AE05004A3D6C /* jsb_renderer_manual.hpp */; }; - 469304202046AE06004A3D6C /* jsb_gfx_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 469302D72046AE05004A3D6C /* jsb_gfx_manual.hpp */; }; - 469304212046AE06004A3D6C /* jsb_gfx_manual.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 469302D72046AE05004A3D6C /* jsb_gfx_manual.hpp */; }; 469304262046AE06004A3D6C /* jsb_conversions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 469302DA2046AE05004A3D6C /* jsb_conversions.cpp */; }; 469304272046AE06004A3D6C /* jsb_conversions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 469302DA2046AE05004A3D6C /* jsb_conversions.cpp */; }; - 4693042C2046AE06004A3D6C /* jsb_renderer_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 469302DD2046AE05004A3D6C /* jsb_renderer_manual.cpp */; }; - 4693042D2046AE06004A3D6C /* jsb_renderer_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 469302DD2046AE05004A3D6C /* jsb_renderer_manual.cpp */; }; 4693042E2046AE06004A3D6C /* jsb_helper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 469302DE2046AE05004A3D6C /* jsb_helper.cpp */; }; 4693042F2046AE06004A3D6C /* jsb_helper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 469302DE2046AE05004A3D6C /* jsb_helper.cpp */; }; 469304302046AE06004A3D6C /* jsb_classtype.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 469302DF2046AE05004A3D6C /* jsb_classtype.hpp */; }; 469304312046AE06004A3D6C /* jsb_classtype.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 469302DF2046AE05004A3D6C /* jsb_classtype.hpp */; }; - 4693043C2046AE06004A3D6C /* jsb_gfx_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 469302E52046AE05004A3D6C /* jsb_gfx_manual.cpp */; }; - 4693043D2046AE06004A3D6C /* jsb_gfx_manual.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 469302E52046AE05004A3D6C /* jsb_gfx_manual.cpp */; }; 469304582046AE06004A3D6C /* EventDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 469302F92046AE05004A3D6C /* EventDispatcher.cpp */; }; 469304592046AE06004A3D6C /* EventDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 469302F92046AE05004A3D6C /* EventDispatcher.cpp */; }; 4693045A2046AE06004A3D6C /* EventDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 469302FA2046AE05004A3D6C /* EventDispatcher.h */; }; @@ -1109,128 +459,6 @@ 46AE400A2092F3A600F3A228 /* node_debug_options.h in Headers */ = {isa = PBXBuildFile; fileRef = 46AE3FDB2092F3A600F3A228 /* node_debug_options.h */; }; 46AE400B2092F3A600F3A228 /* env.cc in Sources */ = {isa = PBXBuildFile; fileRef = 46AE3FDC2092F3A600F3A228 /* env.cc */; }; 46AE400C2092F3A600F3A228 /* env.cc in Sources */ = {isa = PBXBuildFile; fileRef = 46AE3FDC2092F3A600F3A228 /* env.cc */; }; - 46FDDA6D202ACC6A00931238 /* INode.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA2E202ACC6A00931238 /* INode.h */; }; - 46FDDA6E202ACC6A00931238 /* INode.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA2E202ACC6A00931238 /* INode.h */; }; - 46FDDA6F202ACC6A00931238 /* Pass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA2F202ACC6A00931238 /* Pass.cpp */; }; - 46FDDA70202ACC6A00931238 /* Pass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA2F202ACC6A00931238 /* Pass.cpp */; }; - 46FDDA71202ACC6A00931238 /* Scene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA30202ACC6A00931238 /* Scene.cpp */; }; - 46FDDA72202ACC6A00931238 /* Scene.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA30202ACC6A00931238 /* Scene.cpp */; }; - 46FDDA73202ACC6A00931238 /* ProgramLib.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA31202ACC6A00931238 /* ProgramLib.h */; }; - 46FDDA74202ACC6A00931238 /* ProgramLib.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA31202ACC6A00931238 /* ProgramLib.h */; }; - 46FDDA75202ACC6A00931238 /* Config.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA32202ACC6A00931238 /* Config.h */; }; - 46FDDA76202ACC6A00931238 /* Config.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA32202ACC6A00931238 /* Config.h */; }; - 46FDDA77202ACC6A00931238 /* Light.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA33202ACC6A00931238 /* Light.h */; }; - 46FDDA78202ACC6A00931238 /* Light.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA33202ACC6A00931238 /* Light.h */; }; - 46FDDA79202ACC6A00931238 /* Camera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA34202ACC6A00931238 /* Camera.cpp */; }; - 46FDDA7A202ACC6A00931238 /* Camera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA34202ACC6A00931238 /* Camera.cpp */; }; - 46FDDA7B202ACC6A00931238 /* Camera.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA35202ACC6A00931238 /* Camera.h */; }; - 46FDDA7C202ACC6A00931238 /* Camera.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA35202ACC6A00931238 /* Camera.h */; }; - 46FDDA7D202ACC6A00931238 /* Light.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA36202ACC6A00931238 /* Light.cpp */; }; - 46FDDA7E202ACC6A00931238 /* Light.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA36202ACC6A00931238 /* Light.cpp */; }; - 46FDDA7F202ACC6A00931238 /* Renderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA37202ACC6A00931238 /* Renderer.h */; }; - 46FDDA80202ACC6A00931238 /* Renderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA37202ACC6A00931238 /* Renderer.h */; }; - 46FDDA81202ACC6A00931238 /* RendererUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA38202ACC6A00931238 /* RendererUtils.h */; }; - 46FDDA82202ACC6A00931238 /* RendererUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA38202ACC6A00931238 /* RendererUtils.h */; }; - 46FDDA83202ACC6A00931238 /* Technique.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA39202ACC6A00931238 /* Technique.h */; }; - 46FDDA84202ACC6A00931238 /* Technique.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA39202ACC6A00931238 /* Technique.h */; }; - 46FDDA85202ACC6A00931238 /* View.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA3A202ACC6A00931238 /* View.h */; }; - 46FDDA86202ACC6A00931238 /* View.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA3A202ACC6A00931238 /* View.h */; }; - 46FDDA87202ACC6A00931238 /* View.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA3B202ACC6A00931238 /* View.cpp */; }; - 46FDDA88202ACC6A00931238 /* View.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA3B202ACC6A00931238 /* View.cpp */; }; - 46FDDA89202ACC6A00931238 /* Effect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA3C202ACC6A00931238 /* Effect.cpp */; }; - 46FDDA8A202ACC6A00931238 /* Effect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA3C202ACC6A00931238 /* Effect.cpp */; }; - 46FDDA8B202ACC6A00931238 /* ForwardRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA3D202ACC6A00931238 /* ForwardRenderer.cpp */; }; - 46FDDA8C202ACC6A00931238 /* ForwardRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA3D202ACC6A00931238 /* ForwardRenderer.cpp */; }; - 46FDDA8D202ACC6A00931238 /* Config.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA3E202ACC6A00931238 /* Config.cpp */; }; - 46FDDA8E202ACC6A00931238 /* Config.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA3E202ACC6A00931238 /* Config.cpp */; }; - 46FDDA8F202ACC6A00931238 /* BaseRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA3F202ACC6A00931238 /* BaseRenderer.h */; }; - 46FDDA90202ACC6A00931238 /* BaseRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA3F202ACC6A00931238 /* BaseRenderer.h */; }; - 46FDDA91202ACC6A00931238 /* Pass.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA40202ACC6A00931238 /* Pass.h */; }; - 46FDDA92202ACC6A00931238 /* Pass.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA40202ACC6A00931238 /* Pass.h */; }; - 46FDDA93202ACC6A00931238 /* Technique.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA41202ACC6A00931238 /* Technique.cpp */; }; - 46FDDA94202ACC6A00931238 /* Technique.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA41202ACC6A00931238 /* Technique.cpp */; }; - 46FDDA95202ACC6A00931238 /* RendererUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA42202ACC6A00931238 /* RendererUtils.cpp */; }; - 46FDDA96202ACC6A00931238 /* RendererUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA42202ACC6A00931238 /* RendererUtils.cpp */; }; - 46FDDA97202ACC6A00931238 /* Model.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA43202ACC6A00931238 /* Model.h */; }; - 46FDDA98202ACC6A00931238 /* Model.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA43202ACC6A00931238 /* Model.h */; }; - 46FDDA99202ACC6A00931238 /* Model.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA44202ACC6A00931238 /* Model.cpp */; }; - 46FDDA9A202ACC6A00931238 /* Model.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA44202ACC6A00931238 /* Model.cpp */; }; - 46FDDA9B202ACC6A00931238 /* Effect.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA45202ACC6A00931238 /* Effect.h */; }; - 46FDDA9C202ACC6A00931238 /* Effect.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA45202ACC6A00931238 /* Effect.h */; }; - 46FDDA9D202ACC6A00931238 /* BaseRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA46202ACC6A00931238 /* BaseRenderer.cpp */; }; - 46FDDA9E202ACC6A00931238 /* BaseRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA46202ACC6A00931238 /* BaseRenderer.cpp */; }; - 46FDDA9F202ACC6A00931238 /* ProgramLib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA47202ACC6A00931238 /* ProgramLib.cpp */; }; - 46FDDAA0202ACC6A00931238 /* ProgramLib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA47202ACC6A00931238 /* ProgramLib.cpp */; }; - 46FDDAA1202ACC6A00931238 /* InputAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA48202ACC6A00931238 /* InputAssembler.h */; }; - 46FDDAA2202ACC6A00931238 /* InputAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA48202ACC6A00931238 /* InputAssembler.h */; }; - 46FDDAA3202ACC6A00931238 /* InputAssembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA49202ACC6A00931238 /* InputAssembler.cpp */; }; - 46FDDAA4202ACC6A00931238 /* InputAssembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA49202ACC6A00931238 /* InputAssembler.cpp */; }; - 46FDDAA5202ACC6A00931238 /* Scene.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA4A202ACC6A00931238 /* Scene.h */; }; - 46FDDAA6202ACC6A00931238 /* Scene.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA4A202ACC6A00931238 /* Scene.h */; }; - 46FDDAA7202ACC6A00931238 /* ForwardRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA4B202ACC6A00931238 /* ForwardRenderer.h */; }; - 46FDDAA8202ACC6A00931238 /* ForwardRenderer.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA4B202ACC6A00931238 /* ForwardRenderer.h */; }; - 46FDDAA9202ACC6A00931238 /* Types.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA4C202ACC6A00931238 /* Types.cpp */; }; - 46FDDAAA202ACC6A00931238 /* Types.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA4C202ACC6A00931238 /* Types.cpp */; }; - 46FDDAAB202ACC6A00931238 /* Types.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA4E202ACC6A00931238 /* Types.h */; }; - 46FDDAAC202ACC6A00931238 /* Types.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA4E202ACC6A00931238 /* Types.h */; }; - 46FDDAAD202ACC6A00931238 /* Macro.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA4F202ACC6A00931238 /* Macro.h */; }; - 46FDDAAE202ACC6A00931238 /* Macro.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA4F202ACC6A00931238 /* Macro.h */; }; - 46FDDAAF202ACC6A00931238 /* Texture2D.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA51202ACC6A00931238 /* Texture2D.h */; }; - 46FDDAB0202ACC6A00931238 /* Texture2D.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA51202ACC6A00931238 /* Texture2D.h */; }; - 46FDDAB1202ACC6A00931238 /* DeviceGraphics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA52202ACC6A00931238 /* DeviceGraphics.cpp */; }; - 46FDDAB2202ACC6A00931238 /* DeviceGraphics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA52202ACC6A00931238 /* DeviceGraphics.cpp */; }; - 46FDDAB3202ACC6A00931238 /* VertexBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA53202ACC6A00931238 /* VertexBuffer.cpp */; }; - 46FDDAB4202ACC6A00931238 /* VertexBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA53202ACC6A00931238 /* VertexBuffer.cpp */; }; - 46FDDAB5202ACC6A00931238 /* Program.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA54202ACC6A00931238 /* Program.cpp */; }; - 46FDDAB6202ACC6A00931238 /* Program.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA54202ACC6A00931238 /* Program.cpp */; }; - 46FDDAB7202ACC6A00931238 /* IndexBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA55202ACC6A00931238 /* IndexBuffer.h */; }; - 46FDDAB8202ACC6A00931238 /* IndexBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA55202ACC6A00931238 /* IndexBuffer.h */; }; - 46FDDAB9202ACC6A00931238 /* FrameBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA56202ACC6A00931238 /* FrameBuffer.cpp */; }; - 46FDDABA202ACC6A00931238 /* FrameBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA56202ACC6A00931238 /* FrameBuffer.cpp */; }; - 46FDDABB202ACC6A00931238 /* VertexFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA57202ACC6A00931238 /* VertexFormat.cpp */; }; - 46FDDABC202ACC6A00931238 /* VertexFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA57202ACC6A00931238 /* VertexFormat.cpp */; }; - 46FDDABD202ACC6A00931238 /* DeviceGraphics.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA58202ACC6A00931238 /* DeviceGraphics.h */; }; - 46FDDABE202ACC6A00931238 /* DeviceGraphics.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA58202ACC6A00931238 /* DeviceGraphics.h */; }; - 46FDDABF202ACC6A00931238 /* State.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA59202ACC6A00931238 /* State.cpp */; }; - 46FDDAC0202ACC6A00931238 /* State.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA59202ACC6A00931238 /* State.cpp */; }; - 46FDDAC1202ACC6A00931238 /* Texture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA5A202ACC6A00931238 /* Texture.cpp */; }; - 46FDDAC2202ACC6A00931238 /* Texture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA5A202ACC6A00931238 /* Texture.cpp */; }; - 46FDDAC3202ACC6A00931238 /* FrameBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA5B202ACC6A00931238 /* FrameBuffer.h */; }; - 46FDDAC4202ACC6A00931238 /* FrameBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA5B202ACC6A00931238 /* FrameBuffer.h */; }; - 46FDDAC5202ACC6A00931238 /* RenderTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA5C202ACC6A00931238 /* RenderTarget.cpp */; }; - 46FDDAC6202ACC6A00931238 /* RenderTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA5C202ACC6A00931238 /* RenderTarget.cpp */; }; - 46FDDAC7202ACC6A00931238 /* GFX.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA5D202ACC6A00931238 /* GFX.h */; }; - 46FDDAC8202ACC6A00931238 /* GFX.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA5D202ACC6A00931238 /* GFX.h */; }; - 46FDDAC9202ACC6A00931238 /* RenderBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA5E202ACC6A00931238 /* RenderBuffer.cpp */; }; - 46FDDACA202ACC6A00931238 /* RenderBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA5E202ACC6A00931238 /* RenderBuffer.cpp */; }; - 46FDDACB202ACC6A00931238 /* VertexFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA5F202ACC6A00931238 /* VertexFormat.h */; }; - 46FDDACC202ACC6A00931238 /* VertexFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA5F202ACC6A00931238 /* VertexFormat.h */; }; - 46FDDACD202ACC6A00931238 /* GraphicsHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA60202ACC6A00931238 /* GraphicsHandle.h */; }; - 46FDDACE202ACC6A00931238 /* GraphicsHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA60202ACC6A00931238 /* GraphicsHandle.h */; }; - 46FDDACF202ACC6A00931238 /* RenderBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA61202ACC6A00931238 /* RenderBuffer.h */; }; - 46FDDAD0202ACC6A00931238 /* RenderBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA61202ACC6A00931238 /* RenderBuffer.h */; }; - 46FDDAD1202ACC6A00931238 /* Texture.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA62202ACC6A00931238 /* Texture.h */; }; - 46FDDAD2202ACC6A00931238 /* Texture.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA62202ACC6A00931238 /* Texture.h */; }; - 46FDDAD3202ACC6A00931238 /* Texture2D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA63202ACC6A00931238 /* Texture2D.cpp */; }; - 46FDDAD4202ACC6A00931238 /* Texture2D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA63202ACC6A00931238 /* Texture2D.cpp */; }; - 46FDDAD5202ACC6A00931238 /* GraphicsHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA64202ACC6A00931238 /* GraphicsHandle.cpp */; }; - 46FDDAD6202ACC6A00931238 /* GraphicsHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA64202ACC6A00931238 /* GraphicsHandle.cpp */; }; - 46FDDAD7202ACC6A00931238 /* GFXUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA65202ACC6A00931238 /* GFXUtils.h */; }; - 46FDDAD8202ACC6A00931238 /* GFXUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA65202ACC6A00931238 /* GFXUtils.h */; }; - 46FDDAD9202ACC6A00931238 /* Program.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA66202ACC6A00931238 /* Program.h */; }; - 46FDDADA202ACC6A00931238 /* Program.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA66202ACC6A00931238 /* Program.h */; }; - 46FDDADB202ACC6A00931238 /* State.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA67202ACC6A00931238 /* State.h */; }; - 46FDDADC202ACC6A00931238 /* State.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA67202ACC6A00931238 /* State.h */; }; - 46FDDADD202ACC6A00931238 /* VertexBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA68202ACC6A00931238 /* VertexBuffer.h */; }; - 46FDDADE202ACC6A00931238 /* VertexBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA68202ACC6A00931238 /* VertexBuffer.h */; }; - 46FDDADF202ACC6A00931238 /* RenderTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA69202ACC6A00931238 /* RenderTarget.h */; }; - 46FDDAE0202ACC6A00931238 /* RenderTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDA69202ACC6A00931238 /* RenderTarget.h */; }; - 46FDDAE1202ACC6A00931238 /* GFXUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA6A202ACC6A00931238 /* GFXUtils.cpp */; }; - 46FDDAE2202ACC6A00931238 /* GFXUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA6A202ACC6A00931238 /* GFXUtils.cpp */; }; - 46FDDAE3202ACC6A00931238 /* GFX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA6B202ACC6A00931238 /* GFX.cpp */; }; - 46FDDAE4202ACC6B00931238 /* GFX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA6B202ACC6A00931238 /* GFX.cpp */; }; - 46FDDAE5202ACC6B00931238 /* IndexBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA6C202ACC6A00931238 /* IndexBuffer.cpp */; }; - 46FDDAE6202ACC6B00931238 /* IndexBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 46FDDA6C202ACC6A00931238 /* IndexBuffer.cpp */; }; 46FDDB4D202ADDCE00931238 /* pvr.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDAEB202ADDCE00931238 /* pvr.h */; }; 46FDDB4E202ADDCE00931238 /* pvr.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDAEB202ADDCE00931238 /* pvr.h */; }; 46FDDB4F202ADDCE00931238 /* CCValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 46FDDAEC202ADDCE00931238 /* CCValue.h */; }; @@ -1401,6 +629,334 @@ B291B51C1D4A106A00BBB345 /* libpng.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B291B5181D4A106A00BBB345 /* libpng.a */; }; B291B51D1D4A106A00BBB345 /* libtiff.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B291B5191D4A106A00BBB345 /* libtiff.a */; }; B291B51E1D4A106A00BBB345 /* libwebp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B291B51A1D4A106A00BBB345 /* libwebp.a */; }; + BA06A67423583DBD007740C5 /* Core.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A62C23583DBD007740C5 /* Core.h */; }; + BA06A67523583DBD007740C5 /* Core.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A62C23583DBD007740C5 /* Core.h */; }; + BA06A67623583DBD007740C5 /* NedPooling.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A62F23583DBD007740C5 /* NedPooling.cc */; }; + BA06A67723583DBD007740C5 /* NedPooling.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A62F23583DBD007740C5 /* NedPooling.cc */; }; + BA06A67823583DBD007740C5 /* AllocatedObj.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A63023583DBD007740C5 /* AllocatedObj.h */; }; + BA06A67923583DBD007740C5 /* AllocatedObj.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A63023583DBD007740C5 /* AllocatedObj.h */; }; + BA06A67A23583DBD007740C5 /* MemTracker.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A63123583DBD007740C5 /* MemTracker.cc */; }; + BA06A67B23583DBD007740C5 /* MemTracker.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A63123583DBD007740C5 /* MemTracker.cc */; }; + BA06A67C23583DBD007740C5 /* MemDef.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A63223583DBD007740C5 /* MemDef.h */; }; + BA06A67D23583DBD007740C5 /* MemDef.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A63223583DBD007740C5 /* MemDef.h */; }; + BA06A67E23583DBD007740C5 /* JeAlloc.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A63323583DBD007740C5 /* JeAlloc.cc */; }; + BA06A67F23583DBD007740C5 /* JeAlloc.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A63323583DBD007740C5 /* JeAlloc.cc */; }; + BA06A68023583DBD007740C5 /* AllocatedObj.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A63423583DBD007740C5 /* AllocatedObj.cc */; }; + BA06A68123583DBD007740C5 /* AllocatedObj.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A63423583DBD007740C5 /* AllocatedObj.cc */; }; + BA06A68223583DBD007740C5 /* MemTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A63523583DBD007740C5 /* MemTracker.h */; }; + BA06A68323583DBD007740C5 /* MemTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A63523583DBD007740C5 /* MemTracker.h */; }; + BA06A68423583DBD007740C5 /* StlAlloc.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A63623583DBD007740C5 /* StlAlloc.h */; }; + BA06A68523583DBD007740C5 /* StlAlloc.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A63623583DBD007740C5 /* StlAlloc.h */; }; + BA06A68623583DBD007740C5 /* Memory.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A63723583DBD007740C5 /* Memory.h */; }; + BA06A68723583DBD007740C5 /* Memory.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A63723583DBD007740C5 /* Memory.h */; }; + BA06A68823583DBD007740C5 /* JeAlloc.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A63823583DBD007740C5 /* JeAlloc.h */; }; + BA06A68923583DBD007740C5 /* JeAlloc.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A63823583DBD007740C5 /* JeAlloc.h */; }; + BA06A68A23583DBD007740C5 /* Memory.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A63923583DBD007740C5 /* Memory.cc */; }; + BA06A68B23583DBD007740C5 /* Memory.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A63923583DBD007740C5 /* Memory.cc */; }; + BA06A68C23583DBD007740C5 /* StdAlloc.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A63A23583DBD007740C5 /* StdAlloc.h */; }; + BA06A68D23583DBD007740C5 /* StdAlloc.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A63A23583DBD007740C5 /* StdAlloc.h */; }; + BA06A68E23583DBD007740C5 /* NedPooling.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A63B23583DBD007740C5 /* NedPooling.h */; }; + BA06A68F23583DBD007740C5 /* NedPooling.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A63B23583DBD007740C5 /* NedPooling.h */; }; + BA06A69023583DBD007740C5 /* StringUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A63D23583DBD007740C5 /* StringUtil.h */; }; + BA06A69123583DBD007740C5 /* StringUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A63D23583DBD007740C5 /* StringUtil.h */; }; + BA06A69223583DBD007740C5 /* StringUtil.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A63E23583DBD007740C5 /* StringUtil.cc */; }; + BA06A69323583DBD007740C5 /* StringUtil.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A63E23583DBD007740C5 /* StringUtil.cc */; }; + BA06A69423583DBD007740C5 /* CoreStd.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A63F23583DBD007740C5 /* CoreStd.cc */; }; + BA06A69523583DBD007740C5 /* CoreStd.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A63F23583DBD007740C5 /* CoreStd.cc */; }; + BA06A69623583DBD007740C5 /* CCMath.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A64123583DBD007740C5 /* CCMath.cc */; }; + BA06A69723583DBD007740C5 /* CCMath.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A64123583DBD007740C5 /* CCMath.cc */; }; + BA06A69823583DBD007740C5 /* CCMath.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A64223583DBD007740C5 /* CCMath.h */; }; + BA06A69923583DBD007740C5 /* CCMath.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A64223583DBD007740C5 /* CCMath.h */; }; + BA06A69A23583DBD007740C5 /* CoreStd.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A64323583DBD007740C5 /* CoreStd.h */; }; + BA06A69B23583DBD007740C5 /* CoreStd.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A64323583DBD007740C5 /* CoreStd.h */; }; + BA06A69C23583DBD007740C5 /* CoreDef.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A64423583DBD007740C5 /* CoreDef.h */; }; + BA06A69D23583DBD007740C5 /* CoreDef.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A64423583DBD007740C5 /* CoreDef.h */; }; + BA06A69E23583DBD007740C5 /* GFXShader.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A64623583DBD007740C5 /* GFXShader.cc */; }; + BA06A69F23583DBD007740C5 /* GFXShader.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A64623583DBD007740C5 /* GFXShader.cc */; }; + BA06A6A023583DBD007740C5 /* GFXShader.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A64723583DBD007740C5 /* GFXShader.h */; }; + BA06A6A123583DBD007740C5 /* GFXShader.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A64723583DBD007740C5 /* GFXShader.h */; }; + BA06A6A223583DBD007740C5 /* GFXDevice.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A64823583DBD007740C5 /* GFXDevice.h */; }; + BA06A6A323583DBD007740C5 /* GFXDevice.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A64823583DBD007740C5 /* GFXDevice.h */; }; + BA06A6A423583DBD007740C5 /* GFXCommandAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A64923583DBD007740C5 /* GFXCommandAllocator.h */; }; + BA06A6A523583DBD007740C5 /* GFXCommandAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A64923583DBD007740C5 /* GFXCommandAllocator.h */; }; + BA06A6A623583DBD007740C5 /* GFXWindow.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A64A23583DBD007740C5 /* GFXWindow.cc */; }; + BA06A6A723583DBD007740C5 /* GFXWindow.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A64A23583DBD007740C5 /* GFXWindow.cc */; }; + BA06A6A823583DBD007740C5 /* GFXTextureView.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A64B23583DBD007740C5 /* GFXTextureView.h */; }; + BA06A6A923583DBD007740C5 /* GFXTextureView.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A64B23583DBD007740C5 /* GFXTextureView.h */; }; + BA06A6AA23583DBD007740C5 /* GFXPipelineLayout.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A64C23583DBD007740C5 /* GFXPipelineLayout.cc */; }; + BA06A6AB23583DBD007740C5 /* GFXPipelineLayout.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A64C23583DBD007740C5 /* GFXPipelineLayout.cc */; }; + BA06A6AC23583DBD007740C5 /* GFXTexture.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A64D23583DBD007740C5 /* GFXTexture.h */; }; + BA06A6AD23583DBD007740C5 /* GFXTexture.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A64D23583DBD007740C5 /* GFXTexture.h */; }; + BA06A6AE23583DBD007740C5 /* GFXBindingLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A64E23583DBD007740C5 /* GFXBindingLayout.h */; }; + BA06A6AF23583DBD007740C5 /* GFXBindingLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A64E23583DBD007740C5 /* GFXBindingLayout.h */; }; + BA06A6B023583DBD007740C5 /* GFXQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A64F23583DBD007740C5 /* GFXQueue.h */; }; + BA06A6B123583DBD007740C5 /* GFXQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A64F23583DBD007740C5 /* GFXQueue.h */; }; + BA06A6B223583DBD007740C5 /* GFXRenderPass.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A65023583DBD007740C5 /* GFXRenderPass.h */; }; + BA06A6B323583DBD007740C5 /* GFXRenderPass.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A65023583DBD007740C5 /* GFXRenderPass.h */; }; + BA06A6B423583DBD007740C5 /* GFXTextureView.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A65123583DBD007740C5 /* GFXTextureView.cc */; }; + BA06A6B523583DBD007740C5 /* GFXTextureView.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A65123583DBD007740C5 /* GFXTextureView.cc */; }; + BA06A6B623583DBD007740C5 /* GFXPipelineLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A65223583DBD007740C5 /* GFXPipelineLayout.h */; }; + BA06A6B723583DBD007740C5 /* GFXPipelineLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A65223583DBD007740C5 /* GFXPipelineLayout.h */; }; + BA06A6B823583DBD007740C5 /* GFXWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A65323583DBD007740C5 /* GFXWindow.h */; }; + BA06A6B923583DBD007740C5 /* GFXWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A65323583DBD007740C5 /* GFXWindow.h */; }; + BA06A6BA23583DBD007740C5 /* GFXDef.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A65423583DBD007740C5 /* GFXDef.cc */; }; + BA06A6BB23583DBD007740C5 /* GFXDef.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A65423583DBD007740C5 /* GFXDef.cc */; }; + BA06A6BC23583DBD007740C5 /* GFXPipelineState.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A65523583DBD007740C5 /* GFXPipelineState.h */; }; + BA06A6BD23583DBD007740C5 /* GFXPipelineState.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A65523583DBD007740C5 /* GFXPipelineState.h */; }; + BA06A6BE23583DBD007740C5 /* GFXDevice.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A65623583DBD007740C5 /* GFXDevice.cc */; }; + BA06A6BF23583DBD007740C5 /* GFXDevice.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A65623583DBD007740C5 /* GFXDevice.cc */; }; + BA06A6C023583DBD007740C5 /* GFXDef.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A65723583DBD007740C5 /* GFXDef.h */; }; + BA06A6C123583DBD007740C5 /* GFXDef.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A65723583DBD007740C5 /* GFXDef.h */; }; + BA06A6C223583DBD007740C5 /* GFXBuffer.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A65823583DBD007740C5 /* GFXBuffer.cc */; }; + BA06A6C323583DBD007740C5 /* GFXBuffer.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A65823583DBD007740C5 /* GFXBuffer.cc */; }; + BA06A6C423583DBD007740C5 /* GFXFramebuffer.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A65923583DBD007740C5 /* GFXFramebuffer.cc */; }; + BA06A6C523583DBD007740C5 /* GFXFramebuffer.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A65923583DBD007740C5 /* GFXFramebuffer.cc */; }; + BA06A6C623583DBD007740C5 /* GFXCommandBuffer.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A65A23583DBD007740C5 /* GFXCommandBuffer.cc */; }; + BA06A6C723583DBD007740C5 /* GFXCommandBuffer.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A65A23583DBD007740C5 /* GFXCommandBuffer.cc */; }; + BA06A6C823583DBD007740C5 /* GFXInputAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A65B23583DBD007740C5 /* GFXInputAssembler.h */; }; + BA06A6C923583DBD007740C5 /* GFXInputAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A65B23583DBD007740C5 /* GFXInputAssembler.h */; }; + BA06A6CA23583DBD007740C5 /* GFXRenderPass.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A65C23583DBD007740C5 /* GFXRenderPass.cc */; }; + BA06A6CB23583DBD007740C5 /* GFXRenderPass.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A65C23583DBD007740C5 /* GFXRenderPass.cc */; }; + BA06A6CC23583DBD007740C5 /* GFXInputAssembler.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A65D23583DBD007740C5 /* GFXInputAssembler.cc */; }; + BA06A6CD23583DBD007740C5 /* GFXInputAssembler.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A65D23583DBD007740C5 /* GFXInputAssembler.cc */; }; + BA06A6CE23583DBD007740C5 /* GFXCommandBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A65E23583DBD007740C5 /* GFXCommandBuffer.h */; }; + BA06A6CF23583DBD007740C5 /* GFXCommandBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A65E23583DBD007740C5 /* GFXCommandBuffer.h */; }; + BA06A6D023583DBD007740C5 /* GFXContext.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A65F23583DBD007740C5 /* GFXContext.h */; }; + BA06A6D123583DBD007740C5 /* GFXContext.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A65F23583DBD007740C5 /* GFXContext.h */; }; + BA06A6D223583DBD007740C5 /* GFXSampler.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A66023583DBD007740C5 /* GFXSampler.cc */; }; + BA06A6D323583DBD007740C5 /* GFXSampler.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A66023583DBD007740C5 /* GFXSampler.cc */; }; + BA06A6D423583DBD007740C5 /* GFXFramebuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A66123583DBD007740C5 /* GFXFramebuffer.h */; }; + BA06A6D523583DBD007740C5 /* GFXFramebuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A66123583DBD007740C5 /* GFXFramebuffer.h */; }; + BA06A6D623583DBD007740C5 /* GFXBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A66223583DBD007740C5 /* GFXBuffer.h */; }; + BA06A6D723583DBD007740C5 /* GFXBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A66223583DBD007740C5 /* GFXBuffer.h */; }; + BA06A6D823583DBD007740C5 /* GFXTexture.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A66323583DBD007740C5 /* GFXTexture.cc */; }; + BA06A6D923583DBD007740C5 /* GFXTexture.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A66323583DBD007740C5 /* GFXTexture.cc */; }; + BA06A6DA23583DBD007740C5 /* GFXSampler.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A66423583DBD007740C5 /* GFXSampler.h */; }; + BA06A6DB23583DBD007740C5 /* GFXSampler.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A66423583DBD007740C5 /* GFXSampler.h */; }; + BA06A6DC23583DBD007740C5 /* GFXBindingLayout.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A66523583DBD007740C5 /* GFXBindingLayout.cc */; }; + BA06A6DD23583DBD007740C5 /* GFXBindingLayout.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A66523583DBD007740C5 /* GFXBindingLayout.cc */; }; + BA06A6DE23583DBD007740C5 /* GFXQueue.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A66623583DBD007740C5 /* GFXQueue.cc */; }; + BA06A6DF23583DBD007740C5 /* GFXQueue.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A66623583DBD007740C5 /* GFXQueue.cc */; }; + BA06A6E023583DBD007740C5 /* GFXCommandAllocator.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A66723583DBD007740C5 /* GFXCommandAllocator.cc */; }; + BA06A6E123583DBD007740C5 /* GFXCommandAllocator.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A66723583DBD007740C5 /* GFXCommandAllocator.cc */; }; + BA06A6E223583DBD007740C5 /* GFXContext.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A66823583DBD007740C5 /* GFXContext.cc */; }; + BA06A6E323583DBD007740C5 /* GFXContext.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A66823583DBD007740C5 /* GFXContext.cc */; }; + BA06A6E423583DBD007740C5 /* GFXPipelineState.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A66923583DBD007740C5 /* GFXPipelineState.cc */; }; + BA06A6E523583DBD007740C5 /* GFXPipelineState.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A66923583DBD007740C5 /* GFXPipelineState.cc */; }; + BA06A6E623583DBD007740C5 /* CachedArray.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A66B23583DBD007740C5 /* CachedArray.h */; }; + BA06A6E723583DBD007740C5 /* CachedArray.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A66B23583DBD007740C5 /* CachedArray.h */; }; + BA06A6E823583DBD007740C5 /* UTFString.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A66C23583DBD007740C5 /* UTFString.cc */; }; + BA06A6E923583DBD007740C5 /* UTFString.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A66C23583DBD007740C5 /* UTFString.cc */; }; + BA06A6EA23583DBD007740C5 /* assertion.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A66D23583DBD007740C5 /* assertion.h */; }; + BA06A6EB23583DBD007740C5 /* assertion.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A66D23583DBD007740C5 /* assertion.h */; }; + BA06A6EC23583DBD007740C5 /* UTFString.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A66E23583DBD007740C5 /* UTFString.h */; }; + BA06A6ED23583DBD007740C5 /* UTFString.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A66E23583DBD007740C5 /* UTFString.h */; }; + BA06A6EE23583DBD007740C5 /* Log.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A66F23583DBD007740C5 /* Log.h */; }; + BA06A6EF23583DBD007740C5 /* Log.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A66F23583DBD007740C5 /* Log.h */; }; + BA06A6F023583DBD007740C5 /* Assertion.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A67023583DBD007740C5 /* Assertion.cc */; }; + BA06A6F123583DBD007740C5 /* Assertion.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A67023583DBD007740C5 /* Assertion.cc */; }; + BA06A6F223583DBD007740C5 /* Object.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A67123583DBD007740C5 /* Object.h */; }; + BA06A6F323583DBD007740C5 /* Object.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A67123583DBD007740C5 /* Object.h */; }; + BA06A6F423583DBD007740C5 /* Log.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A67223583DBD007740C5 /* Log.cc */; }; + BA06A6F523583DBD007740C5 /* Log.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A67223583DBD007740C5 /* Log.cc */; }; + BA06A6F623583DBD007740C5 /* TypeDef.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A67323583DBD007740C5 /* TypeDef.h */; }; + BA06A6F723583DBD007740C5 /* TypeDef.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A67323583DBD007740C5 /* TypeDef.h */; }; + BA06A75F23583DFE007740C5 /* gles2w.mm in Sources */ = {isa = PBXBuildFile; fileRef = BA06A6F923583DFD007740C5 /* gles2w.mm */; }; + BA06A76023583DFE007740C5 /* gles2w.mm in Sources */ = {isa = PBXBuildFile; fileRef = BA06A6F923583DFD007740C5 /* gles2w.mm */; }; + BA06A76123583DFE007740C5 /* GLES2GPUObjects.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A6FA23583DFD007740C5 /* GLES2GPUObjects.h */; }; + BA06A76223583DFE007740C5 /* GLES2GPUObjects.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A6FA23583DFD007740C5 /* GLES2GPUObjects.h */; }; + BA06A76323583DFE007740C5 /* GLES2CommandAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A6FB23583DFD007740C5 /* GLES2CommandAllocator.h */; }; + BA06A76423583DFE007740C5 /* GLES2CommandAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A6FB23583DFD007740C5 /* GLES2CommandAllocator.h */; }; + BA06A76523583DFE007740C5 /* GLES2TextureView.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A6FC23583DFD007740C5 /* GLES2TextureView.h */; }; + BA06A76623583DFE007740C5 /* GLES2TextureView.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A6FC23583DFD007740C5 /* GLES2TextureView.h */; }; + BA06A76723583DFE007740C5 /* GLES2Device.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A6FD23583DFD007740C5 /* GLES2Device.cc */; }; + BA06A76823583DFE007740C5 /* GLES2Device.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A6FD23583DFD007740C5 /* GLES2Device.cc */; }; + BA06A76923583DFE007740C5 /* GLES2PipelineLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A6FE23583DFD007740C5 /* GLES2PipelineLayout.h */; }; + BA06A76A23583DFE007740C5 /* GLES2PipelineLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A6FE23583DFD007740C5 /* GLES2PipelineLayout.h */; }; + BA06A76B23583DFE007740C5 /* GFXGLES2.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A6FF23583DFD007740C5 /* GFXGLES2.h */; }; + BA06A76C23583DFE007740C5 /* GFXGLES2.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A6FF23583DFD007740C5 /* GFXGLES2.h */; }; + BA06A76D23583DFE007740C5 /* GLES2Commands.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A70023583DFD007740C5 /* GLES2Commands.h */; }; + BA06A76E23583DFE007740C5 /* GLES2Commands.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A70023583DFD007740C5 /* GLES2Commands.h */; }; + BA06A76F23583DFE007740C5 /* GLES2Window.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A70123583DFD007740C5 /* GLES2Window.h */; }; + BA06A77023583DFE007740C5 /* GLES2Window.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A70123583DFD007740C5 /* GLES2Window.h */; }; + BA06A77123583DFE007740C5 /* GLES2EGLContext.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A70223583DFD007740C5 /* GLES2EGLContext.cc */; }; + BA06A77223583DFE007740C5 /* GLES2EGLContext.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A70223583DFD007740C5 /* GLES2EGLContext.cc */; }; + BA06A77323583DFE007740C5 /* GLES2Texture.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A70323583DFD007740C5 /* GLES2Texture.cc */; }; + BA06A77423583DFE007740C5 /* GLES2Texture.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A70323583DFD007740C5 /* GLES2Texture.cc */; }; + BA06A77523583DFE007740C5 /* GLES2Framebuffer.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A70423583DFD007740C5 /* GLES2Framebuffer.cc */; }; + BA06A77623583DFE007740C5 /* GLES2Framebuffer.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A70423583DFD007740C5 /* GLES2Framebuffer.cc */; }; + BA06A77723583DFE007740C5 /* GLES2RenderPass.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A70523583DFD007740C5 /* GLES2RenderPass.h */; }; + BA06A77823583DFE007740C5 /* GLES2RenderPass.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A70523583DFD007740C5 /* GLES2RenderPass.h */; }; + BA06A77923583DFE007740C5 /* GLES2InputAssembler.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A70623583DFD007740C5 /* GLES2InputAssembler.cc */; }; + BA06A77A23583DFE007740C5 /* GLES2InputAssembler.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A70623583DFD007740C5 /* GLES2InputAssembler.cc */; }; + BA06A77B23583DFE007740C5 /* GLES2Sampler.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A70723583DFD007740C5 /* GLES2Sampler.cc */; }; + BA06A77C23583DFE007740C5 /* GLES2Sampler.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A70723583DFD007740C5 /* GLES2Sampler.cc */; }; + BA06A77D23583DFE007740C5 /* GLES2Texture.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A70823583DFD007740C5 /* GLES2Texture.h */; }; + BA06A77E23583DFE007740C5 /* GLES2Texture.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A70823583DFD007740C5 /* GLES2Texture.h */; }; + BA06A77F23583DFE007740C5 /* gles2w.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A70923583DFD007740C5 /* gles2w.h */; }; + BA06A78023583DFE007740C5 /* gles2w.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A70923583DFD007740C5 /* gles2w.h */; }; + BA06A78123583DFE007740C5 /* GLES2CommandAllocator.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A70A23583DFD007740C5 /* GLES2CommandAllocator.cc */; }; + BA06A78223583DFE007740C5 /* GLES2CommandAllocator.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A70A23583DFD007740C5 /* GLES2CommandAllocator.cc */; }; + BA06A78323583DFE007740C5 /* GLES2Std.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A70B23583DFD007740C5 /* GLES2Std.cc */; }; + BA06A78423583DFE007740C5 /* GLES2Std.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A70B23583DFD007740C5 /* GLES2Std.cc */; }; + BA06A78523583DFE007740C5 /* GLES2Window.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A70C23583DFD007740C5 /* GLES2Window.cc */; }; + BA06A78623583DFE007740C5 /* GLES2Window.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A70C23583DFD007740C5 /* GLES2Window.cc */; }; + BA06A78723583DFE007740C5 /* GLES2Device.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A70D23583DFD007740C5 /* GLES2Device.h */; }; + BA06A78823583DFE007740C5 /* GLES2Device.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A70D23583DFD007740C5 /* GLES2Device.h */; }; + BA06A78923583DFE007740C5 /* GLES2Shader.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A70E23583DFD007740C5 /* GLES2Shader.h */; }; + BA06A78A23583DFE007740C5 /* GLES2Shader.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A70E23583DFD007740C5 /* GLES2Shader.h */; }; + BA06A78B23583DFE007740C5 /* GLES2Shader.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A70F23583DFD007740C5 /* GLES2Shader.cc */; }; + BA06A78C23583DFE007740C5 /* GLES2Shader.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A70F23583DFD007740C5 /* GLES2Shader.cc */; }; + BA06A78D23583DFE007740C5 /* GLES2CommandBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A71023583DFD007740C5 /* GLES2CommandBuffer.h */; }; + BA06A78E23583DFE007740C5 /* GLES2CommandBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A71023583DFD007740C5 /* GLES2CommandBuffer.h */; }; + BA06A78F23583DFE007740C5 /* GLES2Framebuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A71123583DFD007740C5 /* GLES2Framebuffer.h */; }; + BA06A79023583DFE007740C5 /* GLES2Framebuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A71123583DFD007740C5 /* GLES2Framebuffer.h */; }; + BA06A79123583DFE007740C5 /* GLES2Queue.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A71223583DFD007740C5 /* GLES2Queue.cc */; }; + BA06A79223583DFE007740C5 /* GLES2Queue.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A71223583DFD007740C5 /* GLES2Queue.cc */; }; + BA06A79323583DFE007740C5 /* GLES2StateCache.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A71323583DFD007740C5 /* GLES2StateCache.h */; }; + BA06A79423583DFE007740C5 /* GLES2StateCache.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A71323583DFD007740C5 /* GLES2StateCache.h */; }; + BA06A79523583DFE007740C5 /* GLES2PipelineState.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A71423583DFD007740C5 /* GLES2PipelineState.cc */; }; + BA06A79623583DFE007740C5 /* GLES2PipelineState.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A71423583DFD007740C5 /* GLES2PipelineState.cc */; }; + BA06A79723583DFE007740C5 /* GLES2RenderPass.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A71523583DFD007740C5 /* GLES2RenderPass.cc */; }; + BA06A79823583DFE007740C5 /* GLES2RenderPass.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A71523583DFD007740C5 /* GLES2RenderPass.cc */; }; + BA06A79923583DFE007740C5 /* GLES2Sampler.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A71623583DFD007740C5 /* GLES2Sampler.h */; }; + BA06A79A23583DFE007740C5 /* GLES2Sampler.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A71623583DFD007740C5 /* GLES2Sampler.h */; }; + BA06A79B23583DFE007740C5 /* GLES2PipelineState.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A71723583DFD007740C5 /* GLES2PipelineState.h */; }; + BA06A79C23583DFE007740C5 /* GLES2PipelineState.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A71723583DFD007740C5 /* GLES2PipelineState.h */; }; + BA06A79D23583DFE007740C5 /* GLES2BindingLayout.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A71823583DFD007740C5 /* GLES2BindingLayout.cc */; }; + BA06A79E23583DFE007740C5 /* GLES2BindingLayout.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A71823583DFD007740C5 /* GLES2BindingLayout.cc */; }; + BA06A79F23583DFE007740C5 /* GLES2EGLContext.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A71923583DFD007740C5 /* GLES2EGLContext.h */; }; + BA06A7A023583DFE007740C5 /* GLES2EGLContext.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A71923583DFD007740C5 /* GLES2EGLContext.h */; }; + BA06A7A123583DFE007740C5 /* gles2w.c in Sources */ = {isa = PBXBuildFile; fileRef = BA06A71A23583DFD007740C5 /* gles2w.c */; }; + BA06A7A223583DFE007740C5 /* gles2w.c in Sources */ = {isa = PBXBuildFile; fileRef = BA06A71A23583DFD007740C5 /* gles2w.c */; }; + BA06A7A323583DFE007740C5 /* GLES2Commands.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A71B23583DFD007740C5 /* GLES2Commands.cc */; }; + BA06A7A423583DFE007740C5 /* GLES2Commands.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A71B23583DFD007740C5 /* GLES2Commands.cc */; }; + BA06A7A523583DFE007740C5 /* GLES2Queue.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A71C23583DFD007740C5 /* GLES2Queue.h */; }; + BA06A7A623583DFE007740C5 /* GLES2Queue.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A71C23583DFD007740C5 /* GLES2Queue.h */; }; + BA06A7A723583DFE007740C5 /* GLES2PipelineLayout.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A71D23583DFD007740C5 /* GLES2PipelineLayout.cc */; }; + BA06A7A823583DFE007740C5 /* GLES2PipelineLayout.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A71D23583DFD007740C5 /* GLES2PipelineLayout.cc */; }; + BA06A7A923583DFE007740C5 /* GLES2CommandPool.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A71E23583DFD007740C5 /* GLES2CommandPool.h */; }; + BA06A7AA23583DFE007740C5 /* GLES2CommandPool.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A71E23583DFD007740C5 /* GLES2CommandPool.h */; }; + BA06A7AB23583DFE007740C5 /* GLES2Std.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A71F23583DFD007740C5 /* GLES2Std.h */; }; + BA06A7AC23583DFE007740C5 /* GLES2Std.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A71F23583DFD007740C5 /* GLES2Std.h */; }; + BA06A7AD23583DFE007740C5 /* GLES2Buffer.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A72023583DFD007740C5 /* GLES2Buffer.h */; }; + BA06A7AE23583DFE007740C5 /* GLES2Buffer.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A72023583DFD007740C5 /* GLES2Buffer.h */; }; + BA06A7AF23583DFE007740C5 /* GLES2BindingLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A72123583DFD007740C5 /* GLES2BindingLayout.h */; }; + BA06A7B023583DFE007740C5 /* GLES2BindingLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A72123583DFD007740C5 /* GLES2BindingLayout.h */; }; + BA06A7B123583DFE007740C5 /* GLES2InputAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A72223583DFD007740C5 /* GLES2InputAssembler.h */; }; + BA06A7B223583DFE007740C5 /* GLES2InputAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A72223583DFD007740C5 /* GLES2InputAssembler.h */; }; + BA06A7B323583DFE007740C5 /* GLES2Buffer.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A72323583DFD007740C5 /* GLES2Buffer.cc */; }; + BA06A7B423583DFE007740C5 /* GLES2Buffer.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A72323583DFD007740C5 /* GLES2Buffer.cc */; }; + BA06A7B523583DFE007740C5 /* GLES2TextureView.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A72423583DFD007740C5 /* GLES2TextureView.cc */; }; + BA06A7B623583DFE007740C5 /* GLES2TextureView.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A72423583DFD007740C5 /* GLES2TextureView.cc */; }; + BA06A7B723583DFE007740C5 /* GLES2CommandBuffer.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A72523583DFD007740C5 /* GLES2CommandBuffer.cc */; }; + BA06A7B823583DFE007740C5 /* GLES2CommandBuffer.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A72523583DFD007740C5 /* GLES2CommandBuffer.cc */; }; + BA06A7B923583DFE007740C5 /* wglew.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A72823583DFD007740C5 /* wglew.h */; }; + BA06A7BA23583DFE007740C5 /* wglew.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A72823583DFD007740C5 /* wglew.h */; }; + BA06A7BB23583DFE007740C5 /* glew.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A72923583DFD007740C5 /* glew.h */; }; + BA06A7BC23583DFE007740C5 /* glew.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A72923583DFD007740C5 /* glew.h */; }; + BA06A7BD23583DFE007740C5 /* GLStd.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A72A23583DFD007740C5 /* GLStd.h */; }; + BA06A7BE23583DFE007740C5 /* GLStd.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A72A23583DFD007740C5 /* GLStd.h */; }; + BA06A7BF23583DFE007740C5 /* GLStd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BA06A72B23583DFD007740C5 /* GLStd.cpp */; }; + BA06A7C023583DFE007740C5 /* GLStd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BA06A72B23583DFD007740C5 /* GLStd.cpp */; }; + BA06A7C123583DFE007740C5 /* MetalStd.mm in Sources */ = {isa = PBXBuildFile; fileRef = BA06A72D23583DFD007740C5 /* MetalStd.mm */; }; + BA06A7C223583DFE007740C5 /* MetalStd.mm in Sources */ = {isa = PBXBuildFile; fileRef = BA06A72D23583DFD007740C5 /* MetalStd.mm */; }; + BA06A7C323583DFE007740C5 /* MetalStd.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A72E23583DFD007740C5 /* MetalStd.h */; }; + BA06A7C423583DFE007740C5 /* MetalStd.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A72E23583DFD007740C5 /* MetalStd.h */; }; + BA06A7C523583DFE007740C5 /* MTLbuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A72F23583DFD007740C5 /* MTLbuffer.h */; }; + BA06A7C623583DFE007740C5 /* MTLbuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A72F23583DFD007740C5 /* MTLbuffer.h */; }; + BA06A7C723583DFE007740C5 /* MTLbuffer.mm in Sources */ = {isa = PBXBuildFile; fileRef = BA06A73023583DFD007740C5 /* MTLbuffer.mm */; }; + BA06A7C823583DFE007740C5 /* MTLbuffer.mm in Sources */ = {isa = PBXBuildFile; fileRef = BA06A73023583DFD007740C5 /* MTLbuffer.mm */; }; + BA06A7C923583DFE007740C5 /* GLES3Window.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A73223583DFD007740C5 /* GLES3Window.h */; }; + BA06A7CA23583DFE007740C5 /* GLES3Window.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A73223583DFD007740C5 /* GLES3Window.h */; }; + BA06A7CB23583DFE007740C5 /* GLES3EGLContext.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A73323583DFD007740C5 /* GLES3EGLContext.h */; }; + BA06A7CC23583DFE007740C5 /* GLES3EGLContext.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A73323583DFD007740C5 /* GLES3EGLContext.h */; }; + BA06A7CD23583DFE007740C5 /* GLES3InputAssembler.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A73423583DFD007740C5 /* GLES3InputAssembler.cc */; }; + BA06A7CE23583DFE007740C5 /* GLES3InputAssembler.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A73423583DFD007740C5 /* GLES3InputAssembler.cc */; }; + BA06A7CF23583DFE007740C5 /* GLES3Sampler.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A73523583DFD007740C5 /* GLES3Sampler.cc */; }; + BA06A7D023583DFE007740C5 /* GLES3Sampler.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A73523583DFD007740C5 /* GLES3Sampler.cc */; }; + BA06A7D123583DFE007740C5 /* gles3w.mm in Sources */ = {isa = PBXBuildFile; fileRef = BA06A73623583DFD007740C5 /* gles3w.mm */; }; + BA06A7D223583DFE007740C5 /* gles3w.mm in Sources */ = {isa = PBXBuildFile; fileRef = BA06A73623583DFD007740C5 /* gles3w.mm */; }; + BA06A7D323583DFE007740C5 /* GLES3EGLContext.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A73723583DFD007740C5 /* GLES3EGLContext.cc */; }; + BA06A7D423583DFE007740C5 /* GLES3EGLContext.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A73723583DFD007740C5 /* GLES3EGLContext.cc */; }; + BA06A7D523583DFE007740C5 /* GLES3TextureView.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A73823583DFD007740C5 /* GLES3TextureView.cc */; }; + BA06A7D623583DFE007740C5 /* GLES3TextureView.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A73823583DFD007740C5 /* GLES3TextureView.cc */; }; + BA06A7D723583DFE007740C5 /* GLES3Device.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A73923583DFD007740C5 /* GLES3Device.cc */; }; + BA06A7D823583DFE007740C5 /* GLES3Device.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A73923583DFD007740C5 /* GLES3Device.cc */; }; + BA06A7D923583DFE007740C5 /* GLES3CommandAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A73A23583DFD007740C5 /* GLES3CommandAllocator.h */; }; + BA06A7DA23583DFE007740C5 /* GLES3CommandAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A73A23583DFD007740C5 /* GLES3CommandAllocator.h */; }; + BA06A7DB23583DFE007740C5 /* GLES3TextureView.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A73B23583DFD007740C5 /* GLES3TextureView.h */; }; + BA06A7DC23583DFE007740C5 /* GLES3TextureView.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A73B23583DFD007740C5 /* GLES3TextureView.h */; }; + BA06A7DD23583DFE007740C5 /* GLES3Std.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A73C23583DFD007740C5 /* GLES3Std.cc */; }; + BA06A7DE23583DFE007740C5 /* GLES3Std.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A73C23583DFD007740C5 /* GLES3Std.cc */; }; + BA06A7DF23583DFE007740C5 /* GLES3StateCache.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A73D23583DFD007740C5 /* GLES3StateCache.h */; }; + BA06A7E023583DFE007740C5 /* GLES3StateCache.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A73D23583DFD007740C5 /* GLES3StateCache.h */; }; + BA06A7E123583DFE007740C5 /* GLES3Shader.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A73E23583DFD007740C5 /* GLES3Shader.h */; }; + BA06A7E223583DFE007740C5 /* GLES3Shader.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A73E23583DFD007740C5 /* GLES3Shader.h */; }; + BA06A7E323583DFE007740C5 /* GLES3Device.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A73F23583DFD007740C5 /* GLES3Device.h */; }; + BA06A7E423583DFE007740C5 /* GLES3Device.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A73F23583DFD007740C5 /* GLES3Device.h */; }; + BA06A7E523583DFE007740C5 /* GLES3PipelineLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A74023583DFD007740C5 /* GLES3PipelineLayout.h */; }; + BA06A7E623583DFE007740C5 /* GLES3PipelineLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A74023583DFD007740C5 /* GLES3PipelineLayout.h */; }; + BA06A7E723583DFE007740C5 /* GLES3CommandBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A74123583DFD007740C5 /* GLES3CommandBuffer.h */; }; + BA06A7E823583DFE007740C5 /* GLES3CommandBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A74123583DFD007740C5 /* GLES3CommandBuffer.h */; }; + BA06A7E923583DFE007740C5 /* GLES3Texture.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A74223583DFD007740C5 /* GLES3Texture.h */; }; + BA06A7EA23583DFE007740C5 /* GLES3Texture.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A74223583DFD007740C5 /* GLES3Texture.h */; }; + BA06A7EB23583DFE007740C5 /* GLES3Queue.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A74323583DFD007740C5 /* GLES3Queue.h */; }; + BA06A7EC23583DFE007740C5 /* GLES3Queue.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A74323583DFD007740C5 /* GLES3Queue.h */; }; + BA06A7ED23583DFE007740C5 /* GLES3Commands.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A74423583DFD007740C5 /* GLES3Commands.cc */; }; + BA06A7EE23583DFE007740C5 /* GLES3Commands.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A74423583DFD007740C5 /* GLES3Commands.cc */; }; + BA06A7EF23583DFE007740C5 /* gles3w.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A74523583DFD007740C5 /* gles3w.h */; }; + BA06A7F023583DFE007740C5 /* gles3w.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A74523583DFD007740C5 /* gles3w.h */; }; + BA06A7F123583DFE007740C5 /* GLES3Window.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A74623583DFD007740C5 /* GLES3Window.cc */; }; + BA06A7F223583DFE007740C5 /* GLES3Window.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A74623583DFD007740C5 /* GLES3Window.cc */; }; + BA06A7F323583DFE007740C5 /* GLES3Commands.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A74723583DFD007740C5 /* GLES3Commands.h */; }; + BA06A7F423583DFE007740C5 /* GLES3Commands.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A74723583DFD007740C5 /* GLES3Commands.h */; }; + BA06A7F523583DFE007740C5 /* GLES3Texture.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A74823583DFD007740C5 /* GLES3Texture.cc */; }; + BA06A7F623583DFE007740C5 /* GLES3Texture.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A74823583DFD007740C5 /* GLES3Texture.cc */; }; + BA06A7F723583DFE007740C5 /* GLES3Shader.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A74923583DFD007740C5 /* GLES3Shader.cc */; }; + BA06A7F823583DFE007740C5 /* GLES3Shader.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A74923583DFD007740C5 /* GLES3Shader.cc */; }; + BA06A7F923583DFE007740C5 /* GLES3RenderPass.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A74A23583DFD007740C5 /* GLES3RenderPass.h */; }; + BA06A7FA23583DFE007740C5 /* GLES3RenderPass.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A74A23583DFD007740C5 /* GLES3RenderPass.h */; }; + BA06A7FB23583DFE007740C5 /* GLES3InputAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A74B23583DFD007740C5 /* GLES3InputAssembler.h */; }; + BA06A7FC23583DFE007740C5 /* GLES3InputAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A74B23583DFD007740C5 /* GLES3InputAssembler.h */; }; + BA06A7FD23583DFE007740C5 /* GLES3PipelineState.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A74C23583DFD007740C5 /* GLES3PipelineState.h */; }; + BA06A7FE23583DFE007740C5 /* GLES3PipelineState.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A74C23583DFD007740C5 /* GLES3PipelineState.h */; }; + BA06A7FF23583DFE007740C5 /* GLES3CommandAllocator.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A74D23583DFD007740C5 /* GLES3CommandAllocator.cc */; }; + BA06A80023583DFE007740C5 /* GLES3CommandAllocator.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A74D23583DFD007740C5 /* GLES3CommandAllocator.cc */; }; + BA06A80123583DFE007740C5 /* GLES3PipelineLayout.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A74E23583DFD007740C5 /* GLES3PipelineLayout.cc */; }; + BA06A80223583DFE007740C5 /* GLES3PipelineLayout.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A74E23583DFD007740C5 /* GLES3PipelineLayout.cc */; }; + BA06A80323583DFE007740C5 /* GLES3CommandBuffer.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A74F23583DFD007740C5 /* GLES3CommandBuffer.cc */; }; + BA06A80423583DFE007740C5 /* GLES3CommandBuffer.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A74F23583DFD007740C5 /* GLES3CommandBuffer.cc */; }; + BA06A80523583DFE007740C5 /* GLES3Framebuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A75023583DFD007740C5 /* GLES3Framebuffer.h */; }; + BA06A80623583DFE007740C5 /* GLES3Framebuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A75023583DFD007740C5 /* GLES3Framebuffer.h */; }; + BA06A80723583DFE007740C5 /* GLES3Sampler.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A75123583DFD007740C5 /* GLES3Sampler.h */; }; + BA06A80823583DFE007740C5 /* GLES3Sampler.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A75123583DFD007740C5 /* GLES3Sampler.h */; }; + BA06A80923583DFE007740C5 /* GLES3Queue.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A75223583DFD007740C5 /* GLES3Queue.cc */; }; + BA06A80A23583DFE007740C5 /* GLES3Queue.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A75223583DFD007740C5 /* GLES3Queue.cc */; }; + BA06A80B23583DFE007740C5 /* GLES3RenderPass.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A75323583DFD007740C5 /* GLES3RenderPass.cc */; }; + BA06A80C23583DFE007740C5 /* GLES3RenderPass.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A75323583DFD007740C5 /* GLES3RenderPass.cc */; }; + BA06A80D23583DFE007740C5 /* GLES3GPUObjects.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A75423583DFD007740C5 /* GLES3GPUObjects.h */; }; + BA06A80E23583DFE007740C5 /* GLES3GPUObjects.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A75423583DFD007740C5 /* GLES3GPUObjects.h */; }; + BA06A80F23583DFE007740C5 /* GLES3Framebuffer.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A75523583DFD007740C5 /* GLES3Framebuffer.cc */; }; + BA06A81023583DFE007740C5 /* GLES3Framebuffer.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A75523583DFD007740C5 /* GLES3Framebuffer.cc */; }; + BA06A81123583DFE007740C5 /* GLES3BindingLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A75623583DFD007740C5 /* GLES3BindingLayout.h */; }; + BA06A81223583DFE007740C5 /* GLES3BindingLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A75623583DFD007740C5 /* GLES3BindingLayout.h */; }; + BA06A81323583DFE007740C5 /* GLES3BindingLayout.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A75723583DFD007740C5 /* GLES3BindingLayout.cc */; }; + BA06A81423583DFE007740C5 /* GLES3BindingLayout.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A75723583DFD007740C5 /* GLES3BindingLayout.cc */; }; + BA06A81523583DFE007740C5 /* GLES3Std.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A75823583DFD007740C5 /* GLES3Std.h */; }; + BA06A81623583DFE007740C5 /* GLES3Std.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A75823583DFD007740C5 /* GLES3Std.h */; }; + BA06A81723583DFE007740C5 /* GFXGLES3.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A75923583DFD007740C5 /* GFXGLES3.h */; }; + BA06A81823583DFE007740C5 /* GFXGLES3.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A75923583DFD007740C5 /* GFXGLES3.h */; }; + BA06A81923583DFE007740C5 /* GLES3PipelineState.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A75A23583DFD007740C5 /* GLES3PipelineState.cc */; }; + BA06A81A23583DFE007740C5 /* GLES3PipelineState.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A75A23583DFD007740C5 /* GLES3PipelineState.cc */; }; + BA06A81B23583DFE007740C5 /* GLES3Buffer.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A75B23583DFD007740C5 /* GLES3Buffer.h */; }; + BA06A81C23583DFE007740C5 /* GLES3Buffer.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A75B23583DFD007740C5 /* GLES3Buffer.h */; }; + BA06A81D23583DFE007740C5 /* GLES3Buffer.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A75C23583DFD007740C5 /* GLES3Buffer.cc */; }; + BA06A81E23583DFE007740C5 /* GLES3Buffer.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA06A75C23583DFD007740C5 /* GLES3Buffer.cc */; }; + BA06A81F23583DFE007740C5 /* gles3w.c in Sources */ = {isa = PBXBuildFile; fileRef = BA06A75D23583DFD007740C5 /* gles3w.c */; }; + BA06A82023583DFE007740C5 /* gles3w.c in Sources */ = {isa = PBXBuildFile; fileRef = BA06A75D23583DFD007740C5 /* gles3w.c */; }; + BA06A82123583DFE007740C5 /* GLES3CommandPool.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A75E23583DFD007740C5 /* GLES3CommandPool.h */; }; + BA06A82223583DFE007740C5 /* GLES3CommandPool.h in Headers */ = {isa = PBXBuildFile; fileRef = BA06A75E23583DFD007740C5 /* GLES3CommandPool.h */; }; BA0DAAEF1DB76F2C00EE23AD /* libwebp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BA0DAAEE1DB76F2C00EE23AD /* libwebp.a */; }; BA21055821008B6600E19975 /* jsb_cocos2dx_extension_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BA21055721008B6600E19975 /* jsb_cocos2dx_extension_auto.cpp */; }; BA21055921008B6600E19975 /* jsb_cocos2dx_extension_auto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BA21055721008B6600E19975 /* jsb_cocos2dx_extension_auto.cpp */; }; @@ -1443,314 +999,6 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 0418549D228D7E5700F8DF31 /* ParticleSimulator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ParticleSimulator.cpp; path = "../cocos/editor-support/particle/ParticleSimulator.cpp"; sourceTree = ""; }; - 0418549E228D7E5700F8DF31 /* ParticleSimulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ParticleSimulator.h; path = "../cocos/editor-support/particle/ParticleSimulator.h"; sourceTree = ""; }; - 041854A3228D7E7200F8DF31 /* jsb_cocos2dx_particle_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsb_cocos2dx_particle_auto.hpp; sourceTree = ""; }; - 041854A4228D7E7300F8DF31 /* jsb_cocos2dx_particle_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_cocos2dx_particle_auto.cpp; sourceTree = ""; }; - 042058CB22A61B340092DE5D /* RenderDataList.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RenderDataList.cpp; sourceTree = ""; }; - 042058CC22A61B340092DE5D /* RenderDataList.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = RenderDataList.hpp; sourceTree = ""; }; - 0431A06722CCA441003356C9 /* AssemblerSprite.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AssemblerSprite.cpp; sourceTree = ""; }; - 0431A06822CCA441003356C9 /* AssemblerSprite.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = AssemblerSprite.hpp; sourceTree = ""; }; - 0431A06D22CCA7C1003356C9 /* SimpleSprite2D.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleSprite2D.cpp; sourceTree = ""; }; - 0431A06E22CCA7C1003356C9 /* SimpleSprite2D.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = SimpleSprite2D.hpp; sourceTree = ""; }; - 04355814217EADF300B9C056 /* IOBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IOBuffer.cpp; path = "../cocos/editor-support/IOBuffer.cpp"; sourceTree = ""; }; - 04355815217EADF300B9C056 /* IOBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IOBuffer.h; path = "../cocos/editor-support/IOBuffer.h"; sourceTree = ""; }; - 044597F322D332D700924443 /* Extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Extension.h; path = "../cocos/editor-support/spine/Extension.h"; sourceTree = ""; }; - 045F672622A50A8C0033F7BD /* RenderData.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = RenderData.cpp; sourceTree = ""; }; - 045F672722A50A8C0033F7BD /* RenderData.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = RenderData.hpp; sourceTree = ""; }; - 046B6888219FA61200B33469 /* MiddlewareManager.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = MiddlewareManager.cpp; path = "../cocos/editor-support/MiddlewareManager.cpp"; sourceTree = ""; }; - 046B6889219FA61200B33469 /* MiddlewareManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = MiddlewareManager.h; path = "../cocos/editor-support/MiddlewareManager.h"; sourceTree = ""; }; - 046B688E21A00F5600B33469 /* IOTypedArray.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = IOTypedArray.cpp; path = "../cocos/editor-support/IOTypedArray.cpp"; sourceTree = ""; }; - 046B688F21A00F5600B33469 /* IOTypedArray.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = IOTypedArray.h; path = "../cocos/editor-support/IOTypedArray.h"; sourceTree = ""; }; - 046B689421A10D5800B33469 /* MiddlewareMacro.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = MiddlewareMacro.h; path = "../cocos/editor-support/MiddlewareMacro.h"; sourceTree = ""; }; - 046B68A421A292D200B33469 /* jsb_spine_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_spine_manual.cpp; sourceTree = ""; }; - 046B68A521A292D200B33469 /* jsb_spine_manual.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsb_spine_manual.hpp; sourceTree = ""; }; - 046B68AA21A294B100B33469 /* jsb_cocos2dx_spine_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsb_cocos2dx_spine_auto.hpp; sourceTree = ""; }; - 046B68AB21A294B100B33469 /* jsb_cocos2dx_spine_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_cocos2dx_spine_auto.cpp; sourceTree = ""; }; - 046E060B2185B37000B24E2D /* CCArmatureDisplay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCArmatureDisplay.h; path = "../cocos/editor-support/dragonbones-creator-support/CCArmatureDisplay.h"; sourceTree = ""; }; - 046E060C2185B37000B24E2D /* CCSlot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCSlot.cpp; path = "../cocos/editor-support/dragonbones-creator-support/CCSlot.cpp"; sourceTree = ""; }; - 046E060D2185B37000B24E2D /* CCTextureAtlasData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCTextureAtlasData.h; path = "../cocos/editor-support/dragonbones-creator-support/CCTextureAtlasData.h"; sourceTree = ""; }; - 046E060E2185B37000B24E2D /* CCFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCFactory.h; path = "../cocos/editor-support/dragonbones-creator-support/CCFactory.h"; sourceTree = ""; }; - 046E060F2185B37100B24E2D /* CCFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCFactory.cpp; path = "../cocos/editor-support/dragonbones-creator-support/CCFactory.cpp"; sourceTree = ""; }; - 046E06102185B37100B24E2D /* CCDragonBonesHeaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCDragonBonesHeaders.h; path = "../cocos/editor-support/dragonbones-creator-support/CCDragonBonesHeaders.h"; sourceTree = ""; }; - 046E06112185B37100B24E2D /* CCArmatureDisplay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCArmatureDisplay.cpp; path = "../cocos/editor-support/dragonbones-creator-support/CCArmatureDisplay.cpp"; sourceTree = ""; }; - 046E06122185B37100B24E2D /* CCTextureAtlasData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCTextureAtlasData.cpp; path = "../cocos/editor-support/dragonbones-creator-support/CCTextureAtlasData.cpp"; sourceTree = ""; }; - 046E06132185B37100B24E2D /* CCSlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCSlot.h; path = "../cocos/editor-support/dragonbones-creator-support/CCSlot.h"; sourceTree = ""; }; - 046E06262185B40F00B24E2D /* BaseTimelineState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BaseTimelineState.cpp; path = "../cocos/editor-support/dragonbones/animation/BaseTimelineState.cpp"; sourceTree = ""; }; - 046E06272185B41000B24E2D /* Animation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Animation.h; path = "../cocos/editor-support/dragonbones/animation/Animation.h"; sourceTree = ""; }; - 046E06282185B41000B24E2D /* TimelineState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TimelineState.cpp; path = "../cocos/editor-support/dragonbones/animation/TimelineState.cpp"; sourceTree = ""; }; - 046E06292185B41000B24E2D /* AnimationState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AnimationState.cpp; path = "../cocos/editor-support/dragonbones/animation/AnimationState.cpp"; sourceTree = ""; }; - 046E062A2185B41000B24E2D /* WorldClock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WorldClock.cpp; path = "../cocos/editor-support/dragonbones/animation/WorldClock.cpp"; sourceTree = ""; }; - 046E062B2185B41000B24E2D /* WorldClock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WorldClock.h; path = "../cocos/editor-support/dragonbones/animation/WorldClock.h"; sourceTree = ""; }; - 046E062C2185B41000B24E2D /* TimelineState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TimelineState.h; path = "../cocos/editor-support/dragonbones/animation/TimelineState.h"; sourceTree = ""; }; - 046E062D2185B41000B24E2D /* AnimationState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AnimationState.h; path = "../cocos/editor-support/dragonbones/animation/AnimationState.h"; sourceTree = ""; }; - 046E062E2185B41000B24E2D /* BaseTimelineState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BaseTimelineState.h; path = "../cocos/editor-support/dragonbones/animation/BaseTimelineState.h"; sourceTree = ""; }; - 046E062F2185B41000B24E2D /* Animation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Animation.cpp; path = "../cocos/editor-support/dragonbones/animation/Animation.cpp"; sourceTree = ""; }; - 046E06302185B41100B24E2D /* IAnimatable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IAnimatable.h; path = "../cocos/editor-support/dragonbones/animation/IAnimatable.h"; sourceTree = ""; }; - 046E06472185B41A00B24E2D /* Bone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Bone.h; path = "../cocos/editor-support/dragonbones/armature/Bone.h"; sourceTree = ""; }; - 046E06482185B41A00B24E2D /* TransformObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TransformObject.cpp; path = "../cocos/editor-support/dragonbones/armature/TransformObject.cpp"; sourceTree = ""; }; - 046E06492185B41A00B24E2D /* Armature.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Armature.cpp; path = "../cocos/editor-support/dragonbones/armature/Armature.cpp"; sourceTree = ""; }; - 046E064A2185B41A00B24E2D /* DeformVertices.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DeformVertices.cpp; path = "../cocos/editor-support/dragonbones/armature/DeformVertices.cpp"; sourceTree = ""; }; - 046E064B2185B41A00B24E2D /* Constraint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Constraint.cpp; path = "../cocos/editor-support/dragonbones/armature/Constraint.cpp"; sourceTree = ""; }; - 046E064C2185B41A00B24E2D /* TransformObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TransformObject.h; path = "../cocos/editor-support/dragonbones/armature/TransformObject.h"; sourceTree = ""; }; - 046E064D2185B41A00B24E2D /* DeformVertices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DeformVertices.h; path = "../cocos/editor-support/dragonbones/armature/DeformVertices.h"; sourceTree = ""; }; - 046E064E2185B41A00B24E2D /* Slot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Slot.h; path = "../cocos/editor-support/dragonbones/armature/Slot.h"; sourceTree = ""; }; - 046E064F2185B41A00B24E2D /* Armature.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Armature.h; path = "../cocos/editor-support/dragonbones/armature/Armature.h"; sourceTree = ""; }; - 046E06502185B41B00B24E2D /* Bone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Bone.cpp; path = "../cocos/editor-support/dragonbones/armature/Bone.cpp"; sourceTree = ""; }; - 046E06512185B41B00B24E2D /* Constraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Constraint.h; path = "../cocos/editor-support/dragonbones/armature/Constraint.h"; sourceTree = ""; }; - 046E06522185B41B00B24E2D /* IArmatureProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IArmatureProxy.h; path = "../cocos/editor-support/dragonbones/armature/IArmatureProxy.h"; sourceTree = ""; }; - 046E06532185B41B00B24E2D /* Slot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Slot.cpp; path = "../cocos/editor-support/dragonbones/armature/Slot.cpp"; sourceTree = ""; }; - 046E066E2185B42400B24E2D /* BaseObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BaseObject.cpp; path = "../cocos/editor-support/dragonbones/core/BaseObject.cpp"; sourceTree = ""; }; - 046E066F2185B42400B24E2D /* DragonBones.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DragonBones.cpp; path = "../cocos/editor-support/dragonbones/core/DragonBones.cpp"; sourceTree = ""; }; - 046E06702185B42500B24E2D /* DragonBones.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DragonBones.h; path = "../cocos/editor-support/dragonbones/core/DragonBones.h"; sourceTree = ""; }; - 046E06712185B42500B24E2D /* BaseObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BaseObject.h; path = "../cocos/editor-support/dragonbones/core/BaseObject.h"; sourceTree = ""; }; - 046E067A2185B42F00B24E2D /* DragonBonesHeaders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DragonBonesHeaders.h; path = "../cocos/editor-support/dragonbones/DragonBonesHeaders.h"; sourceTree = ""; }; - 046E067D2185B43B00B24E2D /* IEventDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IEventDispatcher.h; path = "../cocos/editor-support/dragonbones/event/IEventDispatcher.h"; sourceTree = ""; }; - 046E067E2185B43B00B24E2D /* EventObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EventObject.cpp; path = "../cocos/editor-support/dragonbones/event/EventObject.cpp"; sourceTree = ""; }; - 046E067F2185B43B00B24E2D /* EventObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EventObject.h; path = "../cocos/editor-support/dragonbones/event/EventObject.h"; sourceTree = ""; }; - 046E06862185B44A00B24E2D /* BaseFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BaseFactory.cpp; path = "../cocos/editor-support/dragonbones/factory/BaseFactory.cpp"; sourceTree = ""; }; - 046E06872185B44A00B24E2D /* BaseFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BaseFactory.h; path = "../cocos/editor-support/dragonbones/factory/BaseFactory.h"; sourceTree = ""; }; - 046E068C2185B45200B24E2D /* Rectangle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Rectangle.h; path = "../cocos/editor-support/dragonbones/geom/Rectangle.h"; sourceTree = ""; }; - 046E068D2185B45200B24E2D /* ColorTransform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ColorTransform.h; path = "../cocos/editor-support/dragonbones/geom/ColorTransform.h"; sourceTree = ""; }; - 046E068E2185B45200B24E2D /* Transform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Transform.cpp; path = "../cocos/editor-support/dragonbones/geom/Transform.cpp"; sourceTree = ""; }; - 046E068F2185B45200B24E2D /* Matrix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Matrix.h; path = "../cocos/editor-support/dragonbones/geom/Matrix.h"; sourceTree = ""; }; - 046E06902185B45300B24E2D /* Point.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Point.cpp; path = "../cocos/editor-support/dragonbones/geom/Point.cpp"; sourceTree = ""; }; - 046E06912185B45300B24E2D /* Transform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Transform.h; path = "../cocos/editor-support/dragonbones/geom/Transform.h"; sourceTree = ""; }; - 046E06922185B45300B24E2D /* Point.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Point.h; path = "../cocos/editor-support/dragonbones/geom/Point.h"; sourceTree = ""; }; - 046E06A12185B49B00B24E2D /* AnimationData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AnimationData.h; path = "../cocos/editor-support/dragonbones/model/AnimationData.h"; sourceTree = ""; }; - 046E06A22185B49B00B24E2D /* ConstraintData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ConstraintData.cpp; path = "../cocos/editor-support/dragonbones/model/ConstraintData.cpp"; sourceTree = ""; }; - 046E06A32185B49B00B24E2D /* TextureAtlasData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TextureAtlasData.cpp; path = "../cocos/editor-support/dragonbones/model/TextureAtlasData.cpp"; sourceTree = ""; }; - 046E06A42185B49C00B24E2D /* UserData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UserData.h; path = "../cocos/editor-support/dragonbones/model/UserData.h"; sourceTree = ""; }; - 046E06A52185B49C00B24E2D /* BoundingBoxData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BoundingBoxData.cpp; path = "../cocos/editor-support/dragonbones/model/BoundingBoxData.cpp"; sourceTree = ""; }; - 046E06A62185B49C00B24E2D /* TextureAtlasData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextureAtlasData.h; path = "../cocos/editor-support/dragonbones/model/TextureAtlasData.h"; sourceTree = ""; }; - 046E06A72185B49C00B24E2D /* ArmatureData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ArmatureData.cpp; path = "../cocos/editor-support/dragonbones/model/ArmatureData.cpp"; sourceTree = ""; }; - 046E06A82185B49C00B24E2D /* AnimationConfig.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AnimationConfig.cpp; path = "../cocos/editor-support/dragonbones/model/AnimationConfig.cpp"; sourceTree = ""; }; - 046E06A92185B49C00B24E2D /* DisplayData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DisplayData.h; path = "../cocos/editor-support/dragonbones/model/DisplayData.h"; sourceTree = ""; }; - 046E06AA2185B49C00B24E2D /* UserData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UserData.cpp; path = "../cocos/editor-support/dragonbones/model/UserData.cpp"; sourceTree = ""; }; - 046E06AB2185B49D00B24E2D /* SkinData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkinData.h; path = "../cocos/editor-support/dragonbones/model/SkinData.h"; sourceTree = ""; }; - 046E06AC2185B49D00B24E2D /* CanvasData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CanvasData.cpp; path = "../cocos/editor-support/dragonbones/model/CanvasData.cpp"; sourceTree = ""; }; - 046E06AD2185B49D00B24E2D /* BoundingBoxData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BoundingBoxData.h; path = "../cocos/editor-support/dragonbones/model/BoundingBoxData.h"; sourceTree = ""; }; - 046E06AE2185B49D00B24E2D /* DisplayData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DisplayData.cpp; path = "../cocos/editor-support/dragonbones/model/DisplayData.cpp"; sourceTree = ""; }; - 046E06AF2185B49D00B24E2D /* SkinData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkinData.cpp; path = "../cocos/editor-support/dragonbones/model/SkinData.cpp"; sourceTree = ""; }; - 046E06B02185B49D00B24E2D /* ArmatureData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ArmatureData.h; path = "../cocos/editor-support/dragonbones/model/ArmatureData.h"; sourceTree = ""; }; - 046E06B12185B49D00B24E2D /* AnimationConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AnimationConfig.h; path = "../cocos/editor-support/dragonbones/model/AnimationConfig.h"; sourceTree = ""; }; - 046E06B22185B49E00B24E2D /* CanvasData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CanvasData.h; path = "../cocos/editor-support/dragonbones/model/CanvasData.h"; sourceTree = ""; }; - 046E06B32185B49E00B24E2D /* ConstraintData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ConstraintData.h; path = "../cocos/editor-support/dragonbones/model/ConstraintData.h"; sourceTree = ""; }; - 046E06B42185B49E00B24E2D /* AnimationData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AnimationData.cpp; path = "../cocos/editor-support/dragonbones/model/AnimationData.cpp"; sourceTree = ""; }; - 046E06B52185B49E00B24E2D /* DragonBonesData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DragonBonesData.h; path = "../cocos/editor-support/dragonbones/model/DragonBonesData.h"; sourceTree = ""; }; - 046E06B62185B49E00B24E2D /* DragonBonesData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DragonBonesData.cpp; path = "../cocos/editor-support/dragonbones/model/DragonBonesData.cpp"; sourceTree = ""; }; - 046E06E32185B4A500B24E2D /* JSONDataParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSONDataParser.cpp; path = "../cocos/editor-support/dragonbones/parser/JSONDataParser.cpp"; sourceTree = ""; }; - 046E06E42185B4A500B24E2D /* DataParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DataParser.cpp; path = "../cocos/editor-support/dragonbones/parser/DataParser.cpp"; sourceTree = ""; }; - 046E06E52185B4A500B24E2D /* JSONDataParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSONDataParser.h; path = "../cocos/editor-support/dragonbones/parser/JSONDataParser.h"; sourceTree = ""; }; - 046E06E62185B4A500B24E2D /* BinaryDataParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BinaryDataParser.cpp; path = "../cocos/editor-support/dragonbones/parser/BinaryDataParser.cpp"; sourceTree = ""; }; - 046E06E72185B4A500B24E2D /* BinaryDataParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BinaryDataParser.h; path = "../cocos/editor-support/dragonbones/parser/BinaryDataParser.h"; sourceTree = ""; }; - 046E06E82185B4A500B24E2D /* DataParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DataParser.h; path = "../cocos/editor-support/dragonbones/parser/DataParser.h"; sourceTree = ""; }; - 046E06F52189990700B24E2D /* middleware-adapter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "middleware-adapter.cpp"; path = "../cocos/editor-support/middleware-adapter.cpp"; sourceTree = ""; }; - 046E06F62189990700B24E2D /* middleware-adapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "middleware-adapter.h"; path = "../cocos/editor-support/middleware-adapter.h"; sourceTree = ""; }; - 046E06FB2189999500B24E2D /* jsb_cocos2dx_editor_support_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_cocos2dx_editor_support_auto.cpp; sourceTree = ""; }; - 046E06FC2189999600B24E2D /* jsb_cocos2dx_editor_support_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsb_cocos2dx_editor_support_auto.hpp; sourceTree = ""; }; - 046E0707218B015000B24E2D /* jsb_cocos2dx_dragonbones_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_cocos2dx_dragonbones_auto.cpp; sourceTree = ""; }; - 046E0708218B015000B24E2D /* jsb_cocos2dx_dragonbones_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsb_cocos2dx_dragonbones_auto.hpp; sourceTree = ""; }; - 046E070D218B01EF00B24E2D /* jsb_dragonbones_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_dragonbones_manual.cpp; sourceTree = ""; }; - 046E070E218B01EF00B24E2D /* jsb_dragonbones_manual.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsb_dragonbones_manual.hpp; sourceTree = ""; }; - 0482F184228D87900019ECF7 /* RenderFlow.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = RenderFlow.hpp; sourceTree = ""; }; - 0482F185228D87910019ECF7 /* ModelBatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ModelBatcher.cpp; sourceTree = ""; }; - 0482F186228D87910019ECF7 /* scene-bindings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "scene-bindings.h"; sourceTree = ""; }; - 0482F187228D87920019ECF7 /* Assembler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Assembler.cpp; sourceTree = ""; }; - 0482F188228D87920019ECF7 /* NodeProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NodeProxy.cpp; sourceTree = ""; }; - 0482F189228D87920019ECF7 /* CustomAssembler.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = CustomAssembler.hpp; sourceTree = ""; }; - 0482F18A228D87920019ECF7 /* MeshBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MeshBuffer.cpp; sourceTree = ""; }; - 0482F18B228D87930019ECF7 /* NodeProxy.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = NodeProxy.hpp; sourceTree = ""; }; - 0482F18C228D87930019ECF7 /* StencilManager.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = StencilManager.hpp; sourceTree = ""; }; - 0482F18D228D87930019ECF7 /* AssemblerBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AssemblerBase.cpp; sourceTree = ""; }; - 0482F18E228D87940019ECF7 /* MaskAssembler.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = MaskAssembler.hpp; sourceTree = ""; }; - 0482F190228D87940019ECF7 /* ModelBatcher.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ModelBatcher.hpp; sourceTree = ""; }; - 0482F191228D87950019ECF7 /* MaskAssembler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MaskAssembler.cpp; sourceTree = ""; }; - 0482F192228D87950019ECF7 /* RenderFlow.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderFlow.cpp; sourceTree = ""; }; - 0482F193228D87950019ECF7 /* StencilManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StencilManager.cpp; sourceTree = ""; }; - 0482F195228D87960019ECF7 /* MeshBuffer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = MeshBuffer.hpp; sourceTree = ""; }; - 0482F196228D87960019ECF7 /* CustomAssembler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustomAssembler.cpp; sourceTree = ""; }; - 0482F197228D87960019ECF7 /* Assembler.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Assembler.hpp; sourceTree = ""; }; - 0482F198228D87970019ECF7 /* AssemblerBase.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = AssemblerBase.hpp; sourceTree = ""; }; - 04886B3F22CE22F2008CEB66 /* SlicedSprite2D.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SlicedSprite2D.cpp; sourceTree = ""; }; - 04886B4022CE22F2008CEB66 /* SlicedSprite2D.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = SlicedSprite2D.hpp; sourceTree = ""; }; - 0494CFD222BEFC6D00B73B79 /* ParallelTask.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ParallelTask.cpp; sourceTree = ""; }; - 0494CFD322BEFC6D00B73B79 /* ParallelTask.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = ParallelTask.hpp; sourceTree = ""; }; - 049B31F92313B6240004909A /* SkeletonCacheMgr.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonCacheMgr.cpp; path = "../cocos/editor-support/spine-creator-support/SkeletonCacheMgr.cpp"; sourceTree = ""; }; - 049B31FA2313B6240004909A /* SkeletonCacheMgr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SkeletonCacheMgr.h; path = "../cocos/editor-support/spine-creator-support/SkeletonCacheMgr.h"; sourceTree = ""; }; - 049B32052314DF1C0004909A /* SkeletonCache.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonCache.cpp; path = "../cocos/editor-support/spine-creator-support/SkeletonCache.cpp"; sourceTree = ""; }; - 049B32062314DF1C0004909A /* SkeletonCache.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SkeletonCache.h; path = "../cocos/editor-support/spine-creator-support/SkeletonCache.h"; sourceTree = ""; }; - 049B320B231533BF0004909A /* SkeletonCacheAnimation.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonCacheAnimation.cpp; path = "../cocos/editor-support/spine-creator-support/SkeletonCacheAnimation.cpp"; sourceTree = ""; }; - 049B320C231533BF0004909A /* SkeletonCacheAnimation.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SkeletonCacheAnimation.h; path = "../cocos/editor-support/spine-creator-support/SkeletonCacheAnimation.h"; sourceTree = ""; }; - 04AF62FD219190ED00AED9DE /* TypedArrayPool.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = TypedArrayPool.cpp; path = "../cocos/editor-support/TypedArrayPool.cpp"; sourceTree = ""; }; - 04AF62FE219190ED00AED9DE /* TypedArrayPool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TypedArrayPool.h; path = "../cocos/editor-support/TypedArrayPool.h"; sourceTree = ""; }; - 04DBD30922AE2D8000DBE4CD /* VertexEffectDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VertexEffectDelegate.h; path = "../cocos/editor-support/spine-creator-support/VertexEffectDelegate.h"; sourceTree = ""; }; - 04DBD30A22AE2D8000DBE4CD /* SkeletonRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkeletonRenderer.h; path = "../cocos/editor-support/spine-creator-support/SkeletonRenderer.h"; sourceTree = ""; }; - 04DBD30B22AE2D8000DBE4CD /* AttachmentVertices.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AttachmentVertices.cpp; path = "../cocos/editor-support/spine-creator-support/AttachmentVertices.cpp"; sourceTree = ""; }; - 04DBD30C22AE2D8000DBE4CD /* SkeletonAnimation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonAnimation.cpp; path = "../cocos/editor-support/spine-creator-support/SkeletonAnimation.cpp"; sourceTree = ""; }; - 04DBD30D22AE2D8100DBE4CD /* SkeletonAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkeletonAnimation.h; path = "../cocos/editor-support/spine-creator-support/SkeletonAnimation.h"; sourceTree = ""; }; - 04DBD30E22AE2D8100DBE4CD /* AttachmentVertices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AttachmentVertices.h; path = "../cocos/editor-support/spine-creator-support/AttachmentVertices.h"; sourceTree = ""; }; - 04DBD30F22AE2D8100DBE4CD /* VertexEffectDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VertexEffectDelegate.cpp; path = "../cocos/editor-support/spine-creator-support/VertexEffectDelegate.cpp"; sourceTree = ""; }; - 04DBD31022AE2D8100DBE4CD /* SkeletonDataMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkeletonDataMgr.h; path = "../cocos/editor-support/spine-creator-support/SkeletonDataMgr.h"; sourceTree = ""; }; - 04DBD31122AE2D8100DBE4CD /* SkeletonRenderer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonRenderer.cpp; path = "../cocos/editor-support/spine-creator-support/SkeletonRenderer.cpp"; sourceTree = ""; }; - 04DBD31222AE2D8100DBE4CD /* SkeletonDataMgr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonDataMgr.cpp; path = "../cocos/editor-support/spine-creator-support/SkeletonDataMgr.cpp"; sourceTree = ""; }; - 04DBD31322AE2D8100DBE4CD /* spine-cocos2dx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "spine-cocos2dx.cpp"; path = "../cocos/editor-support/spine-creator-support/spine-cocos2dx.cpp"; sourceTree = ""; }; - 04DBD31422AE2D8100DBE4CD /* spine-cocos2dx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "spine-cocos2dx.h"; path = "../cocos/editor-support/spine-creator-support/spine-cocos2dx.h"; sourceTree = ""; }; - 04DBD32D22AE2DA200DBE4CD /* Pool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Pool.h; path = "../cocos/editor-support/spine/Pool.h"; sourceTree = ""; }; - 04DBD32E22AE2DA200DBE4CD /* Attachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Attachment.h; path = "../cocos/editor-support/spine/Attachment.h"; sourceTree = ""; }; - 04DBD32F22AE2DA300DBE4CD /* AnimationStateData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AnimationStateData.h; path = "../cocos/editor-support/spine/AnimationStateData.h"; sourceTree = ""; }; - 04DBD33022AE2DA300DBE4CD /* TextureLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextureLoader.h; path = "../cocos/editor-support/spine/TextureLoader.h"; sourceTree = ""; }; - 04DBD33122AE2DA300DBE4CD /* VertexEffect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VertexEffect.cpp; path = "../cocos/editor-support/spine/VertexEffect.cpp"; sourceTree = ""; }; - 04DBD33222AE2DA300DBE4CD /* MixDirection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MixDirection.h; path = "../cocos/editor-support/spine/MixDirection.h"; sourceTree = ""; }; - 04DBD33322AE2DA300DBE4CD /* HasRendererObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HasRendererObject.h; path = "../cocos/editor-support/spine/HasRendererObject.h"; sourceTree = ""; }; - 04DBD33422AE2DA300DBE4CD /* AtlasAttachmentLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AtlasAttachmentLoader.cpp; path = "../cocos/editor-support/spine/AtlasAttachmentLoader.cpp"; sourceTree = ""; }; - 04DBD33522AE2DA300DBE4CD /* Atlas.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Atlas.cpp; path = "../cocos/editor-support/spine/Atlas.cpp"; sourceTree = ""; }; - 04DBD33622AE2DA300DBE4CD /* Bone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Bone.cpp; path = "../cocos/editor-support/spine/Bone.cpp"; sourceTree = ""; }; - 04DBD33722AE2DA300DBE4CD /* Triangulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Triangulator.h; path = "../cocos/editor-support/spine/Triangulator.h"; sourceTree = ""; }; - 04DBD33822AE2DA400DBE4CD /* EventData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EventData.h; path = "../cocos/editor-support/spine/EventData.h"; sourceTree = ""; }; - 04DBD33922AE2DA400DBE4CD /* RotateTimeline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RotateTimeline.h; path = "../cocos/editor-support/spine/RotateTimeline.h"; sourceTree = ""; }; - 04DBD33A22AE2DA400DBE4CD /* ColorTimeline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ColorTimeline.h; path = "../cocos/editor-support/spine/ColorTimeline.h"; sourceTree = ""; }; - 04DBD33B22AE2DA400DBE4CD /* PathAttachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PathAttachment.cpp; path = "../cocos/editor-support/spine/PathAttachment.cpp"; sourceTree = ""; }; - 04DBD33C22AE2DA400DBE4CD /* Constraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Constraint.h; path = "../cocos/editor-support/spine/Constraint.h"; sourceTree = ""; }; - 04DBD33D22AE2DA400DBE4CD /* TranslateTimeline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TranslateTimeline.h; path = "../cocos/editor-support/spine/TranslateTimeline.h"; sourceTree = ""; }; - 04DBD33E22AE2DA400DBE4CD /* SkeletonData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkeletonData.h; path = "../cocos/editor-support/spine/SkeletonData.h"; sourceTree = ""; }; - 04DBD33F22AE2DA500DBE4CD /* RotateTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RotateTimeline.cpp; path = "../cocos/editor-support/spine/RotateTimeline.cpp"; sourceTree = ""; }; - 04DBD34022AE2DA500DBE4CD /* AttachmentTimeline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AttachmentTimeline.h; path = "../cocos/editor-support/spine/AttachmentTimeline.h"; sourceTree = ""; }; - 04DBD34122AE2DA500DBE4CD /* BlendMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BlendMode.h; path = "../cocos/editor-support/spine/BlendMode.h"; sourceTree = ""; }; - 04DBD34222AE2DA500DBE4CD /* PointAttachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PointAttachment.cpp; path = "../cocos/editor-support/spine/PointAttachment.cpp"; sourceTree = ""; }; - 04DBD34322AE2DA500DBE4CD /* PathConstraintMixTimeline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PathConstraintMixTimeline.h; path = "../cocos/editor-support/spine/PathConstraintMixTimeline.h"; sourceTree = ""; }; - 04DBD34422AE2DA500DBE4CD /* Debug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Debug.h; path = "../cocos/editor-support/spine/Debug.h"; sourceTree = ""; }; - 04DBD34522AE2DA600DBE4CD /* CurveTimeline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CurveTimeline.h; path = "../cocos/editor-support/spine/CurveTimeline.h"; sourceTree = ""; }; - 04DBD34622AE2DA600DBE4CD /* Timeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Timeline.cpp; path = "../cocos/editor-support/spine/Timeline.cpp"; sourceTree = ""; }; - 04DBD34722AE2DA600DBE4CD /* Extension.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Extension.cpp; path = "../cocos/editor-support/spine/Extension.cpp"; sourceTree = ""; }; - 04DBD34822AE2DA600DBE4CD /* MathUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MathUtil.h; path = "../cocos/editor-support/spine/MathUtil.h"; sourceTree = ""; }; - 04DBD34922AE2DA600DBE4CD /* TimelineType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TimelineType.h; path = "../cocos/editor-support/spine/TimelineType.h"; sourceTree = ""; }; - 04DBD34A22AE2DA600DBE4CD /* ClippingAttachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClippingAttachment.h; path = "../cocos/editor-support/spine/ClippingAttachment.h"; sourceTree = ""; }; - 04DBD34B22AE2DA700DBE4CD /* PathConstraintMixTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PathConstraintMixTimeline.cpp; path = "../cocos/editor-support/spine/PathConstraintMixTimeline.cpp"; sourceTree = ""; }; - 04DBD34C22AE2DA700DBE4CD /* Event.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Event.h; path = "../cocos/editor-support/spine/Event.h"; sourceTree = ""; }; - 04DBD34D22AE2DA700DBE4CD /* Animation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Animation.h; path = "../cocos/editor-support/spine/Animation.h"; sourceTree = ""; }; - 04DBD34E22AE2DA700DBE4CD /* HashMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HashMap.h; path = "../cocos/editor-support/spine/HashMap.h"; sourceTree = ""; }; - 04DBD34F22AE2DA700DBE4CD /* EventTimeline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EventTimeline.h; path = "../cocos/editor-support/spine/EventTimeline.h"; sourceTree = ""; }; - 04DBD35022AE2DA800DBE4CD /* AtlasAttachmentLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AtlasAttachmentLoader.h; path = "../cocos/editor-support/spine/AtlasAttachmentLoader.h"; sourceTree = ""; }; - 04DBD35122AE2DA800DBE4CD /* Skin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Skin.h; path = "../cocos/editor-support/spine/Skin.h"; sourceTree = ""; }; - 04DBD35222AE2DA800DBE4CD /* BoundingBoxAttachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BoundingBoxAttachment.h; path = "../cocos/editor-support/spine/BoundingBoxAttachment.h"; sourceTree = ""; }; - 04DBD35322AE2DA800DBE4CD /* SkeletonClipping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonClipping.cpp; path = "../cocos/editor-support/spine/SkeletonClipping.cpp"; sourceTree = ""; }; - 04DBD35422AE2DA800DBE4CD /* IkConstraintData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IkConstraintData.h; path = "../cocos/editor-support/spine/IkConstraintData.h"; sourceTree = ""; }; - 04DBD35522AE2DA800DBE4CD /* SpineString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SpineString.h; path = "../cocos/editor-support/spine/SpineString.h"; sourceTree = ""; }; - 04DBD35622AE2DA900DBE4CD /* VertexAttachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VertexAttachment.cpp; path = "../cocos/editor-support/spine/VertexAttachment.cpp"; sourceTree = ""; }; - 04DBD35722AE2DA900DBE4CD /* TransformConstraintTimeline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TransformConstraintTimeline.h; path = "../cocos/editor-support/spine/TransformConstraintTimeline.h"; sourceTree = ""; }; - 04DBD35822AE2DA900DBE4CD /* Constraint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Constraint.cpp; path = "../cocos/editor-support/spine/Constraint.cpp"; sourceTree = ""; }; - 04DBD35922AE2DA900DBE4CD /* Triangulator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Triangulator.cpp; path = "../cocos/editor-support/spine/Triangulator.cpp"; sourceTree = ""; }; - 04DBD35A22AE2DA900DBE4CD /* MathUtil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MathUtil.cpp; path = "../cocos/editor-support/spine/MathUtil.cpp"; sourceTree = ""; }; - 04DBD35B22AE2DAA00DBE4CD /* BoneData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BoneData.cpp; path = "../cocos/editor-support/spine/BoneData.cpp"; sourceTree = ""; }; - 04DBD35C22AE2DAA00DBE4CD /* IkConstraint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IkConstraint.cpp; path = "../cocos/editor-support/spine/IkConstraint.cpp"; sourceTree = ""; }; - 04DBD35D22AE2DAA00DBE4CD /* SlotData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SlotData.cpp; path = "../cocos/editor-support/spine/SlotData.cpp"; sourceTree = ""; }; - 04DBD35E22AE2DAA00DBE4CD /* TextureLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TextureLoader.cpp; path = "../cocos/editor-support/spine/TextureLoader.cpp"; sourceTree = ""; }; - 04DBD35F22AE2DAA00DBE4CD /* Animation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Animation.cpp; path = "../cocos/editor-support/spine/Animation.cpp"; sourceTree = ""; }; - 04DBD36022AE2DAB00DBE4CD /* SkeletonData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonData.cpp; path = "../cocos/editor-support/spine/SkeletonData.cpp"; sourceTree = ""; }; - 04DBD36122AE2DAB00DBE4CD /* SlotData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SlotData.h; path = "../cocos/editor-support/spine/SlotData.h"; sourceTree = ""; }; - 04DBD36222AE2DAB00DBE4CD /* PathConstraint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PathConstraint.cpp; path = "../cocos/editor-support/spine/PathConstraint.cpp"; sourceTree = ""; }; - 04DBD36322AE2DAB00DBE4CD /* VertexEffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VertexEffect.h; path = "../cocos/editor-support/spine/VertexEffect.h"; sourceTree = ""; }; - 04DBD36422AE2DAC00DBE4CD /* RegionAttachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegionAttachment.cpp; path = "../cocos/editor-support/spine/RegionAttachment.cpp"; sourceTree = ""; }; - 04DBD36522AE2DAC00DBE4CD /* IkConstraintData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IkConstraintData.cpp; path = "../cocos/editor-support/spine/IkConstraintData.cpp"; sourceTree = ""; }; - 04DBD36622AE2DAC00DBE4CD /* PathConstraintSpacingTimeline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PathConstraintSpacingTimeline.h; path = "../cocos/editor-support/spine/PathConstraintSpacingTimeline.h"; sourceTree = ""; }; - 04DBD36722AE2DAC00DBE4CD /* Json.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Json.cpp; path = "../cocos/editor-support/spine/Json.cpp"; sourceTree = ""; }; - 04DBD36822AE2DAC00DBE4CD /* Color.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Color.h; path = "../cocos/editor-support/spine/Color.h"; sourceTree = ""; }; - 04DBD36922AE2DAD00DBE4CD /* Skin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Skin.cpp; path = "../cocos/editor-support/spine/Skin.cpp"; sourceTree = ""; }; - 04DBD36A22AE2DAD00DBE4CD /* RotateMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RotateMode.h; path = "../cocos/editor-support/spine/RotateMode.h"; sourceTree = ""; }; - 04DBD36B22AE2DAD00DBE4CD /* TranslateTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TranslateTimeline.cpp; path = "../cocos/editor-support/spine/TranslateTimeline.cpp"; sourceTree = ""; }; - 04DBD36C22AE2DAD00DBE4CD /* Updatable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Updatable.h; path = "../cocos/editor-support/spine/Updatable.h"; sourceTree = ""; }; - 04DBD36D22AE2DAD00DBE4CD /* TransformConstraint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TransformConstraint.cpp; path = "../cocos/editor-support/spine/TransformConstraint.cpp"; sourceTree = ""; }; - 04DBD36E22AE2DAE00DBE4CD /* SkeletonBinary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkeletonBinary.h; path = "../cocos/editor-support/spine/SkeletonBinary.h"; sourceTree = ""; }; - 04DBD36F22AE2DAE00DBE4CD /* DrawOrderTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DrawOrderTimeline.cpp; path = "../cocos/editor-support/spine/DrawOrderTimeline.cpp"; sourceTree = ""; }; - 04DBD37022AE2DAE00DBE4CD /* PathAttachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PathAttachment.h; path = "../cocos/editor-support/spine/PathAttachment.h"; sourceTree = ""; }; - 04DBD37122AE2DAE00DBE4CD /* PathConstraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PathConstraint.h; path = "../cocos/editor-support/spine/PathConstraint.h"; sourceTree = ""; }; - 04DBD37222AE2DAE00DBE4CD /* AnimationState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AnimationState.cpp; path = "../cocos/editor-support/spine/AnimationState.cpp"; sourceTree = ""; }; - 04DBD37322AE2DAF00DBE4CD /* Skeleton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Skeleton.cpp; path = "../cocos/editor-support/spine/Skeleton.cpp"; sourceTree = ""; }; - 04DBD37422AE2DAF00DBE4CD /* DrawOrderTimeline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DrawOrderTimeline.h; path = "../cocos/editor-support/spine/DrawOrderTimeline.h"; sourceTree = ""; }; - 04DBD37522AE2DAF00DBE4CD /* IkConstraintTimeline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IkConstraintTimeline.h; path = "../cocos/editor-support/spine/IkConstraintTimeline.h"; sourceTree = ""; }; - 04DBD37622AE2DAF00DBE4CD /* SpacingMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SpacingMode.h; path = "../cocos/editor-support/spine/SpacingMode.h"; sourceTree = ""; }; - 04DBD37722AE2DAF00DBE4CD /* Json.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Json.h; path = "../cocos/editor-support/spine/Json.h"; sourceTree = ""; }; - 04DBD37822AE2DAF00DBE4CD /* AnimationStateData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AnimationStateData.cpp; path = "../cocos/editor-support/spine/AnimationStateData.cpp"; sourceTree = ""; }; - 04DBD37922AE2DB000DBE4CD /* TransformConstraintTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TransformConstraintTimeline.cpp; path = "../cocos/editor-support/spine/TransformConstraintTimeline.cpp"; sourceTree = ""; }; - 04DBD37A22AE2DB000DBE4CD /* Vertices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Vertices.h; path = "../cocos/editor-support/spine/Vertices.h"; sourceTree = ""; }; - 04DBD37B22AE2DB000DBE4CD /* AttachmentLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AttachmentLoader.h; path = "../cocos/editor-support/spine/AttachmentLoader.h"; sourceTree = ""; }; - 04DBD37C22AE2DB000DBE4CD /* PointAttachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PointAttachment.h; path = "../cocos/editor-support/spine/PointAttachment.h"; sourceTree = ""; }; - 04DBD37D22AE2DB000DBE4CD /* Timeline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Timeline.h; path = "../cocos/editor-support/spine/Timeline.h"; sourceTree = ""; }; - 04DBD37E22AE2DB100DBE4CD /* SkeletonBinary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonBinary.cpp; path = "../cocos/editor-support/spine/SkeletonBinary.cpp"; sourceTree = ""; }; - 04DBD37F22AE2DB100DBE4CD /* Event.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Event.cpp; path = "../cocos/editor-support/spine/Event.cpp"; sourceTree = ""; }; - 04DBD38022AE2DB100DBE4CD /* TwoColorTimeline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TwoColorTimeline.h; path = "../cocos/editor-support/spine/TwoColorTimeline.h"; sourceTree = ""; }; - 04DBD38122AE2DB100DBE4CD /* PathConstraintData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PathConstraintData.cpp; path = "../cocos/editor-support/spine/PathConstraintData.cpp"; sourceTree = ""; }; - 04DBD38222AE2DB100DBE4CD /* ScaleTimeline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScaleTimeline.h; path = "../cocos/editor-support/spine/ScaleTimeline.h"; sourceTree = ""; }; - 04DBD38322AE2DB200DBE4CD /* TransformConstraintData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TransformConstraintData.h; path = "../cocos/editor-support/spine/TransformConstraintData.h"; sourceTree = ""; }; - 04DBD38422AE2DB200DBE4CD /* ShearTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ShearTimeline.cpp; path = "../cocos/editor-support/spine/ShearTimeline.cpp"; sourceTree = ""; }; - 04DBD38522AE2DB200DBE4CD /* AttachmentTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AttachmentTimeline.cpp; path = "../cocos/editor-support/spine/AttachmentTimeline.cpp"; sourceTree = ""; }; - 04DBD38622AE2DB200DBE4CD /* ScaleTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScaleTimeline.cpp; path = "../cocos/editor-support/spine/ScaleTimeline.cpp"; sourceTree = ""; }; - 04DBD38722AE2DB200DBE4CD /* TransformConstraintData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TransformConstraintData.cpp; path = "../cocos/editor-support/spine/TransformConstraintData.cpp"; sourceTree = ""; }; - 04DBD38822AE2DB300DBE4CD /* Bone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Bone.h; path = "../cocos/editor-support/spine/Bone.h"; sourceTree = ""; }; - 04DBD38922AE2DB300DBE4CD /* AttachmentType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AttachmentType.h; path = "../cocos/editor-support/spine/AttachmentType.h"; sourceTree = ""; }; - 04DBD38A22AE2DB300DBE4CD /* MeshAttachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MeshAttachment.h; path = "../cocos/editor-support/spine/MeshAttachment.h"; sourceTree = ""; }; - 04DBD38B22AE2DB300DBE4CD /* Atlas.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Atlas.h; path = "../cocos/editor-support/spine/Atlas.h"; sourceTree = ""; }; - 04DBD38C22AE2DB300DBE4CD /* PositionMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PositionMode.h; path = "../cocos/editor-support/spine/PositionMode.h"; sourceTree = ""; }; - 04DBD38D22AE2DB400DBE4CD /* AnimationState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AnimationState.h; path = "../cocos/editor-support/spine/AnimationState.h"; sourceTree = ""; }; - 04DBD38E22AE2DB400DBE4CD /* DeformTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DeformTimeline.cpp; path = "../cocos/editor-support/spine/DeformTimeline.cpp"; sourceTree = ""; }; - 04DBD38F22AE2DB400DBE4CD /* PathConstraintSpacingTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PathConstraintSpacingTimeline.cpp; path = "../cocos/editor-support/spine/PathConstraintSpacingTimeline.cpp"; sourceTree = ""; }; - 04DBD39022AE2DB400DBE4CD /* PathConstraintPositionTimeline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PathConstraintPositionTimeline.h; path = "../cocos/editor-support/spine/PathConstraintPositionTimeline.h"; sourceTree = ""; }; - 04DBD39122AE2DB400DBE4CD /* PathConstraintData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PathConstraintData.h; path = "../cocos/editor-support/spine/PathConstraintData.h"; sourceTree = ""; }; - 04DBD39222AE2DB500DBE4CD /* EventTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EventTimeline.cpp; path = "../cocos/editor-support/spine/EventTimeline.cpp"; sourceTree = ""; }; - 04DBD39322AE2DB500DBE4CD /* MixBlend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MixBlend.h; path = "../cocos/editor-support/spine/MixBlend.h"; sourceTree = ""; }; - 04DBD39422AE2DB500DBE4CD /* IkConstraintTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IkConstraintTimeline.cpp; path = "../cocos/editor-support/spine/IkConstraintTimeline.cpp"; sourceTree = ""; }; - 04DBD39522AE2DB500DBE4CD /* CurveTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CurveTimeline.cpp; path = "../cocos/editor-support/spine/CurveTimeline.cpp"; sourceTree = ""; }; - 04DBD39622AE2DB500DBE4CD /* Slot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Slot.h; path = "../cocos/editor-support/spine/Slot.h"; sourceTree = ""; }; - 04DBD39722AE2DB600DBE4CD /* Vector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Vector.h; path = "../cocos/editor-support/spine/Vector.h"; sourceTree = ""; }; - 04DBD39822AE2DB600DBE4CD /* ShearTimeline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ShearTimeline.h; path = "../cocos/editor-support/spine/ShearTimeline.h"; sourceTree = ""; }; - 04DBD39922AE2DB600DBE4CD /* SkeletonJson.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkeletonJson.h; path = "../cocos/editor-support/spine/SkeletonJson.h"; sourceTree = ""; }; - 04DBD39A22AE2DB600DBE4CD /* SpineObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SpineObject.h; path = "../cocos/editor-support/spine/SpineObject.h"; sourceTree = ""; }; - 04DBD39C22AE2DB700DBE4CD /* TransformMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TransformMode.h; path = "../cocos/editor-support/spine/TransformMode.h"; sourceTree = ""; }; - 04DBD39D22AE2DB700DBE4CD /* EventData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EventData.cpp; path = "../cocos/editor-support/spine/EventData.cpp"; sourceTree = ""; }; - 04DBD39E22AE2DB700DBE4CD /* SkeletonJson.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonJson.cpp; path = "../cocos/editor-support/spine/SkeletonJson.cpp"; sourceTree = ""; }; - 04DBD39F22AE2DB700DBE4CD /* ColorTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ColorTimeline.cpp; path = "../cocos/editor-support/spine/ColorTimeline.cpp"; sourceTree = ""; }; - 04DBD3A022AE2DB700DBE4CD /* Attachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Attachment.cpp; path = "../cocos/editor-support/spine/Attachment.cpp"; sourceTree = ""; }; - 04DBD3A122AE2DB800DBE4CD /* AttachmentLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AttachmentLoader.cpp; path = "../cocos/editor-support/spine/AttachmentLoader.cpp"; sourceTree = ""; }; - 04DBD3A222AE2DB800DBE4CD /* LinkedMesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LinkedMesh.cpp; path = "../cocos/editor-support/spine/LinkedMesh.cpp"; sourceTree = ""; }; - 04DBD3A322AE2DB800DBE4CD /* RegionAttachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegionAttachment.h; path = "../cocos/editor-support/spine/RegionAttachment.h"; sourceTree = ""; }; - 04DBD3A422AE2DB800DBE4CD /* SpineObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SpineObject.cpp; path = "../cocos/editor-support/spine/SpineObject.cpp"; sourceTree = ""; }; - 04DBD3A522AE2DB800DBE4CD /* Slot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Slot.cpp; path = "../cocos/editor-support/spine/Slot.cpp"; sourceTree = ""; }; - 04DBD3A622AE2DB800DBE4CD /* BoundingBoxAttachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BoundingBoxAttachment.cpp; path = "../cocos/editor-support/spine/BoundingBoxAttachment.cpp"; sourceTree = ""; }; - 04DBD3A722AE2DB900DBE4CD /* MeshAttachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MeshAttachment.cpp; path = "../cocos/editor-support/spine/MeshAttachment.cpp"; sourceTree = ""; }; - 04DBD3A822AE2DB900DBE4CD /* TwoColorTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TwoColorTimeline.cpp; path = "../cocos/editor-support/spine/TwoColorTimeline.cpp"; sourceTree = ""; }; - 04DBD3A922AE2DB900DBE4CD /* ContainerUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ContainerUtil.h; path = "../cocos/editor-support/spine/ContainerUtil.h"; sourceTree = ""; }; - 04DBD3AA22AE2DB900DBE4CD /* RTTI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RTTI.cpp; path = "../cocos/editor-support/spine/RTTI.cpp"; sourceTree = ""; }; - 04DBD3AB22AE2DB900DBE4CD /* SkeletonBounds.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonBounds.cpp; path = "../cocos/editor-support/spine/SkeletonBounds.cpp"; sourceTree = ""; }; - 04DBD3AC22AE2DBA00DBE4CD /* Skeleton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Skeleton.h; path = "../cocos/editor-support/spine/Skeleton.h"; sourceTree = ""; }; - 04DBD3AD22AE2DBA00DBE4CD /* PathConstraintPositionTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PathConstraintPositionTimeline.cpp; path = "../cocos/editor-support/spine/PathConstraintPositionTimeline.cpp"; sourceTree = ""; }; - 04DBD3AE22AE2DBA00DBE4CD /* spine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = spine.h; path = "../cocos/editor-support/spine/spine.h"; sourceTree = ""; }; - 04DBD3AF22AE2DBA00DBE4CD /* DeformTimeline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DeformTimeline.h; path = "../cocos/editor-support/spine/DeformTimeline.h"; sourceTree = ""; }; - 04DBD3B022AE2DBA00DBE4CD /* Updatable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Updatable.cpp; path = "../cocos/editor-support/spine/Updatable.cpp"; sourceTree = ""; }; - 04DBD3B122AE2DBB00DBE4CD /* BoneData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BoneData.h; path = "../cocos/editor-support/spine/BoneData.h"; sourceTree = ""; }; - 04DBD3B222AE2DBB00DBE4CD /* dll.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dll.h; path = "../cocos/editor-support/spine/dll.h"; sourceTree = ""; }; - 04DBD3B322AE2DBB00DBE4CD /* SkeletonBounds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkeletonBounds.h; path = "../cocos/editor-support/spine/SkeletonBounds.h"; sourceTree = ""; }; - 04DBD3B422AE2DBB00DBE4CD /* TransformConstraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TransformConstraint.h; path = "../cocos/editor-support/spine/TransformConstraint.h"; sourceTree = ""; }; - 04DBD3B522AE2DBB00DBE4CD /* VertexAttachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VertexAttachment.h; path = "../cocos/editor-support/spine/VertexAttachment.h"; sourceTree = ""; }; - 04DBD3B622AE2DBC00DBE4CD /* ClippingAttachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClippingAttachment.cpp; path = "../cocos/editor-support/spine/ClippingAttachment.cpp"; sourceTree = ""; }; - 04DBD3B722AE2DBC00DBE4CD /* SkeletonClipping.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkeletonClipping.h; path = "../cocos/editor-support/spine/SkeletonClipping.h"; sourceTree = ""; }; - 04DBD3B822AE2DBC00DBE4CD /* LinkedMesh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LinkedMesh.h; path = "../cocos/editor-support/spine/LinkedMesh.h"; sourceTree = ""; }; - 04DBD3B922AE2DBC00DBE4CD /* RTTI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RTTI.h; path = "../cocos/editor-support/spine/RTTI.h"; sourceTree = ""; }; - 04DBD3BA22AE2DBC00DBE4CD /* IkConstraint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IkConstraint.h; path = "../cocos/editor-support/spine/IkConstraint.h"; sourceTree = ""; }; - 04DBD4D922B51EA300DBE4CD /* MemPool.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MemPool.cpp; sourceTree = ""; }; - 04DBD4DA22B51EA300DBE4CD /* MemPool.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = MemPool.hpp; sourceTree = ""; }; - 04DBD4DF22B51EB300DBE4CD /* NodeMemPool.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = NodeMemPool.cpp; sourceTree = ""; }; - 04DBD4E022B51EB300DBE4CD /* NodeMemPool.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = NodeMemPool.hpp; sourceTree = ""; }; - 04ED68D621F8188F006E82F8 /* MeshBuffer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = MeshBuffer.cpp; path = "../cocos/editor-support/MeshBuffer.cpp"; sourceTree = ""; }; - 04ED68D721F8188F006E82F8 /* MeshBuffer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = MeshBuffer.h; path = "../cocos/editor-support/MeshBuffer.h"; sourceTree = ""; }; - 04F8563222ABCB9900063A20 /* TiledMapAssembler.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TiledMapAssembler.cpp; sourceTree = ""; }; - 04F8563322ABCB9900063A20 /* TiledMapAssembler.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = TiledMapAssembler.hpp; sourceTree = ""; }; - 04FB24032328D42A0021DD02 /* CCArmatureCacheDisplay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CCArmatureCacheDisplay.h; path = "../cocos/editor-support/dragonbones-creator-support/CCArmatureCacheDisplay.h"; sourceTree = ""; }; - 04FB24042328D42A0021DD02 /* ArmatureCacheMgr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ArmatureCacheMgr.h; path = "../cocos/editor-support/dragonbones-creator-support/ArmatureCacheMgr.h"; sourceTree = ""; }; - 04FB24052328D42A0021DD02 /* ArmatureCacheMgr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ArmatureCacheMgr.cpp; path = "../cocos/editor-support/dragonbones-creator-support/ArmatureCacheMgr.cpp"; sourceTree = ""; }; - 04FB24062328D42A0021DD02 /* ArmatureCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ArmatureCache.cpp; path = "../cocos/editor-support/dragonbones-creator-support/ArmatureCache.cpp"; sourceTree = ""; }; - 04FB24072328D42A0021DD02 /* ArmatureCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ArmatureCache.h; path = "../cocos/editor-support/dragonbones-creator-support/ArmatureCache.h"; sourceTree = ""; }; - 04FB24082328D42A0021DD02 /* CCArmatureCacheDisplay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CCArmatureCacheDisplay.cpp; path = "../cocos/editor-support/dragonbones-creator-support/CCArmatureCacheDisplay.cpp"; sourceTree = ""; }; 051C016F21E2F85C00D4A347 /* CCModuleConfigIOS.debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = CCModuleConfigIOS.debug.xcconfig; sourceTree = ""; }; 051C017021E2F85C00D4A347 /* CCModuleConfigIOS.release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = CCModuleConfigIOS.release.xcconfig; sourceTree = ""; }; 051C017121E2F86900D4A347 /* CCModuleConfigMac.release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = CCModuleConfigMac.release.xcconfig; sourceTree = ""; }; @@ -1901,17 +1149,8 @@ 40F373D921B67A7D0083E4E7 /* libv8_snapshot.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libv8_snapshot.a; path = ../external/mac/libs/libv8_snapshot.a; sourceTree = ""; }; 40FF7A9E216B29CB00E73029 /* VideoPlayer-ios.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "VideoPlayer-ios.mm"; sourceTree = ""; }; 40FF7A9F216B29CB00E73029 /* VideoPlayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VideoPlayer.h; sourceTree = ""; }; - 4233799C22BB43B900E5D8A2 /* RecyclePool.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = RecyclePool.hpp; sourceTree = ""; }; - 423379A122BB8DEA00E5D8A2 /* CustomProperties.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = CustomProperties.cpp; sourceTree = ""; }; - 423379A222BB8DEA00E5D8A2 /* CustomProperties.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = CustomProperties.hpp; sourceTree = ""; }; 425D3FEF22D86BEF00BCED11 /* Mat3.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Mat3.cpp; sourceTree = ""; }; 425D3FF022D86BEF00BCED11 /* Mat3.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Mat3.hpp; sourceTree = ""; }; - 426947B7234ED0130044C66E /* SimpleSprite3D.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleSprite3D.cpp; sourceTree = ""; }; - 426947B8234ED0130044C66E /* SimpleSprite3D.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = SimpleSprite3D.hpp; sourceTree = ""; }; - 426947BD234ED02E0044C66E /* SlicedSprite3D.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SlicedSprite3D.cpp; sourceTree = ""; }; - 426947BE234ED02E0044C66E /* SlicedSprite3D.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = SlicedSprite3D.hpp; sourceTree = ""; }; - 427475F723214E2900139DF8 /* MeshAssembler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MeshAssembler.cpp; sourceTree = ""; }; - 427475F823214E2A00139DF8 /* MeshAssembler.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = MeshAssembler.hpp; sourceTree = ""; }; 461785FE20522468008256E1 /* SocketIO.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SocketIO.cpp; sourceTree = ""; }; 4617860220522468008256E1 /* HttpCookie.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HttpCookie.cpp; sourceTree = ""; }; 4617860420522469008256E1 /* CCIDownloaderImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCIDownloaderImpl.h; sourceTree = ""; }; @@ -1982,21 +1221,13 @@ 4693024E2046AE05004A3D6C /* Class.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Class.cpp; sourceTree = ""; }; 4693024F2046AE05004A3D6C /* Utils.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Utils.hpp; sourceTree = ""; }; 469302502046AE05004A3D6C /* Base.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Base.h; sourceTree = ""; }; - 469302592046AE05004A3D6C /* jsb_renderer_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_renderer_auto.cpp; sourceTree = ""; }; - 4693025D2046AE05004A3D6C /* jsb_gfx_auto.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_gfx_auto.cpp; sourceTree = ""; }; - 469302632046AE05004A3D6C /* jsb_gfx_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsb_gfx_auto.hpp; sourceTree = ""; }; - 469302822046AE05004A3D6C /* jsb_renderer_auto.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsb_renderer_auto.hpp; sourceTree = ""; }; 469302C72046AE05004A3D6C /* jsb_global.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jsb_global.h; sourceTree = ""; }; 469302CB2046AE05004A3D6C /* jsb_global.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_global.cpp; sourceTree = ""; }; 469302CF2046AE05004A3D6C /* jsb_helper.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsb_helper.hpp; sourceTree = ""; }; 469302D02046AE05004A3D6C /* jsb_classtype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_classtype.cpp; sourceTree = ""; }; - 469302D12046AE05004A3D6C /* jsb_renderer_manual.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsb_renderer_manual.hpp; sourceTree = ""; }; - 469302D72046AE05004A3D6C /* jsb_gfx_manual.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsb_gfx_manual.hpp; sourceTree = ""; }; 469302DA2046AE05004A3D6C /* jsb_conversions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_conversions.cpp; sourceTree = ""; }; - 469302DD2046AE05004A3D6C /* jsb_renderer_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_renderer_manual.cpp; sourceTree = ""; }; 469302DE2046AE05004A3D6C /* jsb_helper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_helper.cpp; sourceTree = ""; }; 469302DF2046AE05004A3D6C /* jsb_classtype.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = jsb_classtype.hpp; sourceTree = ""; }; - 469302E52046AE05004A3D6C /* jsb_gfx_manual.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = jsb_gfx_manual.cpp; sourceTree = ""; }; 469302F92046AE05004A3D6C /* EventDispatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventDispatcher.cpp; sourceTree = ""; }; 469302FA2046AE05004A3D6C /* EventDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventDispatcher.h; sourceTree = ""; }; 46930464204FE20F004A3D6C /* CCLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCLog.h; sourceTree = ""; }; @@ -2025,67 +1256,6 @@ 46AE3FDA2092F3A600F3A228 /* node_debug_options.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = node_debug_options.cc; sourceTree = ""; }; 46AE3FDB2092F3A600F3A228 /* node_debug_options.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = node_debug_options.h; sourceTree = ""; }; 46AE3FDC2092F3A600F3A228 /* env.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = env.cc; sourceTree = ""; }; - 46FDDA2E202ACC6A00931238 /* INode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = INode.h; sourceTree = ""; }; - 46FDDA2F202ACC6A00931238 /* Pass.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Pass.cpp; sourceTree = ""; }; - 46FDDA30202ACC6A00931238 /* Scene.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Scene.cpp; sourceTree = ""; }; - 46FDDA31202ACC6A00931238 /* ProgramLib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProgramLib.h; sourceTree = ""; }; - 46FDDA32202ACC6A00931238 /* Config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Config.h; sourceTree = ""; }; - 46FDDA33202ACC6A00931238 /* Light.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Light.h; sourceTree = ""; }; - 46FDDA34202ACC6A00931238 /* Camera.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Camera.cpp; sourceTree = ""; }; - 46FDDA35202ACC6A00931238 /* Camera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Camera.h; sourceTree = ""; }; - 46FDDA36202ACC6A00931238 /* Light.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Light.cpp; sourceTree = ""; }; - 46FDDA37202ACC6A00931238 /* Renderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Renderer.h; sourceTree = ""; }; - 46FDDA38202ACC6A00931238 /* RendererUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RendererUtils.h; sourceTree = ""; }; - 46FDDA39202ACC6A00931238 /* Technique.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Technique.h; sourceTree = ""; }; - 46FDDA3A202ACC6A00931238 /* View.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = View.h; sourceTree = ""; }; - 46FDDA3B202ACC6A00931238 /* View.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = View.cpp; sourceTree = ""; }; - 46FDDA3C202ACC6A00931238 /* Effect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Effect.cpp; sourceTree = ""; }; - 46FDDA3D202ACC6A00931238 /* ForwardRenderer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ForwardRenderer.cpp; sourceTree = ""; }; - 46FDDA3E202ACC6A00931238 /* Config.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Config.cpp; sourceTree = ""; }; - 46FDDA3F202ACC6A00931238 /* BaseRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseRenderer.h; sourceTree = ""; }; - 46FDDA40202ACC6A00931238 /* Pass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Pass.h; sourceTree = ""; }; - 46FDDA41202ACC6A00931238 /* Technique.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Technique.cpp; sourceTree = ""; }; - 46FDDA42202ACC6A00931238 /* RendererUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RendererUtils.cpp; sourceTree = ""; }; - 46FDDA43202ACC6A00931238 /* Model.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Model.h; sourceTree = ""; }; - 46FDDA44202ACC6A00931238 /* Model.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Model.cpp; sourceTree = ""; }; - 46FDDA45202ACC6A00931238 /* Effect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Effect.h; sourceTree = ""; }; - 46FDDA46202ACC6A00931238 /* BaseRenderer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BaseRenderer.cpp; sourceTree = ""; }; - 46FDDA47202ACC6A00931238 /* ProgramLib.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProgramLib.cpp; sourceTree = ""; }; - 46FDDA48202ACC6A00931238 /* InputAssembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InputAssembler.h; sourceTree = ""; }; - 46FDDA49202ACC6A00931238 /* InputAssembler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InputAssembler.cpp; sourceTree = ""; }; - 46FDDA4A202ACC6A00931238 /* Scene.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Scene.h; sourceTree = ""; }; - 46FDDA4B202ACC6A00931238 /* ForwardRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ForwardRenderer.h; sourceTree = ""; }; - 46FDDA4C202ACC6A00931238 /* Types.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Types.cpp; sourceTree = ""; }; - 46FDDA4E202ACC6A00931238 /* Types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Types.h; sourceTree = ""; }; - 46FDDA4F202ACC6A00931238 /* Macro.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Macro.h; sourceTree = ""; }; - 46FDDA51202ACC6A00931238 /* Texture2D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Texture2D.h; sourceTree = ""; }; - 46FDDA52202ACC6A00931238 /* DeviceGraphics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeviceGraphics.cpp; sourceTree = ""; }; - 46FDDA53202ACC6A00931238 /* VertexBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VertexBuffer.cpp; sourceTree = ""; }; - 46FDDA54202ACC6A00931238 /* Program.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Program.cpp; sourceTree = ""; }; - 46FDDA55202ACC6A00931238 /* IndexBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IndexBuffer.h; sourceTree = ""; }; - 46FDDA56202ACC6A00931238 /* FrameBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FrameBuffer.cpp; sourceTree = ""; }; - 46FDDA57202ACC6A00931238 /* VertexFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VertexFormat.cpp; sourceTree = ""; }; - 46FDDA58202ACC6A00931238 /* DeviceGraphics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceGraphics.h; sourceTree = ""; }; - 46FDDA59202ACC6A00931238 /* State.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = State.cpp; sourceTree = ""; }; - 46FDDA5A202ACC6A00931238 /* Texture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Texture.cpp; sourceTree = ""; }; - 46FDDA5B202ACC6A00931238 /* FrameBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FrameBuffer.h; sourceTree = ""; }; - 46FDDA5C202ACC6A00931238 /* RenderTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTarget.cpp; sourceTree = ""; }; - 46FDDA5D202ACC6A00931238 /* GFX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GFX.h; sourceTree = ""; }; - 46FDDA5E202ACC6A00931238 /* RenderBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderBuffer.cpp; sourceTree = ""; }; - 46FDDA5F202ACC6A00931238 /* VertexFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VertexFormat.h; sourceTree = ""; }; - 46FDDA60202ACC6A00931238 /* GraphicsHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsHandle.h; sourceTree = ""; }; - 46FDDA61202ACC6A00931238 /* RenderBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderBuffer.h; sourceTree = ""; }; - 46FDDA62202ACC6A00931238 /* Texture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Texture.h; sourceTree = ""; }; - 46FDDA63202ACC6A00931238 /* Texture2D.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Texture2D.cpp; sourceTree = ""; }; - 46FDDA64202ACC6A00931238 /* GraphicsHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsHandle.cpp; sourceTree = ""; }; - 46FDDA65202ACC6A00931238 /* GFXUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GFXUtils.h; sourceTree = ""; }; - 46FDDA66202ACC6A00931238 /* Program.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Program.h; sourceTree = ""; }; - 46FDDA67202ACC6A00931238 /* State.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = State.h; sourceTree = ""; }; - 46FDDA68202ACC6A00931238 /* VertexBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VertexBuffer.h; sourceTree = ""; }; - 46FDDA69202ACC6A00931238 /* RenderTarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderTarget.h; sourceTree = ""; }; - 46FDDA6A202ACC6A00931238 /* GFXUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GFXUtils.cpp; sourceTree = ""; }; - 46FDDA6B202ACC6A00931238 /* GFX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GFX.cpp; sourceTree = ""; }; - 46FDDA6C202ACC6A00931238 /* IndexBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IndexBuffer.cpp; sourceTree = ""; }; 46FDDAEB202ADDCE00931238 /* pvr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pvr.h; sourceTree = ""; }; 46FDDAEC202ADDCE00931238 /* CCValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCValue.h; sourceTree = ""; }; 46FDDAEE202ADDCE00931238 /* utlist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = utlist.h; sourceTree = ""; }; @@ -2192,6 +1362,170 @@ B291B5181D4A106A00BBB345 /* libpng.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpng.a; path = ../external/ios/libs/libpng.a; sourceTree = ""; }; B291B5191D4A106A00BBB345 /* libtiff.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libtiff.a; path = ../external/ios/libs/libtiff.a; sourceTree = ""; }; B291B51A1D4A106A00BBB345 /* libwebp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libwebp.a; path = ../external/ios/libs/libwebp.a; sourceTree = ""; }; + BA06A62C23583DBD007740C5 /* Core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Core.h; sourceTree = ""; }; + BA06A62F23583DBD007740C5 /* NedPooling.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NedPooling.cc; sourceTree = ""; }; + BA06A63023583DBD007740C5 /* AllocatedObj.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AllocatedObj.h; sourceTree = ""; }; + BA06A63123583DBD007740C5 /* MemTracker.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MemTracker.cc; sourceTree = ""; }; + BA06A63223583DBD007740C5 /* MemDef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemDef.h; sourceTree = ""; }; + BA06A63323583DBD007740C5 /* JeAlloc.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JeAlloc.cc; sourceTree = ""; }; + BA06A63423583DBD007740C5 /* AllocatedObj.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AllocatedObj.cc; sourceTree = ""; }; + BA06A63523583DBD007740C5 /* MemTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemTracker.h; sourceTree = ""; }; + BA06A63623583DBD007740C5 /* StlAlloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StlAlloc.h; sourceTree = ""; }; + BA06A63723583DBD007740C5 /* Memory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Memory.h; sourceTree = ""; }; + BA06A63823583DBD007740C5 /* JeAlloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JeAlloc.h; sourceTree = ""; }; + BA06A63923583DBD007740C5 /* Memory.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Memory.cc; sourceTree = ""; }; + BA06A63A23583DBD007740C5 /* StdAlloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StdAlloc.h; sourceTree = ""; }; + BA06A63B23583DBD007740C5 /* NedPooling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NedPooling.h; sourceTree = ""; }; + BA06A63D23583DBD007740C5 /* StringUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringUtil.h; sourceTree = ""; }; + BA06A63E23583DBD007740C5 /* StringUtil.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringUtil.cc; sourceTree = ""; }; + BA06A63F23583DBD007740C5 /* CoreStd.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CoreStd.cc; sourceTree = ""; }; + BA06A64123583DBD007740C5 /* CCMath.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCMath.cc; sourceTree = ""; }; + BA06A64223583DBD007740C5 /* CCMath.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCMath.h; sourceTree = ""; }; + BA06A64323583DBD007740C5 /* CoreStd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreStd.h; sourceTree = ""; }; + BA06A64423583DBD007740C5 /* CoreDef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreDef.h; sourceTree = ""; }; + BA06A64623583DBD007740C5 /* GFXShader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GFXShader.cc; sourceTree = ""; }; + BA06A64723583DBD007740C5 /* GFXShader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GFXShader.h; sourceTree = ""; }; + BA06A64823583DBD007740C5 /* GFXDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GFXDevice.h; sourceTree = ""; }; + BA06A64923583DBD007740C5 /* GFXCommandAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GFXCommandAllocator.h; sourceTree = ""; }; + BA06A64A23583DBD007740C5 /* GFXWindow.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GFXWindow.cc; sourceTree = ""; }; + BA06A64B23583DBD007740C5 /* GFXTextureView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GFXTextureView.h; sourceTree = ""; }; + BA06A64C23583DBD007740C5 /* GFXPipelineLayout.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GFXPipelineLayout.cc; sourceTree = ""; }; + BA06A64D23583DBD007740C5 /* GFXTexture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GFXTexture.h; sourceTree = ""; }; + BA06A64E23583DBD007740C5 /* GFXBindingLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GFXBindingLayout.h; sourceTree = ""; }; + BA06A64F23583DBD007740C5 /* GFXQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GFXQueue.h; sourceTree = ""; }; + BA06A65023583DBD007740C5 /* GFXRenderPass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GFXRenderPass.h; sourceTree = ""; }; + BA06A65123583DBD007740C5 /* GFXTextureView.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GFXTextureView.cc; sourceTree = ""; }; + BA06A65223583DBD007740C5 /* GFXPipelineLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GFXPipelineLayout.h; sourceTree = ""; }; + BA06A65323583DBD007740C5 /* GFXWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GFXWindow.h; sourceTree = ""; }; + BA06A65423583DBD007740C5 /* GFXDef.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GFXDef.cc; sourceTree = ""; }; + BA06A65523583DBD007740C5 /* GFXPipelineState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GFXPipelineState.h; sourceTree = ""; }; + BA06A65623583DBD007740C5 /* GFXDevice.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GFXDevice.cc; sourceTree = ""; }; + BA06A65723583DBD007740C5 /* GFXDef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GFXDef.h; sourceTree = ""; }; + BA06A65823583DBD007740C5 /* GFXBuffer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GFXBuffer.cc; sourceTree = ""; }; + BA06A65923583DBD007740C5 /* GFXFramebuffer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GFXFramebuffer.cc; sourceTree = ""; }; + BA06A65A23583DBD007740C5 /* GFXCommandBuffer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GFXCommandBuffer.cc; sourceTree = ""; }; + BA06A65B23583DBD007740C5 /* GFXInputAssembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GFXInputAssembler.h; sourceTree = ""; }; + BA06A65C23583DBD007740C5 /* GFXRenderPass.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GFXRenderPass.cc; sourceTree = ""; }; + BA06A65D23583DBD007740C5 /* GFXInputAssembler.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GFXInputAssembler.cc; sourceTree = ""; }; + BA06A65E23583DBD007740C5 /* GFXCommandBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GFXCommandBuffer.h; sourceTree = ""; }; + BA06A65F23583DBD007740C5 /* GFXContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GFXContext.h; sourceTree = ""; }; + BA06A66023583DBD007740C5 /* GFXSampler.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GFXSampler.cc; sourceTree = ""; }; + BA06A66123583DBD007740C5 /* GFXFramebuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GFXFramebuffer.h; sourceTree = ""; }; + BA06A66223583DBD007740C5 /* GFXBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GFXBuffer.h; sourceTree = ""; }; + BA06A66323583DBD007740C5 /* GFXTexture.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GFXTexture.cc; sourceTree = ""; }; + BA06A66423583DBD007740C5 /* GFXSampler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GFXSampler.h; sourceTree = ""; }; + BA06A66523583DBD007740C5 /* GFXBindingLayout.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GFXBindingLayout.cc; sourceTree = ""; }; + BA06A66623583DBD007740C5 /* GFXQueue.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GFXQueue.cc; sourceTree = ""; }; + BA06A66723583DBD007740C5 /* GFXCommandAllocator.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GFXCommandAllocator.cc; sourceTree = ""; }; + BA06A66823583DBD007740C5 /* GFXContext.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GFXContext.cc; sourceTree = ""; }; + BA06A66923583DBD007740C5 /* GFXPipelineState.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GFXPipelineState.cc; sourceTree = ""; }; + BA06A66B23583DBD007740C5 /* CachedArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedArray.h; sourceTree = ""; }; + BA06A66C23583DBD007740C5 /* UTFString.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UTFString.cc; sourceTree = ""; }; + BA06A66D23583DBD007740C5 /* assertion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = assertion.h; sourceTree = ""; }; + BA06A66E23583DBD007740C5 /* UTFString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UTFString.h; sourceTree = ""; }; + BA06A66F23583DBD007740C5 /* Log.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Log.h; sourceTree = ""; }; + BA06A67023583DBD007740C5 /* Assertion.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Assertion.cc; sourceTree = ""; }; + BA06A67123583DBD007740C5 /* Object.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Object.h; sourceTree = ""; }; + BA06A67223583DBD007740C5 /* Log.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Log.cc; sourceTree = ""; }; + BA06A67323583DBD007740C5 /* TypeDef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypeDef.h; sourceTree = ""; }; + BA06A6F923583DFD007740C5 /* gles2w.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = gles2w.mm; sourceTree = ""; }; + BA06A6FA23583DFD007740C5 /* GLES2GPUObjects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES2GPUObjects.h; sourceTree = ""; }; + BA06A6FB23583DFD007740C5 /* GLES2CommandAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES2CommandAllocator.h; sourceTree = ""; }; + BA06A6FC23583DFD007740C5 /* GLES2TextureView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES2TextureView.h; sourceTree = ""; }; + BA06A6FD23583DFD007740C5 /* GLES2Device.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES2Device.cc; sourceTree = ""; }; + BA06A6FE23583DFD007740C5 /* GLES2PipelineLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES2PipelineLayout.h; sourceTree = ""; }; + BA06A6FF23583DFD007740C5 /* GFXGLES2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GFXGLES2.h; sourceTree = ""; }; + BA06A70023583DFD007740C5 /* GLES2Commands.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES2Commands.h; sourceTree = ""; }; + BA06A70123583DFD007740C5 /* GLES2Window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES2Window.h; sourceTree = ""; }; + BA06A70223583DFD007740C5 /* GLES2EGLContext.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES2EGLContext.cc; sourceTree = ""; }; + BA06A70323583DFD007740C5 /* GLES2Texture.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES2Texture.cc; sourceTree = ""; }; + BA06A70423583DFD007740C5 /* GLES2Framebuffer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES2Framebuffer.cc; sourceTree = ""; }; + BA06A70523583DFD007740C5 /* GLES2RenderPass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES2RenderPass.h; sourceTree = ""; }; + BA06A70623583DFD007740C5 /* GLES2InputAssembler.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES2InputAssembler.cc; sourceTree = ""; }; + BA06A70723583DFD007740C5 /* GLES2Sampler.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES2Sampler.cc; sourceTree = ""; }; + BA06A70823583DFD007740C5 /* GLES2Texture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES2Texture.h; sourceTree = ""; }; + BA06A70923583DFD007740C5 /* gles2w.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gles2w.h; sourceTree = ""; }; + BA06A70A23583DFD007740C5 /* GLES2CommandAllocator.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES2CommandAllocator.cc; sourceTree = ""; }; + BA06A70B23583DFD007740C5 /* GLES2Std.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES2Std.cc; sourceTree = ""; }; + BA06A70C23583DFD007740C5 /* GLES2Window.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES2Window.cc; sourceTree = ""; }; + BA06A70D23583DFD007740C5 /* GLES2Device.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES2Device.h; sourceTree = ""; }; + BA06A70E23583DFD007740C5 /* GLES2Shader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES2Shader.h; sourceTree = ""; }; + BA06A70F23583DFD007740C5 /* GLES2Shader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES2Shader.cc; sourceTree = ""; }; + BA06A71023583DFD007740C5 /* GLES2CommandBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES2CommandBuffer.h; sourceTree = ""; }; + BA06A71123583DFD007740C5 /* GLES2Framebuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES2Framebuffer.h; sourceTree = ""; }; + BA06A71223583DFD007740C5 /* GLES2Queue.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES2Queue.cc; sourceTree = ""; }; + BA06A71323583DFD007740C5 /* GLES2StateCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES2StateCache.h; sourceTree = ""; }; + BA06A71423583DFD007740C5 /* GLES2PipelineState.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES2PipelineState.cc; sourceTree = ""; }; + BA06A71523583DFD007740C5 /* GLES2RenderPass.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES2RenderPass.cc; sourceTree = ""; }; + BA06A71623583DFD007740C5 /* GLES2Sampler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES2Sampler.h; sourceTree = ""; }; + BA06A71723583DFD007740C5 /* GLES2PipelineState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES2PipelineState.h; sourceTree = ""; }; + BA06A71823583DFD007740C5 /* GLES2BindingLayout.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES2BindingLayout.cc; sourceTree = ""; }; + BA06A71923583DFD007740C5 /* GLES2EGLContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES2EGLContext.h; sourceTree = ""; }; + BA06A71A23583DFD007740C5 /* gles2w.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = gles2w.c; sourceTree = ""; }; + BA06A71B23583DFD007740C5 /* GLES2Commands.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES2Commands.cc; sourceTree = ""; }; + BA06A71C23583DFD007740C5 /* GLES2Queue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES2Queue.h; sourceTree = ""; }; + BA06A71D23583DFD007740C5 /* GLES2PipelineLayout.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES2PipelineLayout.cc; sourceTree = ""; }; + BA06A71E23583DFD007740C5 /* GLES2CommandPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES2CommandPool.h; sourceTree = ""; }; + BA06A71F23583DFD007740C5 /* GLES2Std.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES2Std.h; sourceTree = ""; }; + BA06A72023583DFD007740C5 /* GLES2Buffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES2Buffer.h; sourceTree = ""; }; + BA06A72123583DFD007740C5 /* GLES2BindingLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES2BindingLayout.h; sourceTree = ""; }; + BA06A72223583DFD007740C5 /* GLES2InputAssembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES2InputAssembler.h; sourceTree = ""; }; + BA06A72323583DFD007740C5 /* GLES2Buffer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES2Buffer.cc; sourceTree = ""; }; + BA06A72423583DFD007740C5 /* GLES2TextureView.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES2TextureView.cc; sourceTree = ""; }; + BA06A72523583DFD007740C5 /* GLES2CommandBuffer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES2CommandBuffer.cc; sourceTree = ""; }; + BA06A72823583DFD007740C5 /* wglew.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wglew.h; sourceTree = ""; }; + BA06A72923583DFD007740C5 /* glew.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = glew.h; sourceTree = ""; }; + BA06A72A23583DFD007740C5 /* GLStd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLStd.h; sourceTree = ""; }; + BA06A72B23583DFD007740C5 /* GLStd.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLStd.cpp; sourceTree = ""; }; + BA06A72D23583DFD007740C5 /* MetalStd.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MetalStd.mm; sourceTree = ""; }; + BA06A72E23583DFD007740C5 /* MetalStd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MetalStd.h; sourceTree = ""; }; + BA06A72F23583DFD007740C5 /* MTLbuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MTLbuffer.h; sourceTree = ""; }; + BA06A73023583DFD007740C5 /* MTLbuffer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MTLbuffer.mm; sourceTree = ""; }; + BA06A73223583DFD007740C5 /* GLES3Window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES3Window.h; sourceTree = ""; }; + BA06A73323583DFD007740C5 /* GLES3EGLContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES3EGLContext.h; sourceTree = ""; }; + BA06A73423583DFD007740C5 /* GLES3InputAssembler.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES3InputAssembler.cc; sourceTree = ""; }; + BA06A73523583DFD007740C5 /* GLES3Sampler.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES3Sampler.cc; sourceTree = ""; }; + BA06A73623583DFD007740C5 /* gles3w.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = gles3w.mm; sourceTree = ""; }; + BA06A73723583DFD007740C5 /* GLES3EGLContext.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES3EGLContext.cc; sourceTree = ""; }; + BA06A73823583DFD007740C5 /* GLES3TextureView.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES3TextureView.cc; sourceTree = ""; }; + BA06A73923583DFD007740C5 /* GLES3Device.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES3Device.cc; sourceTree = ""; }; + BA06A73A23583DFD007740C5 /* GLES3CommandAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES3CommandAllocator.h; sourceTree = ""; }; + BA06A73B23583DFD007740C5 /* GLES3TextureView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES3TextureView.h; sourceTree = ""; }; + BA06A73C23583DFD007740C5 /* GLES3Std.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES3Std.cc; sourceTree = ""; }; + BA06A73D23583DFD007740C5 /* GLES3StateCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES3StateCache.h; sourceTree = ""; }; + BA06A73E23583DFD007740C5 /* GLES3Shader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES3Shader.h; sourceTree = ""; }; + BA06A73F23583DFD007740C5 /* GLES3Device.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES3Device.h; sourceTree = ""; }; + BA06A74023583DFD007740C5 /* GLES3PipelineLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES3PipelineLayout.h; sourceTree = ""; }; + BA06A74123583DFD007740C5 /* GLES3CommandBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES3CommandBuffer.h; sourceTree = ""; }; + BA06A74223583DFD007740C5 /* GLES3Texture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES3Texture.h; sourceTree = ""; }; + BA06A74323583DFD007740C5 /* GLES3Queue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES3Queue.h; sourceTree = ""; }; + BA06A74423583DFD007740C5 /* GLES3Commands.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES3Commands.cc; sourceTree = ""; }; + BA06A74523583DFD007740C5 /* gles3w.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gles3w.h; sourceTree = ""; }; + BA06A74623583DFD007740C5 /* GLES3Window.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES3Window.cc; sourceTree = ""; }; + BA06A74723583DFD007740C5 /* GLES3Commands.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES3Commands.h; sourceTree = ""; }; + BA06A74823583DFD007740C5 /* GLES3Texture.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES3Texture.cc; sourceTree = ""; }; + BA06A74923583DFD007740C5 /* GLES3Shader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES3Shader.cc; sourceTree = ""; }; + BA06A74A23583DFD007740C5 /* GLES3RenderPass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES3RenderPass.h; sourceTree = ""; }; + BA06A74B23583DFD007740C5 /* GLES3InputAssembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES3InputAssembler.h; sourceTree = ""; }; + BA06A74C23583DFD007740C5 /* GLES3PipelineState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES3PipelineState.h; sourceTree = ""; }; + BA06A74D23583DFD007740C5 /* GLES3CommandAllocator.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES3CommandAllocator.cc; sourceTree = ""; }; + BA06A74E23583DFD007740C5 /* GLES3PipelineLayout.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES3PipelineLayout.cc; sourceTree = ""; }; + BA06A74F23583DFD007740C5 /* GLES3CommandBuffer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES3CommandBuffer.cc; sourceTree = ""; }; + BA06A75023583DFD007740C5 /* GLES3Framebuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES3Framebuffer.h; sourceTree = ""; }; + BA06A75123583DFD007740C5 /* GLES3Sampler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES3Sampler.h; sourceTree = ""; }; + BA06A75223583DFD007740C5 /* GLES3Queue.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES3Queue.cc; sourceTree = ""; }; + BA06A75323583DFD007740C5 /* GLES3RenderPass.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES3RenderPass.cc; sourceTree = ""; }; + BA06A75423583DFD007740C5 /* GLES3GPUObjects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES3GPUObjects.h; sourceTree = ""; }; + BA06A75523583DFD007740C5 /* GLES3Framebuffer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES3Framebuffer.cc; sourceTree = ""; }; + BA06A75623583DFD007740C5 /* GLES3BindingLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES3BindingLayout.h; sourceTree = ""; }; + BA06A75723583DFD007740C5 /* GLES3BindingLayout.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES3BindingLayout.cc; sourceTree = ""; }; + BA06A75823583DFD007740C5 /* GLES3Std.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES3Std.h; sourceTree = ""; }; + BA06A75923583DFD007740C5 /* GFXGLES3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GFXGLES3.h; sourceTree = ""; }; + BA06A75A23583DFD007740C5 /* GLES3PipelineState.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES3PipelineState.cc; sourceTree = ""; }; + BA06A75B23583DFD007740C5 /* GLES3Buffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES3Buffer.h; sourceTree = ""; }; + BA06A75C23583DFD007740C5 /* GLES3Buffer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GLES3Buffer.cc; sourceTree = ""; }; + BA06A75D23583DFD007740C5 /* gles3w.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = gles3w.c; sourceTree = ""; }; + BA06A75E23583DFD007740C5 /* GLES3CommandPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLES3CommandPool.h; sourceTree = ""; }; BA0DAAEE1DB76F2C00EE23AD /* libwebp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libwebp.a; path = ../external/mac/libs/libwebp.a; sourceTree = ""; }; BA21054721008AC300E19975 /* AssetsManagerEx.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = AssetsManagerEx.cpp; sourceTree = ""; }; BA21054821008AC300E19975 /* AssetsManagerEx.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AssetsManagerEx.h; sourceTree = ""; }; @@ -2283,438 +1617,9 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 0418549C228D7E4500F8DF31 /* particle */ = { - isa = PBXGroup; - children = ( - 0418549D228D7E5700F8DF31 /* ParticleSimulator.cpp */, - 0418549E228D7E5700F8DF31 /* ParticleSimulator.h */, - ); - name = particle; - sourceTree = ""; - }; - 04355811217EADAC00B9C056 /* editor-support */ = { - isa = PBXGroup; - children = ( - 0418549C228D7E4500F8DF31 /* particle */, - 046E040B2181A9BE00B24E2D /* dragonbones-creator-support */, - 046E040321806AD400B24E2D /* dragonbones */, - 046E03DE2180456A00B24E2D /* spine-creator-support */, - 04355814217EADF300B9C056 /* IOBuffer.cpp */, - 04355815217EADF300B9C056 /* IOBuffer.h */, - 046E06F52189990700B24E2D /* middleware-adapter.cpp */, - 046E06F62189990700B24E2D /* middleware-adapter.h */, - 04355812217EADB900B9C056 /* spine */, - 04AF62FD219190ED00AED9DE /* TypedArrayPool.cpp */, - 04AF62FE219190ED00AED9DE /* TypedArrayPool.h */, - 046B6888219FA61200B33469 /* MiddlewareManager.cpp */, - 046B6889219FA61200B33469 /* MiddlewareManager.h */, - 046B688E21A00F5600B33469 /* IOTypedArray.cpp */, - 046B688F21A00F5600B33469 /* IOTypedArray.h */, - 046B689421A10D5800B33469 /* MiddlewareMacro.h */, - 04ED68D621F8188F006E82F8 /* MeshBuffer.cpp */, - 04ED68D721F8188F006E82F8 /* MeshBuffer.h */, - ); - name = "editor-support"; - sourceTree = ""; - }; - 04355812217EADB900B9C056 /* spine */ = { - isa = PBXGroup; - children = ( - 04DBD35F22AE2DAA00DBE4CD /* Animation.cpp */, - 04DBD34D22AE2DA700DBE4CD /* Animation.h */, - 04DBD37222AE2DAE00DBE4CD /* AnimationState.cpp */, - 04DBD38D22AE2DB400DBE4CD /* AnimationState.h */, - 04DBD37822AE2DAF00DBE4CD /* AnimationStateData.cpp */, - 04DBD32F22AE2DA300DBE4CD /* AnimationStateData.h */, - 04DBD33522AE2DA300DBE4CD /* Atlas.cpp */, - 04DBD38B22AE2DB300DBE4CD /* Atlas.h */, - 04DBD33422AE2DA300DBE4CD /* AtlasAttachmentLoader.cpp */, - 04DBD35022AE2DA800DBE4CD /* AtlasAttachmentLoader.h */, - 04DBD3A022AE2DB700DBE4CD /* Attachment.cpp */, - 04DBD32E22AE2DA200DBE4CD /* Attachment.h */, - 04DBD3A122AE2DB800DBE4CD /* AttachmentLoader.cpp */, - 04DBD37B22AE2DB000DBE4CD /* AttachmentLoader.h */, - 04DBD38522AE2DB200DBE4CD /* AttachmentTimeline.cpp */, - 04DBD34022AE2DA500DBE4CD /* AttachmentTimeline.h */, - 04DBD38922AE2DB300DBE4CD /* AttachmentType.h */, - 04DBD34122AE2DA500DBE4CD /* BlendMode.h */, - 04DBD33622AE2DA300DBE4CD /* Bone.cpp */, - 04DBD38822AE2DB300DBE4CD /* Bone.h */, - 04DBD35B22AE2DAA00DBE4CD /* BoneData.cpp */, - 04DBD3B122AE2DBB00DBE4CD /* BoneData.h */, - 04DBD3A622AE2DB800DBE4CD /* BoundingBoxAttachment.cpp */, - 04DBD35222AE2DA800DBE4CD /* BoundingBoxAttachment.h */, - 04DBD3B622AE2DBC00DBE4CD /* ClippingAttachment.cpp */, - 04DBD34A22AE2DA600DBE4CD /* ClippingAttachment.h */, - 04DBD36822AE2DAC00DBE4CD /* Color.h */, - 04DBD39F22AE2DB700DBE4CD /* ColorTimeline.cpp */, - 04DBD33A22AE2DA400DBE4CD /* ColorTimeline.h */, - 04DBD35822AE2DA900DBE4CD /* Constraint.cpp */, - 04DBD33C22AE2DA400DBE4CD /* Constraint.h */, - 04DBD3A922AE2DB900DBE4CD /* ContainerUtil.h */, - 04DBD39522AE2DB500DBE4CD /* CurveTimeline.cpp */, - 04DBD34522AE2DA600DBE4CD /* CurveTimeline.h */, - 04DBD34422AE2DA500DBE4CD /* Debug.h */, - 04DBD38E22AE2DB400DBE4CD /* DeformTimeline.cpp */, - 044597F322D332D700924443 /* Extension.h */, - 04DBD3AF22AE2DBA00DBE4CD /* DeformTimeline.h */, - 04DBD3B222AE2DBB00DBE4CD /* dll.h */, - 04DBD36F22AE2DAE00DBE4CD /* DrawOrderTimeline.cpp */, - 04DBD37422AE2DAF00DBE4CD /* DrawOrderTimeline.h */, - 04DBD37F22AE2DB100DBE4CD /* Event.cpp */, - 04DBD34C22AE2DA700DBE4CD /* Event.h */, - 04DBD39D22AE2DB700DBE4CD /* EventData.cpp */, - 04DBD33822AE2DA400DBE4CD /* EventData.h */, - 04DBD39222AE2DB500DBE4CD /* EventTimeline.cpp */, - 04DBD34F22AE2DA700DBE4CD /* EventTimeline.h */, - 04DBD34722AE2DA600DBE4CD /* Extension.cpp */, - 04DBD34E22AE2DA700DBE4CD /* HashMap.h */, - 04DBD33322AE2DA300DBE4CD /* HasRendererObject.h */, - 04DBD35C22AE2DAA00DBE4CD /* IkConstraint.cpp */, - 04DBD3BA22AE2DBC00DBE4CD /* IkConstraint.h */, - 04DBD36522AE2DAC00DBE4CD /* IkConstraintData.cpp */, - 04DBD35422AE2DA800DBE4CD /* IkConstraintData.h */, - 04DBD39422AE2DB500DBE4CD /* IkConstraintTimeline.cpp */, - 04DBD37522AE2DAF00DBE4CD /* IkConstraintTimeline.h */, - 04DBD36722AE2DAC00DBE4CD /* Json.cpp */, - 04DBD37722AE2DAF00DBE4CD /* Json.h */, - 04DBD3A222AE2DB800DBE4CD /* LinkedMesh.cpp */, - 04DBD3B822AE2DBC00DBE4CD /* LinkedMesh.h */, - 04DBD35A22AE2DA900DBE4CD /* MathUtil.cpp */, - 04DBD34822AE2DA600DBE4CD /* MathUtil.h */, - 04DBD3A722AE2DB900DBE4CD /* MeshAttachment.cpp */, - 04DBD38A22AE2DB300DBE4CD /* MeshAttachment.h */, - 04DBD39322AE2DB500DBE4CD /* MixBlend.h */, - 04DBD33222AE2DA300DBE4CD /* MixDirection.h */, - 04DBD33B22AE2DA400DBE4CD /* PathAttachment.cpp */, - 04DBD37022AE2DAE00DBE4CD /* PathAttachment.h */, - 04DBD36222AE2DAB00DBE4CD /* PathConstraint.cpp */, - 04DBD37122AE2DAE00DBE4CD /* PathConstraint.h */, - 04DBD38122AE2DB100DBE4CD /* PathConstraintData.cpp */, - 04DBD39122AE2DB400DBE4CD /* PathConstraintData.h */, - 04DBD34B22AE2DA700DBE4CD /* PathConstraintMixTimeline.cpp */, - 04DBD34322AE2DA500DBE4CD /* PathConstraintMixTimeline.h */, - 04DBD3AD22AE2DBA00DBE4CD /* PathConstraintPositionTimeline.cpp */, - 04DBD39022AE2DB400DBE4CD /* PathConstraintPositionTimeline.h */, - 04DBD38F22AE2DB400DBE4CD /* PathConstraintSpacingTimeline.cpp */, - 04DBD36622AE2DAC00DBE4CD /* PathConstraintSpacingTimeline.h */, - 04DBD34222AE2DA500DBE4CD /* PointAttachment.cpp */, - 04DBD37C22AE2DB000DBE4CD /* PointAttachment.h */, - 04DBD32D22AE2DA200DBE4CD /* Pool.h */, - 04DBD38C22AE2DB300DBE4CD /* PositionMode.h */, - 04DBD36422AE2DAC00DBE4CD /* RegionAttachment.cpp */, - 04DBD3A322AE2DB800DBE4CD /* RegionAttachment.h */, - 04DBD36A22AE2DAD00DBE4CD /* RotateMode.h */, - 04DBD33F22AE2DA500DBE4CD /* RotateTimeline.cpp */, - 04DBD33922AE2DA400DBE4CD /* RotateTimeline.h */, - 04DBD3AA22AE2DB900DBE4CD /* RTTI.cpp */, - 04DBD3B922AE2DBC00DBE4CD /* RTTI.h */, - 04DBD38622AE2DB200DBE4CD /* ScaleTimeline.cpp */, - 04DBD38222AE2DB100DBE4CD /* ScaleTimeline.h */, - 04DBD38422AE2DB200DBE4CD /* ShearTimeline.cpp */, - 04DBD39822AE2DB600DBE4CD /* ShearTimeline.h */, - 04DBD37322AE2DAF00DBE4CD /* Skeleton.cpp */, - 04DBD3AC22AE2DBA00DBE4CD /* Skeleton.h */, - 04DBD37E22AE2DB100DBE4CD /* SkeletonBinary.cpp */, - 04DBD36E22AE2DAE00DBE4CD /* SkeletonBinary.h */, - 04DBD3AB22AE2DB900DBE4CD /* SkeletonBounds.cpp */, - 04DBD3B322AE2DBB00DBE4CD /* SkeletonBounds.h */, - 04DBD35322AE2DA800DBE4CD /* SkeletonClipping.cpp */, - 04DBD3B722AE2DBC00DBE4CD /* SkeletonClipping.h */, - 04DBD36022AE2DAB00DBE4CD /* SkeletonData.cpp */, - 04DBD33E22AE2DA400DBE4CD /* SkeletonData.h */, - 04DBD39E22AE2DB700DBE4CD /* SkeletonJson.cpp */, - 04DBD39922AE2DB600DBE4CD /* SkeletonJson.h */, - 04DBD36922AE2DAD00DBE4CD /* Skin.cpp */, - 04DBD35122AE2DA800DBE4CD /* Skin.h */, - 04DBD3A522AE2DB800DBE4CD /* Slot.cpp */, - 04DBD39622AE2DB500DBE4CD /* Slot.h */, - 04DBD35D22AE2DAA00DBE4CD /* SlotData.cpp */, - 04DBD36122AE2DAB00DBE4CD /* SlotData.h */, - 04DBD37622AE2DAF00DBE4CD /* SpacingMode.h */, - 04DBD3AE22AE2DBA00DBE4CD /* spine.h */, - 04DBD3A422AE2DB800DBE4CD /* SpineObject.cpp */, - 04DBD39A22AE2DB600DBE4CD /* SpineObject.h */, - 04DBD35522AE2DA800DBE4CD /* SpineString.h */, - 04DBD35E22AE2DAA00DBE4CD /* TextureLoader.cpp */, - 04DBD33022AE2DA300DBE4CD /* TextureLoader.h */, - 04DBD34622AE2DA600DBE4CD /* Timeline.cpp */, - 04DBD37D22AE2DB000DBE4CD /* Timeline.h */, - 04DBD34922AE2DA600DBE4CD /* TimelineType.h */, - 04DBD36D22AE2DAD00DBE4CD /* TransformConstraint.cpp */, - 04DBD3B422AE2DBB00DBE4CD /* TransformConstraint.h */, - 04DBD38722AE2DB200DBE4CD /* TransformConstraintData.cpp */, - 04DBD38322AE2DB200DBE4CD /* TransformConstraintData.h */, - 04DBD37922AE2DB000DBE4CD /* TransformConstraintTimeline.cpp */, - 04DBD35722AE2DA900DBE4CD /* TransformConstraintTimeline.h */, - 04DBD39C22AE2DB700DBE4CD /* TransformMode.h */, - 04DBD36B22AE2DAD00DBE4CD /* TranslateTimeline.cpp */, - 04DBD33D22AE2DA400DBE4CD /* TranslateTimeline.h */, - 04DBD35922AE2DA900DBE4CD /* Triangulator.cpp */, - 04DBD33722AE2DA300DBE4CD /* Triangulator.h */, - 04DBD3A822AE2DB900DBE4CD /* TwoColorTimeline.cpp */, - 04DBD38022AE2DB100DBE4CD /* TwoColorTimeline.h */, - 04DBD3B022AE2DBA00DBE4CD /* Updatable.cpp */, - 04DBD36C22AE2DAD00DBE4CD /* Updatable.h */, - 04DBD39722AE2DB600DBE4CD /* Vector.h */, - 04DBD35622AE2DA900DBE4CD /* VertexAttachment.cpp */, - 04DBD3B522AE2DBB00DBE4CD /* VertexAttachment.h */, - 04DBD33122AE2DA300DBE4CD /* VertexEffect.cpp */, - 04DBD36322AE2DAB00DBE4CD /* VertexEffect.h */, - 04DBD37A22AE2DB000DBE4CD /* Vertices.h */, - ); - name = spine; - sourceTree = ""; - }; - 046E03DE2180456A00B24E2D /* spine-creator-support */ = { - isa = PBXGroup; - children = ( - 04DBD30B22AE2D8000DBE4CD /* AttachmentVertices.cpp */, - 04DBD30E22AE2D8100DBE4CD /* AttachmentVertices.h */, - 04DBD30C22AE2D8000DBE4CD /* SkeletonAnimation.cpp */, - 04DBD30D22AE2D8100DBE4CD /* SkeletonAnimation.h */, - 04DBD31222AE2D8100DBE4CD /* SkeletonDataMgr.cpp */, - 04DBD31022AE2D8100DBE4CD /* SkeletonDataMgr.h */, - 04DBD31122AE2D8100DBE4CD /* SkeletonRenderer.cpp */, - 04DBD30A22AE2D8000DBE4CD /* SkeletonRenderer.h */, - 04DBD31322AE2D8100DBE4CD /* spine-cocos2dx.cpp */, - 04DBD31422AE2D8100DBE4CD /* spine-cocos2dx.h */, - 04DBD30F22AE2D8100DBE4CD /* VertexEffectDelegate.cpp */, - 04DBD30922AE2D8000DBE4CD /* VertexEffectDelegate.h */, - 049B31F92313B6240004909A /* SkeletonCacheMgr.cpp */, - 049B31FA2313B6240004909A /* SkeletonCacheMgr.h */, - 049B32052314DF1C0004909A /* SkeletonCache.cpp */, - 049B32062314DF1C0004909A /* SkeletonCache.h */, - 049B320B231533BF0004909A /* SkeletonCacheAnimation.cpp */, - 049B320C231533BF0004909A /* SkeletonCacheAnimation.h */, - ); - name = "spine-creator-support"; - sourceTree = ""; - }; - 046E040321806AD400B24E2D /* dragonbones */ = { - isa = PBXGroup; - children = ( - 046E067A2185B42F00B24E2D /* DragonBonesHeaders.h */, - 046E04132181AA1E00B24E2D /* parser */, - 046E04122181AA1800B24E2D /* model */, - 046E04112181AA1300B24E2D /* geom */, - 046E04102181AA0900B24E2D /* factory */, - 046E040F2181AA0200B24E2D /* event */, - 046E040E2181A9FB00B24E2D /* core */, - 046E040D2181A9F400B24E2D /* armature */, - 046E040C2181A9EB00B24E2D /* animation */, - ); - name = dragonbones; - sourceTree = ""; - }; - 046E040B2181A9BE00B24E2D /* dragonbones-creator-support */ = { - isa = PBXGroup; - children = ( - 04FB24062328D42A0021DD02 /* ArmatureCache.cpp */, - 04FB24072328D42A0021DD02 /* ArmatureCache.h */, - 04FB24052328D42A0021DD02 /* ArmatureCacheMgr.cpp */, - 04FB24042328D42A0021DD02 /* ArmatureCacheMgr.h */, - 04FB24082328D42A0021DD02 /* CCArmatureCacheDisplay.cpp */, - 04FB24032328D42A0021DD02 /* CCArmatureCacheDisplay.h */, - 046E06112185B37100B24E2D /* CCArmatureDisplay.cpp */, - 046E060B2185B37000B24E2D /* CCArmatureDisplay.h */, - 046E06102185B37100B24E2D /* CCDragonBonesHeaders.h */, - 046E060F2185B37100B24E2D /* CCFactory.cpp */, - 046E060E2185B37000B24E2D /* CCFactory.h */, - 046E060C2185B37000B24E2D /* CCSlot.cpp */, - 046E06132185B37100B24E2D /* CCSlot.h */, - 046E06122185B37100B24E2D /* CCTextureAtlasData.cpp */, - 046E060D2185B37000B24E2D /* CCTextureAtlasData.h */, - ); - name = "dragonbones-creator-support"; - sourceTree = ""; - }; - 046E040C2181A9EB00B24E2D /* animation */ = { - isa = PBXGroup; - children = ( - 046E062F2185B41000B24E2D /* Animation.cpp */, - 046E06272185B41000B24E2D /* Animation.h */, - 046E06292185B41000B24E2D /* AnimationState.cpp */, - 046E062D2185B41000B24E2D /* AnimationState.h */, - 046E06262185B40F00B24E2D /* BaseTimelineState.cpp */, - 046E062E2185B41000B24E2D /* BaseTimelineState.h */, - 046E06302185B41100B24E2D /* IAnimatable.h */, - 046E06282185B41000B24E2D /* TimelineState.cpp */, - 046E062C2185B41000B24E2D /* TimelineState.h */, - 046E062A2185B41000B24E2D /* WorldClock.cpp */, - 046E062B2185B41000B24E2D /* WorldClock.h */, - ); - name = animation; - sourceTree = ""; - }; - 046E040D2181A9F400B24E2D /* armature */ = { - isa = PBXGroup; - children = ( - 046E06492185B41A00B24E2D /* Armature.cpp */, - 046E064F2185B41A00B24E2D /* Armature.h */, - 046E06502185B41B00B24E2D /* Bone.cpp */, - 046E06472185B41A00B24E2D /* Bone.h */, - 046E064B2185B41A00B24E2D /* Constraint.cpp */, - 046E06512185B41B00B24E2D /* Constraint.h */, - 046E064A2185B41A00B24E2D /* DeformVertices.cpp */, - 046E064D2185B41A00B24E2D /* DeformVertices.h */, - 046E06522185B41B00B24E2D /* IArmatureProxy.h */, - 046E06532185B41B00B24E2D /* Slot.cpp */, - 046E064E2185B41A00B24E2D /* Slot.h */, - 046E06482185B41A00B24E2D /* TransformObject.cpp */, - 046E064C2185B41A00B24E2D /* TransformObject.h */, - ); - name = armature; - sourceTree = ""; - }; - 046E040E2181A9FB00B24E2D /* core */ = { - isa = PBXGroup; - children = ( - 046E066E2185B42400B24E2D /* BaseObject.cpp */, - 046E06712185B42500B24E2D /* BaseObject.h */, - 046E066F2185B42400B24E2D /* DragonBones.cpp */, - 046E06702185B42500B24E2D /* DragonBones.h */, - ); - name = core; - sourceTree = ""; - }; - 046E040F2181AA0200B24E2D /* event */ = { - isa = PBXGroup; - children = ( - 046E067E2185B43B00B24E2D /* EventObject.cpp */, - 046E067F2185B43B00B24E2D /* EventObject.h */, - 046E067D2185B43B00B24E2D /* IEventDispatcher.h */, - ); - name = event; - sourceTree = ""; - }; - 046E04102181AA0900B24E2D /* factory */ = { - isa = PBXGroup; - children = ( - 046E06862185B44A00B24E2D /* BaseFactory.cpp */, - 046E06872185B44A00B24E2D /* BaseFactory.h */, - ); - name = factory; - sourceTree = ""; - }; - 046E04112181AA1300B24E2D /* geom */ = { - isa = PBXGroup; - children = ( - 046E068D2185B45200B24E2D /* ColorTransform.h */, - 046E068F2185B45200B24E2D /* Matrix.h */, - 046E06902185B45300B24E2D /* Point.cpp */, - 046E06922185B45300B24E2D /* Point.h */, - 046E068C2185B45200B24E2D /* Rectangle.h */, - 046E068E2185B45200B24E2D /* Transform.cpp */, - 046E06912185B45300B24E2D /* Transform.h */, - ); - name = geom; - sourceTree = ""; - }; - 046E04122181AA1800B24E2D /* model */ = { - isa = PBXGroup; - children = ( - 046E06A82185B49C00B24E2D /* AnimationConfig.cpp */, - 046E06B12185B49D00B24E2D /* AnimationConfig.h */, - 046E06B42185B49E00B24E2D /* AnimationData.cpp */, - 046E06A12185B49B00B24E2D /* AnimationData.h */, - 046E06A72185B49C00B24E2D /* ArmatureData.cpp */, - 046E06B02185B49D00B24E2D /* ArmatureData.h */, - 046E06A52185B49C00B24E2D /* BoundingBoxData.cpp */, - 046E06AD2185B49D00B24E2D /* BoundingBoxData.h */, - 046E06AC2185B49D00B24E2D /* CanvasData.cpp */, - 046E06B22185B49E00B24E2D /* CanvasData.h */, - 046E06A22185B49B00B24E2D /* ConstraintData.cpp */, - 046E06B32185B49E00B24E2D /* ConstraintData.h */, - 046E06AE2185B49D00B24E2D /* DisplayData.cpp */, - 046E06A92185B49C00B24E2D /* DisplayData.h */, - 046E06B62185B49E00B24E2D /* DragonBonesData.cpp */, - 046E06B52185B49E00B24E2D /* DragonBonesData.h */, - 046E06AF2185B49D00B24E2D /* SkinData.cpp */, - 046E06AB2185B49D00B24E2D /* SkinData.h */, - 046E06A32185B49B00B24E2D /* TextureAtlasData.cpp */, - 046E06A62185B49C00B24E2D /* TextureAtlasData.h */, - 046E06AA2185B49C00B24E2D /* UserData.cpp */, - 046E06A42185B49C00B24E2D /* UserData.h */, - ); - name = model; - sourceTree = ""; - }; - 046E04132181AA1E00B24E2D /* parser */ = { - isa = PBXGroup; - children = ( - 046E06E62185B4A500B24E2D /* BinaryDataParser.cpp */, - 046E06E72185B4A500B24E2D /* BinaryDataParser.h */, - 046E06E42185B4A500B24E2D /* DataParser.cpp */, - 046E06E82185B4A500B24E2D /* DataParser.h */, - 046E06E32185B4A500B24E2D /* JSONDataParser.cpp */, - 046E06E52185B4A500B24E2D /* JSONDataParser.h */, - ); - name = parser; - sourceTree = ""; - }; - 0482F183228D87780019ECF7 /* scene */ = { - isa = PBXGroup; - children = ( - 04F8563122ABCB1F00063A20 /* assembler */, - 0482F18A228D87920019ECF7 /* MeshBuffer.cpp */, - 0482F195228D87960019ECF7 /* MeshBuffer.hpp */, - 0482F185228D87910019ECF7 /* ModelBatcher.cpp */, - 0482F190228D87940019ECF7 /* ModelBatcher.hpp */, - 0482F188228D87920019ECF7 /* NodeProxy.cpp */, - 0482F18B228D87930019ECF7 /* NodeProxy.hpp */, - 0482F192228D87950019ECF7 /* RenderFlow.cpp */, - 0482F184228D87900019ECF7 /* RenderFlow.hpp */, - 0482F186228D87910019ECF7 /* scene-bindings.h */, - 0482F193228D87950019ECF7 /* StencilManager.cpp */, - 0482F18C228D87930019ECF7 /* StencilManager.hpp */, - 04DBD4D922B51EA300DBE4CD /* MemPool.cpp */, - 04DBD4DA22B51EA300DBE4CD /* MemPool.hpp */, - 04DBD4DF22B51EB300DBE4CD /* NodeMemPool.cpp */, - 04DBD4E022B51EB300DBE4CD /* NodeMemPool.hpp */, - 0494CFD222BEFC6D00B73B79 /* ParallelTask.cpp */, - 0494CFD322BEFC6D00B73B79 /* ParallelTask.hpp */, - ); - path = scene; - sourceTree = ""; - }; - 04F8563122ABCB1F00063A20 /* assembler */ = { - isa = PBXGroup; - children = ( - 427475F723214E2900139DF8 /* MeshAssembler.cpp */, - 427475F823214E2A00139DF8 /* MeshAssembler.hpp */, - 045F672622A50A8C0033F7BD /* RenderData.cpp */, - 045F672722A50A8C0033F7BD /* RenderData.hpp */, - 042058CB22A61B340092DE5D /* RenderDataList.cpp */, - 042058CC22A61B340092DE5D /* RenderDataList.hpp */, - 0482F187228D87920019ECF7 /* Assembler.cpp */, - 0482F197228D87960019ECF7 /* Assembler.hpp */, - 0482F196228D87960019ECF7 /* CustomAssembler.cpp */, - 0482F189228D87920019ECF7 /* CustomAssembler.hpp */, - 0482F191228D87950019ECF7 /* MaskAssembler.cpp */, - 0482F18E228D87940019ECF7 /* MaskAssembler.hpp */, - 0482F18D228D87930019ECF7 /* AssemblerBase.cpp */, - 0482F198228D87970019ECF7 /* AssemblerBase.hpp */, - 04F8563222ABCB9900063A20 /* TiledMapAssembler.cpp */, - 04F8563322ABCB9900063A20 /* TiledMapAssembler.hpp */, - 0431A06722CCA441003356C9 /* AssemblerSprite.cpp */, - 0431A06822CCA441003356C9 /* AssemblerSprite.hpp */, - 0431A06D22CCA7C1003356C9 /* SimpleSprite2D.cpp */, - 0431A06E22CCA7C1003356C9 /* SimpleSprite2D.hpp */, - 04886B3F22CE22F2008CEB66 /* SlicedSprite2D.cpp */, - 04886B4022CE22F2008CEB66 /* SlicedSprite2D.hpp */, - 426947B7234ED0130044C66E /* SimpleSprite3D.cpp */, - 426947B8234ED0130044C66E /* SimpleSprite3D.hpp */, - 426947BD234ED02E0044C66E /* SlicedSprite3D.cpp */, - 426947BE234ED02E0044C66E /* SlicedSprite3D.hpp */, - ); - path = assembler; - sourceTree = ""; - }; 1551A334158F2AB200E66CFE = { isa = PBXGroup; children = ( - 04355811217EADAC00B9C056 /* editor-support */, 461DCA3220BBFA2D00B22827 /* ui */, 1AAAC877205CB6E9005321B9 /* audio */, 1A29D77F205666B100168D9A /* storage */, @@ -3035,14 +1940,6 @@ path = videoplayer; sourceTree = ""; }; - 4233798722BB237700E5D8A2 /* memop */ = { - isa = PBXGroup; - children = ( - 4233799C22BB43B900E5D8A2 /* RecyclePool.hpp */, - ); - path = memop; - sourceTree = ""; - }; 461785FD20522468008256E1 /* network */ = { isa = PBXGroup; children = ( @@ -3155,17 +2052,9 @@ 469302512046AE05004A3D6C /* auto */ = { isa = PBXGroup; children = ( - 041854A4228D7E7300F8DF31 /* jsb_cocos2dx_particle_auto.cpp */, - 041854A3228D7E7200F8DF31 /* jsb_cocos2dx_particle_auto.hpp */, - 046E06FB2189999500B24E2D /* jsb_cocos2dx_editor_support_auto.cpp */, - 046E06FC2189999600B24E2D /* jsb_cocos2dx_editor_support_auto.hpp */, - 046E0707218B015000B24E2D /* jsb_cocos2dx_dragonbones_auto.cpp */, - 046E0708218B015000B24E2D /* jsb_cocos2dx_dragonbones_auto.hpp */, 40AEF7BD216DF21B00729AA5 /* jsb_video_auto.cpp */, 40AEF7BE216DF21B00729AA5 /* jsb_video_auto.hpp */, 40AEF7B4216D982600729AA5 /* jsb_webview_auto.cpp */, - 046B68AB21A294B100B33469 /* jsb_cocos2dx_spine_auto.cpp */, - 046B68AA21A294B100B33469 /* jsb_cocos2dx_spine_auto.hpp */, 40AEF7B5216D982600729AA5 /* jsb_webview_auto.hpp */, 1AAAC871205CB647005321B9 /* jsb_cocos2dx_audioengine_auto.cpp */, 1AAAC872205CB647005321B9 /* jsb_cocos2dx_audioengine_auto.hpp */, @@ -3173,10 +2062,6 @@ 1A29D768205665BE00168D9A /* jsb_cocos2dx_auto.hpp */, 461786692052609B008256E1 /* jsb_cocos2dx_network_auto.cpp */, 4617866A2052609B008256E1 /* jsb_cocos2dx_network_auto.hpp */, - 4693025D2046AE05004A3D6C /* jsb_gfx_auto.cpp */, - 469302632046AE05004A3D6C /* jsb_gfx_auto.hpp */, - 469302592046AE05004A3D6C /* jsb_renderer_auto.cpp */, - 469302822046AE05004A3D6C /* jsb_renderer_auto.hpp */, BA21055721008B6600E19975 /* jsb_cocos2dx_extension_auto.cpp */, BA21055621008B6600E19975 /* jsb_cocos2dx_extension_auto.hpp */, ); @@ -3187,16 +2072,12 @@ isa = PBXGroup; children = ( 403ACAD820CE4EB000BB433D /* jsb_module_register.cpp */, - 046E070D218B01EF00B24E2D /* jsb_dragonbones_manual.cpp */, - 046E070E218B01EF00B24E2D /* jsb_dragonbones_manual.hpp */, 403ACAD920CE4EB000BB433D /* jsb_module_register.hpp */, 4008729220CE20C2002EB77B /* jsb_cocos2dx_network_manual.cpp */, 4008729320CE20C2002EB77B /* jsb_cocos2dx_network_manual.h */, 461DCA5720C7E4B900B22827 /* JavaScriptObjCBridge.h */, 461DCA5620C7E4B900B22827 /* JavaScriptObjCBridge.mm */, 1A52DB872060B11800350EE3 /* jsb_platform.h */, - 046B68A421A292D200B33469 /* jsb_spine_manual.cpp */, - 046B68A521A292D200B33469 /* jsb_spine_manual.hpp */, 1A52DB862060B11800350EE3 /* jsb_platfrom_apple.mm */, 469302D02046AE05004A3D6C /* jsb_classtype.cpp */, 469302DF2046AE05004A3D6C /* jsb_classtype.hpp */, @@ -3204,8 +2085,6 @@ 1A29D76E205665D100168D9A /* jsb_cocos2dx_manual.hpp */, 469302DA2046AE05004A3D6C /* jsb_conversions.cpp */, 4617866F205262BB008256E1 /* jsb_conversions.hpp */, - 469302E52046AE05004A3D6C /* jsb_gfx_manual.cpp */, - 469302D72046AE05004A3D6C /* jsb_gfx_manual.hpp */, 469302CB2046AE05004A3D6C /* jsb_global.cpp */, 469302C72046AE05004A3D6C /* jsb_global.h */, 469302DE2046AE05004A3D6C /* jsb_helper.cpp */, @@ -3214,8 +2093,6 @@ 1A29D790205666F500168D9A /* jsb_opengl_manual.hpp */, 1A29D78C205666F200168D9A /* jsb_opengl_utils.cpp */, 1A29D78E205666F200168D9A /* jsb_opengl_utils.hpp */, - 469302DD2046AE05004A3D6C /* jsb_renderer_manual.cpp */, - 469302D12046AE05004A3D6C /* jsb_renderer_manual.hpp */, 461786592052607E008256E1 /* jsb_socketio.cpp */, 4617865A2052607E008256E1 /* jsb_socketio.hpp */, 4617865B2052607E008256E1 /* jsb_websocket.cpp */, @@ -3307,92 +2184,16 @@ 46FDDA2C202ACC6A00931238 /* renderer */ = { isa = PBXGroup; children = ( - 4233798722BB237700E5D8A2 /* memop */, - 0482F183228D87780019ECF7 /* scene */, - 46FDDA2D202ACC6A00931238 /* renderer */, - 46FDDA4C202ACC6A00931238 /* Types.cpp */, - 46FDDA4E202ACC6A00931238 /* Types.h */, - 46FDDA4F202ACC6A00931238 /* Macro.h */, - 46FDDA50202ACC6A00931238 /* gfx */, + BA06A62B23583DBD007740C5 /* core */, + BA06A72623583DFD007740C5 /* gfx-gl */, + BA06A6F823583DFD007740C5 /* gfx-gles2 */, + BA06A73123583DFD007740C5 /* gfx-gles3 */, + BA06A72C23583DFD007740C5 /* gfx-metal */, ); name = renderer; path = ../cocos/renderer; sourceTree = ""; }; - 46FDDA2D202ACC6A00931238 /* renderer */ = { - isa = PBXGroup; - children = ( - 46FDDA2E202ACC6A00931238 /* INode.h */, - 46FDDA2F202ACC6A00931238 /* Pass.cpp */, - 46FDDA30202ACC6A00931238 /* Scene.cpp */, - 46FDDA31202ACC6A00931238 /* ProgramLib.h */, - 46FDDA32202ACC6A00931238 /* Config.h */, - 46FDDA33202ACC6A00931238 /* Light.h */, - 46FDDA34202ACC6A00931238 /* Camera.cpp */, - 46FDDA35202ACC6A00931238 /* Camera.h */, - 46FDDA36202ACC6A00931238 /* Light.cpp */, - 46FDDA37202ACC6A00931238 /* Renderer.h */, - 46FDDA38202ACC6A00931238 /* RendererUtils.h */, - 46FDDA39202ACC6A00931238 /* Technique.h */, - 46FDDA3A202ACC6A00931238 /* View.h */, - 46FDDA3B202ACC6A00931238 /* View.cpp */, - 46FDDA3C202ACC6A00931238 /* Effect.cpp */, - 46FDDA3D202ACC6A00931238 /* ForwardRenderer.cpp */, - 46FDDA3E202ACC6A00931238 /* Config.cpp */, - 46FDDA3F202ACC6A00931238 /* BaseRenderer.h */, - 46FDDA40202ACC6A00931238 /* Pass.h */, - 46FDDA41202ACC6A00931238 /* Technique.cpp */, - 46FDDA42202ACC6A00931238 /* RendererUtils.cpp */, - 46FDDA43202ACC6A00931238 /* Model.h */, - 46FDDA44202ACC6A00931238 /* Model.cpp */, - 46FDDA45202ACC6A00931238 /* Effect.h */, - 46FDDA46202ACC6A00931238 /* BaseRenderer.cpp */, - 46FDDA47202ACC6A00931238 /* ProgramLib.cpp */, - 46FDDA48202ACC6A00931238 /* InputAssembler.h */, - 46FDDA49202ACC6A00931238 /* InputAssembler.cpp */, - 46FDDA4A202ACC6A00931238 /* Scene.h */, - 46FDDA4B202ACC6A00931238 /* ForwardRenderer.h */, - 423379A122BB8DEA00E5D8A2 /* CustomProperties.cpp */, - 423379A222BB8DEA00E5D8A2 /* CustomProperties.hpp */, - ); - path = renderer; - sourceTree = ""; - }; - 46FDDA50202ACC6A00931238 /* gfx */ = { - isa = PBXGroup; - children = ( - 46FDDA51202ACC6A00931238 /* Texture2D.h */, - 46FDDA52202ACC6A00931238 /* DeviceGraphics.cpp */, - 46FDDA53202ACC6A00931238 /* VertexBuffer.cpp */, - 46FDDA54202ACC6A00931238 /* Program.cpp */, - 46FDDA55202ACC6A00931238 /* IndexBuffer.h */, - 46FDDA56202ACC6A00931238 /* FrameBuffer.cpp */, - 46FDDA57202ACC6A00931238 /* VertexFormat.cpp */, - 46FDDA58202ACC6A00931238 /* DeviceGraphics.h */, - 46FDDA59202ACC6A00931238 /* State.cpp */, - 46FDDA5A202ACC6A00931238 /* Texture.cpp */, - 46FDDA5B202ACC6A00931238 /* FrameBuffer.h */, - 46FDDA5C202ACC6A00931238 /* RenderTarget.cpp */, - 46FDDA5D202ACC6A00931238 /* GFX.h */, - 46FDDA5E202ACC6A00931238 /* RenderBuffer.cpp */, - 46FDDA5F202ACC6A00931238 /* VertexFormat.h */, - 46FDDA60202ACC6A00931238 /* GraphicsHandle.h */, - 46FDDA61202ACC6A00931238 /* RenderBuffer.h */, - 46FDDA62202ACC6A00931238 /* Texture.h */, - 46FDDA63202ACC6A00931238 /* Texture2D.cpp */, - 46FDDA64202ACC6A00931238 /* GraphicsHandle.cpp */, - 46FDDA65202ACC6A00931238 /* GFXUtils.h */, - 46FDDA66202ACC6A00931238 /* Program.h */, - 46FDDA67202ACC6A00931238 /* State.h */, - 46FDDA68202ACC6A00931238 /* VertexBuffer.h */, - 46FDDA69202ACC6A00931238 /* RenderTarget.h */, - 46FDDA6A202ACC6A00931238 /* GFXUtils.cpp */, - 46FDDA6B202ACC6A00931238 /* GFX.cpp */, - 46FDDA6C202ACC6A00931238 /* IndexBuffer.cpp */, - ); - path = gfx; - sourceTree = ""; - }; 46FDDAE9202ADDCE00931238 /* base */ = { isa = PBXGroup; children = ( @@ -3560,6 +2361,253 @@ name = ios; sourceTree = ""; }; + BA06A62B23583DBD007740C5 /* core */ = { + isa = PBXGroup; + children = ( + BA06A62C23583DBD007740C5 /* Core.h */, + BA06A62E23583DBD007740C5 /* memory */, + BA06A63C23583DBD007740C5 /* util */, + BA06A63F23583DBD007740C5 /* CoreStd.cc */, + BA06A64023583DBD007740C5 /* math */, + BA06A64323583DBD007740C5 /* CoreStd.h */, + BA06A64423583DBD007740C5 /* CoreDef.h */, + BA06A64523583DBD007740C5 /* gfx */, + BA06A66A23583DBD007740C5 /* kernel */, + BA06A67323583DBD007740C5 /* TypeDef.h */, + ); + path = core; + sourceTree = ""; + }; + BA06A62E23583DBD007740C5 /* memory */ = { + isa = PBXGroup; + children = ( + BA06A62F23583DBD007740C5 /* NedPooling.cc */, + BA06A63023583DBD007740C5 /* AllocatedObj.h */, + BA06A63123583DBD007740C5 /* MemTracker.cc */, + BA06A63223583DBD007740C5 /* MemDef.h */, + BA06A63323583DBD007740C5 /* JeAlloc.cc */, + BA06A63423583DBD007740C5 /* AllocatedObj.cc */, + BA06A63523583DBD007740C5 /* MemTracker.h */, + BA06A63623583DBD007740C5 /* StlAlloc.h */, + BA06A63723583DBD007740C5 /* Memory.h */, + BA06A63823583DBD007740C5 /* JeAlloc.h */, + BA06A63923583DBD007740C5 /* Memory.cc */, + BA06A63A23583DBD007740C5 /* StdAlloc.h */, + BA06A63B23583DBD007740C5 /* NedPooling.h */, + ); + path = memory; + sourceTree = ""; + }; + BA06A63C23583DBD007740C5 /* util */ = { + isa = PBXGroup; + children = ( + BA06A63D23583DBD007740C5 /* StringUtil.h */, + BA06A63E23583DBD007740C5 /* StringUtil.cc */, + ); + path = util; + sourceTree = ""; + }; + BA06A64023583DBD007740C5 /* math */ = { + isa = PBXGroup; + children = ( + BA06A64123583DBD007740C5 /* CCMath.cc */, + BA06A64223583DBD007740C5 /* CCMath.h */, + ); + path = math; + sourceTree = ""; + }; + BA06A64523583DBD007740C5 /* gfx */ = { + isa = PBXGroup; + children = ( + BA06A64623583DBD007740C5 /* GFXShader.cc */, + BA06A64723583DBD007740C5 /* GFXShader.h */, + BA06A64823583DBD007740C5 /* GFXDevice.h */, + BA06A64923583DBD007740C5 /* GFXCommandAllocator.h */, + BA06A64A23583DBD007740C5 /* GFXWindow.cc */, + BA06A64B23583DBD007740C5 /* GFXTextureView.h */, + BA06A64C23583DBD007740C5 /* GFXPipelineLayout.cc */, + BA06A64D23583DBD007740C5 /* GFXTexture.h */, + BA06A64E23583DBD007740C5 /* GFXBindingLayout.h */, + BA06A64F23583DBD007740C5 /* GFXQueue.h */, + BA06A65023583DBD007740C5 /* GFXRenderPass.h */, + BA06A65123583DBD007740C5 /* GFXTextureView.cc */, + BA06A65223583DBD007740C5 /* GFXPipelineLayout.h */, + BA06A65323583DBD007740C5 /* GFXWindow.h */, + BA06A65423583DBD007740C5 /* GFXDef.cc */, + BA06A65523583DBD007740C5 /* GFXPipelineState.h */, + BA06A65623583DBD007740C5 /* GFXDevice.cc */, + BA06A65723583DBD007740C5 /* GFXDef.h */, + BA06A65823583DBD007740C5 /* GFXBuffer.cc */, + BA06A65923583DBD007740C5 /* GFXFramebuffer.cc */, + BA06A65A23583DBD007740C5 /* GFXCommandBuffer.cc */, + BA06A65B23583DBD007740C5 /* GFXInputAssembler.h */, + BA06A65C23583DBD007740C5 /* GFXRenderPass.cc */, + BA06A65D23583DBD007740C5 /* GFXInputAssembler.cc */, + BA06A65E23583DBD007740C5 /* GFXCommandBuffer.h */, + BA06A65F23583DBD007740C5 /* GFXContext.h */, + BA06A66023583DBD007740C5 /* GFXSampler.cc */, + BA06A66123583DBD007740C5 /* GFXFramebuffer.h */, + BA06A66223583DBD007740C5 /* GFXBuffer.h */, + BA06A66323583DBD007740C5 /* GFXTexture.cc */, + BA06A66423583DBD007740C5 /* GFXSampler.h */, + BA06A66523583DBD007740C5 /* GFXBindingLayout.cc */, + BA06A66623583DBD007740C5 /* GFXQueue.cc */, + BA06A66723583DBD007740C5 /* GFXCommandAllocator.cc */, + BA06A66823583DBD007740C5 /* GFXContext.cc */, + BA06A66923583DBD007740C5 /* GFXPipelineState.cc */, + ); + path = gfx; + sourceTree = ""; + }; + BA06A66A23583DBD007740C5 /* kernel */ = { + isa = PBXGroup; + children = ( + BA06A66B23583DBD007740C5 /* CachedArray.h */, + BA06A66C23583DBD007740C5 /* UTFString.cc */, + BA06A66D23583DBD007740C5 /* assertion.h */, + BA06A66E23583DBD007740C5 /* UTFString.h */, + BA06A66F23583DBD007740C5 /* Log.h */, + BA06A67023583DBD007740C5 /* Assertion.cc */, + BA06A67123583DBD007740C5 /* Object.h */, + BA06A67223583DBD007740C5 /* Log.cc */, + ); + path = kernel; + sourceTree = ""; + }; + BA06A6F823583DFD007740C5 /* gfx-gles2 */ = { + isa = PBXGroup; + children = ( + BA06A6F923583DFD007740C5 /* gles2w.mm */, + BA06A6FA23583DFD007740C5 /* GLES2GPUObjects.h */, + BA06A6FB23583DFD007740C5 /* GLES2CommandAllocator.h */, + BA06A6FC23583DFD007740C5 /* GLES2TextureView.h */, + BA06A6FD23583DFD007740C5 /* GLES2Device.cc */, + BA06A6FE23583DFD007740C5 /* GLES2PipelineLayout.h */, + BA06A6FF23583DFD007740C5 /* GFXGLES2.h */, + BA06A70023583DFD007740C5 /* GLES2Commands.h */, + BA06A70123583DFD007740C5 /* GLES2Window.h */, + BA06A70223583DFD007740C5 /* GLES2EGLContext.cc */, + BA06A70323583DFD007740C5 /* GLES2Texture.cc */, + BA06A70423583DFD007740C5 /* GLES2Framebuffer.cc */, + BA06A70523583DFD007740C5 /* GLES2RenderPass.h */, + BA06A70623583DFD007740C5 /* GLES2InputAssembler.cc */, + BA06A70723583DFD007740C5 /* GLES2Sampler.cc */, + BA06A70823583DFD007740C5 /* GLES2Texture.h */, + BA06A70923583DFD007740C5 /* gles2w.h */, + BA06A70A23583DFD007740C5 /* GLES2CommandAllocator.cc */, + BA06A70B23583DFD007740C5 /* GLES2Std.cc */, + BA06A70C23583DFD007740C5 /* GLES2Window.cc */, + BA06A70D23583DFD007740C5 /* GLES2Device.h */, + BA06A70E23583DFD007740C5 /* GLES2Shader.h */, + BA06A70F23583DFD007740C5 /* GLES2Shader.cc */, + BA06A71023583DFD007740C5 /* GLES2CommandBuffer.h */, + BA06A71123583DFD007740C5 /* GLES2Framebuffer.h */, + BA06A71223583DFD007740C5 /* GLES2Queue.cc */, + BA06A71323583DFD007740C5 /* GLES2StateCache.h */, + BA06A71423583DFD007740C5 /* GLES2PipelineState.cc */, + BA06A71523583DFD007740C5 /* GLES2RenderPass.cc */, + BA06A71623583DFD007740C5 /* GLES2Sampler.h */, + BA06A71723583DFD007740C5 /* GLES2PipelineState.h */, + BA06A71823583DFD007740C5 /* GLES2BindingLayout.cc */, + BA06A71923583DFD007740C5 /* GLES2EGLContext.h */, + BA06A71A23583DFD007740C5 /* gles2w.c */, + BA06A71B23583DFD007740C5 /* GLES2Commands.cc */, + BA06A71C23583DFD007740C5 /* GLES2Queue.h */, + BA06A71D23583DFD007740C5 /* GLES2PipelineLayout.cc */, + BA06A71E23583DFD007740C5 /* GLES2CommandPool.h */, + BA06A71F23583DFD007740C5 /* GLES2Std.h */, + BA06A72023583DFD007740C5 /* GLES2Buffer.h */, + BA06A72123583DFD007740C5 /* GLES2BindingLayout.h */, + BA06A72223583DFD007740C5 /* GLES2InputAssembler.h */, + BA06A72323583DFD007740C5 /* GLES2Buffer.cc */, + BA06A72423583DFD007740C5 /* GLES2TextureView.cc */, + BA06A72523583DFD007740C5 /* GLES2CommandBuffer.cc */, + ); + path = "gfx-gles2"; + sourceTree = ""; + }; + BA06A72623583DFD007740C5 /* gfx-gl */ = { + isa = PBXGroup; + children = ( + BA06A72723583DFD007740C5 /* gl */, + BA06A72A23583DFD007740C5 /* GLStd.h */, + BA06A72B23583DFD007740C5 /* GLStd.cpp */, + ); + path = "gfx-gl"; + sourceTree = ""; + }; + BA06A72723583DFD007740C5 /* gl */ = { + isa = PBXGroup; + children = ( + BA06A72823583DFD007740C5 /* wglew.h */, + BA06A72923583DFD007740C5 /* glew.h */, + ); + path = gl; + sourceTree = ""; + }; + BA06A72C23583DFD007740C5 /* gfx-metal */ = { + isa = PBXGroup; + children = ( + BA06A72D23583DFD007740C5 /* MetalStd.mm */, + BA06A72E23583DFD007740C5 /* MetalStd.h */, + BA06A72F23583DFD007740C5 /* MTLbuffer.h */, + BA06A73023583DFD007740C5 /* MTLbuffer.mm */, + ); + path = "gfx-metal"; + sourceTree = ""; + }; + BA06A73123583DFD007740C5 /* gfx-gles3 */ = { + isa = PBXGroup; + children = ( + BA06A73223583DFD007740C5 /* GLES3Window.h */, + BA06A73323583DFD007740C5 /* GLES3EGLContext.h */, + BA06A73423583DFD007740C5 /* GLES3InputAssembler.cc */, + BA06A73523583DFD007740C5 /* GLES3Sampler.cc */, + BA06A73623583DFD007740C5 /* gles3w.mm */, + BA06A73723583DFD007740C5 /* GLES3EGLContext.cc */, + BA06A73823583DFD007740C5 /* GLES3TextureView.cc */, + BA06A73923583DFD007740C5 /* GLES3Device.cc */, + BA06A73A23583DFD007740C5 /* GLES3CommandAllocator.h */, + BA06A73B23583DFD007740C5 /* GLES3TextureView.h */, + BA06A73C23583DFD007740C5 /* GLES3Std.cc */, + BA06A73D23583DFD007740C5 /* GLES3StateCache.h */, + BA06A73E23583DFD007740C5 /* GLES3Shader.h */, + BA06A73F23583DFD007740C5 /* GLES3Device.h */, + BA06A74023583DFD007740C5 /* GLES3PipelineLayout.h */, + BA06A74123583DFD007740C5 /* GLES3CommandBuffer.h */, + BA06A74223583DFD007740C5 /* GLES3Texture.h */, + BA06A74323583DFD007740C5 /* GLES3Queue.h */, + BA06A74423583DFD007740C5 /* GLES3Commands.cc */, + BA06A74523583DFD007740C5 /* gles3w.h */, + BA06A74623583DFD007740C5 /* GLES3Window.cc */, + BA06A74723583DFD007740C5 /* GLES3Commands.h */, + BA06A74823583DFD007740C5 /* GLES3Texture.cc */, + BA06A74923583DFD007740C5 /* GLES3Shader.cc */, + BA06A74A23583DFD007740C5 /* GLES3RenderPass.h */, + BA06A74B23583DFD007740C5 /* GLES3InputAssembler.h */, + BA06A74C23583DFD007740C5 /* GLES3PipelineState.h */, + BA06A74D23583DFD007740C5 /* GLES3CommandAllocator.cc */, + BA06A74E23583DFD007740C5 /* GLES3PipelineLayout.cc */, + BA06A74F23583DFD007740C5 /* GLES3CommandBuffer.cc */, + BA06A75023583DFD007740C5 /* GLES3Framebuffer.h */, + BA06A75123583DFD007740C5 /* GLES3Sampler.h */, + BA06A75223583DFD007740C5 /* GLES3Queue.cc */, + BA06A75323583DFD007740C5 /* GLES3RenderPass.cc */, + BA06A75423583DFD007740C5 /* GLES3GPUObjects.h */, + BA06A75523583DFD007740C5 /* GLES3Framebuffer.cc */, + BA06A75623583DFD007740C5 /* GLES3BindingLayout.h */, + BA06A75723583DFD007740C5 /* GLES3BindingLayout.cc */, + BA06A75823583DFD007740C5 /* GLES3Std.h */, + BA06A75923583DFD007740C5 /* GFXGLES3.h */, + BA06A75A23583DFD007740C5 /* GLES3PipelineState.cc */, + BA06A75B23583DFD007740C5 /* GLES3Buffer.h */, + BA06A75C23583DFD007740C5 /* GLES3Buffer.cc */, + BA06A75D23583DFD007740C5 /* gles3w.c */, + BA06A75E23583DFD007740C5 /* GLES3CommandPool.h */, + ); + path = "gfx-gles3"; + sourceTree = ""; + }; BA21050A21008AC200E19975 /* extensions */ = { isa = PBXGroup; children = ( @@ -3647,61 +2695,45 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 4233799F22BB43B900E5D8A2 /* RecyclePool.hpp in Headers */, - 046E06802185B43B00B24E2D /* IEventDispatcher.h in Headers */, 1A28FF891F20AFAB007A1D9D /* SRURLUtilities.h in Headers */, - 46FDDAA7202ACC6A00931238 /* ForwardRenderer.h in Headers */, 4037F5CC2108751E001C205C /* CCAsyncTaskPool.h in Headers */, 46AE40052092F3A600F3A228 /* inspector_socket.h in Headers */, - 04DBD49922AE2DBD00DBE4CD /* TransformMode.h in Headers */, + BA06A7BD23583DFE007740C5 /* GLStd.h in Headers */, + BA06A79923583DFE007740C5 /* GLES2Sampler.h in Headers */, 46FDDBC3202ADDCE00931238 /* ccConfig.h in Headers */, - 46FDDA77202ACC6A00931238 /* Light.h in Headers */, - 04DBD45B22AE2DBD00DBE4CD /* Timeline.h in Headers */, - 049B31FD2313B6240004909A /* SkeletonCacheMgr.h in Headers */, - 04DBD48122AE2DBD00DBE4CD /* PathConstraintPositionTimeline.h in Headers */, - 04DBD3BD22AE2DBD00DBE4CD /* Attachment.h in Headers */, + BA06A7A923583DFE007740C5 /* GLES2CommandPool.h in Headers */, 1A28FF5D1F20AFAB007A1D9D /* SRProxyConnect.h in Headers */, + BA06A81523583DFE007740C5 /* GLES3Std.h in Headers */, 1A52DB5F205BCDC700350EE3 /* HelperMacros.h in Headers */, - 46FDDACF202ACC6A00931238 /* RenderBuffer.h in Headers */, - 04DBD48F22AE2DBD00DBE4CD /* Vector.h in Headers */, - 46FDDAAF202ACC6A00931238 /* Texture2D.h in Headers */, 5091A7A319BFABA800AC8789 /* CCPlatformDefine.h in Headers */, - 04DBD3D122AE2DBD00DBE4CD /* EventData.h in Headers */, - 04DBD3C522AE2DBD00DBE4CD /* MixDirection.h in Headers */, - 046E06242185B37100B24E2D /* CCSlot.h in Headers */, - 046E06B72185B49F00B24E2D /* AnimationData.h in Headers */, - 04DBD48722AE2DBD00DBE4CD /* MixBlend.h in Headers */, 46AE3FDF2092F3A600F3A228 /* env.h in Headers */, 46AE3FE72092F3A600F3A228 /* inspector_io.h in Headers */, - 04DBD45922AE2DBD00DBE4CD /* PointAttachment.h in Headers */, - 04FB24092328D42A0021DD02 /* CCArmatureCacheDisplay.h in Headers */, - 04ED68DA21F8188F006E82F8 /* MeshBuffer.h in Headers */, 46FDDBCF202ADDCE00931238 /* CCMap.h in Headers */, - 427475FB23214E2A00139DF8 /* MeshAssembler.hpp in Headers */, + BA06A80D23583DFE007740C5 /* GLES3GPUObjects.h in Headers */, 1A52DB34205BCD9200350EE3 /* Object.hpp in Headers */, 469303962046AE05004A3D6C /* Class.hpp in Headers */, 1A52DB6F205BCDC700350EE3 /* ScriptEngine.hpp in Headers */, - 04DBD47522AE2DBD00DBE4CD /* MeshAttachment.h in Headers */, - 04DBD44D22AE2DBD00DBE4CD /* SpacingMode.h in Headers */, - 04DBD46722AE2DBD00DBE4CD /* TransformConstraintData.h in Headers */, 469304002046AE06004A3D6C /* jsb_global.h in Headers */, 1A586C492064C97800B47573 /* EJConvert.h in Headers */, + BA06A78F23583DFE007740C5 /* GLES2Framebuffer.h in Headers */, 46AE3FDD2092F3A600F3A228 /* inspector_socket_server.h in Headers */, + BA06A67423583DBD007740C5 /* Core.h in Headers */, + BA06A7BB23583DFE007740C5 /* glew.h in Headers */, + BA06A81B23583DFE007740C5 /* GLES3Buffer.h in Headers */, 4008729620CE20C2002EB77B /* jsb_cocos2dx_network_manual.h in Headers */, - 469303EE2046AE05004A3D6C /* jsb_renderer_auto.hpp in Headers */, + BA06A6B623583DBD007740C5 /* GFXPipelineLayout.h in Headers */, 4617863720522469008256E1 /* HttpClient.h in Headers */, 50ABBD461925AB0000A911A9 /* CCVertex.h in Headers */, - 46FDDA9B202ACC6A00931238 /* Effect.h in Headers */, + BA06A7DB23583DFE007740C5 /* GLES3TextureView.h in Headers */, 50ABBD3E1925AB0000A911A9 /* CCGeometry.h in Headers */, - 46FDDAD9202ACC6A00931238 /* Program.h in Headers */, 40CEAEB820CFDC47007A3281 /* CCReachability.h in Headers */, ED30579B1BEC77B70083C3ED /* ConvertUTF.h in Headers */, - 46FDDA75202ACC6A00931238 /* Config.h in Headers */, - 04DBD3D522AE2DBD00DBE4CD /* ColorTimeline.h in Headers */, + BA06A80723583DFE007740C5 /* GLES3Sampler.h in Headers */, + BA06A6EE23583DBD007740C5 /* Log.h in Headers */, 469303822046AE05004A3D6C /* Value.hpp in Headers */, - 046B689521A10D5800B33469 /* MiddlewareMacro.h in Headers */, - 46FDDAC3202ACC6A00931238 /* FrameBuffer.h in Headers */, 4617863D20522469008256E1 /* HttpResponse.h in Headers */, + BA06A68223583DBD007740C5 /* MemTracker.h in Headers */, + BA06A68E23583DBD007740C5 /* NedPooling.h in Headers */, 1A29D7A320566CAC00168D9A /* CCCanvasRenderingContext2D.h in Headers */, 1A29D77D2056667800168D9A /* csscolorparser.hpp in Headers */, 4693038A2046AE05004A3D6C /* State.hpp in Headers */, @@ -3709,336 +2741,232 @@ 4617862320522469008256E1 /* CCIDownloaderImpl.h in Headers */, 46FDDC66202D504E00931238 /* CCApplication.h in Headers */, ED3057811BEC76C90083C3ED /* ioapi.h in Headers */, - 046E06682185B41B00B24E2D /* Constraint.h in Headers */, - 04DBD4D322AE2DBD00DBE4CD /* RTTI.h in Headers */, - 046B68AC21A294B100B33469 /* jsb_cocos2dx_spine_auto.hpp in Headers */, - 04DBD40F22AE2DBD00DBE4CD /* TransformConstraintTimeline.h in Headers */, 469303642046AE05004A3D6C /* RefCounter.hpp in Headers */, - 04886B4322CE22F2008CEB66 /* SlicedSprite2D.hpp in Headers */, - 04DBD3E122AE2DBD00DBE4CD /* AttachmentTimeline.h in Headers */, - 046E06CB2185B49F00B24E2D /* SkinData.h in Headers */, - 46FDDA73202ACC6A00931238 /* ProgramLib.h in Headers */, 1A28FF751F20AFAB007A1D9D /* SRHTTPConnectMessage.h in Headers */, - 46FDDADF202ACC6A00931238 /* RenderTarget.h in Headers */, - 426947BB234ED0130044C66E /* SimpleSprite3D.hpp in Headers */, - 04DBD43D22AE2DBD00DBE4CD /* SkeletonBinary.h in Headers */, 4617862920522469008256E1 /* Uri.h in Headers */, - 04DBD42D22AE2DBD00DBE4CD /* PathConstraintSpacingTimeline.h in Headers */, 469303902046AE05004A3D6C /* MappingUtils.hpp in Headers */, + BA06A6AE23583DBD007740C5 /* GFXBindingLayout.h in Headers */, + BA06A7FD23583DFE007740C5 /* GLES3PipelineState.h in Headers */, 1AAAC8F5205CB6E9005321B9 /* Export.h in Headers */, - 046E065E2185B41B00B24E2D /* TransformObject.h in Headers */, - 04DBD4D122AE2DBD00DBE4CD /* LinkedMesh.h in Headers */, + BA06A77F23583DFE007740C5 /* gles2w.h in Headers */, + BA06A6CE23583DBD007740C5 /* GFXCommandBuffer.h in Headers */, + BA06A7C923583DFE007740C5 /* GLES3Window.h in Headers */, 1A28FF5B1F20AFAB007A1D9D /* NSURLRequest+SRWebSocketPrivate.h in Headers */, - 46FDDAAB202ACC6A00931238 /* Types.h in Headers */, - 04DBD48322AE2DBD00DBE4CD /* PathConstraintData.h in Headers */, - 046E06412185B41100B24E2D /* BaseTimelineState.h in Headers */, ED30577D1BEC76C90083C3ED /* crypt.h in Headers */, - 041854A5228D7E7300F8DF31 /* jsb_cocos2dx_particle_auto.hpp in Headers */, 4648882520AC2BC900CD1E4A /* CCRenderTexture.h in Headers */, - 46FDDA97202ACC6A00931238 /* Model.h in Headers */, - 0482F1BB228D87970019ECF7 /* MeshBuffer.hpp in Headers */, - 046E06332185B41100B24E2D /* Animation.h in Headers */, 50ABBD4A1925AB0000A911A9 /* Mat4.h in Headers */, - 04DBD3BB22AE2DBD00DBE4CD /* Pool.h in Headers */, - 046E063F2185B41100B24E2D /* AnimationState.h in Headers */, - 044597F422D332D800924443 /* Extension.h in Headers */, 1A52DB38205BCD9200350EE3 /* ScriptEngine.hpp in Headers */, - 046E068A2185B44A00B24E2D /* BaseFactory.h in Headers */, 1A52DB892060B11800350EE3 /* jsb_platform.h in Headers */, + BA06A6B023583DBD007740C5 /* GFXQueue.h in Headers */, 1A52DB64205BCDC700350EE3 /* ScriptEngine.hpp in Headers */, - 04DBD44B22AE2DBD00DBE4CD /* IkConstraintTimeline.h in Headers */, - 0482F1A3228D87970019ECF7 /* CustomAssembler.hpp in Headers */, - 46FDDA83202ACC6A00931238 /* Technique.h in Headers */, - 04DBD44922AE2DBD00DBE4CD /* DrawOrderTimeline.h in Headers */, - 04DBD47122AE2DBD00DBE4CD /* Bone.h in Headers */, + BA06A7CB23583DFE007740C5 /* GLES3EGLContext.h in Headers */, 1A52DB63205BCDC700350EE3 /* Object.hpp in Headers */, - 049B320F231533BF0004909A /* SkeletonCacheAnimation.h in Headers */, + BA06A69823583DBD007740C5 /* CCMath.h in Headers */, 469303802046AE05004A3D6C /* config.hpp in Headers */, - 04DBD4D522AE2DBD00DBE4CD /* IkConstraint.h in Headers */, - 0482F199228D87970019ECF7 /* RenderFlow.hpp in Headers */, - 46FDDA6D202ACC6A00931238 /* INode.h in Headers */, - 046E06782185B42500B24E2D /* BaseObject.h in Headers */, + BA06A76F23583DFE007740C5 /* GLES2Window.h in Headers */, 1A28FF811F20AFAB007A1D9D /* SRRandom.h in Headers */, 50ABC0671926664800A911A9 /* CCPlatformDefine-mac.h in Headers */, + BA06A7C323583DFE007740C5 /* MetalStd.h in Headers */, 469303922046AE05004A3D6C /* SeApi.h in Headers */, 461786532052301A008256E1 /* CCScheduler.h in Headers */, 46FDDB4D202ADDCE00931238 /* pvr.h in Headers */, - 04DBD4DD22B51EA300DBE4CD /* MemPool.hpp in Headers */, 4617863920522469008256E1 /* CCDownloaderImpl-apple.h in Headers */, - 0482F19D228D87970019ECF7 /* scene-bindings.h in Headers */, 1A52DB73205BCDC700350EE3 /* Base.h in Headers */, + BA06A6AC23583DBD007740C5 /* GFXTexture.h in Headers */, 1A28FF551F20AFAB007A1D9D /* SRIOConsumerPool.h in Headers */, 461786632052607E008256E1 /* jsb_socketio.hpp in Headers */, - 046E06BD2185B49F00B24E2D /* UserData.h in Headers */, 46FDDBDD202ADDCE00931238 /* TGAlib.h in Headers */, - 046B688C219FA61200B33469 /* MiddlewareManager.h in Headers */, BAEA45551E279D5C00FA219F /* tinydir.h in Headers */, - 04DBD46522AE2DBD00DBE4CD /* ScaleTimeline.h in Headers */, - 04DBD40322AE2DBD00DBE4CD /* Skin.h in Headers */, - 046B689221A00F5600B33469 /* IOTypedArray.h in Headers */, - 04DBD3E322AE2DBD00DBE4CD /* BlendMode.h in Headers */, - 46FDDAB7202ACC6A00931238 /* IndexBuffer.h in Headers */, 4617864520522469008256E1 /* HttpAsynConnection-apple.h in Headers */, + BA06A6DA23583DBD007740C5 /* GFXSampler.h in Headers */, 4617865D2052607E008256E1 /* jsb_xmlhttprequest.hpp in Headers */, - 46FDDA7B202ACC6A00931238 /* Camera.h in Headers */, - 46FDDAA5202ACC6A00931238 /* Scene.h in Headers */, 46FDDB53202ADDCE00931238 /* utlist.h in Headers */, - 046E06622185B41B00B24E2D /* Slot.h in Headers */, - 04DBD4A722AE2DBD00DBE4CD /* RegionAttachment.h in Headers */, 46FDDB5D202ADDCE00931238 /* ccMacros.h in Headers */, - 0482F1B1228D87970019ECF7 /* ModelBatcher.hpp in Headers */, 1A29D76B205665BE00168D9A /* jsb_cocos2dx_auto.hpp in Headers */, 1A52DB3D205BCD9200350EE3 /* SeApi.h in Headers */, 4DCEC129233238110020F8E3 /* etc2.h in Headers */, - 04DBD44F22AE2DBD00DBE4CD /* Json.h in Headers */, - 46FDDABD202ACC6A00931238 /* DeviceGraphics.h in Headers */, 469303982046AE05004A3D6C /* HelperMacros.h in Headers */, 46FDDC01202ADDCE00931238 /* ccCArray.h in Headers */, - 04DBD3C122AE2DBD00DBE4CD /* TextureLoader.h in Headers */, 469304102046AE06004A3D6C /* jsb_helper.hpp in Headers */, - 04DBD3F122AE2DBD00DBE4CD /* MathUtil.h in Headers */, - 04DBD3F322AE2DBD00DBE4CD /* TimelineType.h in Headers */, + BA06A6B223583DBD007740C5 /* GFXRenderPass.h in Headers */, 50643BDB19BFAF4400EF68ED /* CCStdC.h in Headers */, 1A28FF591F20AFAB007A1D9D /* NSRunLoop+SRWebSocketPrivate.h in Headers */, 1A29D79A205666F500168D9A /* jsb_opengl_utils.hpp in Headers */, + BA06A80523583DFE007740C5 /* GLES3Framebuffer.h in Headers */, 46FDDB5B202ADDCE00931238 /* CCData.h in Headers */, - 046E06452185B41100B24E2D /* IAnimatable.h in Headers */, 1A29D79E205666F500168D9A /* jsb_opengl_manual.hpp in Headers */, 469303A22046AE05004A3D6C /* Object.hpp in Headers */, 1A52DAF6205BB81400350EE3 /* CCThreadPool.h in Headers */, - 046E06642185B41B00B24E2D /* Armature.h in Headers */, + BA06A6A023583DBD007740C5 /* GFXShader.h in Headers */, 1AAAC8E9205CB6E9005321B9 /* AudioMacros.h in Headers */, 1AAAC8EF205CB6E9005321B9 /* AudioEngine-inl.h in Headers */, 46FDDB83202ADDCE00931238 /* ccRandom.h in Headers */, 294D7D9A1D0E93A2002CE7B7 /* CCDevice-apple.h in Headers */, 1A28FF851F20AFAB007A1D9D /* SRSIMDHelpers.h in Headers */, 50ABBD401925AB0000A911A9 /* CCMath.h in Headers */, - 04DBD48D22AE2DBD00DBE4CD /* Slot.h in Headers */, - 046E06F12185B4A500B24E2D /* BinaryDataParser.h in Headers */, ED3057831BEC76C90083C3ED /* unzip.h in Headers */, + BA06A6EA23583DBD007740C5 /* assertion.h in Headers */, + BA06A6B823583DBD007740C5 /* GFXWindow.h in Headers */, 1A28FF511F20AFAB007A1D9D /* SRIOConsumer.h in Headers */, - 04DBD4B322AE2DBD00DBE4CD /* ContainerUtil.h in Headers */, + BA06A69C23583DBD007740C5 /* CoreDef.h in Headers */, 469303882046AE05004A3D6C /* HandleObject.hpp in Headers */, 46930466204FE20F004A3D6C /* CCLog.h in Headers */, 4617862720522469008256E1 /* WebSocket.h in Headers */, - 46FDDA7F202ACC6A00931238 /* Renderer.h in Headers */, - 46FDDAA1202ACC6A00931238 /* InputAssembler.h in Headers */, - 46FDDA91202ACC6A00931238 /* Pass.h in Headers */, - 04DBD4BD22AE2DBD00DBE4CD /* spine.h in Headers */, - 046E069F2185B45300B24E2D /* Point.h in Headers */, - 46FDDAC7202ACC6A00931238 /* GFX.h in Headers */, - 0431A06B22CCA441003356C9 /* AssemblerSprite.hpp in Headers */, 46FDDC63202D502F00931238 /* CCApplication.h in Headers */, - 04DBD44122AE2DBD00DBE4CD /* PathAttachment.h in Headers */, 469303A42046AE05004A3D6C /* ScriptEngine.hpp in Headers */, + BA06A7E323583DFE007740C5 /* GLES3Device.h in Headers */, 46AE3FF32092F3A600F3A228 /* node.h in Headers */, - 04DBD43522AE2DBD00DBE4CD /* RotateMode.h in Headers */, - 04DBD3F922AE2DBD00DBE4CD /* Event.h in Headers */, - 04DBD40522AE2DBD00DBE4CD /* BoundingBoxAttachment.h in Headers */, - 04DBD47722AE2DBD00DBE4CD /* Atlas.h in Headers */, + BA06A7E923583DFE007740C5 /* GLES3Texture.h in Headers */, 1A52DB68205BCDC700350EE3 /* Base.h in Headers */, 50ABBD521925AB0000A911A9 /* Quaternion.h in Headers */, + BA06A6D023583DBD007740C5 /* GFXContext.h in Headers */, + BA06A76123583DFE007740C5 /* GLES2GPUObjects.h in Headers */, 1A52DB2D205BCD9200350EE3 /* ObjectWrap.h in Headers */, - 04FB240B2328D42A0021DD02 /* ArmatureCacheMgr.h in Headers */, - 04DBD47322AE2DBD00DBE4CD /* AttachmentType.h in Headers */, - 042058CF22A61B340092DE5D /* RenderDataList.hpp in Headers */, 1A52DB6A205BCDC700350EE3 /* HelperMacros.h in Headers */, 40CEAEB120CFC86D007A3281 /* CustomEventTypes.h in Headers */, - 04DBD4C322AE2DBD00DBE4CD /* BoneData.h in Headers */, + BA06A7EF23583DFE007740C5 /* gles3w.h in Headers */, 1A52DB23205BCD9200350EE3 /* Class.hpp in Headers */, - 046E061A2185B37100B24E2D /* CCFactory.h in Headers */, - 046E06D52185B49F00B24E2D /* ArmatureData.h in Headers */, - 04DBD4BF22AE2DBD00DBE4CD /* DeformTimeline.h in Headers */, + BA06A76323583DFE007740C5 /* GLES2CommandAllocator.h in Headers */, + BA06A7C523583DFE007740C5 /* MTLbuffer.h in Headers */, 1A28FF9B1F20AFAB007A1D9D /* SRWebSocket.h in Headers */, 50643BE219BFCF1800EF68ED /* CCPlatformConfig.h in Headers */, + BA06A67823583DBD007740C5 /* AllocatedObj.h in Headers */, 1A28FF611F20AFAB007A1D9D /* SRRunLoopThread.h in Headers */, - 469303D22046AE05004A3D6C /* jsb_gfx_auto.hpp in Headers */, - 046B68A821A292D300B33469 /* jsb_spine_manual.hpp in Headers */, - 0431A07122CCA7C1003356C9 /* SimpleSprite2D.hpp in Headers */, 1A52DB5E205BCDC700350EE3 /* Class.hpp in Headers */, 4693039C2046AE05004A3D6C /* PlatformUtils.h in Headers */, - 0482F1AD228D87970019ECF7 /* MaskAssembler.hpp in Headers */, - 046E06C12185B49F00B24E2D /* TextureAtlasData.h in Headers */, - 041854A1228D7E5700F8DF31 /* ParticleSimulator.h in Headers */, 1AAAC8E5205CB6E9005321B9 /* AudioPlayer.h in Headers */, + BA06A6A223583DBD007740C5 /* GFXDevice.h in Headers */, + BA06A68423583DBD007740C5 /* StlAlloc.h in Headers */, 1AAAC8ED205CB6E9005321B9 /* AudioCache.h in Headers */, - 046E063D2185B41100B24E2D /* TimelineState.h in Headers */, - 04DBD4C522AE2DBD00DBE4CD /* dll.h in Headers */, 46FDDBBB202ADDCE00931238 /* CCRefPtr.h in Headers */, - 04DBD4CF22AE2DBD00DBE4CD /* SkeletonClipping.h in Headers */, - 046E06182185B37100B24E2D /* CCTextureAtlasData.h in Headers */, - 046E067B2185B42F00B24E2D /* DragonBonesHeaders.h in Headers */, - 046E06C72185B49F00B24E2D /* DisplayData.h in Headers */, - 46FDDADB202ACC6A00931238 /* State.h in Headers */, 1A29D771205665D200168D9A /* jsb_cocos2dx_manual.hpp in Headers */, - 04DBD3D922AE2DBD00DBE4CD /* Constraint.h in Headers */, - 04DBD3E922AE2DBD00DBE4CD /* Debug.h in Headers */, 46AE3FFF2092F3A600F3A228 /* v8_inspector_protocol_json.h in Headers */, - 046E06842185B43B00B24E2D /* EventObject.h in Headers */, - 423379A522BB8DEA00E5D8A2 /* CustomProperties.hpp in Headers */, - 046E06ED2185B4A500B24E2D /* JSONDataParser.h in Headers */, - 046E06F32185B4A500B24E2D /* DataParser.h in Headers */, - 46FDDACB202ACC6A00931238 /* VertexFormat.h in Headers */, - 46FDDA81202ACC6A00931238 /* RendererUtils.h in Headers */, - 469304142046AE06004A3D6C /* jsb_renderer_manual.hpp in Headers */, - 46FDDAD1202ACC6A00931238 /* Texture.h in Headers */, - 04DBD43922AE2DBD00DBE4CD /* Updatable.h in Headers */, 1A52DB72205BCDC700350EE3 /* Utils.hpp in Headers */, + BA06A78923583DFE007740C5 /* GLES2Shader.h in Headers */, 1A52DB70205BCDC700350EE3 /* SeApi.h in Headers */, - 046E06DB2185B49F00B24E2D /* ConstraintData.h in Headers */, + BA06A77723583DFE007740C5 /* GLES2RenderPass.h in Headers */, 1A28FF971F20AFAB007A1D9D /* SRSecurityPolicy.h in Headers */, - 04DBD3FF22AE2DBD00DBE4CD /* EventTimeline.h in Headers */, - 04DBD31722AE2D8200DBE4CD /* SkeletonRenderer.h in Headers */, - 04355818217EADF300B9C056 /* IOBuffer.h in Headers */, 5027253A190BF1B900AAF4ED /* cocos2d.h in Headers */, - 046E06542185B41B00B24E2D /* Bone.h in Headers */, - 046E06DF2185B49F00B24E2D /* DragonBonesData.h in Headers */, - 04AF6301219190ED00AED9DE /* TypedArrayPool.h in Headers */, 46AE3FE52092F3A600F3A228 /* base64.h in Headers */, - 04DBD45722AE2DBD00DBE4CD /* AttachmentLoader.h in Headers */, - 04DBD42722AE2DBD00DBE4CD /* VertexEffect.h in Headers */, - 046E061E2185B37100B24E2D /* CCDragonBonesHeaders.h in Headers */, 50ABBD421925AB0000A911A9 /* CCMathBase.h in Headers */, - 04DBD47B22AE2DBD00DBE4CD /* AnimationState.h in Headers */, - 04DBD4C922AE2DBD00DBE4CD /* TransformConstraint.h in Headers */, 469303862046AE05004A3D6C /* Object.hpp in Headers */, - 04DBD31F22AE2D8200DBE4CD /* AttachmentVertices.h in Headers */, 1A29D788205666B200168D9A /* LocalStorage.h in Headers */, 50ABBD4E1925AB0000A911A9 /* MathUtil.h in Headers */, + BA06A7F323583DFE007740C5 /* GLES3Commands.h in Headers */, 1A52DB67205BCDC700350EE3 /* Utils.hpp in Headers */, 1A52DB25205BCD9200350EE3 /* HelperMacros.h in Headers */, + BA06A69023583DBD007740C5 /* StringUtil.h in Headers */, + BA06A6BC23583DBD007740C5 /* GFXPipelineState.h in Headers */, 469303AC2046AE05004A3D6C /* Utils.hpp in Headers */, 1A28FF911F20AFAB007A1D9D /* NSURLRequest+SRWebSocket.h in Headers */, - 46FDDAAD202ACC6A00931238 /* Macro.h in Headers */, - 04DBD42322AE2DBD00DBE4CD /* SlotData.h in Headers */, - 046E070B218B015100B24E2D /* jsb_cocos2dx_dragonbones_auto.hpp in Headers */, 461786672052607E008256E1 /* jsb_websocket.hpp in Headers */, 50ABC01B1926664800A911A9 /* CCSAXParser.h in Headers */, - 0482F1C1228D87970019ECF7 /* AssemblerBase.hpp in Headers */, - 04DBD3DD22AE2DBD00DBE4CD /* SkeletonData.h in Headers */, - 04DBD3DB22AE2DBD00DBE4CD /* TranslateTimeline.h in Headers */, 1A28FF691F20AFAB007A1D9D /* SRConstants.h in Headers */, - 04DBD3FB22AE2DBD00DBE4CD /* Animation.h in Headers */, ED3057891BEC773E0083C3ED /* tinyxml2.h in Headers */, + BA06A7E123583DFE007740C5 /* GLES3Shader.h in Headers */, + BA06A79323583DFE007740C5 /* GLES2StateCache.h in Headers */, + BA06A7AB23583DFE007740C5 /* GLES2Std.h in Headers */, + BA06A7FB23583DFE007740C5 /* GLES3InputAssembler.h in Headers */, 50ABC0651926664800A911A9 /* CCGL-mac.h in Headers */, - 046E06932185B45300B24E2D /* Rectangle.h in Headers */, 50643BD419BFAECF00EF68ED /* CCGL.h in Headers */, - 0482F1BF228D87970019ECF7 /* Assembler.hpp in Headers */, - 045F672A22A50A8D0033F7BD /* RenderData.hpp in Headers */, - 04DBD46122AE2DBD00DBE4CD /* TwoColorTimeline.h in Headers */, 50ABBD621925AB0000A911A9 /* Vec4.h in Headers */, - 04F8563622ABCB9900063A20 /* TiledMapAssembler.hpp in Headers */, - 04DBD3BF22AE2DBD00DBE4CD /* AnimationStateData.h in Headers */, 46AE40092092F3A600F3A228 /* node_debug_options.h in Headers */, - 04DBD49522AE2DBD00DBE4CD /* SpineObject.h in Headers */, - 046E06CF2185B49F00B24E2D /* BoundingBoxData.h in Headers */, + BA06A7E723583DFE007740C5 /* GLES3CommandBuffer.h in Headers */, 1A28FF791F20AFAB007A1D9D /* SRLog.h in Headers */, - 04DBD4C722AE2DBD00DBE4CD /* SkeletonBounds.h in Headers */, 469303AE2046AE05004A3D6C /* Base.h in Headers */, 46FDDB6D202ADDCE00931238 /* etc1.h in Headers */, 46FDDBB7202ADDCE00931238 /* ccUtils.h in Headers */, - 046E06762185B42500B24E2D /* DragonBones.h in Headers */, + BA06A6F623583DBD007740C5 /* TypeDef.h in Headers */, 46FDDB6B202ADDCE00931238 /* base64.h in Headers */, - 046E06D92185B49F00B24E2D /* CanvasData.h in Headers */, 1A52DB45205BCD9200350EE3 /* Base.h in Headers */, 1A52DB65205BCDC700350EE3 /* SeApi.h in Headers */, - 046E06602185B41B00B24E2D /* DeformVertices.h in Headers */, + BA06A77D23583DFE007740C5 /* GLES2Texture.h in Headers */, 425D3FF322D86BEF00BCED11 /* Mat3.hpp in Headers */, 1A28FF6D1F20AFAB007A1D9D /* SRError.h in Headers */, 46AE3FE32092F3A600F3A228 /* inspector_agent.h in Headers */, 46AE3FEB2092F3A600F3A228 /* node_mutex.h in Headers */, - 04DBD49322AE2DBD00DBE4CD /* SkeletonJson.h in Headers */, - 046E063B2185B41100B24E2D /* WorldClock.h in Headers */, - 046E06F92189990700B24E2D /* middleware-adapter.h in Headers */, 4617864320522469008256E1 /* HttpRequest.h in Headers */, + BA06A67C23583DBD007740C5 /* MemDef.h in Headers */, + BA06A76B23583DFE007740C5 /* GFXGLES2.h in Headers */, 1A28FF651F20AFAB007A1D9D /* SRPinningSecurityPolicy.h in Headers */, - 46FDDA85202ACC6A00931238 /* View.h in Headers */, + BA06A6EC23583DBD007740C5 /* UTFString.h in Headers */, 46AE3FF72092F3A600F3A228 /* util-inl.h in Headers */, 1AAAC875205CB647005321B9 /* jsb_cocos2dx_audioengine_auto.hpp in Headers */, - 04DBD3EB22AE2DBD00DBE4CD /* CurveTimeline.h in Headers */, - 04DBD3D322AE2DBD00DBE4CD /* RotateTimeline.h in Headers */, - 0482F1A7228D87970019ECF7 /* NodeProxy.hpp in Headers */, 1A28FF951F20AFAB007A1D9D /* SocketRocket.h in Headers */, 46AE40012092F3A600F3A228 /* SHA1.h in Headers */, - 04FB24112328D42A0021DD02 /* ArmatureCache.h in Headers */, - 046E06992185B45300B24E2D /* Matrix.h in Headers */, - 046E06142185B37100B24E2D /* CCArmatureDisplay.h in Headers */, - 04DBD3E722AE2DBD00DBE4CD /* PathConstraintMixTimeline.h in Headers */, 46178670205262BC008256E1 /* jsb_conversions.hpp in Headers */, + BA06A7E523583DFE007740C5 /* GLES3PipelineLayout.h in Headers */, 469303A82046AE05004A3D6C /* SeApi.h in Headers */, 50ABBD5A1925AB0000A911A9 /* Vec2.h in Headers */, 46FDDB81202ADDCE00931238 /* ccTypes.h in Headers */, - 04DBD49122AE2DBD00DBE4CD /* ShearTimeline.h in Headers */, - 04DBD31D22AE2D8200DBE4CD /* SkeletonAnimation.h in Headers */, 469304302046AE06004A3D6C /* jsb_classtype.hpp in Headers */, - 46FDDADD202ACC6A00931238 /* VertexBuffer.h in Headers */, 1A28FF8D1F20AFAB007A1D9D /* NSRunLoop+SRWebSocket.h in Headers */, - 04DBD40122AE2DBD00DBE4CD /* AtlasAttachmentLoader.h in Headers */, - 046E06D72185B49F00B24E2D /* AnimationConfig.h in Headers */, - 04DBD45522AE2DBD00DBE4CD /* Vertices.h in Headers */, - 04DBD40922AE2DBD00DBE4CD /* IkConstraintData.h in Headers */, - 04DBD32322AE2D8200DBE4CD /* SkeletonDataMgr.h in Headers */, - 469304202046AE06004A3D6C /* jsb_gfx_manual.hpp in Headers */, - 04DBD32B22AE2D8200DBE4CD /* spine-cocos2dx.h in Headers */, + BA06A6A423583DBD007740C5 /* GFXCommandAllocator.h in Headers */, 4043D65F20D2132E00C55611 /* CCGLView-desktop.h in Headers */, - 04DBD40B22AE2DBD00DBE4CD /* SpineString.h in Headers */, 403ACADB20CE4EB000BB433D /* jsb_module_register.hpp in Headers */, - 04DBD43122AE2DBD00DBE4CD /* Color.h in Headers */, - 0482F1A9228D87970019ECF7 /* StencilManager.hpp in Headers */, - 46FDDACD202ACC6A00931238 /* GraphicsHandle.h in Headers */, 461DCA5A20C7E4BA00B22827 /* JavaScriptObjCBridge.h in Headers */, + BA06A68623583DBD007740C5 /* Memory.h in Headers */, 46FDDBCB202ADDCE00931238 /* ZipUtils.h in Headers */, 50ABBFFD1926664800A911A9 /* CCFileUtils-apple.h in Headers */, - 46FDDA8F202ACC6A00931238 /* BaseRenderer.h in Headers */, + BA06A6C823583DBD007740C5 /* GFXInputAssembler.h in Headers */, 1A52DB69205BCDC700350EE3 /* Class.hpp in Headers */, - 46FDDAD7202ACC6A00931238 /* GFXUtils.h in Headers */, - 04DBD44322AE2DBD00DBE4CD /* PathConstraint.h in Headers */, + BA06A81123583DFE007740C5 /* GLES3BindingLayout.h in Headers */, + BA06A6A823583DBD007740C5 /* GFXTextureView.h in Headers */, 4617866D2052609B008256E1 /* jsb_cocos2dx_network_auto.hpp in Headers */, 50ABC00F1926664800A911A9 /* CCFileUtils.h in Headers */, - 046E06FF2189999600B24E2D /* jsb_cocos2dx_editor_support_auto.hpp in Headers */, 1A28FF4D1F20AFAB007A1D9D /* SRDelegateController.h in Headers */, + BA06A69A23583DBD007740C5 /* CoreStd.h in Headers */, + BA06A68C23583DBD007740C5 /* StdAlloc.h in Headers */, 46FDDB9F202ADDCE00931238 /* CCVector.h in Headers */, 50ABBD5E1925AB0000A911A9 /* Vec3.h in Headers */, - 046E0711218B01EF00B24E2D /* jsb_dragonbones_manual.hpp in Headers */, + BA06A7F923583DFE007740C5 /* GLES3RenderPass.h in Headers */, + BA06A6D423583DBD007740C5 /* GFXFramebuffer.h in Headers */, + BA06A79F23583DFE007740C5 /* GLES2EGLContext.h in Headers */, + BA06A6E623583DBD007740C5 /* CachedArray.h in Headers */, + BA06A7D923583DFE007740C5 /* GLES3CommandAllocator.h in Headers */, + BA06A76D23583DFE007740C5 /* GLES2Commands.h in Headers */, 4617863120522469008256E1 /* SocketIO.h in Headers */, 46FDDBD1202ADDCE00931238 /* ccUTF8.h in Headers */, - 049B32092314DF1C0004909A /* SkeletonCache.h in Headers */, + BA06A76523583DFE007740C5 /* GLES2TextureView.h in Headers */, 4693045A2046AE06004A3D6C /* EventDispatcher.h in Headers */, - 0494CFD622BEFC6D00B73B79 /* ParallelTask.hpp in Headers */, 1AAAC8F3205CB6E9005321B9 /* AudioEngine.h in Headers */, 1A52DB6E205BCDC700350EE3 /* Object.hpp in Headers */, ED3057A21BEC77D50083C3ED /* xxhash.h in Headers */, - 04DBD3C722AE2DBD00DBE4CD /* HasRendererObject.h in Headers */, 1A52DB42205BCD9200350EE3 /* Utils.hpp in Headers */, 50ABC00B1926664800A911A9 /* CCDevice.h in Headers */, 46FDDB89202ADDCE00931238 /* CCRef.h in Headers */, - 046E069D2185B45300B24E2D /* Transform.h in Headers */, - 04DBD47922AE2DBD00DBE4CD /* PositionMode.h in Headers */, 46FDDBE9202ADDCE00931238 /* CCAutoreleasePool.h in Headers */, - 04DBD3F522AE2DBD00DBE4CD /* ClippingAttachment.h in Headers */, - 04DBD3FD22AE2DBD00DBE4CD /* HashMap.h in Headers */, + BA06A79B23583DFE007740C5 /* GLES2PipelineState.h in Headers */, 46FDDB4F202ADDCE00931238 /* CCValue.h in Headers */, - 04DBD4CB22AE2DBD00DBE4CD /* VertexAttachment.h in Headers */, - 046E06952185B45300B24E2D /* ColorTransform.h in Headers */, 46AE3FFD2092F3A600F3A228 /* util.h in Headers */, 46FDDBB5202ADDCE00931238 /* uthash.h in Headers */, 1AAAC8DF205CB6E9005321B9 /* AudioDecoder.h in Headers */, - 04DBD3CF22AE2DBD00DBE4CD /* Triangulator.h in Headers */, 4617862520522469008256E1 /* CCDownloader.h in Headers */, + BA06A76923583DFE007740C5 /* GLES2PipelineLayout.h in Headers */, + BA06A6D623583DBD007740C5 /* GFXBuffer.h in Headers */, 1A28FF7D1F20AFAB007A1D9D /* SRMutex.h in Headers */, - 04DBD4B922AE2DBD00DBE4CD /* Skeleton.h in Headers */, 1A28FF711F20AFAB007A1D9D /* SRHash.h in Headers */, - 04DBD4E322B51EB300DBE4CD /* NodeMemPool.hpp in Headers */, 469301CF203FC696004A3D6C /* CCConfiguration.h in Headers */, 1A14FD932080B4E300E10ABE /* CCGLUtils.h in Headers */, 50ABC0171926664800A911A9 /* CCImage.h in Headers */, + BA06A7A523583DFE007740C5 /* GLES2Queue.h in Headers */, + BA06A82123583DFE007740C5 /* GLES3CommandPool.h in Headers */, + BA06A6C023583DBD007740C5 /* GFXDef.h in Headers */, + BA06A78D23583DFE007740C5 /* GLES2CommandBuffer.h in Headers */, + BA06A68823583DBD007740C5 /* JeAlloc.h in Headers */, + BA06A78723583DFE007740C5 /* GLES2Device.h in Headers */, + BA06A7AD23583DFE007740C5 /* GLES2Buffer.h in Headers */, + BA06A7AF23583DFE007740C5 /* GLES2BindingLayout.h in Headers */, ED30577F1BEC76C90083C3ED /* ioapi_mem.h in Headers */, - 426947C1234ED02E0044C66E /* SlicedSprite3D.hpp in Headers */, + BA06A7B123583DFE007740C5 /* GLES2InputAssembler.h in Headers */, + BA06A7DF23583DFE007740C5 /* GLES3StateCache.h in Headers */, + BA06A7EB23583DFE007740C5 /* GLES3Queue.h in Headers */, + BA06A7B923583DFE007740C5 /* wglew.h in Headers */, 46AE3FED2092F3A600F3A228 /* http_parser.h in Headers */, + BA06A6F223583DBD007740C5 /* Object.h in Headers */, 4617864B20522469008256E1 /* HttpCookie.h in Headers */, - 04DBD31522AE2D8200DBE4CD /* VertexEffectDelegate.h in Headers */, - 046E066A2185B41B00B24E2D /* IArmatureProxy.h in Headers */, 1A586C432064C90500B47573 /* EJConvertTypedArray.h in Headers */, + BA06A81723583DFE007740C5 /* GFXGLES3.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4046,381 +2974,261 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 04DBD4BA22AE2DBD00DBE4CD /* Skeleton.h in Headers */, + BA06A6D523583DBD007740C5 /* GFXFramebuffer.h in Headers */, 4617862A20522469008256E1 /* Uri.h in Headers */, - 046E069A2185B45300B24E2D /* Matrix.h in Headers */, + BA06A79023583DFE007740C5 /* GLES2Framebuffer.h in Headers */, 469303892046AE05004A3D6C /* HandleObject.hpp in Headers */, 503DD8EF1926736A00CD74DD /* CCPlatformDefine-ios.h in Headers */, - 04DBD4C022AE2DBD00DBE4CD /* DeformTimeline.h in Headers */, + BA06A7A023583DFE007740C5 /* GLES2EGLContext.h in Headers */, + BA06A76E23583DFE007740C5 /* GLES2Commands.h in Headers */, + BA06A6AD23583DBD007740C5 /* GFXTexture.h in Headers */, 1A28FF921F20AFAB007A1D9D /* NSURLRequest+SRWebSocket.h in Headers */, - 046E06CC2185B49F00B24E2D /* SkinData.h in Headers */, 46FDDB5C202ADDCE00931238 /* CCData.h in Headers */, 469303832046AE05004A3D6C /* Value.hpp in Headers */, - 04DBD48422AE2DBD00DBE4CD /* PathConstraintData.h in Headers */, - 04DBD3F422AE2DBD00DBE4CD /* TimelineType.h in Headers */, - 046E06A02185B45300B24E2D /* Point.h in Headers */, 1A28FF961F20AFAB007A1D9D /* SocketRocket.h in Headers */, 4617864620522469008256E1 /* HttpAsynConnection-apple.h in Headers */, - 46FDDAA8202ACC6A00931238 /* ForwardRenderer.h in Headers */, + BA06A6B323583DBD007740C5 /* GFXRenderPass.h in Headers */, + BA06A6B923583DBD007740C5 /* GFXWindow.h in Headers */, 1A29D79B205666F500168D9A /* jsb_opengl_utils.hpp in Headers */, - 04DBD4CA22AE2DBD00DBE4CD /* TransformConstraint.h in Headers */, 1A28FF8E1F20AFAB007A1D9D /* NSRunLoop+SRWebSocket.h in Headers */, + BA06A6A323583DBD007740C5 /* GFXDevice.h in Headers */, 425D3FF422D86BEF00BCED11 /* Mat3.hpp in Headers */, + BA06A7FC23583DFE007740C5 /* GLES3InputAssembler.h in Headers */, 46FDDBA0202ADDCE00931238 /* CCVector.h in Headers */, 46FDDB54202ADDCE00931238 /* utlist.h in Headers */, - 046E06252185B37100B24E2D /* CCSlot.h in Headers */, 46AE40022092F3A600F3A228 /* SHA1.h in Headers */, + BA06A7DC23583DFE007740C5 /* GLES3TextureView.h in Headers */, 469303932046AE05004A3D6C /* SeApi.h in Headers */, - 46FDDA84202ACC6A00931238 /* Technique.h in Headers */, + BA06A6F723583DBD007740C5 /* TypeDef.h in Headers */, 1A29D76C205665BE00168D9A /* jsb_cocos2dx_auto.hpp in Headers */, - 046B688D219FA61200B33469 /* MiddlewareManager.h in Headers */, - 046E06792185B42500B24E2D /* BaseObject.h in Headers */, - 04DBD45C22AE2DBD00DBE4CD /* Timeline.h in Headers */, - 04DBD3C022AE2DBD00DBE4CD /* AnimationStateData.h in Headers */, 46FDDBB8202ADDCE00931238 /* ccUtils.h in Headers */, - 04DBD48822AE2DBD00DBE4CD /* MixBlend.h in Headers */, - 046E06552185B41B00B24E2D /* Bone.h in Headers */, - 04DBD3DC22AE2DBD00DBE4CD /* TranslateTimeline.h in Headers */, - 04DBD49422AE2DBD00DBE4CD /* SkeletonJson.h in Headers */, 50643BE319BFCF1800EF68ED /* CCPlatformConfig.h in Headers */, - 46FDDA92202ACC6A00931238 /* Pass.h in Headers */, - 046E067C2185B42F00B24E2D /* DragonBonesHeaders.h in Headers */, 46FDDB4E202ADDCE00931238 /* pvr.h in Headers */, - 049B31FE2313B6240004909A /* SkeletonCacheMgr.h in Headers */, 46FDDBB6202ADDCE00931238 /* uthash.h in Headers */, + BA06A76623583DFE007740C5 /* GLES2TextureView.h in Headers */, 46FDDB5E202ADDCE00931238 /* ccMacros.h in Headers */, 294D7D9B1D0E93A2002CE7B7 /* CCDevice-apple.h in Headers */, 46178650205224DA008256E1 /* CCDownloaderImpl-apple.h in Headers */, - 46FDDAA6202ACC6A00931238 /* Scene.h in Headers */, - 04FB240A2328D42A0021DD02 /* CCArmatureCacheDisplay.h in Headers */, 46AE3FE62092F3A600F3A228 /* base64.h in Headers */, 1A586C4A2064C97800B47573 /* EJConvert.h in Headers */, - 04DBD42422AE2DBD00DBE4CD /* SlotData.h in Headers */, 46AE3FE82092F3A600F3A228 /* inspector_io.h in Headers */, + BA06A77E23583DFE007740C5 /* GLES2Texture.h in Headers */, 1AAAC8E0205CB6E9005321B9 /* AudioDecoder.h in Headers */, - 049B3210231533BF0004909A /* SkeletonCacheAnimation.h in Headers */, - 04DBD3BE22AE2DBD00DBE4CD /* Attachment.h in Headers */, - 046E06D02185B49F00B24E2D /* BoundingBoxData.h in Headers */, 1A28FF821F20AFAB007A1D9D /* SRRandom.h in Headers */, 1A52DB79205BCDD000350EE3 /* Object.hpp in Headers */, 50643BD619BFAEDA00EF68ED /* CCPlatformDefine.h in Headers */, - 046E063E2185B41100B24E2D /* TimelineState.h in Headers */, - 46FDDA6E202ACC6A00931238 /* INode.h in Headers */, - 469304152046AE06004A3D6C /* jsb_renderer_manual.hpp in Headers */, + BA06A7E023583DFE007740C5 /* GLES3StateCache.h in Headers */, 50ABBD631925AB0000A911A9 /* Vec4.h in Headers */, 46AE3FDE2092F3A600F3A228 /* inspector_socket_server.h in Headers */, + BA06A78E23583DFE007740C5 /* GLES2CommandBuffer.h in Headers */, 1A586C442064C90500B47573 /* EJConvertTypedArray.h in Headers */, 46AE3FFE2092F3A600F3A228 /* util.h in Headers */, - 046E06652185B41B00B24E2D /* Armature.h in Headers */, - 046E06692185B41B00B24E2D /* Constraint.h in Headers */, - 046B689621A10D5800B33469 /* MiddlewareMacro.h in Headers */, - 46FDDA82202ACC6A00931238 /* RendererUtils.h in Headers */, + BA06A7B223583DFE007740C5 /* GLES2InputAssembler.h in Headers */, + BA06A7FE23583DFE007740C5 /* GLES3PipelineState.h in Headers */, + BA06A6CF23583DBD007740C5 /* GFXCommandBuffer.h in Headers */, 40AEF7B7216D982600729AA5 /* jsb_webview_auto.hpp in Headers */, 50ABC0101926664800A911A9 /* CCFileUtils.h in Headers */, - 04DBD4C422AE2DBD00DBE4CD /* BoneData.h in Headers */, + BA06A7BA23583DFE007740C5 /* wglew.h in Headers */, 40FF7AA2216B29CC00E73029 /* VideoPlayer.h in Headers */, - 04DBD4D622AE2DBD00DBE4CD /* IkConstraint.h in Headers */, - 04DBD47222AE2DBD00DBE4CD /* Bone.h in Headers */, 1A29D77E2056667800168D9A /* csscolorparser.hpp in Headers */, - 04DBD32022AE2D8200DBE4CD /* AttachmentVertices.h in Headers */, - 46FDDA9C202ACC6A00931238 /* Effect.h in Headers */, - 046E07002189999600B24E2D /* jsb_cocos2dx_editor_support_auto.hpp in Headers */, - 04DBD49A22AE2DBD00DBE4CD /* TransformMode.h in Headers */, - 04DBD32422AE2D8200DBE4CD /* SkeletonDataMgr.h in Headers */, + BA06A81623583DFE007740C5 /* GLES3Std.h in Headers */, 46AE40062092F3A600F3A228 /* inspector_socket.h in Headers */, 40AEF7B1216D940200729AA5 /* WebView-inl.h in Headers */, + BA06A7F423583DFE007740C5 /* GLES3Commands.h in Headers */, 503DD8E61926736A00CD74DD /* CCEAGLView-ios.h in Headers */, - 04DBD4CC22AE2DBD00DBE4CD /* VertexAttachment.h in Headers */, - 46FDDAC8202ACC6A00931238 /* GFX.h in Headers */, 469303972046AE05004A3D6C /* Class.hpp in Headers */, - 04DBD4C622AE2DBD00DBE4CD /* dll.h in Headers */, - 04DBD40022AE2DBD00DBE4CD /* EventTimeline.h in Headers */, - 04DBD31E22AE2D8200DBE4CD /* SkeletonAnimation.h in Headers */, - 046E06F22185B4A500B24E2D /* BinaryDataParser.h in Headers */, - 041854A6228D7E7300F8DF31 /* jsb_cocos2dx_particle_auto.hpp in Headers */, - 04DBD46222AE2DBD00DBE4CD /* TwoColorTimeline.h in Headers */, - 46FDDA98202ACC6A00931238 /* Model.h in Headers */, - 04DBD45822AE2DBD00DBE4CD /* AttachmentLoader.h in Headers */, 469304112046AE06004A3D6C /* jsb_helper.hpp in Headers */, 1A52DAF7205BB81400350EE3 /* CCThreadPool.h in Headers */, - 046E06192185B37100B24E2D /* CCTextureAtlasData.h in Headers */, + BA06A6BD23583DBD007740C5 /* GFXPipelineState.h in Headers */, 50ABBD5B1925AB0000A911A9 /* Vec2.h in Headers */, + BA06A76A23583DFE007740C5 /* GLES2PipelineLayout.h in Headers */, + BA06A68723583DBD007740C5 /* Memory.h in Headers */, 4008729720CE20C2002EB77B /* jsb_cocos2dx_network_manual.h in Headers */, - 04DBD4BE22AE2DBD00DBE4CD /* spine.h in Headers */, 50ABBD411925AB0000A911A9 /* CCMath.h in Headers */, - 04DBD3E822AE2DBD00DBE4CD /* PathConstraintMixTimeline.h in Headers */, - 04DBD43622AE2DBD00DBE4CD /* RotateMode.h in Headers */, - 04355819217EADF300B9C056 /* IOBuffer.h in Headers */, - 0494CFD722BEFC6D00B73B79 /* ParallelTask.hpp in Headers */, - 046E06342185B41100B24E2D /* Animation.h in Headers */, 461786682052607E008256E1 /* jsb_websocket.hpp in Headers */, 4617865E2052607E008256E1 /* jsb_xmlhttprequest.hpp in Headers */, - 04DBD3C822AE2DBD00DBE4CD /* HasRendererObject.h in Headers */, - 04DBD3EC22AE2DBD00DBE4CD /* CurveTimeline.h in Headers */, - 46FDDAB0202ACC6A00931238 /* Texture2D.h in Headers */, + BA06A76C23583DFE007740C5 /* GFXGLES2.h in Headers */, 50ABBD3F1925AB0000A911A9 /* CCGeometry.h in Headers */, 4693039D2046AE05004A3D6C /* PlatformUtils.h in Headers */, - 046E06C22185B49F00B24E2D /* TextureAtlasData.h in Headers */, - 04DBD3D222AE2DBD00DBE4CD /* EventData.h in Headers */, - 046E06402185B41100B24E2D /* AnimationState.h in Headers */, 4617866E2052609B008256E1 /* jsb_cocos2dx_network_auto.hpp in Headers */, - 046E066B2185B41B00B24E2D /* IArmatureProxy.h in Headers */, - 0482F19A228D87970019ECF7 /* RenderFlow.hpp in Headers */, - 0482F1A8228D87970019ECF7 /* NodeProxy.hpp in Headers */, - 04DBD44422AE2DBD00DBE4CD /* PathConstraint.h in Headers */, - 04DBD45622AE2DBD00DBE4CD /* Vertices.h in Headers */, + BA06A68923583DBD007740C5 /* JeAlloc.h in Headers */, 1A28FF6A1F20AFAB007A1D9D /* SRConstants.h in Headers */, - 04DBD40C22AE2DBD00DBE4CD /* SpineString.h in Headers */, - 04DBD47822AE2DBD00DBE4CD /* Atlas.h in Headers */, + BA06A69B23583DBD007740C5 /* CoreStd.h in Headers */, 50ABBFFE1926664800A911A9 /* CCFileUtils-apple.h in Headers */, - 046E061F2185B37100B24E2D /* CCDragonBonesHeaders.h in Headers */, - 046B689321A00F5600B33469 /* IOTypedArray.h in Headers */, 46FDDBEA202ADDCE00931238 /* CCAutoreleasePool.h in Headers */, - 0482F1C0228D87970019ECF7 /* Assembler.hpp in Headers */, + BA06A7AC23583DFE007740C5 /* GLES2Std.h in Headers */, 461786642052607E008256E1 /* jsb_socketio.hpp in Headers */, 40AEF7C1216DF22500729AA5 /* jsb_video_auto.hpp in Headers */, + BA06A7E223583DFE007740C5 /* GLES3Shader.h in Headers */, 46AE40002092F3A600F3A228 /* v8_inspector_protocol_json.h in Headers */, - 469303EF2046AE05004A3D6C /* jsb_renderer_auto.hpp in Headers */, - 04DBD49622AE2DBD00DBE4CD /* SpineObject.h in Headers */, 1A28FF521F20AFAB007A1D9D /* SRIOConsumer.h in Headers */, + BA06A79423583DFE007740C5 /* GLES2StateCache.h in Headers */, 1A28FF981F20AFAB007A1D9D /* SRSecurityPolicy.h in Headers */, - 04DBD3F222AE2DBD00DBE4CD /* MathUtil.h in Headers */, + BA06A67D23583DBD007740C5 /* MemDef.h in Headers */, 40CEAEB520CFDC23007A3281 /* CCReachability.h in Headers */, 4037F5CD2108751E001C205C /* CCAsyncTaskPool.h in Headers */, + BA06A6B723583DBD007740C5 /* GFXPipelineLayout.h in Headers */, 1A52DB76205BCDD000350EE3 /* Class.hpp in Headers */, + BA06A6EB23583DBD007740C5 /* assertion.h in Headers */, + BA06A7CA23583DFE007740C5 /* GLES3Window.h in Headers */, + BA06A77823583DFE007740C5 /* GLES2RenderPass.h in Headers */, 50643BDC19BFAF4400EF68ED /* CCStdC.h in Headers */, - 04DBD3FA22AE2DBD00DBE4CD /* Event.h in Headers */, - 046E06422185B41100B24E2D /* BaseTimelineState.h in Headers */, + BA06A6AF23583DBD007740C5 /* GFXBindingLayout.h in Headers */, 469303AF2046AE05004A3D6C /* Base.h in Headers */, 46930467204FE20F004A3D6C /* CCLog.h in Headers */, 1A28FF761F20AFAB007A1D9D /* SRHTTPConnectMessage.h in Headers */, - 046E06942185B45300B24E2D /* Rectangle.h in Headers */, + BA06A6A123583DBD007740C5 /* GFXShader.h in Headers */, 46FDDBBC202ADDCE00931238 /* CCRefPtr.h in Headers */, 46AE3FEC2092F3A600F3A228 /* node_mutex.h in Headers */, - 04DBD40A22AE2DBD00DBE4CD /* IkConstraintData.h in Headers */, 4617864C20522469008256E1 /* HttpCookie.h in Headers */, - 04DBD3C622AE2DBD00DBE4CD /* MixDirection.h in Headers */, + BA06A81823583DFE007740C5 /* GFXGLES3.h in Headers */, 1A52DB74205BCDD000350EE3 /* Base.h in Headers */, - 049B320A2314DF1C0004909A /* SkeletonCache.h in Headers */, - 04DBD3E222AE2DBD00DBE4CD /* AttachmentTimeline.h in Headers */, 469304012046AE06004A3D6C /* jsb_global.h in Headers */, - 04DBD47A22AE2DBD00DBE4CD /* PositionMode.h in Headers */, - 0431A07222CCA7C1003356C9 /* SimpleSprite2D.hpp in Headers */, - 04DBD48222AE2DBD00DBE4CD /* PathConstraintPositionTimeline.h in Headers */, + BA06A7EC23583DFE007740C5 /* GLES3Queue.h in Headers */, + BA06A81223583DFE007740C5 /* GLES3BindingLayout.h in Headers */, 46AE3FF82092F3A600F3A228 /* util-inl.h in Headers */, - 46FDDADE202ACC6A00931238 /* VertexBuffer.h in Headers */, 40AEF7B3216D940200729AA5 /* WebViewImpl-ios.h in Headers */, 1A28FF621F20AFAB007A1D9D /* SRRunLoopThread.h in Headers */, - 46FDDA86202ACC6A00931238 /* View.h in Headers */, - 04F8563722ABCB9900063A20 /* TiledMapAssembler.hpp in Headers */, - 46FDDAD8202ACC6A00931238 /* GFXUtils.h in Headers */, + BA06A67523583DBD007740C5 /* Core.h in Headers */, 46FDDB82202ADDCE00931238 /* ccTypes.h in Headers */, 50ABC00C1926664800A911A9 /* CCDevice.h in Headers */, - 46FDDA74202ACC6A00931238 /* ProgramLib.h in Headers */, - 46FDDAD0202ACC6A00931238 /* RenderBuffer.h in Headers */, 1A28FF7A1F20AFAB007A1D9D /* SRLog.h in Headers */, 46AE3FF42092F3A600F3A228 /* node.h in Headers */, 46FDDC64202D502F00931238 /* CCApplication.h in Headers */, - 042058D022A61B340092DE5D /* RenderDataList.hpp in Headers */, - 046E06D82185B49F00B24E2D /* AnimationConfig.h in Headers */, - 46FDDACC202ACC6A00931238 /* VertexFormat.h in Headers */, - 46FDDACE202ACC6A00931238 /* GraphicsHandle.h in Headers */, 469303912046AE05004A3D6C /* MappingUtils.hpp in Headers */, - 0482F1C2228D87970019ECF7 /* AssemblerBase.hpp in Headers */, - 04DBD49022AE2DBD00DBE4CD /* Vector.h in Headers */, - 46FDDA80202ACC6A00931238 /* Renderer.h in Headers */, + BA06A80E23583DFE007740C5 /* GLES3GPUObjects.h in Headers */, 4617864420522469008256E1 /* HttpRequest.h in Headers */, 46AE3FEE2092F3A600F3A228 /* http_parser.h in Headers */, - 04DBD47422AE2DBD00DBE4CD /* AttachmentType.h in Headers */, - 0431A06C22CCA441003356C9 /* AssemblerSprite.hpp in Headers */, - 046E06632185B41B00B24E2D /* Slot.h in Headers */, - 04DBD3D422AE2DBD00DBE4CD /* RotateTimeline.h in Headers */, - 04DBD46822AE2DBD00DBE4CD /* TransformConstraintData.h in Headers */, + BA06A79A23583DFE007740C5 /* GLES2Sampler.h in Headers */, 4693045B2046AE06004A3D6C /* EventDispatcher.h in Headers */, - 046E06BE2185B49F00B24E2D /* UserData.h in Headers */, - 04DBD3FE22AE2DBD00DBE4CD /* HashMap.h in Headers */, - 46FDDAA2202ACC6A00931238 /* InputAssembler.h in Headers */, - 046E06612185B41B00B24E2D /* DeformVertices.h in Headers */, + BA06A76223583DFE007740C5 /* GLES2GPUObjects.h in Headers */, + BA06A7F023583DFE007740C5 /* gles3w.h in Headers */, 46FDDBCC202ADDCE00931238 /* ZipUtils.h in Headers */, - 04DBD43A22AE2DBD00DBE4CD /* Updatable.h in Headers */, - 046E06462185B41100B24E2D /* IAnimatable.h in Headers */, - 04DBD3DA22AE2DBD00DBE4CD /* Constraint.h in Headers */, - 04DBD43E22AE2DBD00DBE4CD /* SkeletonBinary.h in Headers */, - 046E06E02185B49F00B24E2D /* DragonBonesData.h in Headers */, - 04DBD3C222AE2DBD00DBE4CD /* TextureLoader.h in Headers */, - 427475FC23214E2A00139DF8 /* MeshAssembler.hpp in Headers */, - 04AF6302219190ED00AED9DE /* TypedArrayPool.h in Headers */, + BA06A6EF23583DBD007740C5 /* Log.h in Headers */, 46FDDB50202ADDCE00931238 /* CCValue.h in Headers */, - 46FDDADA202ACC6A00931238 /* Program.h in Headers */, - 04DBD44222AE2DBD00DBE4CD /* PathAttachment.h in Headers */, - 46FDDAC4202ACC6A00931238 /* FrameBuffer.h in Headers */, - 0482F1AE228D87970019ECF7 /* MaskAssembler.hpp in Headers */, - 46FDDAD2202ACC6A00931238 /* Texture.h in Headers */, 469303992046AE05004A3D6C /* HelperMacros.h in Headers */, 1AAAC8EE205CB6E9005321B9 /* AudioCache.h in Headers */, - 04DBD3DE22AE2DBD00DBE4CD /* SkeletonData.h in Headers */, 1A28FF721F20AFAB007A1D9D /* SRHash.h in Headers */, 50ABBD431925AB0000A911A9 /* CCMathBase.h in Headers */, - 04FB24122328D42A0021DD02 /* ArmatureCache.h in Headers */, + BA06A78A23583DFE007740C5 /* GLES2Shader.h in Headers */, + BA06A69923583DBD007740C5 /* CCMath.h in Headers */, 46FDDBDE202ADDCE00931238 /* TGAlib.h in Headers */, - 046E06DC2185B49F00B24E2D /* ConstraintData.h in Headers */, 469303812046AE05004A3D6C /* config.hpp in Headers */, + BA06A7FA23583DFE007740C5 /* GLES3RenderPass.h in Headers */, 1A28FF9C1F20AFAB007A1D9D /* SRWebSocket.h in Headers */, - 046E061B2185B37100B24E2D /* CCFactory.h in Headers */, BAEA45561E279D5C00FA219F /* tinydir.h in Headers */, 4693038B2046AE05004A3D6C /* State.hpp in Headers */, 461DCA5B20C7E4BA00B22827 /* JavaScriptObjCBridge.h in Headers */, - 04DBD3EA22AE2DBD00DBE4CD /* Debug.h in Headers */, - 46FDDADC202ACC6A00931238 /* State.h in Headers */, 46FDDB8A202ADDCE00931238 /* CCRef.h in Headers */, - 046E06852185B43B00B24E2D /* EventObject.h in Headers */, - 04DBD48E22AE2DBD00DBE4CD /* Slot.h in Headers */, - 04DBD44A22AE2DBD00DBE4CD /* DrawOrderTimeline.h in Headers */, - 046E06DA2185B49F00B24E2D /* CanvasData.h in Headers */, 46FDDB6C202ADDCE00931238 /* base64.h in Headers */, 469303652046AE05004A3D6C /* RefCounter.hpp in Headers */, - 469303D32046AE05004A3D6C /* jsb_gfx_auto.hpp in Headers */, - 046E068B2185B44A00B24E2D /* BaseFactory.h in Headers */, - 046E063C2185B41100B24E2D /* WorldClock.h in Headers */, + BA06A6C923583DBD007740C5 /* GFXInputAssembler.h in Headers */, + BA06A6D123583DBD007740C5 /* GFXContext.h in Headers */, + BA06A6B123583DBD007740C5 /* GFXQueue.h in Headers */, 40AEF7B2216D940200729AA5 /* WebView.h in Headers */, - 04DBD4D022AE2DBD00DBE4CD /* SkeletonClipping.h in Headers */, + BA06A68523583DBD007740C5 /* StlAlloc.h in Headers */, 1AAAC8F4205CB6E9005321B9 /* AudioEngine.h in Headers */, - 04886B4422CE22F2008CEB66 /* SlicedSprite2D.hpp in Headers */, - 046B68A921A292D300B33469 /* jsb_spine_manual.hpp in Headers */, - 46FDDA78202ACC6A00931238 /* Light.h in Headers */, + BA06A77023583DFE007740C5 /* GLES2Window.h in Headers */, 1A29D7A420566CAC00168D9A /* CCCanvasRenderingContext2D.h in Headers */, - 046E06812185B43B00B24E2D /* IEventDispatcher.h in Headers */, 1A52DB7C205BCDD000350EE3 /* SeApi.h in Headers */, - 426947C2234ED02E0044C66E /* SlicedSprite3D.hpp in Headers */, 469303A92046AE05004A3D6C /* SeApi.h in Headers */, - 46FDDAAE202ACC6A00931238 /* Macro.h in Headers */, - 04ED68DB21F8188F006E82F8 /* MeshBuffer.h in Headers */, + BA06A7B023583DFE007740C5 /* GLES2BindingLayout.h in Headers */, + BA06A69123583DBD007740C5 /* StringUtil.h in Headers */, + BA06A7BE23583DFE007740C5 /* GLStd.h in Headers */, 469303872046AE05004A3D6C /* Object.hpp in Headers */, 1A28FF5E1F20AFAB007A1D9D /* SRProxyConnect.h in Headers */, - 04DBD42822AE2DBD00DBE4CD /* VertexEffect.h in Headers */, - 04DBD47C22AE2DBD00DBE4CD /* AnimationState.h in Headers */, + BA06A68D23583DBD007740C5 /* StdAlloc.h in Headers */, 469303AD2046AE05004A3D6C /* Utils.hpp in Headers */, - 04DBD4D222AE2DBD00DBE4CD /* LinkedMesh.h in Headers */, - 04DBD4DE22B51EA300DBE4CD /* MemPool.hpp in Headers */, - 046E06FA2189990700B24E2D /* middleware-adapter.h in Headers */, - 04DBD4E422B51EB300DBE4CD /* NodeMemPool.hpp in Headers */, 1A28FF4E1F20AFAB007A1D9D /* SRDelegateController.h in Headers */, 469301D0203FC696004A3D6C /* CCConfiguration.h in Headers */, - 04DBD45A22AE2DBD00DBE4CD /* PointAttachment.h in Headers */, - 426947BC234ED0130044C66E /* SimpleSprite3D.hpp in Headers */, 46FDDB6E202ADDCE00931238 /* etc1.h in Headers */, - 04DBD40222AE2DBD00DBE4CD /* AtlasAttachmentLoader.h in Headers */, 461DCA3720BBFA2D00B22827 /* EditBox.h in Headers */, - 04DBD31622AE2D8200DBE4CD /* VertexEffectDelegate.h in Headers */, 1AAAC8E6205CB6E9005321B9 /* AudioPlayer.h in Headers */, - 0482F1BC228D87970019ECF7 /* MeshBuffer.hpp in Headers */, 469303A52046AE05004A3D6C /* ScriptEngine.hpp in Headers */, - 045F672B22A50A8D0033F7BD /* RenderData.hpp in Headers */, - 046E069E2185B45300B24E2D /* Transform.h in Headers */, - 046E070C218B015100B24E2D /* jsb_cocos2dx_dragonbones_auto.hpp in Headers */, - 046E06152185B37100B24E2D /* CCArmatureDisplay.h in Headers */, - 04DBD41022AE2DBD00DBE4CD /* TransformConstraintTimeline.h in Headers */, + BA06A79C23583DFE007740C5 /* GLES2PipelineState.h in Headers */, + BA06A7AE23583DFE007740C5 /* GLES2Buffer.h in Headers */, 1A28FF8A1F20AFAB007A1D9D /* SRURLUtilities.h in Headers */, 50ABBD4B1925AB0000A911A9 /* Mat4.h in Headers */, + BA06A7EA23583DFE007740C5 /* GLES3Texture.h in Headers */, 50ABBD531925AB0000A911A9 /* Quaternion.h in Headers */, + BA06A7E623583DFE007740C5 /* GLES3PipelineLayout.h in Headers */, + BA06A7CC23583DFE007740C5 /* GLES3EGLContext.h in Headers */, 4617863E20522469008256E1 /* HttpResponse.h in Headers */, + BA06A78023583DFE007740C5 /* gles2w.h in Headers */, 461786542052301A008256E1 /* CCScheduler.h in Headers */, - 04DBD49222AE2DBD00DBE4CD /* ShearTimeline.h in Headers */, - 04DBD3E422AE2DBD00DBE4CD /* BlendMode.h in Headers */, - 046E065F2185B41B00B24E2D /* TransformObject.h in Headers */, - 046E06962185B45300B24E2D /* ColorTransform.h in Headers */, - 04DBD44C22AE2DBD00DBE4CD /* IkConstraintTimeline.h in Headers */, 50ABC0181926664800A911A9 /* CCImage.h in Headers */, + BA06A6ED23583DBD007740C5 /* UTFString.h in Headers */, + BA06A68323583DBD007740C5 /* MemTracker.h in Headers */, + BA06A6C123583DBD007740C5 /* GFXDef.h in Headers */, 503DD8EB1926736A00CD74DD /* CCGL-ios.h in Headers */, - 46FDDA7C202ACC6A00931238 /* Camera.h in Headers */, + BA06A6A523583DBD007740C5 /* GFXCommandAllocator.h in Headers */, 4617862420522469008256E1 /* CCIDownloaderImpl.h in Headers */, - 046E06EE2185B4A500B24E2D /* JSONDataParser.h in Headers */, - 046E06F42185B4A500B24E2D /* DataParser.h in Headers */, 5027253B190BF1B900AAF4ED /* cocos2d.h in Headers */, - 0482F1B2228D87970019ECF7 /* ModelBatcher.hpp in Headers */, - 04DBD3BC22AE2DBD00DBE4CD /* Pool.h in Headers */, - 46FDDAAC202ACC6A00931238 /* Types.h in Headers */, - 04DBD45022AE2DBD00DBE4CD /* Json.h in Headers */, - 04DBD43222AE2DBD00DBE4CD /* Color.h in Headers */, + BA06A6DB23583DBD007740C5 /* GFXSampler.h in Headers */, + BA06A80623583DFE007740C5 /* GLES3Framebuffer.h in Headers */, 1AAAC876205CB647005321B9 /* jsb_cocos2dx_audioengine_auto.hpp in Headers */, - 04DBD32C22AE2D8200DBE4CD /* spine-cocos2dx.h in Headers */, + BA06A6D723583DBD007740C5 /* GFXBuffer.h in Headers */, + BA06A78823583DFE007740C5 /* GLES2Device.h in Headers */, 1A52DB7B205BCDD000350EE3 /* ScriptEngine.hpp in Headers */, - 04DBD47622AE2DBD00DBE4CD /* MeshAttachment.h in Headers */, 4648882620AC2BC900CD1E4A /* CCRenderTexture.h in Headers */, - 0482F1AA228D87970019ECF7 /* StencilManager.hpp in Headers */, 1A29D772205665D200168D9A /* jsb_cocos2dx_manual.hpp in Headers */, 1A29D789205666B200168D9A /* LocalStorage.h in Headers */, - 046E0712218B01EF00B24E2D /* jsb_dragonbones_manual.hpp in Headers */, 46FDDC67202D504E00931238 /* CCApplication.h in Headers */, - 046E06772185B42500B24E2D /* DragonBones.h in Headers */, - 0482F19E228D87970019ECF7 /* scene-bindings.h in Headers */, - 041854A2228D7E5700F8DF31 /* ParticleSimulator.h in Headers */, + BA06A6F323583DBD007740C5 /* Object.h in Headers */, 46AE3FE42092F3A600F3A228 /* inspector_agent.h in Headers */, - 04DBD4B422AE2DBD00DBE4CD /* ContainerUtil.h in Headers */, - 046E06C82185B49F00B24E2D /* DisplayData.h in Headers */, + BA06A76423583DFE007740C5 /* GLES2CommandAllocator.h in Headers */, 50ABBD4F1925AB0000A911A9 /* MathUtil.h in Headers */, - 04DBD3FC22AE2DBD00DBE4CD /* Animation.h in Headers */, + BA06A82223583DFE007740C5 /* GLES3CommandPool.h in Headers */, 1A28FF561F20AFAB007A1D9D /* SRIOConsumerPool.h in Headers */, - 044597F522D332D800924443 /* Extension.h in Headers */, + BA06A7E823583DFE007740C5 /* GLES3CommandBuffer.h in Headers */, 1A28FF7E1F20AFAB007A1D9D /* SRMutex.h in Headers */, + BA06A7C623583DFE007740C5 /* MTLbuffer.h in Headers */, 403ACADD20CE542900BB433D /* jsb_module_register.hpp in Headers */, - 46FDDA76202ACC6A00931238 /* Config.h in Headers */, - 04DBD3D022AE2DBD00DBE4CD /* Triangulator.h in Headers */, 50643BD519BFAECF00EF68ED /* CCGL.h in Headers */, - 04FB240C2328D42A0021DD02 /* ArmatureCacheMgr.h in Headers */, - 046E06D62185B49F00B24E2D /* ArmatureData.h in Headers */, 46FDDB84202ADDCE00931238 /* ccRandom.h in Headers */, 1AAAC8EA205CB6E9005321B9 /* AudioMacros.h in Headers */, + BA06A7DA23583DFE007740C5 /* GLES3CommandAllocator.h in Headers */, 46AE400A2092F3A600F3A228 /* node_debug_options.h in Headers */, 4617862620522469008256E1 /* CCDownloader.h in Headers */, - 04DBD46622AE2DBD00DBE4CD /* ScaleTimeline.h in Headers */, 4DCEC127233236D60020F8E3 /* etc2.h in Headers */, 46FDDBD2202ADDCE00931238 /* ccUTF8.h in Headers */, - 04DBD4A822AE2DBD00DBE4CD /* RegionAttachment.h in Headers */, + BA06A7BC23583DFE007740C5 /* glew.h in Headers */, 1A14FD942080B4E300E10ABE /* CCGLUtils.h in Headers */, 50ABBD5F1925AB0000A911A9 /* Vec3.h in Headers */, - 04DBD4D422AE2DBD00DBE4CD /* RTTI.h in Headers */, 46FDDC02202ADDCE00931238 /* ccCArray.h in Headers */, 1A29D79F205666F500168D9A /* jsb_opengl_manual.hpp in Headers */, - 46FDDAE0202ACC6A00931238 /* RenderTarget.h in Headers */, - 04DBD3F622AE2DBD00DBE4CD /* ClippingAttachment.h in Headers */, - 046E06B82185B49F00B24E2D /* AnimationData.h in Headers */, + BA06A7A623583DFE007740C5 /* GLES2Queue.h in Headers */, + BA06A81C23583DFE007740C5 /* GLES3Buffer.h in Headers */, 50ABBD471925AB0000A911A9 /* CCVertex.h in Headers */, - 46FDDA90202ACC6A00931238 /* BaseRenderer.h in Headers */, - 046B68AD21A294B100B33469 /* jsb_cocos2dx_spine_auto.hpp in Headers */, - 46FDDABE202ACC6A00931238 /* DeviceGraphics.h in Headers */, + BA06A6E723583DBD007740C5 /* CachedArray.h in Headers */, 4617862820522469008256E1 /* WebSocket.h in Headers */, 4617863220522469008256E1 /* SocketIO.h in Headers */, - 46FDDAB8202ACC6A00931238 /* IndexBuffer.h in Headers */, 1A28FF5C1F20AFAB007A1D9D /* NSURLRequest+SRWebSocketPrivate.h in Headers */, + BA06A68F23583DBD007740C5 /* NedPooling.h in Headers */, + BA06A7E423583DFE007740C5 /* GLES3Device.h in Headers */, 1AAAC8F0205CB6E9005321B9 /* AudioEngine-inl.h in Headers */, - 04DBD3D622AE2DBD00DBE4CD /* ColorTimeline.h in Headers */, - 04DBD4C822AE2DBD00DBE4CD /* SkeletonBounds.h in Headers */, - 04DBD31822AE2D8200DBE4CD /* SkeletonRenderer.h in Headers */, 1A28FF6E1F20AFAB007A1D9D /* SRError.h in Headers */, - 0482F1A4228D87970019ECF7 /* CustomAssembler.hpp in Headers */, 1AAAC8F6205CB6E9005321B9 /* Export.h in Headers */, 46FDDBC4202ADDCE00931238 /* ccConfig.h in Headers */, + BA06A80823583DFE007740C5 /* GLES3Sampler.h in Headers */, 46AE3FE02092F3A600F3A228 /* env.h in Headers */, 469303A32046AE05004A3D6C /* Object.hpp in Headers */, 1A28FF661F20AFAB007A1D9D /* SRPinningSecurityPolicy.h in Headers */, + BA06A7AA23583DFE007740C5 /* GLES2CommandPool.h in Headers */, + BA06A6A923583DBD007740C5 /* GFXTextureView.h in Headers */, 46178671205262BC008256E1 /* jsb_conversions.hpp in Headers */, - 469304212046AE06004A3D6C /* jsb_gfx_manual.hpp in Headers */, + BA06A69D23583DBD007740C5 /* CoreDef.h in Headers */, 50ABC01C1926664800A911A9 /* CCSAXParser.h in Headers */, 1A52DB77205BCDD000350EE3 /* HelperMacros.h in Headers */, 469304312046AE06004A3D6C /* jsb_classtype.hpp in Headers */, 46FDDBD0202ADDCE00931238 /* CCMap.h in Headers */, 1A52DB7E205BCDD000350EE3 /* Utils.hpp in Headers */, - 04DBD40422AE2DBD00DBE4CD /* Skin.h in Headers */, + BA06A67923583DBD007740C5 /* AllocatedObj.h in Headers */, 503DD8F11926736A00CD74DD /* OpenGL_Internal-ios.h in Headers */, 1A28FF5A1F20AFAB007A1D9D /* NSRunLoop+SRWebSocketPrivate.h in Headers */, 1A28FF861F20AFAB007A1D9D /* SRSIMDHelpers.h in Headers */, - 04DBD42E22AE2DBD00DBE4CD /* PathConstraintSpacingTimeline.h in Headers */, - 04DBD40622AE2DBD00DBE4CD /* BoundingBoxAttachment.h in Headers */, + BA06A7C423583DFE007740C5 /* MetalStd.h in Headers */, 4617863820522469008256E1 /* HttpClient.h in Headers */, - 04DBD44E22AE2DBD00DBE4CD /* SpacingMode.h in Headers */, - 423379A022BB43B900E5D8A2 /* RecyclePool.hpp in Headers */, - 423379A622BB8DEA00E5D8A2 /* CustomProperties.hpp in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4496,323 +3304,221 @@ files = ( 1A29D794205666F500168D9A /* jsb_opengl_manual.cpp in Sources */, 4693038C2046AE05004A3D6C /* config.cpp in Sources */, - 46FDDA7D202ACC6A00931238 /* Light.cpp in Sources */, - 046E070F218B01EF00B24E2D /* jsb_dragonbones_manual.cpp in Sources */, - 4693042C2046AE06004A3D6C /* jsb_renderer_manual.cpp in Sources */, 1AAAC8E3205CB6E9005321B9 /* AudioDecoder.mm in Sources */, 1A52DB66205BCDC700350EE3 /* Class.cpp in Sources */, - 04DBD45D22AE2DBD00DBE4CD /* SkeletonBinary.cpp in Sources */, - 046E0709218B015100B24E2D /* jsb_cocos2dx_dragonbones_auto.cpp in Sources */, - 046E06352185B41100B24E2D /* TimelineState.cpp in Sources */, 1A28FF7F1F20AFAB007A1D9D /* SRMutex.m in Sources */, - 04DBD46D22AE2DBD00DBE4CD /* ScaleTimeline.cpp in Sources */, 469303942046AE05004A3D6C /* RefCounter.cpp in Sources */, 469304262046AE06004A3D6C /* jsb_conversions.cpp in Sources */, 469304582046AE06004A3D6C /* EventDispatcher.cpp in Sources */, - 04355816217EADF300B9C056 /* IOBuffer.cpp in Sources */, + BA06A79523583DFE007740C5 /* GLES2PipelineState.cc in Sources */, 1A52DAF8205BB81400350EE3 /* CCThreadPool.cpp in Sources */, + BA06A69623583DBD007740C5 /* CCMath.cc in Sources */, + BA06A68023583DBD007740C5 /* AllocatedObj.cc in Sources */, + BA06A80F23583DFE007740C5 /* GLES3Framebuffer.cc in Sources */, + BA06A6E223583DBD007740C5 /* GFXContext.cc in Sources */, + BA06A6B423583DBD007740C5 /* GFXTextureView.cc in Sources */, 46AE3FFB2092F3A600F3A228 /* inspector_io.cc in Sources */, - 04DBD4A922AE2DBD00DBE4CD /* SpineObject.cpp in Sources */, + BA06A69223583DBD007740C5 /* StringUtil.cc in Sources */, 4037F5CE2108751E001C205C /* CCAsyncTaskPool.cpp in Sources */, + BA06A7B723583DFE007740C5 /* GLES2CommandBuffer.cc in Sources */, 46FDDB65202ADDCE00931238 /* ccRandom.cpp in Sources */, - 46FDDAB9202ACC6A00931238 /* FrameBuffer.cpp in Sources */, 50ABBD581925AB0000A911A9 /* Vec2.cpp in Sources */, - 049B31FB2313B6240004909A /* SkeletonCacheMgr.cpp in Sources */, 4626B1FF202D9BD800BE30B9 /* CCApplication-mac.mm in Sources */, - 04DBD46F22AE2DBD00DBE4CD /* TransformConstraintData.cpp in Sources */, 5027253C190BF1B900AAF4ED /* cocos2d.cpp in Sources */, - 46FDDAA3202ACC6A00931238 /* InputAssembler.cpp in Sources */, - 046E06222185B37100B24E2D /* CCTextureAtlasData.cpp in Sources */, 1AAAC8EB205CB6E9005321B9 /* AudioCache.mm in Sources */, 4648882720AC2BC900CD1E4A /* CCRenderTexture.cpp in Sources */, - 041854A7228D7E7300F8DF31 /* jsb_cocos2dx_particle_auto.cpp in Sources */, + BA06A7D723583DFE007740C5 /* GLES3Device.cc in Sources */, 46AE3FF92092F3A600F3A228 /* inspector_socket.cc in Sources */, - 0431A06922CCA441003356C9 /* AssemblerSprite.cpp in Sources */, - 04DBD47D22AE2DBD00DBE4CD /* DeformTimeline.cpp in Sources */, 1A52DB61205BCDC700350EE3 /* Object.cpp in Sources */, - 042058CD22A61B340092DE5D /* RenderDataList.cpp in Sources */, - 045F672822A50A8D0033F7BD /* RenderData.cpp in Sources */, 50ABBD501925AB0000A911A9 /* Quaternion.cpp in Sources */, - 0418549F228D7E5700F8DF31 /* ParticleSimulator.cpp in Sources */, 425D3FF122D86BEF00BCED11 /* Mat3.cpp in Sources */, + BA06A68A23583DBD007740C5 /* Memory.cc in Sources */, ED30579A1BEC77B70083C3ED /* ConvertUTF.c in Sources */, - 046E06C92185B49F00B24E2D /* UserData.cpp in Sources */, - 46FDDA79202ACC6A00931238 /* Camera.cpp in Sources */, 4617863320522469008256E1 /* Uri.cpp in Sources */, - 04DBD48922AE2DBD00DBE4CD /* IkConstraintTimeline.cpp in Sources */, - 46FDDAC1202ACC6A00931238 /* Texture.cpp in Sources */, - 0482F19F228D87970019ECF7 /* Assembler.cpp in Sources */, 1A28FF6B1F20AFAB007A1D9D /* SRConstants.m in Sources */, 294D7D9C1D0E93A2002CE7B7 /* CCDevice-apple.mm in Sources */, - 046E061C2185B37100B24E2D /* CCFactory.cpp in Sources */, 1A586C452064C90500B47573 /* EJConvertTypedArray.m in Sources */, - 04DBD32922AE2D8200DBE4CD /* spine-cocos2dx.cpp in Sources */, 1A29D77B2056667800168D9A /* csscolorparser.cpp in Sources */, - 46FDDA71202ACC6A00931238 /* Scene.cpp in Sources */, - 469303C62046AE05004A3D6C /* jsb_gfx_auto.cpp in Sources */, + BA06A79D23583DFE007740C5 /* GLES2BindingLayout.cc in Sources */, 46AE40072092F3A600F3A228 /* node_debug_options.cc in Sources */, 469304122046AE06004A3D6C /* jsb_classtype.cpp in Sources */, 50ABBFFF1926664800A911A9 /* CCFileUtils-apple.mm in Sources */, - 04DBD49D22AE2DBD00DBE4CD /* SkeletonJson.cpp in Sources */, - 04DBD49F22AE2DBD00DBE4CD /* ColorTimeline.cpp in Sources */, + BA06A6F023583DBD007740C5 /* Assertion.cc in Sources */, 4617866B2052609B008256E1 /* jsb_cocos2dx_network_auto.cpp in Sources */, + BA06A7D323583DFE007740C5 /* GLES3EGLContext.cc in Sources */, 461DCA3E20BBFCFE00B22827 /* EditBox-mac.mm in Sources */, 40CEAEB720CFDC45007A3281 /* CCReachability.cpp in Sources */, - 04DBD4B122AE2DBD00DBE4CD /* TwoColorTimeline.cpp in Sources */, - 04DBD48522AE2DBD00DBE4CD /* EventTimeline.cpp in Sources */, - 046E06DD2185B49F00B24E2D /* AnimationData.cpp in Sources */, - 04FB24132328D42A0021DD02 /* CCArmatureCacheDisplay.cpp in Sources */, - 046E06202185B37100B24E2D /* CCArmatureDisplay.cpp in Sources */, - 0494CFD422BEFC6D00B73B79 /* ParallelTask.cpp in Sources */, - 426947BF234ED02E0044C66E /* SlicedSprite3D.cpp in Sources */, - 046E06882185B44A00B24E2D /* BaseFactory.cpp in Sources */, 1A52DB30205BCD9200350EE3 /* ScriptEngine.cpp in Sources */, - 0482F1A1228D87970019ECF7 /* NodeProxy.cpp in Sources */, - 04DBD4E122B51EB300DBE4CD /* NodeMemPool.cpp in Sources */, 1A52DB62205BCDC700350EE3 /* ScriptEngine.cpp in Sources */, - 04DBD44722AE2DBD00DBE4CD /* Skeleton.cpp in Sources */, 4DC57D211F7A58B5005B6546 /* xxtea.cpp in Sources */, 46AE40032092F3A600F3A228 /* http_parser.c in Sources */, 1A586C4B2064C97800B47573 /* EJConvert.m in Sources */, + BA06A78523583DFE007740C5 /* GLES2Window.cc in Sources */, + BA06A7B523583DFE007740C5 /* GLES2TextureView.cc in Sources */, + BA06A80123583DFE007740C5 /* GLES3PipelineLayout.cc in Sources */, + BA06A6D823583DBD007740C5 /* GFXTexture.cc in Sources */, + BA06A6BE23583DBD007740C5 /* GFXDevice.cc in Sources */, 1AAAC8E7205CB6E9005321B9 /* AudioEngine-inl.mm in Sources */, - 04DBD46B22AE2DBD00DBE4CD /* AttachmentTimeline.cpp in Sources */, 46FDDB71202ADDCE00931238 /* base64.cpp in Sources */, 1AAAC873205CB647005321B9 /* jsb_cocos2dx_audioengine_auto.cpp in Sources */, - 04DBD46322AE2DBD00DBE4CD /* PathConstraintData.cpp in Sources */, - 423379A322BB8DEA00E5D8A2 /* CustomProperties.cpp in Sources */, - 46FDDA8D202ACC6A00931238 /* Config.cpp in Sources */, 46930468204FE20F004A3D6C /* CCLog.cpp in Sources */, 1A28FF991F20AFAB007A1D9D /* SRSecurityPolicy.m in Sources */, + BA06A6CC23583DBD007740C5 /* GFXInputAssembler.cc in Sources */, + BA06A6DC23583DBD007740C5 /* GFXBindingLayout.cc in Sources */, + BA06A7A723583DFE007740C5 /* GLES2PipelineLayout.cc in Sources */, 46AE3FF52092F3A600F3A228 /* util.cc in Sources */, - 046E06582185B41B00B24E2D /* Armature.cpp in Sources */, - 46FDDAE1202ACC6A00931238 /* GFXUtils.cpp in Sources */, - 04886B4122CE22F2008CEB66 /* SlicedSprite2D.cpp in Sources */, 1A52DB6B205BCDC700350EE3 /* Utils.cpp in Sources */, 4693042E2046AE06004A3D6C /* jsb_helper.cpp in Sources */, - 046E06EB2185B4A500B24E2D /* DataParser.cpp in Sources */, - 049B320D231533BF0004909A /* SkeletonCacheAnimation.cpp in Sources */, - 04DBD41F22AE2DBD00DBE4CD /* Animation.cpp in Sources */, 1A14FD912080B4E300E10ABE /* CCGLUtils.cpp in Sources */, - 046E06B92185B49F00B24E2D /* ConstraintData.cpp in Sources */, - 04DBD3D722AE2DBD00DBE4CD /* PathAttachment.cpp in Sources */, + BA06A7D123583DFE007740C5 /* gles3w.mm in Sources */, 469303A02046AE05004A3D6C /* ScriptEngine.mm in Sources */, - 46FDDAB5202ACC6A00931238 /* Program.cpp in Sources */, - 04DBD3F722AE2DBD00DBE4CD /* PathConstraintMixTimeline.cpp in Sources */, - 046E06662185B41B00B24E2D /* Bone.cpp in Sources */, + BA06A69E23583DBD007740C5 /* GFXShader.cc in Sources */, 46FDDBF9202ADDCE00931238 /* etc1.cpp in Sources */, - 04DBD4A122AE2DBD00DBE4CD /* Attachment.cpp in Sources */, - 04DBD4AD22AE2DBD00DBE4CD /* BoundingBoxAttachment.cpp in Sources */, 50ABBD4C1925AB0000A911A9 /* MathUtil.cpp in Sources */, - 04DBD32722AE2D8200DBE4CD /* SkeletonDataMgr.cpp in Sources */, - 04DBD45F22AE2DBD00DBE4CD /* Event.cpp in Sources */, - 046E06C52185B49F00B24E2D /* AnimationConfig.cpp in Sources */, - 04DBD3C922AE2DBD00DBE4CD /* AtlasAttachmentLoader.cpp in Sources */, - 46FDDA99202ACC6A00931238 /* Model.cpp in Sources */, - 04DBD41522AE2DBD00DBE4CD /* MathUtil.cpp in Sources */, - 04DBD42F22AE2DBD00DBE4CD /* Json.cpp in Sources */, - 0482F1B3228D87970019ECF7 /* MaskAssembler.cpp in Sources */, 4693038E2046AE05004A3D6C /* Value.cpp in Sources */, - 04DBD4B522AE2DBD00DBE4CD /* RTTI.cpp in Sources */, - 0482F1A5228D87970019ECF7 /* MeshBuffer.cpp in Sources */, - 46FDDA89202ACC6A00931238 /* Effect.cpp in Sources */, - 04FB240F2328D42A0021DD02 /* ArmatureCache.cpp in Sources */, + BA06A6CA23583DBD007740C5 /* GFXRenderPass.cc in Sources */, + BA06A6BA23583DBD007740C5 /* GFXDef.cc in Sources */, + BA06A7FF23583DFE007740C5 /* GLES3CommandAllocator.cc in Sources */, 1ABAD24E20C29F3800BC71C0 /* CCCanvasRenderingContext2D-apple.mm in Sources */, - 046E06E12185B49F00B24E2D /* DragonBonesData.cpp in Sources */, ED30577E1BEC76C90083C3ED /* ioapi_mem.cpp in Sources */, + BA06A6E823583DBD007740C5 /* UTFString.cc in Sources */, 461DCA5820C7E4BA00B22827 /* JavaScriptObjCBridge.mm in Sources */, 4617861920522469008256E1 /* SocketIO.cpp in Sources */, - 04DBD3DF22AE2DBD00DBE4CD /* RotateTimeline.cpp in Sources */, - 46FDDABF202ACC6A00931238 /* State.cpp in Sources */, - 04DBD4A522AE2DBD00DBE4CD /* LinkedMesh.cpp in Sources */, - 04F8563422ABCB9900063A20 /* TiledMapAssembler.cpp in Sources */, 46AE3FEF2092F3A600F3A228 /* inspector_agent.cc in Sources */, 1A28FF5F1F20AFAB007A1D9D /* SRProxyConnect.m in Sources */, 46FDDB8B202ADDCE00931238 /* CCAutoreleasePool.cpp in Sources */, - 04DBD4AB22AE2DBD00DBE4CD /* Slot.cpp in Sources */, - 04DBD42122AE2DBD00DBE4CD /* SkeletonData.cpp in Sources */, - 04DBD41922AE2DBD00DBE4CD /* IkConstraint.cpp in Sources */, - 046E06432185B41100B24E2D /* Animation.cpp in Sources */, - 046E06312185B41100B24E2D /* BaseTimelineState.cpp in Sources */, 461786652052607E008256E1 /* jsb_websocket.cpp in Sources */, - 46FDDA87202ACC6A00931238 /* View.cpp in Sources */, - 0482F1B5228D87970019ECF7 /* RenderFlow.cpp in Sources */, 1A52DB71205BCDC700350EE3 /* Class.cpp in Sources */, + BA06A7CD23583DFE007740C5 /* GLES3InputAssembler.cc in Sources */, 4617862120522469008256E1 /* HttpCookie.cpp in Sources */, - 04DBD3EF22AE2DBD00DBE4CD /* Extension.cpp in Sources */, + BA06A80323583DFE007740C5 /* GLES3CommandBuffer.cc in Sources */, 1A29D769205665BE00168D9A /* jsb_cocos2dx_auto.cpp in Sources */, ED3057821BEC76C90083C3ED /* unzip.cpp in Sources */, - 046E065A2185B41B00B24E2D /* DeformVertices.cpp in Sources */, 1A28FF8F1F20AFAB007A1D9D /* NSRunLoop+SRWebSocket.m in Sources */, + BA06A67E23583DBD007740C5 /* JeAlloc.cc in Sources */, 469303A62046AE05004A3D6C /* PlatformUtils.mm in Sources */, + BA06A80923583DFE007740C5 /* GLES3Queue.cc in Sources */, ED3057801BEC76C90083C3ED /* ioapi.cpp in Sources */, - 04DBD42B22AE2DBD00DBE4CD /* IkConstraintData.cpp in Sources */, + BA06A79123583DFE007740C5 /* GLES2Queue.cc in Sources */, 1A52DB26205BCD9200350EE3 /* Utils.cpp in Sources */, - 46FDDA9F202ACC6A00931238 /* ProgramLib.cpp in Sources */, - 46FDDABB202ACC6A00931238 /* VertexFormat.cpp in Sources */, - 046E06CD2185B49F00B24E2D /* CanvasData.cpp in Sources */, - 04DBD32522AE2D8200DBE4CD /* SkeletonRenderer.cpp in Sources */, 403ACADA20CE4EB000BB433D /* jsb_module_register.cpp in Sources */, - 04DBD41722AE2DBD00DBE4CD /* BoneData.cpp in Sources */, - 04DBD4C122AE2DBD00DBE4CD /* Updatable.cpp in Sources */, - 04DBD4BB22AE2DBD00DBE4CD /* PathConstraintPositionTimeline.cpp in Sources */, - 04DBD45122AE2DBD00DBE4CD /* AnimationStateData.cpp in Sources */, 1A28FF671F20AFAB007A1D9D /* SRPinningSecurityPolicy.m in Sources */, - 04DBD41122AE2DBD00DBE4CD /* Constraint.cpp in Sources */, - 469303BE2046AE05004A3D6C /* jsb_renderer_auto.cpp in Sources */, - 04DBD43722AE2DBD00DBE4CD /* TranslateTimeline.cpp in Sources */, 50ABC0191926664800A911A9 /* CCSAXParser.cpp in Sources */, - 04FB240D2328D42A0021DD02 /* ArmatureCacheMgr.cpp in Sources */, + BA06A81923583DFE007740C5 /* GLES3PipelineState.cc in Sources */, 1A28FF571F20AFAB007A1D9D /* SRIOConsumerPool.m in Sources */, - 04DBD42922AE2DBD00DBE4CD /* RegionAttachment.cpp in Sources */, 46FDDB7B202ADDCE00931238 /* CCRef.cpp in Sources */, + BA06A78B23583DFE007740C5 /* GLES2Shader.cc in Sources */, 46FDDB8D202ADDCE00931238 /* ccTypes.cpp in Sources */, - 46FDDAA9202ACC6A00931238 /* Types.cpp in Sources */, 1A28FF4F1F20AFAB007A1D9D /* SRDelegateController.m in Sources */, + BA06A77123583DFE007740C5 /* GLES2EGLContext.cc in Sources */, 46FDDBFB202ADDCE00931238 /* ccCArray.cpp in Sources */, 1AAAC8E1205CB6E9005321B9 /* AudioPlayer.mm in Sources */, 1A28FF631F20AFAB007A1D9D /* SRRunLoopThread.m in Sources */, - 04ED68D821F8188F006E82F8 /* MeshBuffer.cpp in Sources */, + BA06A75F23583DFE007740C5 /* gles2w.mm in Sources */, + BA06A67A23583DBD007740C5 /* MemTracker.cc in Sources */, 50ABBD5C1925AB0000A911A9 /* Vec3.cpp in Sources */, - 04DBD43322AE2DBD00DBE4CD /* Skin.cpp in Sources */, 469303662046AE05004A3D6C /* HandleObject.cpp in Sources */, 469301D1203FC696004A3D6C /* CCConfiguration.cpp in Sources */, + BA06A7C723583DFE007740C5 /* MTLbuffer.mm in Sources */, 46FDDB93202ADDCE00931238 /* TGAlib.cpp in Sources */, 1A52DB60205BCDC700350EE3 /* Utils.cpp in Sources */, - 046E06BB2185B49F00B24E2D /* TextureAtlasData.cpp in Sources */, + BA06A7A323583DFE007740C5 /* GLES2Commands.cc in Sources */, + BA06A77B23583DFE007740C5 /* GLES2Sampler.cc in Sources */, + BA06A7F123583DFE007740C5 /* GLES3Window.cc in Sources */, 1A28FF831F20AFAB007A1D9D /* SRRandom.m in Sources */, - 46FDDAC5202ACC6A00931238 /* RenderTarget.cpp in Sources */, - 04DBD4DB22B51EA300DBE4CD /* MemPool.cpp in Sources */, 1A52DB6D205BCDC700350EE3 /* ScriptEngine.cpp in Sources */, - 04DBD44522AE2DBD00DBE4CD /* AnimationState.cpp in Sources */, 50ABBD3C1925AB0000A911A9 /* CCGeometry.cpp in Sources */, 1A28FF771F20AFAB007A1D9D /* SRHTTPConnectMessage.m in Sources */, - 04DBD47F22AE2DBD00DBE4CD /* PathConstraintSpacingTimeline.cpp in Sources */, 46FDDB99202ADDCE00931238 /* ccUTF8.cpp in Sources */, + BA06A6DE23583DBD007740C5 /* GFXQueue.cc in Sources */, 4617862F20522469008256E1 /* HttpClient-apple.mm in Sources */, 4617862B20522469008256E1 /* WebSocket-apple.mm in Sources */, - 46FDDAE3202ACC6A00931238 /* GFX.cpp in Sources */, + BA06A7ED23583DFE007740C5 /* GLES3Commands.cc in Sources */, ED30579C1BEC77B70083C3ED /* ConvertUTFWrapper.cpp in Sources */, - 04DBD41322AE2DBD00DBE4CD /* Triangulator.cpp in Sources */, + BA06A7DD23583DFE007740C5 /* GLES3Std.cc in Sources */, 46AE3FF12092F3A600F3A228 /* SHA1.cpp in Sources */, - 46FDDAB1202ACC6A00931238 /* DeviceGraphics.cpp in Sources */, - 0482F1BD228D87970019ECF7 /* CustomAssembler.cpp in Sources */, + BA06A7F723583DFE007740C5 /* GLES3Shader.cc in Sources */, + BA06A6C623583DBD007740C5 /* GFXCommandBuffer.cc in Sources */, 1A28FF7B1F20AFAB007A1D9D /* SRLog.m in Sources */, - 46FDDAC9202ACC6A00931238 /* RenderBuffer.cpp in Sources */, 46AE3FE92092F3A600F3A228 /* inspector_socket_server.cc in Sources */, + BA06A81323583DFE007740C5 /* GLES3BindingLayout.cc in Sources */, 1A28FF6F1F20AFAB007A1D9D /* SRError.m in Sources */, + BA06A81F23583DFE007740C5 /* gles3w.c in Sources */, + BA06A7D523583DFE007740C5 /* GLES3TextureView.cc in Sources */, + BA06A6AA23583DBD007740C5 /* GFXPipelineLayout.cc in Sources */, 1A28FF531F20AFAB007A1D9D /* SRIOConsumer.m in Sources */, 1A29D784205666B200168D9A /* LocalStorage.cpp in Sources */, - 046E06C32185B49F00B24E2D /* ArmatureData.cpp in Sources */, + BA06A6F423583DBD007740C5 /* Log.cc in Sources */, + BA06A81D23583DFE007740C5 /* GLES3Buffer.cc in Sources */, + BA06A7B323583DFE007740C5 /* GLES2Buffer.cc in Sources */, + BA06A7A123583DFE007740C5 /* gles2w.c in Sources */, 4617864920522469008256E1 /* CCDownloader.cpp in Sources */, 4693039E2046AE05004A3D6C /* Object.mm in Sources */, + BA06A79723583DFE007740C5 /* GLES2RenderPass.cc in Sources */, 4043D65E20D2132E00C55611 /* CCGLView-desktop.cpp in Sources */, - 0482F19B228D87970019ECF7 /* ModelBatcher.cpp in Sources */, 46AE3FE12092F3A600F3A228 /* node.cc in Sources */, - 46FDDA8B202ACC6A00931238 /* ForwardRenderer.cpp in Sources */, - 046E06D32185B49F00B24E2D /* SkinData.cpp in Sources */, - 04DBD48B22AE2DBD00DBE4CD /* CurveTimeline.cpp in Sources */, + BA06A78323583DFE007740C5 /* GLES2Std.cc in Sources */, 50ABBD481925AB0000A911A9 /* Mat4.cpp in Sources */, - 046E06EF2185B4A500B24E2D /* BinaryDataParser.cpp in Sources */, 50ABBD441925AB0000A911A9 /* CCVertex.cpp in Sources */, + BA06A6C223583DBD007740C5 /* GFXBuffer.cc in Sources */, 50ABC0631926664800A911A9 /* CCDevice-mac.mm in Sources */, - 0482F1B7228D87970019ECF7 /* StencilManager.cpp in Sources */, 461786552052301A008256E1 /* CCScheduler.cpp in Sources */, - 04DBD45322AE2DBD00DBE4CD /* TransformConstraintTimeline.cpp in Sources */, - 46FDDAD5202ACC6A00931238 /* GraphicsHandle.cpp in Sources */, - 46FDDA9D202ACC6A00931238 /* BaseRenderer.cpp in Sources */, + BA06A6A623583DBD007740C5 /* GFXWindow.cc in Sources */, 469303AA2046AE05004A3D6C /* Class.cpp in Sources */, - 046E06562185B41B00B24E2D /* TransformObject.cpp in Sources */, - 04DBD3CD22AE2DBD00DBE4CD /* Bone.cpp in Sources */, - 4693043C2046AE06004A3D6C /* jsb_gfx_manual.cpp in Sources */, 469303682046AE05004A3D6C /* State.cpp in Sources */, - 04DBD3C322AE2DBD00DBE4CD /* VertexEffect.cpp in Sources */, - 04DBD4A322AE2DBD00DBE4CD /* AttachmentLoader.cpp in Sources */, - 04DBD49B22AE2DBD00DBE4CD /* EventData.cpp in Sources */, 4693039A2046AE05004A3D6C /* Utils.cpp in Sources */, - 046B689021A00F5600B33469 /* IOTypedArray.cpp in Sources */, - 046E06162185B37100B24E2D /* CCSlot.cpp in Sources */, - 04DBD41D22AE2DBD00DBE4CD /* TextureLoader.cpp in Sources */, - 04DBD4AF22AE2DBD00DBE4CD /* MeshAttachment.cpp in Sources */, 1A52DB882060B11800350EE3 /* jsb_platfrom_apple.mm in Sources */, - 04DBD3E522AE2DBD00DBE4CD /* PointAttachment.cpp in Sources */, - 046E06372185B41100B24E2D /* AnimationState.cpp in Sources */, - 046E06BF2185B49F00B24E2D /* BoundingBoxData.cpp in Sources */, 4617864720522469008256E1 /* CCDownloaderImpl-apple.mm in Sources */, - 426947B9234ED0130044C66E /* SimpleSprite3D.cpp in Sources */, 1A52DB24205BCD9200350EE3 /* ObjectWrap.cpp in Sources */, - 04DBD3ED22AE2DBD00DBE4CD /* Timeline.cpp in Sources */, + BA06A80B23583DFE007740C5 /* GLES3RenderPass.cc in Sources */, 1AAAC8F1205CB6E9005321B9 /* AudioEngine.cpp in Sources */, - 046E06F72189990700B24E2D /* middleware-adapter.cpp in Sources */, - 46FDDAE5202ACC6B00931238 /* IndexBuffer.cpp in Sources */, - 0431A06F22CCA7C1003356C9 /* SimpleSprite2D.cpp in Sources */, - 046B688A219FA61200B33469 /* MiddlewareManager.cpp in Sources */, + BA06A78123583DFE007740C5 /* GLES2CommandAllocator.cc in Sources */, 1A29D76F205665D200168D9A /* jsb_cocos2dx_manual.cpp in Sources */, - 04DBD4CD22AE2DBD00DBE4CD /* ClippingAttachment.cpp in Sources */, - 0482F1AB228D87970019ECF7 /* AssemblerBase.cpp in Sources */, 50ABC00D1926664800A911A9 /* CCFileUtils.cpp in Sources */, 46FDDBA3202ADDCE00931238 /* pvr.cpp in Sources */, - 04DBD42522AE2DBD00DBE4CD /* PathConstraint.cpp in Sources */, 46FDDBE3202ADDCE00931238 /* CCData.cpp in Sources */, + BA06A77523583DFE007740C5 /* GLES2Framebuffer.cc in Sources */, + BA06A6E423583DBD007740C5 /* GFXPipelineState.cc in Sources */, 1A52DB3E205BCD9200350EE3 /* Class.cpp in Sources */, + BA06A7BF23583DFE007740C5 /* GLStd.cpp in Sources */, 1A52DB2E205BCD9200350EE3 /* Object.cpp in Sources */, - 046E06972185B45300B24E2D /* Transform.cpp in Sources */, 1A52DB6C205BCDC700350EE3 /* Object.cpp in Sources */, - 046E069B2185B45300B24E2D /* Point.cpp in Sources */, - 046E06E92185B4A500B24E2D /* JSONDataParser.cpp in Sources */, - 04AF62FF219190ED00AED9DE /* TypedArrayPool.cpp in Sources */, 1A28FF731F20AFAB007A1D9D /* SRHash.m in Sources */, - 46FDDAB3202ACC6A00931238 /* VertexBuffer.cpp in Sources */, - 046E06722185B42500B24E2D /* BaseObject.cpp in Sources */, 4008729420CE20C2002EB77B /* jsb_cocos2dx_network_manual.cpp in Sources */, 469303842046AE05004A3D6C /* MappingUtils.cpp in Sources */, 4617865F2052607E008256E1 /* jsb_xmlhttprequest.cpp in Sources */, - 04DBD31922AE2D8200DBE4CD /* AttachmentVertices.cpp in Sources */, + BA06A6D223583DBD007740C5 /* GFXSampler.cc in Sources */, BA21055821008B6600E19975 /* jsb_cocos2dx_extension_auto.cpp in Sources */, - 04DBD43F22AE2DBD00DBE4CD /* DrawOrderTimeline.cpp in Sources */, 469304082046AE06004A3D6C /* jsb_global.cpp in Sources */, - 046E066C2185B41B00B24E2D /* Slot.cpp in Sources */, 50ABC0151926664800A911A9 /* CCImage.cpp in Sources */, - 046E06D12185B49F00B24E2D /* DisplayData.cpp in Sources */, + BA06A76723583DFE007740C5 /* GLES2Device.cc in Sources */, 46AE400B2092F3A600F3A228 /* env.cc in Sources */, - 46FDDAD3202ACC6A00931238 /* Texture2D.cpp in Sources */, - 04DBD4B722AE2DBD00DBE4CD /* SkeletonBounds.cpp in Sources */, + BA06A7CF23583DFE007740C5 /* GLES3Sampler.cc in Sources */, + BA06A6E023583DBD007740C5 /* GFXCommandAllocator.cc in Sources */, + BA06A6C423583DBD007740C5 /* GFXFramebuffer.cc in Sources */, 46FDDB6F202ADDCE00931238 /* ZipUtils.cpp in Sources */, - 04DBD31B22AE2D8200DBE4CD /* SkeletonAnimation.cpp in Sources */, - 04DBD43B22AE2DBD00DBE4CD /* TransformConstraint.cpp in Sources */, 1A28FF871F20AFAB007A1D9D /* SRSIMDHelpers.m in Sources */, - 046B68AE21A294B100B33469 /* jsb_cocos2dx_spine_auto.cpp in Sources */, - 04DBD40722AE2DBD00DBE4CD /* SkeletonClipping.cpp in Sources */, + BA06A67623583DBD007740C5 /* NedPooling.cc in Sources */, 50ABBD601925AB0000A911A9 /* Vec4.cpp in Sources */, - 04DBD32122AE2D8200DBE4CD /* VertexEffectDelegate.cpp in Sources */, - 04DBD40D22AE2DBD00DBE4CD /* VertexAttachment.cpp in Sources */, - 46FDDA93202ACC6A00931238 /* Technique.cpp in Sources */, 46FDDBFD202ADDCE00931238 /* CCValue.cpp in Sources */, + BA06A7F523583DFE007740C5 /* GLES3Texture.cc in Sources */, + BA06A7C123583DFE007740C5 /* MetalStd.mm in Sources */, + BA06A77323583DFE007740C5 /* GLES2Texture.cc in Sources */, ED3057A11BEC77D50083C3ED /* xxhash.c in Sources */, - 46FDDA6F202ACC6A00931238 /* Pass.cpp in Sources */, 4617863520522469008256E1 /* HttpAsynConnection-apple.m in Sources */, + BA06A69423583DBD007740C5 /* CoreStd.cc in Sources */, 4DCEC128233238110020F8E3 /* etc2.cpp in Sources */, 461786612052607E008256E1 /* jsb_socketio.cpp in Sources */, 1A28FF8B1F20AFAB007A1D9D /* SRURLUtilities.m in Sources */, - 04DBD3CB22AE2DBD00DBE4CD /* Atlas.cpp in Sources */, ED3057881BEC773E0083C3ED /* tinyxml2.cpp in Sources */, - 46FDDA95202ACC6A00931238 /* RendererUtils.cpp in Sources */, 1A28FF9D1F20AFAB007A1D9D /* SRWebSocket.m in Sources */, 46FDDB8F202ADDCE00931238 /* ccUtils.cpp in Sources */, - 046E06FD2189999600B24E2D /* jsb_cocos2dx_editor_support_auto.cpp in Sources */, - 04DBD46922AE2DBD00DBE4CD /* ShearTimeline.cpp in Sources */, - 046E065C2185B41B00B24E2D /* Constraint.cpp in Sources */, 1A29D796205666F500168D9A /* jsb_opengl_utils.cpp in Sources */, BA21055A21009A2600E19975 /* AssetsManagerEx.cpp in Sources */, - 046E06742185B42500B24E2D /* DragonBones.cpp in Sources */, BA21055B21009A2900E19975 /* CCEventAssetsManagerEx.cpp in Sources */, - 046E06822185B43B00B24E2D /* EventObject.cpp in Sources */, - 046B68A621A292D300B33469 /* jsb_spine_manual.cpp in Sources */, + BA06A77923583DFE007740C5 /* GLES2InputAssembler.cc in Sources */, BA21055C21009A2C00E19975 /* Manifest.cpp in Sources */, - 049B32072314DF1C0004909A /* SkeletonCache.cpp in Sources */, - 04DBD41B22AE2DBD00DBE4CD /* SlotData.cpp in Sources */, - 046E06392185B41100B24E2D /* WorldClock.cpp in Sources */, 1A28FF931F20AFAB007A1D9D /* NSURLRequest+SRWebSocket.m in Sources */, - 427475F923214E2A00139DF8 /* MeshAssembler.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4820,326 +3526,224 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 0482F1B8228D87970019ECF7 /* StencilManager.cpp in Sources */, - 423379A422BB8DEA00E5D8A2 /* CustomProperties.cpp in Sources */, - 04DBD41222AE2DBD00DBE4CD /* Constraint.cpp in Sources */, + BA06A6F123583DBD007740C5 /* Assertion.cc in Sources */, ED30578D1BEC77550083C3ED /* unzip.cpp in Sources */, - 46FDDA9E202ACC6A00931238 /* BaseRenderer.cpp in Sources */, - 426947C0234ED02E0044C66E /* SlicedSprite3D.cpp in Sources */, 1A586C462064C90500B47573 /* EJConvertTypedArray.m in Sources */, - 46FDDAC6202ACC6A00931238 /* RenderTarget.cpp in Sources */, 4617864820522469008256E1 /* CCDownloaderImpl-apple.mm in Sources */, - 046E066D2185B41B00B24E2D /* Slot.cpp in Sources */, + BA06A68123583DBD007740C5 /* AllocatedObj.cc in Sources */, 1A28FF601F20AFAB007A1D9D /* SRProxyConnect.m in Sources */, - 049B320E231533BF0004909A /* SkeletonCacheAnimation.cpp in Sources */, - 04F8563522ABCB9900063A20 /* TiledMapAssembler.cpp in Sources */, 1A28FF901F20AFAB007A1D9D /* NSRunLoop+SRWebSocket.m in Sources */, - 046E06C42185B49F00B24E2D /* ArmatureData.cpp in Sources */, + BA06A69523583DBD007740C5 /* CoreStd.cc in Sources */, + BA06A80C23583DFE007740C5 /* GLES3RenderPass.cc in Sources */, 50ABC0161926664800A911A9 /* CCImage.cpp in Sources */, + BA06A7C223583DFE007740C5 /* MetalStd.mm in Sources */, + BA06A79623583DFE007740C5 /* GLES2PipelineState.cc in Sources */, + BA06A79223583DFE007740C5 /* GLES2Queue.cc in Sources */, + BA06A7CE23583DFE007740C5 /* GLES3InputAssembler.cc in Sources */, 425D3FF222D86BEF00BCED11 /* Mat3.cpp in Sources */, - 04DBD40E22AE2DBD00DBE4CD /* VertexAttachment.cpp in Sources */, - 426947BA234ED0130044C66E /* SimpleSprite3D.cpp in Sources */, 469303852046AE05004A3D6C /* MappingUtils.cpp in Sources */, - 0431A06A22CCA441003356C9 /* AssemblerSprite.cpp in Sources */, - 046E06F02185B4A500B24E2D /* BinaryDataParser.cpp in Sources */, + BA06A6D923583DBD007740C5 /* GFXTexture.cc in Sources */, 46FDDBA4202ADDCE00931238 /* pvr.cpp in Sources */, - 46FDDAB6202ACC6A00931238 /* Program.cpp in Sources */, - 04DBD43022AE2DBD00DBE4CD /* Json.cpp in Sources */, - 46FDDAC2202ACC6A00931238 /* Texture.cpp in Sources */, 50ABC01A1926664800A911A9 /* CCSAXParser.cpp in Sources */, - 0482F19C228D87970019ECF7 /* ModelBatcher.cpp in Sources */, 4693039B2046AE05004A3D6C /* Utils.cpp in Sources */, - 046E06982185B45300B24E2D /* Transform.cpp in Sources */, - 04DBD3D822AE2DBD00DBE4CD /* PathAttachment.cpp in Sources */, 503DD8EE1926736A00CD74DD /* CCImage-ios.mm in Sources */, - 04DBD41422AE2DBD00DBE4CD /* Triangulator.cpp in Sources */, - 046B68AF21A294B100B33469 /* jsb_cocos2dx_spine_auto.cpp in Sources */, - 04DBD3E622AE2DBD00DBE4CD /* PointAttachment.cpp in Sources */, - 04FB24102328D42A0021DD02 /* ArmatureCache.cpp in Sources */, + BA06A7EE23583DFE007740C5 /* GLES3Commands.cc in Sources */, ED30578B1BEC774D0083C3ED /* ioapi_mem.cpp in Sources */, 1A28FF9A1F20AFAB007A1D9D /* SRSecurityPolicy.m in Sources */, - 04DBD42022AE2DBD00DBE4CD /* Animation.cpp in Sources */, + BA06A7D223583DFE007740C5 /* gles3w.mm in Sources */, 1A28FF581F20AFAB007A1D9D /* SRIOConsumerPool.m in Sources */, - 04DBD44822AE2DBD00DBE4CD /* Skeleton.cpp in Sources */, - 049B31FC2313B6240004909A /* SkeletonCacheMgr.cpp in Sources */, - 469303C72046AE05004A3D6C /* jsb_gfx_auto.cpp in Sources */, + BA06A69323583DBD007740C5 /* StringUtil.cc in Sources */, 46AE3FF22092F3A600F3A228 /* SHA1.cpp in Sources */, - 04DBD3C422AE2DBD00DBE4CD /* VertexEffect.cpp in Sources */, + BA06A67B23583DBD007740C5 /* MemTracker.cc in Sources */, ED30579E1BEC77BD0083C3ED /* ConvertUTFWrapper.cpp in Sources */, - 046E06892185B44A00B24E2D /* BaseFactory.cpp in Sources */, - 04DBD44022AE2DBD00DBE4CD /* DrawOrderTimeline.cpp in Sources */, 1A28FF801F20AFAB007A1D9D /* SRMutex.m in Sources */, - 046E06FE2189999600B24E2D /* jsb_cocos2dx_editor_support_auto.cpp in Sources */, 46AE400C2092F3A600F3A228 /* env.cc in Sources */, 46FDDC69202D733800931238 /* CCApplication-ios.mm in Sources */, ED3057C21BEC78A80083C3ED /* xxhash.c in Sources */, 4037F5CF2108751E001C205C /* CCAsyncTaskPool.cpp in Sources */, ED30578C1BEC77510083C3ED /* ioapi.cpp in Sources */, - 046E06362185B41100B24E2D /* TimelineState.cpp in Sources */, 4617866C2052609B008256E1 /* jsb_cocos2dx_network_auto.cpp in Sources */, - 046E06C02185B49F00B24E2D /* BoundingBoxData.cpp in Sources */, + BA06A7D823583DFE007740C5 /* GLES3Device.cc in Sources */, + BA06A78C23583DFE007740C5 /* GLES2Shader.cc in Sources */, + BA06A6C323583DBD007740C5 /* GFXBuffer.cc in Sources */, 1AAAC8F2205CB6E9005321B9 /* AudioEngine.cpp in Sources */, - 46FDDAE4202ACC6B00931238 /* GFX.cpp in Sources */, - 045F672922A50A8D0033F7BD /* RenderData.cpp in Sources */, + BA06A7F223583DFE007740C5 /* GLES3Window.cc in Sources */, + BA06A81E23583DFE007740C5 /* GLES3Buffer.cc in Sources */, 4693038D2046AE05004A3D6C /* config.cpp in Sources */, + BA06A78623583DFE007740C5 /* GLES2Window.cc in Sources */, 40AEF7C2216DF22900729AA5 /* jsb_video_auto.cpp in Sources */, ED30578A1BEC77460083C3ED /* tinyxml2.cpp in Sources */, - 04DBD4C222AE2DBD00DBE4CD /* Updatable.cpp in Sources */, - 04DBD4E222B51EB300DBE4CD /* NodeMemPool.cpp in Sources */, + BA06A7C023583DFE007740C5 /* GLStd.cpp in Sources */, 1A29D76A205665BE00168D9A /* jsb_cocos2dx_auto.cpp in Sources */, + BA06A6F523583DBD007740C5 /* Log.cc in Sources */, 46FDDBFC202ADDCE00931238 /* ccCArray.cpp in Sources */, + BA06A6CD23583DBD007740C5 /* GFXInputAssembler.cc in Sources */, 468A968322F43F5A005034BE /* Utils.cpp in Sources */, - 04DBD45422AE2DBD00DBE4CD /* TransformConstraintTimeline.cpp in Sources */, - 04355817217EADF300B9C056 /* IOBuffer.cpp in Sources */, - 04DBD49C22AE2DBD00DBE4CD /* EventData.cpp in Sources */, + BA06A7D423583DFE007740C5 /* GLES3EGLContext.cc in Sources */, + BA06A6BF23583DBD007740C5 /* GFXDevice.cc in Sources */, + BA06A6D323583DBD007740C5 /* GFXSampler.cc in Sources */, + BA06A7D623583DFE007740C5 /* GLES3TextureView.cc in Sources */, 46FDDB7C202ADDCE00931238 /* CCRef.cpp in Sources */, - 046E06F82189990700B24E2D /* middleware-adapter.cpp in Sources */, - 04DBD4AC22AE2DBD00DBE4CD /* Slot.cpp in Sources */, - 04DBD4A422AE2DBD00DBE4CD /* AttachmentLoader.cpp in Sources */, 4DCEC126233236D60020F8E3 /* etc2.cpp in Sources */, - 046E070A218B015100B24E2D /* jsb_cocos2dx_dragonbones_auto.cpp in Sources */, - 04DBD46C22AE2DBD00DBE4CD /* AttachmentTimeline.cpp in Sources */, 469301D2203FC696004A3D6C /* CCConfiguration.cpp in Sources */, 461DCA5920C7E4BA00B22827 /* JavaScriptObjCBridge.mm in Sources */, - 46FDDAB2202ACC6A00931238 /* DeviceGraphics.cpp in Sources */, - 04DBD4A022AE2DBD00DBE4CD /* ColorTimeline.cpp in Sources */, + BA06A81423583DFE007740C5 /* GLES3BindingLayout.cc in Sources */, 46FDDBFA202ADDCE00931238 /* etc1.cpp in Sources */, - 04DBD32622AE2D8200DBE4CD /* SkeletonRenderer.cpp in Sources */, - 46FDDA88202ACC6A00931238 /* View.cpp in Sources */, - 046E06322185B41100B24E2D /* BaseTimelineState.cpp in Sources */, 50ABBD591925AB0000A911A9 /* Vec2.cpp in Sources */, 1A28FF681F20AFAB007A1D9D /* SRPinningSecurityPolicy.m in Sources */, - 04DBD47E22AE2DBD00DBE4CD /* DeformTimeline.cpp in Sources */, - 04DBD3EE22AE2DBD00DBE4CD /* Timeline.cpp in Sources */, + BA06A6B523583DBD007740C5 /* GFXTextureView.cc in Sources */, + BA06A6AB23583DBD007740C5 /* GFXPipelineLayout.cc in Sources */, 1A28FF9E1F20AFAB007A1D9D /* SRWebSocket.m in Sources */, - 046E06592185B41B00B24E2D /* Armature.cpp in Sources */, 403ACADC20CE542600BB433D /* jsb_module_register.cpp in Sources */, - 046E06BC2185B49F00B24E2D /* TextureAtlasData.cpp in Sources */, - 04DBD42622AE2DBD00DBE4CD /* PathConstraint.cpp in Sources */, - 04ED68D921F8188F006E82F8 /* MeshBuffer.cpp in Sources */, - 46FDDA9A202ACC6A00931238 /* Model.cpp in Sources */, - 046E0710218B01EF00B24E2D /* jsb_dragonbones_manual.cpp in Sources */, + BA06A7B423583DFE007740C5 /* GLES2Buffer.cc in Sources */, + BA06A80023583DFE007740C5 /* GLES3CommandAllocator.cc in Sources */, 4693038F2046AE05004A3D6C /* Value.cpp in Sources */, 469303A12046AE05004A3D6C /* ScriptEngine.mm in Sources */, - 046E06EA2185B4A500B24E2D /* JSONDataParser.cpp in Sources */, - 04DBD42C22AE2DBD00DBE4CD /* IkConstraintData.cpp in Sources */, - 046B688B219FA61200B33469 /* MiddlewareManager.cpp in Sources */, + BA06A79E23583DFE007740C5 /* GLES2BindingLayout.cc in Sources */, 46FDDB8C202ADDCE00931238 /* CCAutoreleasePool.cpp in Sources */, 461786622052607E008256E1 /* jsb_socketio.cpp in Sources */, 4693039F2046AE05004A3D6C /* Object.mm in Sources */, - 46FDDABA202ACC6A00931238 /* FrameBuffer.cpp in Sources */, 461786562052301A008256E1 /* CCScheduler.cpp in Sources */, - 46FDDAE6202ACC6B00931238 /* IndexBuffer.cpp in Sources */, 46FDDB8E202ADDCE00931238 /* ccTypes.cpp in Sources */, + BA06A7D023583DFE007740C5 /* GLES3Sampler.cc in Sources */, + BA06A7C823583DFE007740C5 /* MTLbuffer.mm in Sources */, 50ABBD4D1925AB0000A911A9 /* MathUtil.cpp in Sources */, 46AE40082092F3A600F3A228 /* node_debug_options.cc in Sources */, - 04DBD41A22AE2DBD00DBE4CD /* IkConstraint.cpp in Sources */, - 046E06572185B41B00B24E2D /* TransformObject.cpp in Sources */, 1A52DB75205BCDD000350EE3 /* Class.cpp in Sources */, - 04DBD3E022AE2DBD00DBE4CD /* RotateTimeline.cpp in Sources */, 1AAAC8E4205CB6E9005321B9 /* AudioDecoder.mm in Sources */, 46FDDB90202ADDCE00931238 /* ccUtils.cpp in Sources */, 50ABC00E1926664800A911A9 /* CCFileUtils.cpp in Sources */, - 46FDDA94202ACC6A00931238 /* Technique.cpp in Sources */, - 46FDDA72202ACC6A00931238 /* Scene.cpp in Sources */, - 046E06732185B42500B24E2D /* BaseObject.cpp in Sources */, - 046B689121A00F5600B33469 /* IOTypedArray.cpp in Sources */, - 04886B4222CE22F2008CEB66 /* SlicedSprite2D.cpp in Sources */, - 046E06D22185B49F00B24E2D /* DisplayData.cpp in Sources */, 1A52DB7D205BCDD000350EE3 /* Utils.cpp in Sources */, 1A29D770205665D200168D9A /* jsb_cocos2dx_manual.cpp in Sources */, 46AE3FF02092F3A600F3A228 /* inspector_agent.cc in Sources */, + BA06A6DD23583DBD007740C5 /* GFXBindingLayout.cc in Sources */, 1A52DAF9205BB81400350EE3 /* CCThreadPool.cpp in Sources */, 4617864A20522469008256E1 /* CCDownloader.cpp in Sources */, - 46FDDAD6202ACC6A00931238 /* GraphicsHandle.cpp in Sources */, - 046E063A2185B41100B24E2D /* WorldClock.cpp in Sources */, 50ABBD611925AB0000A911A9 /* Vec4.cpp in Sources */, 46FDDB9A202ADDCE00931238 /* ccUTF8.cpp in Sources */, 469304092046AE06004A3D6C /* jsb_global.cpp in Sources */, - 46FDDA70202ACC6A00931238 /* Pass.cpp in Sources */, - 04DBD3CA22AE2DBD00DBE4CD /* AtlasAttachmentLoader.cpp in Sources */, 1A52DB7A205BCDD000350EE3 /* ScriptEngine.cpp in Sources */, - 042058CE22A61B340092DE5D /* RenderDataList.cpp in Sources */, + BA06A7A423583DFE007740C5 /* GLES2Commands.cc in Sources */, 1A14FD922080B4E300E10ABE /* CCGLUtils.cpp in Sources */, - 04DBD43822AE2DBD00DBE4CD /* TranslateTimeline.cpp in Sources */, 1A28FF741F20AFAB007A1D9D /* SRHash.m in Sources */, + BA06A7A223583DFE007740C5 /* gles2w.c in Sources */, 46FDDB70202ADDCE00931238 /* ZipUtils.cpp in Sources */, 50ABBD511925AB0000A911A9 /* Quaternion.cpp in Sources */, + BA06A77A23583DFE007740C5 /* GLES2InputAssembler.cc in Sources */, + BA06A77223583DFE007740C5 /* GLES2EGLContext.cc in Sources */, 46930469204FE20F004A3D6C /* CCLog.cpp in Sources */, - 04DBD41622AE2DBD00DBE4CD /* MathUtil.cpp in Sources */, + BA06A6C723583DBD007740C5 /* GFXCommandBuffer.cc in Sources */, + BA06A6A723583DBD007740C5 /* GFXWindow.cc in Sources */, 1AAAC874205CB647005321B9 /* jsb_cocos2dx_audioengine_auto.cpp in Sources */, + BA06A6E923583DBD007740C5 /* UTFString.cc in Sources */, 50ABBD491925AB0000A911A9 /* Mat4.cpp in Sources */, - 04DBD47022AE2DBD00DBE4CD /* TransformConstraintData.cpp in Sources */, 469303672046AE05004A3D6C /* HandleObject.cpp in Sources */, - 46FDDACA202ACC6A00931238 /* RenderBuffer.cpp in Sources */, - 04DBD32222AE2D8200DBE4CD /* VertexEffectDelegate.cpp in Sources */, 461DCA3B20BBFCA300B22827 /* EditBox-ios.mm in Sources */, + BA06A67723583DBD007740C5 /* NedPooling.cc in Sources */, 1A52DB78205BCDD000350EE3 /* Object.cpp in Sources */, 469303A72046AE05004A3D6C /* PlatformUtils.mm in Sources */, - 046E069C2185B45300B24E2D /* Point.cpp in Sources */, - 046E06DE2185B49F00B24E2D /* AnimationData.cpp in Sources */, - 46FDDAD4202ACC6A00931238 /* Texture2D.cpp in Sources */, - 04DBD4A622AE2DBD00DBE4CD /* LinkedMesh.cpp in Sources */, 40FF7AA1216B29CC00E73029 /* VideoPlayer-ios.mm in Sources */, - 046E06212185B37100B24E2D /* CCArmatureDisplay.cpp in Sources */, - 04DBD4CE22AE2DBD00DBE4CD /* ClippingAttachment.cpp in Sources */, + BA06A6E523583DBD007740C5 /* GFXPipelineState.cc in Sources */, + BA06A76023583DFE007740C5 /* gles2w.mm in Sources */, + BA06A7A823583DFE007740C5 /* GLES2PipelineLayout.cc in Sources */, 40CEAEB620CFDC28007A3281 /* CCReachability.cpp in Sources */, - 046E06BA2185B49F00B24E2D /* ConstraintData.cpp in Sources */, - 04DBD4DC22B51EA300DBE4CD /* MemPool.cpp in Sources */, - 046E06832185B43B00B24E2D /* EventObject.cpp in Sources */, 468A967F22F43F4C005034BE /* Class.cpp in Sources */, - 46FDDA8C202ACC6A00931238 /* ForwardRenderer.cpp in Sources */, - 04DBD41C22AE2DBD00DBE4CD /* SlotData.cpp in Sources */, - 427475FA23214E2A00139DF8 /* MeshAssembler.cpp in Sources */, ED30579D1BEC77B90083C3ED /* ConvertUTF.c in Sources */, 46AE3FE22092F3A600F3A228 /* node.cc in Sources */, 4617864D205224CC008256E1 /* WebSocket-apple.mm in Sources */, 1AAAC8E2205CB6E9005321B9 /* AudioPlayer.mm in Sources */, 468A968222F43F55005034BE /* ScriptEngine.cpp in Sources */, - 046E06752185B42500B24E2D /* DragonBones.cpp in Sources */, 469304132046AE06004A3D6C /* jsb_classtype.cpp in Sources */, - 46FDDAA4202ACC6A00931238 /* InputAssembler.cpp in Sources */, + BA06A76823583DFE007740C5 /* GLES2Device.cc in Sources */, 1A28FF941F20AFAB007A1D9D /* NSURLRequest+SRWebSocket.m in Sources */, - 04FB24142328D42A0021DD02 /* CCArmatureCacheDisplay.cpp in Sources */, 4693042F2046AE06004A3D6C /* jsb_helper.cpp in Sources */, - 046E065B2185B41B00B24E2D /* DeformVertices.cpp in Sources */, - 4693043D2046AE06004A3D6C /* jsb_gfx_manual.cpp in Sources */, - 04DBD32A22AE2D8200DBE4CD /* spine-cocos2dx.cpp in Sources */, 46FDDBFE202ADDCE00931238 /* CCValue.cpp in Sources */, + BA06A77C23583DFE007740C5 /* GLES2Sampler.cc in Sources */, 1A28FF7C1F20AFAB007A1D9D /* SRLog.m in Sources */, 1A28FF641F20AFAB007A1D9D /* SRRunLoopThread.m in Sources */, + BA06A6CB23583DBD007740C5 /* GFXRenderPass.cc in Sources */, 1A28FF6C1F20AFAB007A1D9D /* SRConstants.m in Sources */, - 04DBD42222AE2DBD00DBE4CD /* SkeletonData.cpp in Sources */, - 4693042D2046AE06004A3D6C /* jsb_renderer_manual.cpp in Sources */, + BA06A78423583DFE007740C5 /* GLES2Std.cc in Sources */, 1AAAC8E8205CB6E9005321B9 /* AudioEngine-inl.mm in Sources */, 4617862220522469008256E1 /* HttpCookie.cpp in Sources */, - 46FDDAE2202ACC6A00931238 /* GFXUtils.cpp in Sources */, 1A586C4C2064C97800B47573 /* EJConvert.m in Sources */, 469304272046AE06004A3D6C /* jsb_conversions.cpp in Sources */, - 04DBD48622AE2DBD00DBE4CD /* EventTimeline.cpp in Sources */, - 0482F1AC228D87970019ECF7 /* AssemblerBase.cpp in Sources */, 46AE40042092F3A600F3A228 /* http_parser.c in Sources */, - 04DBD48C22AE2DBD00DBE4CD /* CurveTimeline.cpp in Sources */, - 046E06EC2185B4A500B24E2D /* DataParser.cpp in Sources */, - 46FDDA7A202ACC6A00931238 /* Camera.cpp in Sources */, - 04DBD4B622AE2DBD00DBE4CD /* RTTI.cpp in Sources */, 461786602052607E008256E1 /* jsb_xmlhttprequest.cpp in Sources */, - 04DBD3F022AE2DBD00DBE4CD /* Extension.cpp in Sources */, - 46FDDAA0202ACC6A00931238 /* ProgramLib.cpp in Sources */, 4617863420522469008256E1 /* Uri.cpp in Sources */, 4008729520CE20C2002EB77B /* jsb_cocos2dx_network_manual.cpp in Sources */, - 04DBD4AE22AE2DBD00DBE4CD /* BoundingBoxAttachment.cpp in Sources */, - 046E06442185B41100B24E2D /* Animation.cpp in Sources */, + BA06A68B23583DBD007740C5 /* Memory.cc in Sources */, 468A968122F43F53005034BE /* ObjectWrap.cpp in Sources */, 50ABBD3D1925AB0000A911A9 /* CCGeometry.cpp in Sources */, - 046E06CA2185B49F00B24E2D /* UserData.cpp in Sources */, - 0494CFD522BEFC6D00B73B79 /* ParallelTask.cpp in Sources */, 1A28FF8C1F20AFAB007A1D9D /* SRURLUtilities.m in Sources */, - 0482F1B4228D87970019ECF7 /* MaskAssembler.cpp in Sources */, - 04DBD45222AE2DBD00DBE4CD /* AnimationStateData.cpp in Sources */, - 04DBD40822AE2DBD00DBE4CD /* SkeletonClipping.cpp in Sources */, 1A28FF541F20AFAB007A1D9D /* SRIOConsumer.m in Sources */, - 046B68A721A292D300B33469 /* jsb_spine_manual.cpp in Sources */, + BA06A81A23583DFE007740C5 /* GLES3PipelineState.cc in Sources */, + BA06A6C523583DBD007740C5 /* GFXFramebuffer.cc in Sources */, + BA06A81023583DFE007740C5 /* GLES3Framebuffer.cc in Sources */, 469303692046AE05004A3D6C /* State.cpp in Sources */, - 0482F1BE228D87970019ECF7 /* CustomAssembler.cpp in Sources */, - 04DBD45E22AE2DBD00DBE4CD /* SkeletonBinary.cpp in Sources */, - 04DBD46E22AE2DBD00DBE4CD /* ScaleTimeline.cpp in Sources */, - 0431A07022CCA7C1003356C9 /* SimpleSprite2D.cpp in Sources */, - 04DBD49E22AE2DBD00DBE4CD /* SkeletonJson.cpp in Sources */, - 0482F1A0228D87970019ECF7 /* Assembler.cpp in Sources */, - 46FDDAAA202ACC6A00931238 /* Types.cpp in Sources */, - 04DBD44622AE2DBD00DBE4CD /* AnimationState.cpp in Sources */, 1A29D797205666F500168D9A /* jsb_opengl_utils.cpp in Sources */, - 04FB240E2328D42A0021DD02 /* ArmatureCacheMgr.cpp in Sources */, - 04DBD4BC22AE2DBD00DBE4CD /* PathConstraintPositionTimeline.cpp in Sources */, - 046E06E22185B49F00B24E2D /* DragonBonesData.cpp in Sources */, - 04DBD4B822AE2DBD00DBE4CD /* SkeletonBounds.cpp in Sources */, + BA06A78223583DFE007740C5 /* GLES2CommandAllocator.cc in Sources */, + BA06A7F823583DFE007740C5 /* GLES3Shader.cc in Sources */, 40AEF7B6216D982600729AA5 /* jsb_webview_auto.cpp in Sources */, + BA06A69723583DBD007740C5 /* CCMath.cc in Sources */, 5027253D190BF1B900AAF4ED /* cocos2d.cpp in Sources */, + BA06A80223583DFE007740C5 /* GLES3PipelineLayout.cc in Sources */, 1A28FF781F20AFAB007A1D9D /* SRHTTPConnectMessage.m in Sources */, - 046E06C62185B49F00B24E2D /* AnimationConfig.cpp in Sources */, 1A28FF881F20AFAB007A1D9D /* SRSIMDHelpers.m in Sources */, - 04DBD4B022AE2DBD00DBE4CD /* MeshAttachment.cpp in Sources */, - 04DBD31A22AE2D8200DBE4CD /* AttachmentVertices.cpp in Sources */, 50ABBD451925AB0000A911A9 /* CCVertex.cpp in Sources */, - 04DBD41E22AE2DBD00DBE4CD /* TextureLoader.cpp in Sources */, + BA06A6BB23583DBD007740C5 /* GFXDef.cc in Sources */, 294D7D9D1D0E93A2002CE7B7 /* CCDevice-apple.mm in Sources */, - 469303BF2046AE05004A3D6C /* jsb_renderer_auto.cpp in Sources */, 4617864F205224D6008256E1 /* HttpAsynConnection-apple.m in Sources */, + BA06A82023583DFE007740C5 /* gles3w.c in Sources */, BA21055921008B6600E19975 /* jsb_cocos2dx_extension_auto.cpp in Sources */, + BA06A77423583DFE007740C5 /* GLES2Texture.cc in Sources */, + BA06A80423583DFE007740C5 /* GLES3CommandBuffer.cc in Sources */, + BA06A6DF23583DBD007740C5 /* GFXQueue.cc in Sources */, + BA06A79823583DFE007740C5 /* GLES2RenderPass.cc in Sources */, 1A52DB8E2060DEF500350EE3 /* jsb_platfrom_apple.mm in Sources */, 503DD8E71926736A00CD74DD /* CCEAGLView-ios.mm in Sources */, 1A29D785205666B200168D9A /* LocalStorage.cpp in Sources */, - 04DBD3CC22AE2DBD00DBE4CD /* Atlas.cpp in Sources */, 46AE3FEA2092F3A600F3A228 /* inspector_socket_server.cc in Sources */, - 46FDDA8A202ACC6A00931238 /* Effect.cpp in Sources */, - 046E06382185B41100B24E2D /* AnimationState.cpp in Sources */, - 04DBD3CE22AE2DBD00DBE4CD /* Bone.cpp in Sources */, - 04DBD43C22AE2DBD00DBE4CD /* TransformConstraint.cpp in Sources */, 4617861A20522469008256E1 /* SocketIO.cpp in Sources */, - 0482F1A2228D87970019ECF7 /* NodeProxy.cpp in Sources */, 46FDDB72202ADDCE00931238 /* base64.cpp in Sources */, - 46FDDA7E202ACC6A00931238 /* Light.cpp in Sources */, - 04DBD46A22AE2DBD00DBE4CD /* ShearTimeline.cpp in Sources */, - 0482F1A6228D87970019ECF7 /* MeshBuffer.cpp in Sources */, 469303AB2046AE05004A3D6C /* Class.cpp in Sources */, - 046E065D2185B41B00B24E2D /* Constraint.cpp in Sources */, - 04DBD32822AE2D8200DBE4CD /* SkeletonDataMgr.cpp in Sources */, - 046E06672185B41B00B24E2D /* Bone.cpp in Sources */, 1ABAD24F20C29F3800BC71C0 /* CCCanvasRenderingContext2D-apple.mm in Sources */, + BA06A7B623583DFE007740C5 /* GLES2TextureView.cc in Sources */, 46AE3FFA2092F3A600F3A228 /* inspector_socket.cc in Sources */, 1AAAC8EC205CB6E9005321B9 /* AudioCache.mm in Sources */, 46FDDBE4202ADDCE00931238 /* CCData.cpp in Sources */, 469304592046AE06004A3D6C /* EventDispatcher.cpp in Sources */, - 049B32082314DF1C0004909A /* SkeletonCache.cpp in Sources */, - 46FDDAB4202ACC6A00931238 /* VertexBuffer.cpp in Sources */, 4617864E205224CF008256E1 /* HttpClient-apple.mm in Sources */, - 04DBD43422AE2DBD00DBE4CD /* Skin.cpp in Sources */, + BA06A7B823583DFE007740C5 /* GLES2CommandBuffer.cc in Sources */, 40AEF7AF216D940200729AA5 /* WebViewImpl-ios.mm in Sources */, 46FDDB94202ADDCE00931238 /* TGAlib.cpp in Sources */, 46FDDB66202ADDCE00931238 /* ccRandom.cpp in Sources */, - 04DBD41822AE2DBD00DBE4CD /* BoneData.cpp in Sources */, 1A28FF841F20AFAB007A1D9D /* SRRandom.m in Sources */, - 46FDDA96202ACC6A00931238 /* RendererUtils.cpp in Sources */, - 046E06232185B37100B24E2D /* CCTextureAtlasData.cpp in Sources */, - 04DBD3F822AE2DBD00DBE4CD /* PathConstraintMixTimeline.cpp in Sources */, - 04AF6300219190ED00AED9DE /* TypedArrayPool.cpp in Sources */, - 046E06CE2185B49F00B24E2D /* CanvasData.cpp in Sources */, - 04DBD4A222AE2DBD00DBE4CD /* Attachment.cpp in Sources */, 468A968022F43F4F005034BE /* Object.cpp in Sources */, - 04DBD48A22AE2DBD00DBE4CD /* IkConstraintTimeline.cpp in Sources */, 469303952046AE05004A3D6C /* RefCounter.cpp in Sources */, - 46FDDABC202ACC6A00931238 /* VertexFormat.cpp in Sources */, - 046E061D2185B37100B24E2D /* CCFactory.cpp in Sources */, 50ABBD5D1925AB0000A911A9 /* Vec3.cpp in Sources */, + BA06A7F623583DFE007740C5 /* GLES3Texture.cc in Sources */, + BA06A77623583DFE007740C5 /* GLES2Framebuffer.cc in Sources */, 46AE3FF62092F3A600F3A228 /* util.cc in Sources */, 461786662052607E008256E1 /* jsb_websocket.cpp in Sources */, - 046E06172185B37100B24E2D /* CCSlot.cpp in Sources */, - 041854A8228D7E7300F8DF31 /* jsb_cocos2dx_particle_auto.cpp in Sources */, - 04DBD48022AE2DBD00DBE4CD /* PathConstraintSpacingTimeline.cpp in Sources */, - 04DBD4B222AE2DBD00DBE4CD /* TwoColorTimeline.cpp in Sources */, 50ABC0001926664800A911A9 /* CCFileUtils-apple.mm in Sources */, + BA06A7DE23583DFE007740C5 /* GLES3Std.cc in Sources */, + BA06A80A23583DFE007740C5 /* GLES3Queue.cc in Sources */, 4DC57D331F7B840E005B6546 /* xxtea.cpp in Sources */, - 04DBD42A22AE2DBD00DBE4CD /* RegionAttachment.cpp in Sources */, - 04DBD46022AE2DBD00DBE4CD /* Event.cpp in Sources */, - 041854A0228D7E5700F8DF31 /* ParticleSimulator.cpp in Sources */, 1A29D77C2056667800168D9A /* csscolorparser.cpp in Sources */, - 046E06D42185B49F00B24E2D /* SkinData.cpp in Sources */, - 46FDDA8E202ACC6A00931238 /* Config.cpp in Sources */, - 04DBD46422AE2DBD00DBE4CD /* PathConstraintData.cpp in Sources */, + BA06A6E323583DBD007740C5 /* GFXContext.cc in Sources */, 1A29D795205666F500168D9A /* jsb_opengl_manual.cpp in Sources */, + BA06A67F23583DBD007740C5 /* JeAlloc.cc in Sources */, 46AE3FFC2092F3A600F3A228 /* inspector_io.cc in Sources */, 4648882820AC2BC900CD1E4A /* CCRenderTexture.cpp in Sources */, - 04DBD4AA22AE2DBD00DBE4CD /* SpineObject.cpp in Sources */, 503DD8E31926736A00CD74DD /* CCDevice-ios.mm in Sources */, 1A28FF701F20AFAB007A1D9D /* SRError.m in Sources */, - 0482F1B6228D87970019ECF7 /* RenderFlow.cpp in Sources */, 1A28FF501F20AFAB007A1D9D /* SRDelegateController.m in Sources */, - 46FDDAC0202ACC6A00931238 /* State.cpp in Sources */, + BA06A69F23583DBD007740C5 /* GFXShader.cc in Sources */, BA21055E21009A5700E19975 /* AssetsManagerEx.cpp in Sources */, - 04DBD31C22AE2D8200DBE4CD /* SkeletonAnimation.cpp in Sources */, BA21055F21009A5A00E19975 /* CCEventAssetsManagerEx.cpp in Sources */, BA21055D21009A5500E19975 /* Manifest.cpp in Sources */, + BA06A6E123583DBD007740C5 /* GFXCommandAllocator.cc in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/native/build/cocos2d_libs.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/native/build/cocos2d_libs.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000000..18d981003d --- /dev/null +++ b/native/build/cocos2d_libs.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/native/cocos/editor-support/Android.mk b/native/cocos/editor-support/Android.mk deleted file mode 100644 index 357e441bfc..0000000000 --- a/native/cocos/editor-support/Android.mk +++ /dev/null @@ -1,155 +0,0 @@ -LOCAL_PATH := $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE := editor_support_static - -LOCAL_MODULE_FILENAME := libeditorsupport - -LOCAL_ARM_MODE := arm - -LOCAL_SRC_FILES := \ -../scripting/js-bindings/manual/jsb_helper.cpp \ -IOBuffer.cpp \ -MeshBuffer.cpp \ -middleware-adapter.cpp \ -TypedArrayPool.cpp \ -IOTypedArray.cpp \ -MiddlewareManager.cpp \ -../scripting/js-bindings/auto/jsb_cocos2dx_editor_support_auto.cpp - -ifeq ($(USE_PARTICLE),1) -LOCAL_SRC_FILES += \ -particle/ParticleSimulator.cpp \ -../scripting/js-bindings/auto/jsb_cocos2dx_particle_auto.cpp -endif # USE_PARTICLE - -ifeq ($(USE_SPINE),1) -LOCAL_SRC_FILES += \ -spine/Animation.cpp \ -spine/AnimationState.cpp \ -spine/AnimationStateData.cpp \ -spine/Atlas.cpp \ -spine/AtlasAttachmentLoader.cpp \ -spine/Attachment.cpp \ -spine/AttachmentLoader.cpp \ -spine/AttachmentTimeline.cpp \ -spine/Bone.cpp \ -spine/BoneData.cpp \ -spine/BoundingBoxAttachment.cpp \ -spine/ClippingAttachment.cpp \ -spine/ColorTimeline.cpp \ -spine/Constraint.cpp \ -spine/CurveTimeline.cpp \ -spine/DeformTimeline.cpp \ -spine/DrawOrderTimeline.cpp \ -spine/Event.cpp \ -spine/EventData.cpp \ -spine/EventTimeline.cpp \ -spine/Extension.cpp \ -spine/IkConstraint.cpp \ -spine/IkConstraintData.cpp \ -spine/IkConstraintTimeline.cpp \ -spine/Json.cpp \ -spine/LinkedMesh.cpp \ -spine/MathUtil.cpp \ -spine/MeshAttachment.cpp \ -spine/PathAttachment.cpp \ -spine/PathConstraint.cpp \ -spine/PathConstraintData.cpp \ -spine/PathConstraintMixTimeline.cpp \ -spine/PathConstraintPositionTimeline.cpp \ -spine/PathConstraintSpacingTimeline.cpp \ -spine/PointAttachment.cpp \ -spine/RegionAttachment.cpp \ -spine/RotateTimeline.cpp \ -spine/RTTI.cpp \ -spine/ScaleTimeline.cpp \ -spine/ShearTimeline.cpp \ -spine/Skeleton.cpp \ -spine/SkeletonBinary.cpp \ -spine/SkeletonBounds.cpp \ -spine/SkeletonClipping.cpp \ -spine/SkeletonData.cpp \ -spine/SkeletonJson.cpp \ -spine/Skin.cpp \ -spine/Slot.cpp \ -spine/SlotData.cpp \ -spine/SpineObject.cpp \ -spine/TextureLoader.cpp \ -spine/Timeline.cpp \ -spine/TransformConstraint.cpp \ -spine/TransformConstraintData.cpp \ -spine/TransformConstraintTimeline.cpp \ -spine/TranslateTimeline.cpp \ -spine/Triangulator.cpp \ -spine/TwoColorTimeline.cpp \ -spine/Updatable.cpp \ -spine/VertexAttachment.cpp \ -spine/VertexEffect.cpp \ -spine-creator-support/AttachmentVertices.cpp \ -spine-creator-support/SkeletonAnimation.cpp \ -spine-creator-support/SkeletonDataMgr.cpp \ -spine-creator-support/SkeletonRenderer.cpp \ -spine-creator-support/spine-cocos2dx.cpp \ -spine-creator-support/VertexEffectDelegate.cpp \ -spine-creator-support/SkeletonCacheMgr.cpp \ -spine-creator-support/SkeletonCache.cpp \ -spine-creator-support/SkeletonCacheAnimation.cpp \ -../scripting/js-bindings/manual/jsb_spine_manual.cpp \ -../scripting/js-bindings/auto/jsb_cocos2dx_spine_auto.cpp -endif # USE_SPINE - -ifeq ($(USE_DRAGONBONES),1) -LOCAL_SRC_FILES += \ -dragonbones/animation/Animation.cpp \ -dragonbones/animation/AnimationState.cpp \ -dragonbones/animation/BaseTimelineState.cpp \ -dragonbones/animation/TimelineState.cpp \ -dragonbones/animation/WorldClock.cpp \ -dragonbones/armature/Armature.cpp \ -dragonbones/armature/Bone.cpp \ -dragonbones/armature/Constraint.cpp \ -dragonbones/armature/DeformVertices.cpp \ -dragonbones/armature/Slot.cpp \ -dragonbones/armature/TransformObject.cpp \ -dragonbones/core/BaseObject.cpp \ -dragonbones/core/DragonBones.cpp \ -dragonbones/event/EventObject.cpp \ -dragonbones/factory/BaseFactory.cpp \ -dragonbones/geom/Point.cpp \ -dragonbones/geom/Transform.cpp \ -dragonbones/model/AnimationConfig.cpp \ -dragonbones/model/AnimationData.cpp \ -dragonbones/model/ArmatureData.cpp \ -dragonbones/model/BoundingBoxData.cpp \ -dragonbones/model/CanvasData.cpp \ -dragonbones/model/ConstraintData.cpp \ -dragonbones/model/DisplayData.cpp \ -dragonbones/model/DragonBonesData.cpp \ -dragonbones/model/SkinData.cpp \ -dragonbones/model/TextureAtlasData.cpp \ -dragonbones/model/UserData.cpp \ -dragonbones/parser/DataParser.cpp \ -dragonbones/parser/BinaryDataParser.cpp \ -dragonbones/parser/JSONDataParser.cpp \ -dragonbones-creator-support/CCArmatureDisplay.cpp \ -dragonbones-creator-support/CCFactory.cpp \ -dragonbones-creator-support/CCSlot.cpp \ -dragonbones-creator-support/CCTextureAtlasData.cpp \ -dragonbones-creator-support/ArmatureCache.cpp \ -dragonbones-creator-support/ArmatureCacheMgr.cpp \ -dragonbones-creator-support/CCArmatureCacheDisplay.cpp \ -../scripting/js-bindings/manual/jsb_dragonbones_manual.cpp \ -../scripting/js-bindings/auto/jsb_cocos2dx_dragonbones_auto.cpp -endif # USE_DRAGONBONES - -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \ - $(LOCAL_PATH)/.. \ - $(LOCAL_PATH)/../.. - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. \ - $(LOCAL_PATH)/../.. \ - $(LOCAL_PATH)/../../external/android/$(TARGET_ARCH_ABI)/include/v8 \ - $(LOCAL_PATH)/../../external/sources/ - -include $(BUILD_STATIC_LIBRARY) \ No newline at end of file diff --git a/native/cocos/editor-support/IOBuffer.cpp b/native/cocos/editor-support/IOBuffer.cpp deleted file mode 100644 index 1ebbb9bf83..0000000000 --- a/native/cocos/editor-support/IOBuffer.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ -#include "IOBuffer.h" - -MIDDLEWARE_BEGIN - -void IOBuffer::resize (std::size_t newLen, bool needCopy) -{ - if (_bufferSize < newLen) - { - uint8_t* newBuffer = new uint8_t[newLen]; - if (needCopy) - { - memcpy(newBuffer, _buffer, _bufferSize); - } - - delete[] _buffer; - _buffer = newBuffer; - _bufferSize = newLen; - _outRange = false; - } -} - -MIDDLEWARE_END diff --git a/native/cocos/editor-support/IOBuffer.h b/native/cocos/editor-support/IOBuffer.h deleted file mode 100644 index b551f52882..0000000000 --- a/native/cocos/editor-support/IOBuffer.h +++ /dev/null @@ -1,268 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ -#pragma once -#include "base/ccMacros.h" -#include -#include -#include -#include "MiddlewareMacro.h" -#include -#include - -MIDDLEWARE_BEGIN -/** - * Use for such as vertex buffer or index buffer,write bytes in it. - * If write data out of range,will sign it in _outRange property. - * User decide to enlarge it or not. - */ -class IOBuffer -{ -public: - IOBuffer (std::size_t defaultSize) - { - _bufferSize = defaultSize; - _buffer = new uint8_t[_bufferSize]; - } - - IOBuffer () {} - - virtual ~IOBuffer () - { - if (_buffer) - { - delete[] _buffer; - _buffer = nullptr; - } - } - - inline void writeUint32 (std::size_t pos, uint32_t val) - { - if (_bufferSize < pos + sizeof(val)) - { - _outRange = true; - return; - } - uint32_t* buffer = (uint32_t*)(_buffer + pos); - *buffer = val; - } - - inline void writeFloat32 (std::size_t pos, float val) - { - if (_bufferSize < pos + sizeof(val)) - { - _outRange = true; - return; - } - float* buffer = (float*)(_buffer + pos); - *buffer = val; - } - - inline void writeBytes (const char* bytes, std::size_t bytesLen) - { - if (_bufferSize < _curPos + bytesLen) - { - _outRange = true; - return; - } - memcpy(_buffer + _curPos, bytes, bytesLen); - _curPos += bytesLen; - } - - inline void writeUint32 (uint32_t val) - { - if (_bufferSize < _curPos + sizeof(val)) - { - _outRange = true; - return; - } - uint32_t* buffer = (uint32_t*)(_buffer + _curPos); - *buffer = val; - _curPos += sizeof(val); - } - - inline void writeFloat32 (float val) - { - if (_bufferSize < _curPos + sizeof(val)) - { - _outRange = true; - return; - } - float* buffer = (float*)(_buffer + _curPos); - *buffer = val; - _curPos += sizeof(val); - } - - inline void writeUint16 (uint16_t val) - { - if (_bufferSize < _curPos + sizeof(val)) - { - _outRange = true; - return; - } - uint16_t* buffer = (uint16_t*)(_buffer + _curPos); - *buffer = val; - _curPos += sizeof(val); - } - - inline uint32_t readUint32 () - { - uint32_t* buffer = (uint32_t*)(_buffer + _readPos); - _readPos += sizeof(uint32_t); - return *buffer; - } - - inline uint16_t readUint16 () - { - uint16_t* buffer = (uint16_t*)(_buffer + _readPos); - _readPos += sizeof(uint16_t); - return *buffer; - } - - inline float readFloat32 () - { - float* buffer = (float*)(_buffer + _readPos); - _readPos += sizeof(float); - return *buffer; - } - - inline char readUint8 () - { - char* buffer = (char*)(_buffer + _readPos); - _readPos += sizeof(char); - return *buffer; - } - - inline void reset () - { - _curPos = 0; - _readPos = 0; - } - - inline void clear () - { - memset(_buffer, 0, _bufferSize); - } - - inline void move (int pos) - { - if (_bufferSize < _curPos + pos) - { - _outRange = true; - return; - } - _curPos += pos; - } - - inline std::size_t length () const - { - return _curPos; - } - - inline std::size_t getCurPos () const - { - return _curPos; - } - - inline uint8_t* getCurBuffer () const - { - return _buffer + _curPos; - } - - inline uint8_t* getBuffer () const - { - return _buffer; - } - - inline std::size_t getCapacity () const - { - return _bufferSize; - } - - inline bool isOutRange () - { - return _outRange; - } - - inline int checkSpace (std::size_t needSize, bool needCopy = false) - { - auto needLen = _curPos + needSize; - auto isFull = 0; - if (_maxSize > 0 && needLen > _maxSize) - { - isFull = 1; - if (_fullCallback) - { - _fullCallback(); - } - _curPos = 0; - } - - if (_bufferSize < needLen) - { - std::size_t fitSize = ceil(needLen / float(MIN_TYPE_ARRAY_SIZE)) * MIN_TYPE_ARRAY_SIZE; - resize(fitSize, needCopy); - if (_resizeCallback) - { - _resizeCallback(); - } - } - - return isFull; - } - - void setMaxSize(std::size_t maxSize) - { - _maxSize = maxSize; - } - - typedef std::function fullCallback; - void setFullCallback(fullCallback callback) - { - _fullCallback = callback; - } - - typedef std::function resizeCallback; - void setResizeCallback(resizeCallback callback) - { - _resizeCallback = callback; - } - - /** - * @brief Resize buffer - * @param[in] newLen New size you want to adjustment. - * @param[in] needCopy If true,will copy old data to new buffer,default false. - */ - virtual void resize (std::size_t newLen, bool needCopy = false); -protected: - uint8_t* _buffer = nullptr; - std::size_t _bufferSize = 0; - std::size_t _curPos = 0; - std::size_t _readPos = 0; - bool _outRange = false; - std::size_t _maxSize = 0; - fullCallback _fullCallback = nullptr; - resizeCallback _resizeCallback = nullptr; -}; - -MIDDLEWARE_END diff --git a/native/cocos/editor-support/IOTypedArray.cpp b/native/cocos/editor-support/IOTypedArray.cpp deleted file mode 100644 index 0a49e66ca9..0000000000 --- a/native/cocos/editor-support/IOTypedArray.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ -#include "IOTypedArray.h" -#include "TypedArrayPool.h" - -#define USE_TYPEARRAY_POOL 0 - -MIDDLEWARE_BEGIN - -IOTypedArray::IOTypedArray (se::Object::TypedArrayType arrayType, std::size_t defaultSize, bool usePool) -{ - _arrayType = arrayType; - _bufferSize = defaultSize; - _usePool = usePool; - - if (_usePool) - { - _typeArray = TypedArrayPool::getInstance()->pop(_arrayType, _bufferSize); - } - else - { - se::AutoHandleScope hs; - _typeArray = se::Object::createTypedArray(_arrayType, nullptr, _bufferSize); - _typeArray->root(); - } - - se::AutoHandleScope hs; - _typeArray->getTypedArrayData(&_buffer, &_bufferSize); -} - -IOTypedArray::~IOTypedArray () -{ - if (_usePool) - { - TypedArrayPool::getInstance()->push(_arrayType, _bufferSize, _typeArray); - } - else - { - _typeArray->unroot(); - _typeArray->decRef(); - } - _typeArray = nullptr; - _buffer = nullptr; -} - -void IOTypedArray::resize (std::size_t newLen, bool needCopy) -{ - if (_bufferSize >= newLen) return; - - se::Object* newTypeBuffer = nullptr; - - if (_usePool) - { - newTypeBuffer = TypedArrayPool::getInstance()->pop(_arrayType, newLen); - } - else - { - se::AutoHandleScope hs; - newTypeBuffer = se::Object::createTypedArray(_arrayType, nullptr, newLen); - newTypeBuffer->root(); - } - - uint8_t* newBuffer = nullptr; - se::AutoHandleScope hs; - newTypeBuffer->getTypedArrayData(&newBuffer, (size_t*)&newLen); - - if (needCopy) - { - memcpy(newBuffer, _buffer, _bufferSize); - } - - if (_usePool) - { - TypedArrayPool::getInstance()->push(_arrayType, _bufferSize, _typeArray); - } - else - { - _typeArray->unroot(); - _typeArray->decRef(); - } - - _typeArray = newTypeBuffer; - _buffer = newBuffer; - _bufferSize = newLen; - _outRange = false; - -} - -MIDDLEWARE_END diff --git a/native/cocos/editor-support/IOTypedArray.h b/native/cocos/editor-support/IOTypedArray.h deleted file mode 100644 index 1161ec4d01..0000000000 --- a/native/cocos/editor-support/IOTypedArray.h +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ -#pragma once - -#include "IOBuffer.h" -#include "base/ccMacros.h" -#include "scripting/js-bindings/jswrapper/SeApi.h" -#include "MiddlewareMacro.h" - -MIDDLEWARE_BEGIN -/** - * Inherit from IOBuffer. - */ -class IOTypedArray: public IOBuffer -{ -public: - /** - * @brief constructor - * @param[in] arrayType TypeArray type - * @param[in] defaultSize TypeArray capacity - * @param[in] usePool If true,will get TypeArray from pool,or create TypeArray,default false. - */ - IOTypedArray (se::Object::TypedArrayType arrayType, std::size_t defaultSize, bool usePool = false); - virtual ~IOTypedArray (); - - inline se::Object* getTypeArray () const - { - return _typeArray; - } - - virtual void resize(std::size_t newLen, bool needCopy = false) override; - -private: - se::Object::TypedArrayType _arrayType = se::Object::TypedArrayType::NONE; - se::Object* _typeArray = nullptr; - bool _usePool = false; -}; - -MIDDLEWARE_END diff --git a/native/cocos/editor-support/MeshBuffer.cpp b/native/cocos/editor-support/MeshBuffer.cpp deleted file mode 100644 index 8a1f0f484a..0000000000 --- a/native/cocos/editor-support/MeshBuffer.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "MeshBuffer.h" -#include "base/CCGLUtils.h" -#include "renderer/gfx/DeviceGraphics.h" - -using namespace cocos2d; -using namespace cocos2d::renderer; - -MIDDLEWARE_BEGIN - -MeshBuffer::MeshBuffer(int vertexFormat) -: _vertexFormat(vertexFormat) -, _ib(INIT_INDEX_BUFFER_SIZE) -, _vb(MAX_VERTEX_BUFFER_SIZE * vertexFormat * sizeof(float)) -{ - _vb.setMaxSize(MAX_VERTEX_BUFFER_SIZE * _vertexFormat * sizeof(float)); - _vb.setFullCallback([this] - { - uploadVB(); - uploadIB(); - _vb.reset(); - _ib.reset(); - next(); - }); - - auto glIB = new IndexBuffer(); - glIB->init(DeviceGraphics::getInstance(), IndexFormat::UINT16, Usage::STATIC, nullptr, 0, (uint32_t)_ib.getCapacity() / sizeof(unsigned short)); - _glIBArr.push_back(glIB); - - auto glVB = new VertexBuffer(); - switch(_vertexFormat) - { - case VF_XYUVC: - glVB->init(DeviceGraphics::getInstance(), VertexFormat::XY_UV_Color, Usage::DYNAMIC, nullptr, 0, (uint32_t)_vb.getCapacity() / VertexFormat::XY_UV_Color->getBytes()); - break; - case VF_XYUVCC: - glVB->init(DeviceGraphics::getInstance(), VertexFormat::XY_UV_Two_Color, Usage::DYNAMIC, nullptr, 0, (uint32_t)_vb.getCapacity() / VertexFormat::XY_UV_Two_Color->getBytes()); - break; - default: - CCASSERT(false, "MeshBuffer constructor unknow vertex format"); - break; - } - - _glVBArr.push_back(glVB); -} - -MeshBuffer::~MeshBuffer() -{ - auto num = _glVBArr.size(); - for (auto i = 0; i < num; i++) - { - delete _glIBArr[i]; - delete _glVBArr[i]; - } - _glIBArr.clear(); - _glVBArr.clear(); -} - -void MeshBuffer::uploadVB() -{ - auto length = _vb.length(); - if (length == 0) return; - - auto glVB = _glVBArr[_bufferPos]; - glVB->setBytes((uint32_t)length); - glVB->update(0, _vb.getBuffer(), length); -} - -void MeshBuffer::uploadIB() -{ - auto length = _ib.length(); - if (length == 0) return; - - auto glIB = _glIBArr[_bufferPos]; - glIB->setBytes((uint32_t)length); - glIB->update(0, _ib.getBuffer(), length); -} - -void MeshBuffer::next() -{ - _bufferPos++; - if (_glIBArr.size() <= _bufferPos) - { - auto glIB = new IndexBuffer(); - glIB->init(DeviceGraphics::getInstance(), IndexFormat::UINT16, Usage::STATIC, nullptr, 0, (uint32_t)_ib.getCapacity() / sizeof(unsigned short)); - _glIBArr.push_back(glIB); - } - - if (_glVBArr.size() <= _bufferPos) - { - auto glVB = new VertexBuffer(); - - switch(_vertexFormat) - { - case VF_XYUVC: - glVB->init(DeviceGraphics::getInstance(), VertexFormat::XY_UV_Color, Usage::DYNAMIC, nullptr, 0, (uint32_t)_vb.getCapacity() / VertexFormat::XY_UV_Color->getBytes()); - break; - case VF_XYUVCC: - glVB->init(DeviceGraphics::getInstance(), VertexFormat::XY_UV_Two_Color, Usage::DYNAMIC, nullptr, 0, (uint32_t)_vb.getCapacity() / VertexFormat::XY_UV_Two_Color->getBytes()); - break; - default: - CCASSERT(false, "MeshBuffer constructor unknow vertex format"); - break; - } - - _glVBArr.push_back(glVB); - } -} - -void MeshBuffer::reset() -{ - _bufferPos = 0; - _vb.reset(); - _ib.reset(); -} - -MIDDLEWARE_END diff --git a/native/cocos/editor-support/MeshBuffer.h b/native/cocos/editor-support/MeshBuffer.h deleted file mode 100644 index bd8e0facd9..0000000000 --- a/native/cocos/editor-support/MeshBuffer.h +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ -#pragma once - -#include "IOBuffer.h" -#include -#include "renderer/gfx/VertexBuffer.h" -#include "renderer/gfx/IndexBuffer.h" - -MIDDLEWARE_BEGIN - -class MeshBuffer -{ -public: - MeshBuffer(int vertexFormat); - virtual ~MeshBuffer(); - - inline cocos2d::renderer::VertexBuffer* getGLVB() - { - return _glVBArr[_bufferPos]; - } - - inline cocos2d::renderer::IndexBuffer* getGLIB() - { - return _glIBArr[_bufferPos]; - } - - IOBuffer& getVB() - { - return _vb; - } - - IOBuffer& getIB() - { - return _ib; - } - - void uploadVB(); - void uploadIB(); - void reset(); -private: - void next(); -private: - std::vector _glIBArr; - std::vector _glVBArr; - - std::size_t _bufferPos = 0; - IOBuffer _vb; - IOBuffer _ib; - int _vertexFormat = 0; -}; - -MIDDLEWARE_END diff --git a/native/cocos/editor-support/MiddlewareMacro.h b/native/cocos/editor-support/MiddlewareMacro.h deleted file mode 100644 index df8fa261f6..0000000000 --- a/native/cocos/editor-support/MiddlewareMacro.h +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ -#pragma once -// index buffer init capacity -#define INIT_INDEX_BUFFER_SIZE 1024000 -// max vertex buffer size -#define MAX_VERTEX_BUFFER_SIZE 65535 - -// fill debug data max capacity -#define MAX_DEBUG_BUFFER_SIZE 409600 -// type array pool min size -#define MIN_TYPE_ARRAY_SIZE 1024 - -#ifndef MIDDLEWARE_BEGIN -#define MIDDLEWARE_BEGIN namespace cocos2d { namespace middleware { -#endif // MIDDLEWARE_BEGIN - -#ifndef MIDDLEWARE_END -#define MIDDLEWARE_END }} -#endif // MIDDLEWARE_END - -#ifndef USING_NS_MW -#define USING_NS_MW using namespace cocos2d::middleware -#endif - -#define VF_XYUVC 5 -#define VF_XYUVCC 6 diff --git a/native/cocos/editor-support/MiddlewareManager.cpp b/native/cocos/editor-support/MiddlewareManager.cpp deleted file mode 100644 index 0d636fbc46..0000000000 --- a/native/cocos/editor-support/MiddlewareManager.cpp +++ /dev/null @@ -1,178 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ -#include "MiddlewareManager.h" -#include "base/CCGLUtils.h" -#include "scripting/js-bindings/jswrapper/SeApi.h" -#include - -MIDDLEWARE_BEGIN - -MiddlewareManager* MiddlewareManager::_instance = nullptr; - -MiddlewareManager::MiddlewareManager() -{ - -} - -MiddlewareManager::~MiddlewareManager() -{ - for (auto it : _mbMap) - { - auto buffer = it.second; - if (buffer) - { - delete buffer; - } - } - _mbMap.clear(); -} - -MeshBuffer* MiddlewareManager::getMeshBuffer(int format) -{ - MeshBuffer* mb = _mbMap[format]; - if (!mb) - { - mb = new MeshBuffer(format); - _mbMap[format] = mb; - } - return mb; -} - -void MiddlewareManager::_clearRemoveList() -{ - for (std::size_t i = 0; i < _removeList.size(); i++) - { - auto editor = _removeList[i]; - auto it = std::find(_updateList.begin(), _updateList.end(), editor); - if (it != _updateList.end()) - { - _updateList.erase(it); - } - } - - _removeList.clear(); -} - -void MiddlewareManager::update(float dt) -{ - isUpdating = true; - - for (std::size_t i = 0, n = _updateList.size(); i < n; i++) - { - auto editor = _updateList[i]; - if (_removeList.size() > 0) - { - auto removeIt = std::find(_removeList.begin(), _removeList.end(), editor); - if (removeIt == _removeList.end()) - { - editor->update(dt); - } - } - else - { - editor->update(dt); - } - } - - isUpdating = false; - - _clearRemoveList(); -} - -void MiddlewareManager::render(float dt) -{ - for (auto it : _mbMap) - { - auto buffer = it.second; - if (buffer) - { - buffer->reset(); - } - } - - isRendering = true; - - for (std::size_t i = 0, n = _updateList.size(); i < n; i++) - { - auto editor = _updateList[i]; - if (_removeList.size() > 0) - { - auto removeIt = std::find(_removeList.begin(), _removeList.end(), editor); - if (removeIt == _removeList.end()) - { - editor->render(dt); - } - } - else - { - editor->render(dt); - } - } - - isRendering = false; - - for (auto it : _mbMap) - { - auto buffer = it.second; - if (buffer) - { - buffer->uploadIB(); - buffer->uploadVB(); - } - } - - _clearRemoveList(); -} - -void MiddlewareManager::addTimer(IMiddleware* editor) -{ - auto it0 = std::find(_updateList.begin(), _updateList.end(), editor); - if (it0 != _updateList.end()) { - return; - } - - auto it1 = std::find(_removeList.begin(), _removeList.end(), editor); - if (it1 != _removeList.end()) - { - _removeList.erase(it1); - } - _updateList.push_back(editor); -} - -void MiddlewareManager::removeTimer(IMiddleware* editor) -{ - if (isUpdating || isRendering) - { - _removeList.push_back(editor); - } - else - { - auto it = std::find(_updateList.begin(), _updateList.end(), editor); - if (it != _updateList.end()) - { - _updateList.erase(it); - } - } -} -MIDDLEWARE_END diff --git a/native/cocos/editor-support/MiddlewareManager.h b/native/cocos/editor-support/MiddlewareManager.h deleted file mode 100644 index 4e661cf9b5..0000000000 --- a/native/cocos/editor-support/MiddlewareManager.h +++ /dev/null @@ -1,118 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ -#pragma once - -#include "MeshBuffer.h" -#include -#include -#include "base/CCRef.h" -#include "MiddlewareMacro.h" - -MIDDLEWARE_BEGIN - -/** - * All middleware must implement IMiddleware interface. - */ -class IMiddleware { -public: - IMiddleware() {} - virtual ~IMiddleware() {} - virtual void update(float dt) = 0; - virtual void render(float dt) = 0; -}; - -/** - * Update all middleware,and fill vertex and index into buffer, - * and then upload vertex buffer,index buffer to opengl. - */ -class MiddlewareManager { -public: - static MiddlewareManager* getInstance() - { - if (_instance == nullptr) - { - _instance = new MiddlewareManager; - } - - return _instance; - } - - static void destroyInstance() - { - if (_instance) - { - delete _instance; - _instance = nullptr; - } - } - - static uint8_t generateModuleID() - { - static uint8_t uniqueId = 0; - uniqueId++; - return uniqueId; - } - - /** - * @brief update all elements - * @param[in] dt Delta time. - */ - void update(float dt); - - /** - * @brief render all elements - */ - void render(float dt); - - /** - * @brief Third party module add in _updateMap,it will update perframe. - * @param[in] editor Module must implement IMiddleware interface. - */ - void addTimer(IMiddleware* editor); - - /** - * @brief Third party module remove from _updateMap,it will stop update. - * @param[in] editor Module must implement IMiddleware interface. - */ - void removeTimer(IMiddleware* editor); - - MeshBuffer* getMeshBuffer(int format); - - MiddlewareManager(); - ~MiddlewareManager(); - - // If manager is traversing _updateMap, will set the flag untill traverse is finished. - bool isRendering = false; - bool isUpdating = false; -private: - void _clearRemoveList(); -private: - - std::vector _updateList; - std::vector _removeList; - std::map _mbMap; - - static MiddlewareManager* _instance; -}; -MIDDLEWARE_END diff --git a/native/cocos/editor-support/TypedArrayPool.cpp b/native/cocos/editor-support/TypedArrayPool.cpp deleted file mode 100644 index 917cbc80e6..0000000000 --- a/native/cocos/editor-support/TypedArrayPool.cpp +++ /dev/null @@ -1,194 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ -#include "TypedArrayPool.h" -#include "base/CCLog.h" -#include "base/ccMacros.h" -#include -#include "MiddlewareMacro.h" - -#define POOL_DEBUG 0 - -#if POOL_DEBUG > 0 -#define PoolLog(...) do { fprintf(stdout, __VA_ARGS__); fflush(stdout); } while (false) -#else -#define PoolLog(...) -#endif - -MIDDLEWARE_BEGIN - -const static std::size_t maxPoolSize = 50; - -TypedArrayPool* TypedArrayPool::_instance = nullptr; - -TypedArrayPool::TypedArrayPool() -{ - se::ScriptEngine::getInstance()->addAfterCleanupHook(std::bind(&TypedArrayPool::afterCleanupHandle,this)); -} - -TypedArrayPool::~TypedArrayPool() -{ - clearPool(); -} - -void TypedArrayPool::afterCleanupHandle() -{ - this->allowPush = false; - clearPool(); - se::ScriptEngine::getInstance()->addAfterInitHook(std::bind(&TypedArrayPool::afterInitHandle,this)); -} - -void TypedArrayPool::afterInitHandle() -{ - this->allowPush = true; - se::ScriptEngine::getInstance()->addAfterCleanupHook(std::bind(&TypedArrayPool::afterCleanupHandle,this)); -} - -void TypedArrayPool::clearPool() -{ - PoolLog("*****clearPool TypeArray pool begin"); - - //map - for (auto it = _pool.begin(); it != _pool.end(); it++) - { - //map - fitMap& mapPool = *(it->second); - for (auto itMapPool = mapPool.begin(); itMapPool != mapPool.end(); itMapPool++) - { - //vector - objPool& itFitPool = *(itMapPool->second); - PoolLog("clear arrayType:%d,fitSize:%lu,objSize:%lu\n", it->first, itMapPool->first, itFitPool.size()); - for (auto itFit = itFitPool.begin(); itFit != itFitPool.end(); itFit++) - { - (*itFit)->unroot(); - (*itFit)->decRef(); - } - delete &itFitPool; - } - delete &mapPool; - } - _pool.clear(); - - PoolLog("*****clearPool TypeArray pool end"); -} - -void TypedArrayPool::dump() -{ - //map - for (auto it = _pool.begin(); it != _pool.end(); it++) - { - //map - fitMap& mapPool = *(it->second); - for (auto itMapPool = mapPool.begin(); itMapPool != mapPool.end(); itMapPool++) - { - //vector - CC_UNUSED objPool& itFitPool = *(itMapPool->second); - PoolLog("arrayType:%d,fitSize:%lu,objSize:%lu\n", it->first, itMapPool->first, itFitPool.size()); - } - } -} - -se::Object* TypedArrayPool::pop(arrayType type, std::size_t size) -{ - std::size_t fitSize = ceil(size / float(MIN_TYPE_ARRAY_SIZE)) * MIN_TYPE_ARRAY_SIZE; - objPool* objPoolPtr = getObjPool(type, fitSize); - - if (objPoolPtr->size() > 0) - { - se::Object* obj = objPoolPtr->back(); - objPoolPtr->pop_back(); - PoolLog("TypedArrayPool:pop result:success,type:%d,fitSize:%lu,objSize:%lu\n", (int)type, fitSize, objPoolPtr->size()); - return obj; - } - - PoolLog("TypedArrayPool:pop result:empty,type:%d,fitSize:%lu,objSize:%lu\n", (int)type, fitSize, objPoolPtr->size()); - se::AutoHandleScope hs; - auto typeArray = se::Object::createTypedArray(type, nullptr, fitSize); - typeArray->root(); - return typeArray; -} - -TypedArrayPool::objPool* TypedArrayPool::getObjPool(arrayType type, std::size_t fitSize) -{ - auto it = _pool.find(type); - fitMap* fitMapPtr = nullptr; - if (it == _pool.end()) - { - fitMapPtr = new fitMap(); - _pool[type] = fitMapPtr; - } - else - { - fitMapPtr = it->second; - } - - auto itPool = fitMapPtr->find(fitSize); - objPool* objPoolPtr = nullptr; - if (itPool == fitMapPtr->end()) - { - objPoolPtr = new objPool(); - (*fitMapPtr)[fitSize] = objPoolPtr; - } - else - { - objPoolPtr = itPool->second; - } - - return objPoolPtr; -} - -void TypedArrayPool::push(arrayType type, std::size_t arrayCapacity, se::Object* object) -{ - if (object == nullptr) return; - - // If script engine is cleaning,delete object directly - if (!allowPush) - { - object->unroot(); - object->decRef(); - object = nullptr; - PoolLog("TypedArrayPool:push result:not allow,type:%d,arrayCapacity:%lu\n", (int)type, arrayCapacity); - return; - } - - objPool* objPoolPtr = getObjPool(type, arrayCapacity); - auto it = std::find(objPoolPtr->begin(), objPoolPtr->end(), object); - if (it != objPoolPtr->end()) - { - PoolLog("TypedArrayPool:push result:repeat\n"); - return; - } - - if (objPoolPtr->size() < maxPoolSize) - { - objPoolPtr->push_back(object); - PoolLog("TypedArrayPool:push result:success,type:%d,arrayCapacity:%lu,objSize:%lu\n", (int)type, arrayCapacity, objPoolPtr->size()); - } - else{ - object->unroot(); - object->decRef(); - object = nullptr; - } -} - -MIDDLEWARE_END diff --git a/native/cocos/editor-support/TypedArrayPool.h b/native/cocos/editor-support/TypedArrayPool.h deleted file mode 100644 index 01685f54db..0000000000 --- a/native/cocos/editor-support/TypedArrayPool.h +++ /dev/null @@ -1,96 +0,0 @@ - -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ -#pragma once -#include -#include -#include "scripting/js-bindings/jswrapper/SeApi.h" -#include "MiddlewareMacro.h" - -MIDDLEWARE_BEGIN -/** - * TypeArray Pool for IOTypedArray - */ -class TypedArrayPool -{ -private: - static TypedArrayPool* _instance; -public: - static TypedArrayPool* getInstance() - { - if (_instance == nullptr) - { - _instance = new TypedArrayPool(); - - } - return _instance; - } - - static void destroyInstance() - { - if (_instance) - { - delete _instance; - _instance = nullptr; - } - } -private: - typedef se::Object::TypedArrayType arrayType; - typedef std::vector objPool; - typedef std::map fitMap; - typedef std::map typeMap; - - objPool* getObjPool(arrayType type, std::size_t size); - - TypedArrayPool(); - ~TypedArrayPool(); - - void clearPool(); - /** - * @brief Print all pool data - */ - void dump(); - - void afterCleanupHandle(); - void afterInitHandle(); -private: - typeMap _pool; - bool allowPush = true; -public: - /** - * @brief pop a js TypeArray by given type and size - * @param[in] type TypeArray type. - * @param[in] size. - * @return a js TypeArray Object. - */ - se::Object* pop(arrayType type, std::size_t size); - /** - * @brief push a TypeArray back to pool. - * @param[in] type TypeArray type. - * @param[in] arrayCapacity TypeArray capacity. - * @param[in] object TypeArray which want to put in pool. - */ - void push(arrayType type, std::size_t arrayCapacity, se::Object* object); -}; -MIDDLEWARE_END diff --git a/native/cocos/editor-support/dragonbones-creator-support/ArmatureCache.cpp b/native/cocos/editor-support/dragonbones-creator-support/ArmatureCache.cpp deleted file mode 100644 index aeba95b711..0000000000 --- a/native/cocos/editor-support/dragonbones-creator-support/ArmatureCache.cpp +++ /dev/null @@ -1,447 +0,0 @@ -/** -* The MIT License (MIT) -* -* Copyright (c) 2012-2018 DragonBones team and other contributors -* -* Permission is hereby granted, free of charge, to any person obtaining a copy of -* this software and associated documentation files (the "Software"), to deal in -* the Software without restriction, including without limitation the rights to -* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -* the Software, and to permit persons to whom the Software is furnished to do so, -* subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in all -* copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include "ArmatureCache.h" -#include "CCFactory.h" -#include "base/ccTypes.h" -#include "renderer/gfx/Texture.h" - -USING_NS_CC; -USING_NS_MW; -using namespace cocos2d::renderer; - -DRAGONBONES_NAMESPACE_BEGIN - -float ArmatureCache::FrameTime = 1.0f / 60.0f; -float ArmatureCache::MaxCacheTime = 120.0f; - -ArmatureCache::SegmentData::SegmentData() -{ - -} - -ArmatureCache::SegmentData::~SegmentData() -{ - CC_SAFE_RELEASE_NULL(_texture); -} - -void ArmatureCache::SegmentData::setTexture(cocos2d::middleware::Texture2D* value) -{ - CC_SAFE_RETAIN(value); - CC_SAFE_RELEASE(_texture); - _texture = value; -} - -cocos2d::middleware::Texture2D* ArmatureCache::SegmentData::getTexture() const -{ - return _texture; -} - -ArmatureCache::FrameData::FrameData() -{ - -} - -ArmatureCache::FrameData::~FrameData() -{ - for (std::size_t i = 0, c = _colors.size(); i < c; i++) - { - delete _colors[i]; - } - _colors.clear(); - - for (std::size_t i = 0, c = _segments.size(); i < c; i++) - { - delete _segments[i]; - } - _segments.clear(); -} - -ArmatureCache::ColorData* ArmatureCache::FrameData::buildColorData(std::size_t index) -{ - if (index > _colors.size()) return nullptr; - if (index == _colors.size()) { - ColorData* colorData = new ColorData; - _colors.push_back(colorData); - } - return _colors[index]; -} - -std::size_t ArmatureCache::FrameData::getColorCount() const -{ - return _colors.size(); -} - -ArmatureCache::SegmentData* ArmatureCache::FrameData::buildSegmentData(std::size_t index) -{ - if (index > _segments.size()) return nullptr; - if (index == _segments.size()) - { - SegmentData* segmentData = new SegmentData; - _segments.push_back(segmentData); - } - return _segments[index]; -} - -std::size_t ArmatureCache::FrameData::getSegmentCount() const -{ - return _segments.size(); -} - -ArmatureCache::AnimationData::AnimationData() -{ - -} - -ArmatureCache::AnimationData::~AnimationData() -{ - reset(); -} - -void ArmatureCache::AnimationData::reset() -{ - for (std::size_t i = 0, c = _frames.size(); i < c; i++) - { - delete _frames[i]; - } - _frames.clear(); - _isComplete = false; - _totalTime = 0.0f; -} - -bool ArmatureCache::AnimationData::needUpdate(int toFrameIdx) const -{ - return !_isComplete && _totalTime <= MaxCacheTime && (toFrameIdx == -1 || _frames.size() < toFrameIdx + 1); -} - -ArmatureCache::FrameData* ArmatureCache::AnimationData::buildFrameData(std::size_t frameIdx) -{ - if (frameIdx > _frames.size()) - { - return nullptr; - } - if (frameIdx == _frames.size()) - { - auto frameData = new FrameData(); - _frames.push_back(frameData); - } - return _frames[frameIdx]; -} - -ArmatureCache::FrameData* ArmatureCache::AnimationData::getFrameData(std::size_t frameIdx) const -{ - if (frameIdx >= _frames.size()) - { - return nullptr; - } - return _frames[frameIdx]; -} - -std::size_t ArmatureCache::AnimationData::getFrameCount() const -{ - return _frames.size(); -} - -ArmatureCache::ArmatureCache(const std::string& armatureName, const std::string& armatureKey, const std::string& atlasUUID) -{ - _armatureDisplay = dragonBones::CCFactory::getFactory()->buildArmatureDisplay(armatureName, armatureKey, "", atlasUUID); - if (_armatureDisplay) - { - _armatureDisplay->retain(); - } -} - -ArmatureCache::~ArmatureCache() -{ - if (_armatureDisplay) - { - _armatureDisplay->release(); - _armatureDisplay = nullptr; - } - - for (auto it = _animationCaches.begin(); it != _animationCaches.end(); it++) - { - delete it->second; - } - _animationCaches.clear(); -} - -ArmatureCache::AnimationData* ArmatureCache::buildAnimationData(const std::string& animationName) -{ - if (!_armatureDisplay) return nullptr; - - AnimationData* aniData = nullptr; - auto it = _animationCaches.find(animationName); - if (it == _animationCaches.end()) - { - auto armature = _armatureDisplay->getArmature(); - auto animation = armature->getAnimation(); - auto hasAni = animation->hasAnimation(animationName); - if (!hasAni) return nullptr; - - aniData = new AnimationData(); - aniData->_animationName = animationName; - _animationCaches[animationName] = aniData; - } - else - { - aniData = it->second; - } - return aniData; -} - -ArmatureCache::AnimationData* ArmatureCache::getAnimationData(const std::string& animationName) -{ - auto it = _animationCaches.find(animationName); - if (it == _animationCaches.end()) - { - return nullptr; - } - else - { - return it->second; - } -} - -void ArmatureCache::updateToFrame(const std::string& animationName, int toFrameIdx/*= -1*/) -{ - auto it = _animationCaches.find(animationName); - if (it == _animationCaches.end()) - { - return; - } - - AnimationData* animationData = it->second; - if (!animationData || !animationData->needUpdate(toFrameIdx)) - { - return; - } - - if (_curAnimationName != animationName) - { - updateToFrame(_curAnimationName); - _curAnimationName = animationName; - } - - auto armature = _armatureDisplay->getArmature(); - auto animation = armature->getAnimation(); - - // init animation - if (animationData->getFrameCount() == 0) - { - animation->play(animationName, 1); - } - - do { - armature->advanceTime(FrameTime); - renderAnimationFrame(animationData); - animationData->_totalTime += FrameTime; - if (animation->isCompleted()) - { - animationData->_isComplete = true; - } - } while (animationData->needUpdate(toFrameIdx)); -} - -void ArmatureCache::renderAnimationFrame(AnimationData* animationData) -{ - std::size_t frameIndex = animationData->getFrameCount(); - _frameData = animationData->buildFrameData(frameIndex); - - _preColor = Color4F(-1.0f, -1.0f, -1.0f, -1.0f); - _color = Color4F(1.0f, 1.0f, 1.0f, 1.0f); - - _preBlendMode = -1; - _preTextureIndex = -1; - _curTextureIndex = -1; - _preISegWritePos = -1; - _curISegLen = 0; - _curVSegLen = 0; - _materialLen = 0; - - auto armature = _armatureDisplay->getArmature(); - traverseArmature(armature); - - if (_preISegWritePos != -1) - { - SegmentData* preSegmentData = _frameData->buildSegmentData(_materialLen - 1); - preSegmentData->indexCount = _curISegLen; - preSegmentData->vertexFloatCount = _curVSegLen; - } - - auto colorCount = _frameData->getColorCount(); - if (colorCount > 0) - { - ColorData* preColorData = _frameData->buildColorData(colorCount - 1); - preColorData->vertexFloatOffset = (int)_frameData->vb.getCurPos() / sizeof(float); - } - - _frameData = nullptr; -} - -void ArmatureCache::traverseArmature(Armature* armature, float parentOpacity/*= 1.0f*/) -{ - middleware::IOBuffer& vb = _frameData->vb; - middleware::IOBuffer& ib = _frameData->ib; - - auto& slots = armature->getSlots(); - CCSlot* slot = nullptr; - // range [0.0, 1.0] - Color4F preColor(-1.0f, -1.0f, -1.0f, -1.0f); - Color4F color; - middleware::Texture2D* texture = nullptr; - - auto flush = [&]() - { - // fill pre segment count field - if (_preISegWritePos != -1) - { - SegmentData* preSegmentData = _frameData->buildSegmentData(_materialLen - 1); - preSegmentData->indexCount = _curISegLen; - preSegmentData->vertexFloatCount = _curVSegLen; - } - - SegmentData* segmentData = _frameData->buildSegmentData(_materialLen); - segmentData->setTexture(texture); - segmentData->blendMode = (int)(slot->_blendMode); - - // save new segment count pos field - _preISegWritePos = (int)ib.getCurPos() / sizeof(unsigned short); - // reset pre blend mode to current - _preBlendMode = (int)slot->_blendMode; - // reset pre texture index to current - _preTextureIndex = _curTextureIndex; - // reset index segmentation count - _curISegLen = 0; - // reset vertex segmentation count - _curVSegLen = 0; - // material length increased - _materialLen++; - }; - - for (std::size_t i = 0, len = slots.size(); i < len; i++) - { - slot = (CCSlot*)slots[i]; - if (!slot->getVisible()) - { - continue; - } - slot->updateWorldMatrix(); - - // If slots has child armature,will traverse child first. - Armature* childArmature = slot->getChildArmature(); - if (childArmature != nullptr) - { - traverseArmature(childArmature, parentOpacity * slot->color.a / 255.0f); - continue; - } - - texture = slot->getTexture(); - if (!texture) continue; - _curTextureIndex = texture->getNativeTexture()->getHandle(); - - auto vbSize = slot->triangles.vertCount * sizeof(middleware::V2F_T2F_C4B); - vb.checkSpace(vbSize, true); - - // If texture or blendMode change,will change material. - if (_preTextureIndex != _curTextureIndex || _preBlendMode != (int)slot->_blendMode) - { - flush(); - } - - // Calculation vertex color. - color.a = slot->color.a * parentOpacity; - color.r = slot->color.r; - color.g = slot->color.g; - color.b = slot->color.b; - - if (preColor != color) { - preColor = color; - auto colorCount = _frameData->getColorCount(); - if (colorCount > 0) { - ColorData* preColorData = _frameData->buildColorData(colorCount - 1); - preColorData->vertexFloatOffset = vb.getCurPos() / sizeof(float); - } - ColorData* colorData = _frameData->buildColorData(colorCount); - colorData->color = color; - } - - // Transform component matrix to global matrix - middleware::Triangles& triangles = slot->triangles; - cocos2d::Mat4* worldMatrix = &slot->worldMatrix; - middleware::V2F_T2F_C4B* worldTriangles = slot->worldVerts; - - for (int v = 0, w = 0, vn = triangles.vertCount; v < vn; ++v, w += 2) - { - middleware::V2F_T2F_C4B* vertex = triangles.verts + v; - middleware::V2F_T2F_C4B* worldVertex = worldTriangles + v; - worldVertex->vertex.x = vertex->vertex.x * worldMatrix->m[0] + vertex->vertex.y * worldMatrix->m[4] + worldMatrix->m[12]; - worldVertex->vertex.y = vertex->vertex.x * worldMatrix->m[1] + vertex->vertex.y * worldMatrix->m[5] + worldMatrix->m[13]; - - worldVertex->color.r = (GLubyte)color.r; - worldVertex->color.g = (GLubyte)color.g; - worldVertex->color.b = (GLubyte)color.b; - worldVertex->color.a = (GLubyte)color.a; - } - - vb.writeBytes((char*)worldTriangles, vbSize); - - auto ibSize = triangles.indexCount * sizeof(unsigned short); - ib.checkSpace(ibSize, true); - - auto vertexOffset = _curVSegLen / 5; - for (int ii = 0, nn = triangles.indexCount; ii < nn; ii++) - { - ib.writeUint16(triangles.indices[ii] + vertexOffset); - } - - _curISegLen += triangles.indexCount; - _curVSegLen += vbSize / sizeof(float); - } // End slot traverse -} - -void ArmatureCache::resetAllAnimationData() -{ - for (auto it = _animationCaches.begin(); it != _animationCaches.end(); it++) - { - it->second->reset(); - } -} - -void ArmatureCache::resetAnimationData(const std::string& animationName) { - for (auto it = _animationCaches.begin(); it != _animationCaches.end(); it++) - { - if (it->second->_animationName == animationName) - { - it->second->reset(); - break; - } - } -} - -CCArmatureDisplay* ArmatureCache::getArmatureDisplay() -{ - return _armatureDisplay; -} - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones-creator-support/ArmatureCache.h b/native/cocos/editor-support/dragonbones-creator-support/ArmatureCache.h deleted file mode 100644 index de18c3f79d..0000000000 --- a/native/cocos/editor-support/dragonbones-creator-support/ArmatureCache.h +++ /dev/null @@ -1,141 +0,0 @@ -/** -* The MIT License (MIT) -* -* Copyright (c) 2012-2018 DragonBones team and other contributors -* -* Permission is hereby granted, free of charge, to any person obtaining a copy of -* this software and associated documentation files (the "Software"), to deal in -* the Software without restriction, including without limitation the rights to -* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -* the Software, and to permit persons to whom the Software is furnished to do so, -* subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in all -* copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#pragma once - -#include "IOBuffer.h" -#include "CCArmatureDisplay.h" - -DRAGONBONES_NAMESPACE_BEGIN - -class ArmatureCache : public cocos2d::Ref { -public: - struct SegmentData { - friend class ArmatureCache; - - SegmentData(); - ~SegmentData(); - - void setTexture(cocos2d::middleware::Texture2D* value); - cocos2d::middleware::Texture2D* getTexture() const; - public: - int blendMode = 0; - std::size_t indexCount = 0; - std::size_t vertexFloatCount = 0; - private: - cocos2d::middleware::Texture2D* _texture = nullptr; - }; - - struct ColorData { - cocos2d::Color4F color; - std::size_t vertexFloatOffset = 0; - }; - - struct FrameData { - friend class ArmatureCache; - - FrameData(); - ~FrameData(); - - const std::vector& getColors() const - { - return _colors; - } - std::size_t getColorCount() const; - - const std::vector& getSegments() const - { - return _segments; - } - std::size_t getSegmentCount() const; - private: - // if segment data is empty, it will build new one. - SegmentData* buildSegmentData(std::size_t index); - // if color data is empty, it will build new one. - ColorData* buildColorData(std::size_t index); - - std::vector _colors; - std::vector _segments; - public: - cocos2d::middleware::IOBuffer ib; - cocos2d::middleware::IOBuffer vb; - }; - - struct AnimationData { - friend class ArmatureCache; - - AnimationData(); - ~AnimationData(); - void reset(); - - FrameData* getFrameData(std::size_t frameIdx) const; - std::size_t getFrameCount() const; - - bool isComplete() const { return _isComplete; } - bool needUpdate(int toFrameIdx) const; - private: - // if frame is empty, it will build new one. - FrameData* buildFrameData(std::size_t frameIdx); - private: - std::string _animationName = ""; - bool _isComplete = false; - float _totalTime = 0.0f; - std::vector _frames; - }; - - ArmatureCache(const std::string& armatureName, const std::string& armatureKey, const std::string& atlasUUID); - virtual ~ArmatureCache(); - - void updateToFrame(const std::string& animationName, int toFrameIdx = -1); - // if animation data is empty, it will build new one. - AnimationData* buildAnimationData(const std::string& animationName); - AnimationData* getAnimationData(const std::string& animationName); - CCArmatureDisplay* getArmatureDisplay(); - - void resetAllAnimationData(); - void resetAnimationData(const std::string& animationName); -private: - void renderAnimationFrame(AnimationData* animationData); - void traverseArmature(Armature* armature, float parentOpacity = 1.0f); -public: - static float FrameTime; - static float MaxCacheTime; -private: - FrameData* _frameData = nullptr; - cocos2d::Color4F _preColor = cocos2d::Color4F(-1.0f, -1.0f, -1.0f, -1.0f); - cocos2d::Color4F _color = cocos2d::Color4F(1.0f, 1.0f, 1.0f, 1.0f); - CCArmatureDisplay* _armatureDisplay = nullptr; - int _preBlendMode = -1; - GLuint _preTextureIndex = -1; - GLuint _curTextureIndex = -1; - int _preISegWritePos = -1; - int _curISegLen = 0; - int _curVSegLen = 0; - int _materialLen = 0; - cocos2d::renderer::BlendFactor _curBlendSrc; - cocos2d::renderer::BlendFactor _curBlendDst; - std::string _curAnimationName = ""; - std::map _animationCaches; -}; - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones-creator-support/ArmatureCacheMgr.cpp b/native/cocos/editor-support/dragonbones-creator-support/ArmatureCacheMgr.cpp deleted file mode 100644 index 9812169ffb..0000000000 --- a/native/cocos/editor-support/dragonbones-creator-support/ArmatureCacheMgr.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/** -* The MIT License (MIT) -* -* Copyright (c) 2012-2018 DragonBones team and other contributors -* -* Permission is hereby granted, free of charge, to any person obtaining a copy of -* this software and associated documentation files (the "Software"), to deal in -* the Software without restriction, including without limitation the rights to -* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -* the Software, and to permit persons to whom the Software is furnished to do so, -* subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in all -* copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include "ArmatureCacheMgr.h" - -DRAGONBONES_NAMESPACE_BEGIN - -ArmatureCacheMgr* ArmatureCacheMgr::_instance = nullptr; -ArmatureCache* ArmatureCacheMgr::buildArmatureCache(const std::string& armatureName, const std::string& armatureKey, const std::string& atlasUUID) -{ - ArmatureCache* animation = _caches.at(armatureKey); - if (!animation) - { - animation = new ArmatureCache(armatureName, armatureKey, atlasUUID); - _caches.insert(armatureKey, animation); - animation->autorelease(); - } - return animation; -} - -void ArmatureCacheMgr::removeArmatureCache(const std::string& uuid) -{ - for (auto it = _caches.begin(); it != _caches.end();) - { - auto found = it->first.find(uuid); - if (found != std::string::npos) - { - it = _caches.erase(it); - } - else - { - it++; - } - } -} - -DRAGONBONES_NAMESPACE_END \ No newline at end of file diff --git a/native/cocos/editor-support/dragonbones-creator-support/ArmatureCacheMgr.h b/native/cocos/editor-support/dragonbones-creator-support/ArmatureCacheMgr.h deleted file mode 100644 index b8e7a4cc79..0000000000 --- a/native/cocos/editor-support/dragonbones-creator-support/ArmatureCacheMgr.h +++ /dev/null @@ -1,57 +0,0 @@ -/** -* The MIT License (MIT) -* -* Copyright (c) 2012-2018 DragonBones team and other contributors -* -* Permission is hereby granted, free of charge, to any person obtaining a copy of -* this software and associated documentation files (the "Software"), to deal in -* the Software without restriction, including without limitation the rights to -* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -* the Software, and to permit persons to whom the Software is furnished to do so, -* subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in all -* copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#pragma once -#include "dragonbones/DragonBonesHeaders.h" -#include "ArmatureCache.h" -#include "base/CCMap.h" - -DRAGONBONES_NAMESPACE_BEGIN - -class ArmatureCacheMgr { -public: - static ArmatureCacheMgr* getInstance() - { - if (_instance == nullptr) - { - _instance = new ArmatureCacheMgr(); - } - return _instance; - } - - static void destroyInstance() - { - if (_instance) { - delete _instance; - _instance = nullptr; - } - } - - void removeArmatureCache(const std::string& armatureKey); - ArmatureCache* buildArmatureCache(const std::string& armatureName, const std::string& armatureKey, const std::string& atlasUUID); -private: - static ArmatureCacheMgr* _instance; - cocos2d::Map _caches; -}; - -DRAGONBONES_NAMESPACE_END \ No newline at end of file diff --git a/native/cocos/editor-support/dragonbones-creator-support/CCArmatureCacheDisplay.cpp b/native/cocos/editor-support/dragonbones-creator-support/CCArmatureCacheDisplay.cpp deleted file mode 100644 index 8013bd4fab..0000000000 --- a/native/cocos/editor-support/dragonbones-creator-support/CCArmatureCacheDisplay.cpp +++ /dev/null @@ -1,432 +0,0 @@ -/** -* The MIT License (MIT) -* -* Copyright (c) 2012-2018 DragonBones team and other contributors -* -* Permission is hereby granted, free of charge, to any person obtaining a copy of -* this software and associated documentation files (the "Software"), to deal in -* the Software without restriction, including without limitation the rights to -* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -* the Software, and to permit persons to whom the Software is furnished to do so, -* subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in all -* copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include "CCArmatureCacheDisplay.h" -#include "MiddlewareManager.h" -#include "ArmatureCacheMgr.h" -#include "CCFactory.h" -#include "renderer/gfx/Texture.h" - -USING_NS_CC; -USING_NS_MW; -using namespace cocos2d::renderer; -static const std::string techStage = "opaque"; -static const std::string textureKey = "texture"; -static const std::string startEvent = "start"; -static const std::string loopCompleteEvent = "loopComplete"; -static const std::string completeEvent = "complete"; - -DRAGONBONES_NAMESPACE_BEGIN - -CCArmatureCacheDisplay::CCArmatureCacheDisplay(const std::string & armatureName, const std::string & armatureKey, const std::string & atlasUUID, bool isShare) -{ - _eventObject = BaseObject::borrowObject(); - - if (isShare) - { - _armatureCache = ArmatureCacheMgr::getInstance()->buildArmatureCache(armatureName, armatureKey, atlasUUID); - _armatureCache->retain(); - } - else - { - _armatureCache = new ArmatureCache(armatureName, armatureKey, atlasUUID); - _armatureCache->retain(); - _armatureCache->autorelease(); - } - beginSchedule(); -} - -CCArmatureCacheDisplay::~CCArmatureCacheDisplay () -{ - dispose(); -} - -void CCArmatureCacheDisplay::dispose() -{ - if (_armatureCache) - { - _armatureCache->release(); - _armatureCache = nullptr; - } - if (_eventObject) - { - _eventObject->returnToPool(); - _eventObject = nullptr; - } - CC_SAFE_RELEASE_NULL(_nodeProxy); - CC_SAFE_RELEASE_NULL(_effect); - stopSchedule(); -} - -void CCArmatureCacheDisplay::update(float dt) -{ - auto gTimeScale = dragonBones::CCFactory::getFactory()->getTimeScale(); - dt *= _timeScale * gTimeScale; - - if (_isAniComplete || !_animationData) - { - if (_animationData && !_animationData->isComplete()) - { - _armatureCache->updateToFrame(_animationName); - } - return; - } - - if (_accTime <= 0.00001 && _playCount == 0) - { - _eventObject->type = EventObject::START; - dispatchDBEvent(startEvent, _eventObject); - } - - _accTime += dt; - int frameIdx = floor(_accTime / ArmatureCache::FrameTime); - if (!_animationData->isComplete()) - { - _armatureCache->updateToFrame(_animationName, frameIdx); - } - - int finalFrameIndex = (int)_animationData->getFrameCount() - 1; - if (_animationData->isComplete() && frameIdx >= finalFrameIndex) - { - _playCount++; - _accTime = 0.0f; - if (_playTimes > 0 && _playCount >= _playTimes) - { - frameIdx = finalFrameIndex; - _playCount = 0; - _isAniComplete = true; - } - else - { - frameIdx = 0; - } - - _eventObject->type = EventObject::COMPLETE; - dispatchDBEvent(completeEvent, _eventObject); - - _eventObject->type = EventObject::LOOP_COMPLETE; - dispatchDBEvent(loopCompleteEvent, _eventObject); - } - _curFrameIndex = frameIdx; -} - -void CCArmatureCacheDisplay::render(float dt) -{ - if (_nodeProxy == nullptr) - { - return; - } - - CustomAssembler* assembler = (CustomAssembler*)_nodeProxy->getAssembler(); - if (assembler == nullptr) - { - return; - } - assembler->reset(); - assembler->setUseModel(!_batch); - - if (!_animationData) return; - ArmatureCache::FrameData* frameData = _animationData->getFrameData(_curFrameIndex); - if (!frameData) return; - - auto mgr = MiddlewareManager::getInstance(); - if (!mgr->isRendering) return; - - auto& segments = frameData->getSegments(); - auto& colors = frameData->getColors(); - if (segments.size() == 0 || colors.size() == 0) return; - - _nodeColor.a = _nodeProxy->getRealOpacity() / (float)255; - - middleware::MeshBuffer* mb = mgr->getMeshBuffer(VF_XYUVC); - middleware::IOBuffer& vb = mb->getVB(); - middleware::IOBuffer& ib = mb->getIB(); - const auto& srcVB = frameData->vb; - const auto& srcIB = frameData->ib; - - const cocos2d::Mat4& nodeWorldMat = _nodeProxy->getWorldMatrix(); - - int colorOffset = 0; - ArmatureCache::ColorData* nowColor = colors[colorOffset++]; - auto maxVFOffset = nowColor->vertexFloatOffset; - - Color4B color; - float tempR = 0.0f, tempG = 0.0f, tempB = 0.0f, tempA = 0.0f; - float multiplier = 1.0f; - std::size_t srcVertexBytesOffset = 0; - std::size_t srcIndexBytesOffset = 0; - std::size_t vertexBytes = 0; - std::size_t indexBytes = 0; - GLuint textureHandle = 0; - double effectHash = 0; - BlendMode blendMode = BlendMode::Normal; - std::size_t dstVertexOffset = 0; - float* dstVertexBuffer = nullptr; - unsigned int* dstColorBuffer = nullptr; - unsigned short* dstIndexBuffer = nullptr; - bool needColor = false; - BlendFactor curBlendSrc = BlendFactor::ONE; - BlendFactor curBlendDst = BlendFactor::ZERO; - - if (abs(_nodeColor.r - 1.0f) > 0.0001f || - abs(_nodeColor.g - 1.0f) > 0.0001f || - abs(_nodeColor.b - 1.0f) > 0.0001f || - abs(_nodeColor.a - 1.0f) > 0.0001f || - _premultipliedAlpha) { - needColor = true; - } - - auto handleColor = [&](ArmatureCache::ColorData* colorData) - { - tempA = colorData->color.a * _nodeColor.a; - multiplier = _premultipliedAlpha ? tempA / 255 : 1; - tempR = _nodeColor.r * multiplier; - tempG = _nodeColor.g * multiplier; - tempB = _nodeColor.b * multiplier; - - color.a = (GLubyte)tempA; - color.r = (GLubyte)(colorData->color.r * tempR); - color.g = (GLubyte)(colorData->color.g * tempG); - color.b = (GLubyte)(colorData->color.b * tempB); - }; - - handleColor(nowColor); - - for (std::size_t segIndex = 0, segLen = segments.size(); segIndex < segLen; segIndex++) - { - auto segment = segments[segIndex]; - vertexBytes = segment->vertexFloatCount * sizeof(float); - - // fill vertex buffer - vb.checkSpace(vertexBytes, true); - dstVertexOffset = vb.getCurPos() / sizeof(V2F_T2F_C4B); - dstVertexBuffer = (float*)vb.getCurBuffer(); - dstColorBuffer = (unsigned int*)vb.getCurBuffer(); - vb.writeBytes((char*)srcVB.getBuffer() + srcVertexBytesOffset, vertexBytes); - - // batch handle - if (_batch) - { - cocos2d::Vec3* point = nullptr; - float tempZ = 0.0f; - for (auto posIndex = 0; posIndex < segment->vertexFloatCount; posIndex += 5) - { - point = (cocos2d::Vec3*)(dstVertexBuffer + posIndex); - tempZ = point->z; - point->z = 0; - nodeWorldMat.transformPoint(point); - point->z = tempZ; - } - } - - // handle vertex color - if (needColor) - { - auto frameFloatOffset = srcVertexBytesOffset / sizeof(float); - for (auto colorIndex = 0; colorIndex < segment->vertexFloatCount; colorIndex += 5, frameFloatOffset += 5) - { - if (frameFloatOffset >= maxVFOffset) - { - nowColor = colors[colorOffset++]; - handleColor(nowColor); - maxVFOffset = nowColor->vertexFloatOffset; - } - memcpy(dstColorBuffer + colorIndex + 4, &color, sizeof(color)); - } - } - - // move src vertex buffer offset - srcVertexBytesOffset += vertexBytes; - - // fill index buffer - indexBytes = segment->indexCount * sizeof(unsigned short); - ib.checkSpace(indexBytes, true); - assembler->updateIARange(segIndex, (int)ib.getCurPos() / sizeof(unsigned short), (int)segment->indexCount); - dstIndexBuffer = (unsigned short*)ib.getCurBuffer(); - ib.writeBytes((char*)srcIB.getBuffer() + srcIndexBytesOffset, indexBytes); - for (auto indexPos = 0; indexPos < segment->indexCount; indexPos++) - { - dstIndexBuffer[indexPos] += dstVertexOffset; - } - srcIndexBytesOffset += indexBytes; - - // set assembler glvb and glib - assembler->updateIABuffer(segIndex, mb->getGLVB(), mb->getGLIB()); - - // handle material - textureHandle = segment->getTexture()->getNativeTexture()->getHandle(); - blendMode = (BlendMode)segment->blendMode; - - effectHash = textureHandle + ((uint8_t)blendMode << 16) + ((uint8_t)_batch << 24); - Effect* renderEffect = assembler->getEffect(segIndex); - Technique::Parameter* param = nullptr; - Pass* pass = nullptr; - - if (renderEffect) - { - double renderHash = renderEffect->getHash(); - if (abs(renderHash - effectHash) >= 0.01) - { - param = (Technique::Parameter*)&(renderEffect->getProperty(textureKey)); - Technique* tech = renderEffect->getTechnique(techStage); - cocos2d::Vector& passes = (cocos2d::Vector&)tech->getPasses(); - pass = *(passes.begin()); - } - } - else - { - if (_effect == nullptr) - { - cocos2d::log("ArmatureCacheAnimation:update get effect failed"); - assembler->reset(); - return; - } - auto effect = new cocos2d::renderer::Effect(); - effect->autorelease(); - effect->copy(_effect); - - Technique* tech = effect->getTechnique(techStage); - cocos2d::Vector& passes = (cocos2d::Vector&)tech->getPasses(); - pass = *(passes.begin()); - - assembler->updateEffect(segIndex, effect); - renderEffect = effect; - param = (Technique::Parameter*)&(renderEffect->getProperty(textureKey)); - } - - if (param) - { - param->setTexture(segment->getTexture()->getNativeTexture()); - } - - switch (blendMode) - { - case BlendMode::Add: - curBlendSrc = _premultipliedAlpha ? BlendFactor::ONE : BlendFactor::SRC_ALPHA; - curBlendDst = BlendFactor::ONE; - break; - case BlendMode::Multiply: - curBlendSrc = BlendFactor::DST_COLOR; - curBlendDst = BlendFactor::ONE_MINUS_SRC_ALPHA; - break; - case BlendMode::Screen: - curBlendSrc = BlendFactor::ONE; - curBlendDst = BlendFactor::ONE_MINUS_SRC_COLOR; - break; - default: - curBlendSrc = _premultipliedAlpha ? BlendFactor::ONE : BlendFactor::SRC_ALPHA; - curBlendDst = BlendFactor::ONE_MINUS_SRC_ALPHA; - break; - } - - if (pass) { - pass->setBlend(BlendOp::ADD, curBlendSrc, curBlendDst, - BlendOp::ADD, curBlendSrc, curBlendDst); - } - - renderEffect->updateHash(effectHash); - } -} - -void CCArmatureCacheDisplay::beginSchedule() -{ - MiddlewareManager::getInstance()->addTimer(this); -} - -void CCArmatureCacheDisplay::stopSchedule() -{ - MiddlewareManager::getInstance()->removeTimer(this); -} - -void CCArmatureCacheDisplay::onEnable() -{ - beginSchedule(); -} - -void CCArmatureCacheDisplay::onDisable() -{ - stopSchedule(); -} - -Armature* CCArmatureCacheDisplay::getArmature() const -{ - auto armatureDisplay = _armatureCache->getArmatureDisplay(); - return armatureDisplay->getArmature(); -} - -Animation* CCArmatureCacheDisplay::getAnimation() const -{ - auto armature = getArmature(); - return armature->getAnimation(); -} - -void CCArmatureCacheDisplay::playAnimation(const std::string& name, int playTimes) -{ - _playTimes = playTimes; - _animationName = name; - _animationData = _armatureCache->buildAnimationData(_animationName); - _isAniComplete = false; - _accTime = 0.0f; - _playCount = 0; - _curFrameIndex = 0; -} - -void CCArmatureCacheDisplay::addDBEventListener(const std::string& type) -{ - _listenerIDMap[type] = true; -} - -void CCArmatureCacheDisplay::removeDBEventListener(const std::string& type) -{ - auto it = _listenerIDMap.find(type); - if (it != _listenerIDMap.end()) - { - _listenerIDMap.erase(it); - } -} - -void CCArmatureCacheDisplay::dispatchDBEvent(const std::string& type, EventObject* value) -{ - auto it = _listenerIDMap.find(type); - if (it == _listenerIDMap.end()) - { - return; - } - - if (_dbEventCallback) - { - _dbEventCallback(value); - } -} - -void CCArmatureCacheDisplay::updateAnimationCache (const std::string& animationName) -{ - _armatureCache->resetAnimationData(animationName); -} - -void CCArmatureCacheDisplay::updateAllAnimationCache () -{ - _armatureCache->resetAllAnimationData(); -} - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones-creator-support/CCArmatureCacheDisplay.h b/native/cocos/editor-support/dragonbones-creator-support/CCArmatureCacheDisplay.h deleted file mode 100644 index a724a41007..0000000000 --- a/native/cocos/editor-support/dragonbones-creator-support/CCArmatureCacheDisplay.h +++ /dev/null @@ -1,131 +0,0 @@ -/** -* The MIT License (MIT) -* -* Copyright (c) 2012-2018 DragonBones team and other contributors -* -* Permission is hereby granted, free of charge, to any person obtaining a copy of -* this software and associated documentation files (the "Software"), to deal in -* the Software without restriction, including without limitation the rights to -* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -* the Software, and to permit persons to whom the Software is furnished to do so, -* subject to the following conditions: -* -* The above copyright notice and this permission notice shall be included in all -* copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#pragma once - -#include "dragonbones/DragonBonesHeaders.h" -#include "base/CCRef.h" -#include "renderer/scene/NodeProxy.hpp" -#include "renderer/scene/assembler/CustomAssembler.hpp" -#include "CCArmatureDisplay.h" -#include "ArmatureCache.h" - -DRAGONBONES_NAMESPACE_BEGIN -class CCArmatureCacheDisplay : public cocos2d::middleware::IMiddleware, public cocos2d::Ref -{ -public: - CCArmatureCacheDisplay(const std::string& armatureName, const std::string& armatureKey, const std::string& atlasUUID, bool isShare); - virtual ~CCArmatureCacheDisplay(); - void dispose(); - - virtual void update(float dt) override; - virtual void render(float dt) override; - - void setTimeScale(float scale) - { - _timeScale = scale; - } - - float getTimeScale() const - { - return _timeScale; - } - - void beginSchedule(); - void stopSchedule(); - void onEnable(); - void onDisable(); - - Armature* getArmature() const; - Animation* getAnimation() const; - - void bindNodeProxy(cocos2d::renderer::NodeProxy* node) - { - CC_SAFE_RELEASE(_nodeProxy); - _nodeProxy = node; - CC_SAFE_RETAIN(_nodeProxy); - } - - void setEffect(cocos2d::renderer::Effect* effect) - { - if (effect == _effect) return; - CC_SAFE_RELEASE(_effect); - _effect = effect; - CC_SAFE_RETAIN(_effect); - } - - void setColor(cocos2d::Color4B& color) - { - _nodeColor.r = color.r / 255.0f; - _nodeColor.g = color.g / 255.0f; - _nodeColor.b = color.b / 255.0f; - _nodeColor.a = color.a / 255.0f; - } - - void setBatchEnabled(bool enabled) - { - _batch = enabled; - } - - void setOpacityModifyRGB(bool value) - { - _premultipliedAlpha = value; - } - - typedef std::function dbEventCallback; - void setDBEventCallback(dbEventCallback callback) - { - _dbEventCallback = callback; - } - void addDBEventListener(const std::string& type); - void removeDBEventListener(const std::string& type); - void dispatchDBEvent(const std::string& type, EventObject* value); - - void playAnimation(const std::string& name, int playTimes); - void updateAnimationCache (const std::string& animationName); - void updateAllAnimationCache (); -private: - float _timeScale = 1; - int _curFrameIndex = -1; - float _accTime = 0.0f; - int _playCount = 0; - int _playTimes = 0; - bool _isAniComplete = true; - std::string _animationName = ""; - - Armature* _armature = nullptr; - ArmatureCache::AnimationData* _animationData = nullptr; - std::map _listenerIDMap; - cocos2d::Color4F _nodeColor = cocos2d::Color4F::WHITE; - - bool _batch = false; - bool _premultipliedAlpha = false; - dbEventCallback _dbEventCallback = nullptr; - cocos2d::renderer::NodeProxy* _nodeProxy = nullptr; - cocos2d::renderer::Effect* _effect = nullptr; - cocos2d::renderer::CustomAssembler* _assembler = nullptr; - ArmatureCache* _armatureCache = nullptr; - EventObject* _eventObject; -}; - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones-creator-support/CCArmatureDisplay.cpp b/native/cocos/editor-support/dragonbones-creator-support/CCArmatureDisplay.cpp deleted file mode 100644 index 6235ee72f6..0000000000 --- a/native/cocos/editor-support/dragonbones-creator-support/CCArmatureDisplay.cpp +++ /dev/null @@ -1,440 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#include "dragonbones-creator-support/CCArmatureDisplay.h" -#include "dragonbones-creator-support/CCSlot.h" -#include "MiddlewareMacro.h" -#include "renderer/renderer/Pass.h" -#include "renderer/renderer/Technique.h" -#include "renderer/gfx/Texture.h" - -USING_NS_CC; -USING_NS_MW; -using namespace cocos2d::renderer; - -static const std::string techStage = "opaque"; -static const std::string textureKey = "texture"; - -DRAGONBONES_NAMESPACE_BEGIN - -CCArmatureDisplay* CCArmatureDisplay::create() -{ - CCArmatureDisplay* displayContainer = new (std::nothrow) CCArmatureDisplay(); - if (displayContainer) - { - displayContainer->autorelease(); - } - else - { - CC_SAFE_DELETE(displayContainer); - } - return displayContainer; -} - -CCArmatureDisplay::CCArmatureDisplay() -{ - -} - -CCArmatureDisplay::~CCArmatureDisplay() -{ - dispose(); - - if (_debugBuffer) - { - delete _debugBuffer; - _debugBuffer = nullptr; - } - - CC_SAFE_RELEASE(_nodeProxy); - CC_SAFE_RELEASE(_effect); -} - -void CCArmatureDisplay::dispose(bool disposeProxy) -{ - if (_armature != nullptr) - { - _armature->dispose(); - _armature = nullptr; - } -} - -void CCArmatureDisplay::dbInit(Armature* armature) -{ - _armature = armature; -} - -void CCArmatureDisplay::dbClear() -{ - _armature = nullptr; - release(); -} - -void CCArmatureDisplay::dbUpdate() {} - -void CCArmatureDisplay::dbRender() -{ - if (_nodeProxy == nullptr) - { - return; - } - - _assembler = (CustomAssembler*)_nodeProxy->getAssembler(); - if (_assembler == nullptr) - { - return; - } - _assembler->reset(); - _assembler->setUseModel(!_batch); - - if (this->_armature->getParent()) - return; - - auto mgr = MiddlewareManager::getInstance(); - if (!mgr->isRendering) return; - - _preBlendMode = -1; - _preTextureIndex = -1; - _curTextureIndex = -1; - _preISegWritePos = -1; - _curISegLen = 0; - - _debugSlotsLen = 0; - _materialLen = 0; - - // Traverse all aramture to fill vertex and index buffer. - traverseArmature(_armature); - if (_preISegWritePos != -1) - { - _assembler->updateIARange(_materialLen - 1, _preISegWritePos, _curISegLen); - } - - if (_debugDraw) - { - // If enable debug draw,then init debug buffer. - if (_debugBuffer == nullptr) - { - _debugBuffer = new IOTypedArray(se::Object::TypedArrayType::FLOAT32, MAX_DEBUG_BUFFER_SIZE); - } - - _debugBuffer->reset(); - - auto& bones = _armature->getBones(); - std::size_t count = bones.size(); - - _debugBuffer->writeFloat32(count * 4); - for (int i = 0; i < count; i++) - { - Bone* bone = (Bone*)bones[i]; - float boneLen = 5; - if (bone->_boneData->length > boneLen) - { - boneLen = bone->_boneData->length; - } - - float bx = bone->globalTransformMatrix.tx; - float by = -bone->globalTransformMatrix.ty; - float endx = bx + bone->globalTransformMatrix.a * boneLen; - float endy = by - bone->globalTransformMatrix.b * boneLen; - - _debugBuffer->writeFloat32(bx); - _debugBuffer->writeFloat32(by); - _debugBuffer->writeFloat32(endx); - _debugBuffer->writeFloat32(endy); - } - - if (_debugBuffer->isOutRange()) - { - _debugBuffer->writeFloat32(0, 0); - cocos2d::log("Dragonbones debug data is too large,debug buffer has no space to put in it!!!!!!!!!!"); - cocos2d::log("You can adjust MAX_DEBUG_BUFFER_SIZE in MiddlewareMacro"); - } - } -} - -cocos2d::Vec2 CCArmatureDisplay::convertToRootSpace(const cocos2d::Vec2& pos) const -{ - CCSlot* slot = (CCSlot*)_armature->getParent(); - if (!slot) - { - return pos; - } - cocos2d::Vec2 newPos; - slot->updateWorldMatrix(); - cocos2d::Mat4& worldMatrix = slot->worldMatrix; - newPos.x = pos.x * worldMatrix.m[0] + pos.y * worldMatrix.m[4] + worldMatrix.m[12]; - newPos.y = pos.x * worldMatrix.m[1] + pos.y * worldMatrix.m[5] + worldMatrix.m[13]; - return newPos; -} - -CCArmatureDisplay* CCArmatureDisplay::getRootDisplay() -{ - Slot* slot = _armature->getParent(); - if (!slot) - { - return this; - } - - Slot* parentSlot = slot->_armature->getParent(); - while (parentSlot) - { - slot = parentSlot; - parentSlot = parentSlot->_armature->getParent(); - } - return (CCArmatureDisplay*)slot->_armature->getDisplay(); -} - -void CCArmatureDisplay::traverseArmature(Armature* armature, float parentOpacity) -{ - static cocos2d::Mat4 matrixTemp; - const cocos2d::Mat4& nodeWorldMat = _nodeProxy->getWorldMatrix(); - - auto& slots = armature->getSlots(); - auto mgr = MiddlewareManager::getInstance(); - - middleware::MeshBuffer* mb = mgr->getMeshBuffer(VF_XYUVC); - IOBuffer& vb = mb->getVB(); - IOBuffer& ib = mb->getIB(); - float realOpacity = _nodeProxy->getRealOpacity() / 255.0f; - - // range [0.0, 255.0] - float r, g, b, a; - CCSlot* slot = nullptr; - middleware::Texture2D* texture = nullptr; - int isFull = 0; - - auto flush = [&]() - { - // fill pre segment count field - if (_preISegWritePos != -1) - { - _assembler->updateIARange(_materialLen - 1, _preISegWritePos, _curISegLen); - } - - // prepare to fill new segment field - switch (slot->_blendMode) - { - case BlendMode::Add: - _curBlendSrc = _premultipliedAlpha ? BlendFactor::ONE : BlendFactor::SRC_ALPHA; - _curBlendDst = BlendFactor::ONE; - break; - case BlendMode::Multiply: - _curBlendSrc = BlendFactor::DST_COLOR; - _curBlendDst = BlendFactor::ONE_MINUS_SRC_ALPHA; - break; - case BlendMode::Screen: - _curBlendSrc = BlendFactor::ONE; - _curBlendDst = BlendFactor::ONE_MINUS_SRC_COLOR; - break; - default: - _curBlendSrc = _premultipliedAlpha ? BlendFactor::ONE : BlendFactor::SRC_ALPHA; - _curBlendDst = BlendFactor::ONE_MINUS_SRC_ALPHA; - break; - } - - double curHash = _curTextureIndex + ((uint8_t)slot->_blendMode << 16) + ((uint8_t)_batch << 24); - - Effect* renderEffect = _assembler->getEffect(_materialLen); - Technique::Parameter* param = nullptr; - Pass* pass = nullptr; - - if (renderEffect) - { - double renderHash = renderEffect->getHash(); - if (abs(renderHash - curHash) >= 0.01) - { - param = (Technique::Parameter*)&(renderEffect->getProperty(textureKey)); - Technique* tech = renderEffect->getTechnique(techStage); - Vector& passes = (Vector&)tech->getPasses(); - pass = *(passes.begin()); - } - } - else - { - if (_effect == nullptr) - { - cocos2d::log("ArmatureDisplay:update get effect failed"); - _assembler->reset(); - return; - } - auto effect = new cocos2d::renderer::Effect(); - effect->autorelease(); - effect->copy(_effect); - - Technique* tech = effect->getTechnique(techStage); - Vector& passes = (Vector&)tech->getPasses(); - pass = *(passes.begin()); - - _assembler->updateEffect(_materialLen, effect); - renderEffect = effect; - param = (Technique::Parameter*)&(renderEffect->getProperty(textureKey)); - } - - if (param) - { - param->setTexture(texture->getNativeTexture()); - } - - if (pass) - { - pass->setBlend(BlendOp::ADD, _curBlendSrc, _curBlendDst, - BlendOp::ADD, _curBlendSrc, _curBlendDst); - } - - renderEffect->updateHash(curHash); - - // save new segment count pos field - _preISegWritePos = (int)ib.getCurPos()/sizeof(unsigned short); - // save new segment vb and ib - _assembler->updateIABuffer(_materialLen, mb->getGLVB(), mb->getGLIB()); - // reset pre blend mode to current - _preBlendMode = (int)slot->_blendMode; - // reset pre texture index to current - _preTextureIndex = _curTextureIndex; - - // reset index segmentation count - _curISegLen = 0; - // material length increased - _materialLen++; - }; - - for (std::size_t i = 0, len = slots.size(); i < len; i++) - { - isFull = 0; - slot = (CCSlot*)slots[i]; - if (!slot->getVisible()) - { - continue; - } - - slot->updateWorldMatrix(); - - // If slots has child armature,will traverse child first. - Armature* childArmature = slot->getChildArmature(); - if (childArmature != nullptr) - { - traverseArmature(childArmature, parentOpacity * slot->color.a / 255.0f); - continue; - } - - texture = slot->getTexture(); - if (!texture) continue; - _curTextureIndex = texture->getNativeTexture()->getHandle(); - - auto vbSize = slot->triangles.vertCount * sizeof(middleware::V2F_T2F_C4B); - isFull |= vb.checkSpace(vbSize, true); - - // If texture or blendMode change,will change material. - if (_preTextureIndex != _curTextureIndex || _preBlendMode != (int)slot->_blendMode || isFull) - { - flush(); - } - - // Calculation vertex color. - a = realOpacity * slot->color.a * parentOpacity; - float multiplier = _premultipliedAlpha ? a / 255.0f : 1.0f; - r = _nodeColor.r * slot->color.r * multiplier; - g = _nodeColor.g * slot->color.g * multiplier; - b = _nodeColor.b * slot->color.b * multiplier; - - // Transform component matrix to global matrix - middleware::Triangles& triangles = slot->triangles; - cocos2d::Mat4* worldMatrix = &slot->worldMatrix; - if (_batch) { - cocos2d::Mat4::multiply(nodeWorldMat, *worldMatrix, &matrixTemp); - worldMatrix = &matrixTemp; - } - - middleware::V2F_T2F_C4B* worldTriangles = slot->worldVerts; - - for (int v = 0, w = 0, vn = triangles.vertCount; v < vn; ++v, w += 2) - { - middleware::V2F_T2F_C4B* vertex = triangles.verts + v; - middleware::V2F_T2F_C4B* worldVertex = worldTriangles + v; - worldVertex->vertex.x = vertex->vertex.x * worldMatrix->m[0] + vertex->vertex.y * worldMatrix->m[4] + worldMatrix->m[12]; - worldVertex->vertex.y = vertex->vertex.x * worldMatrix->m[1] + vertex->vertex.y * worldMatrix->m[5] + worldMatrix->m[13]; - - worldVertex->color.r = (GLubyte)r; - worldVertex->color.g = (GLubyte)g; - worldVertex->color.b = (GLubyte)b; - worldVertex->color.a = (GLubyte)a; - } - - // Fill MiddlewareManager vertex buffer - auto vertexOffset = vb.getCurPos() / sizeof(middleware::V2F_T2F_C4B); - vb.writeBytes((char*)worldTriangles, vbSize); - - auto ibSize = triangles.indexCount * sizeof(unsigned short); - ib.checkSpace(ibSize, true); - // If vertex buffer current offset is zero,fill it directly or recalculate vertex offset. - if (vertexOffset > 0) - { - for (int ii = 0, nn = triangles.indexCount; ii < nn; ii++) - { - ib.writeUint16(triangles.indices[ii] + vertexOffset); - } - } - else - { - ib.writeBytes((char*)triangles.indices, ibSize); - } - - // Record this turn index segmentation count,it will store in material buffer in the end. - _curISegLen += triangles.indexCount; - } -} - -bool CCArmatureDisplay::hasDBEventListener(const std::string& type) const -{ - auto it = _listenerIDMap.find(type); - return it != _listenerIDMap.end(); -} - -void CCArmatureDisplay::addDBEventListener(const std::string& type, const std::function& callback) -{ - _listenerIDMap[type] = true; -} - -void CCArmatureDisplay::dispatchDBEvent(const std::string& type, EventObject* value) -{ - auto it = _listenerIDMap.find(type); - if (it == _listenerIDMap.end()) - { - return; - } - - if (_dbEventCallback) - { - _dbEventCallback(value); - } -} - -void CCArmatureDisplay::removeDBEventListener(const std::string& type, const std::function& callback) -{ - auto it = _listenerIDMap.find(type); - if (it != _listenerIDMap.end()) - { - _listenerIDMap.erase(it); - } -} - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones-creator-support/CCArmatureDisplay.h b/native/cocos/editor-support/dragonbones-creator-support/CCArmatureDisplay.h deleted file mode 100644 index b81da1aac8..0000000000 --- a/native/cocos/editor-support/dragonbones-creator-support/CCArmatureDisplay.h +++ /dev/null @@ -1,214 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_CC_ARMATURE_DISPLAY_CONTAINER_H -#define DRAGONBONES_CC_ARMATURE_DISPLAY_CONTAINER_H - -#include "dragonbones/DragonBonesHeaders.h" -#include "base/CCRef.h" -#include "scripting/js-bindings/event/EventDispatcher.h" -#include -#include - -#include "dragonbones-creator-support/CCSlot.h" -#include "IOTypedArray.h" -#include "MiddlewareManager.h" -#include "renderer/scene/NodeProxy.hpp" -#include "base/CCMap.h" -#include "middleware-adapter.h" -#include "renderer/scene/assembler/CustomAssembler.hpp" -#include "renderer/Types.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * CCArmatureDisplay is a armature tree.It can add or remove a childArmature. - * It will not save vertices and indices.Only CCSlot will save these info. - * And CCArmatureDisplay will traverse all tree node and calculate render data. - */ -class CCArmatureDisplay : public cocos2d::Ref, public virtual IArmatureProxy -{ - DRAGONBONES_DISALLOW_COPY_AND_ASSIGN(CCArmatureDisplay) - -public: - /** - * @internal - */ - static CCArmatureDisplay* create(); - -private: - void traverseArmature(Armature* armature, float parentOpacity = 1.0f); - -protected: - bool _debugDraw = false; - Armature* _armature = nullptr; - -public: - CCArmatureDisplay(); - virtual ~CCArmatureDisplay(); - - /** - * @inheritDoc - */ - virtual void dbInit(Armature* armature) override; - /** - * @inheritDoc - */ - virtual void dbClear() override; - /** - * @inheritDoc - */ - virtual void dbUpdate() override; - /** - * @inheritDoc - */ - virtual void dbRender() override; - /** - * @inheritDoc - */ - virtual void dispose(bool disposeProxy = true) override; - /** - * @inheritDoc - */ - virtual bool hasDBEventListener(const std::string& type) const override; - /** - * @inheritDoc - */ - virtual void dispatchDBEvent(const std::string& type, EventObject* value) override; - /** - * @inheritDoc - */ - virtual void addDBEventListener(const std::string& type, const std::function& listener) override; - /** - * @inheritDoc - */ - virtual void removeDBEventListener(const std::string& type, const std::function& listener) override; - - typedef std::function dbEventCallback; - void setDBEventCallback(dbEventCallback callback) - { - _dbEventCallback = callback; - } - - /** - * @inheritDoc - */ - inline virtual Armature* getArmature() const override - { - return _armature; - } - /** - * @inheritDoc - */ - inline virtual Animation* getAnimation() const override - { - return _armature->getAnimation(); - } - - /** - * @return debug data,it's a Float32Array, - * format |debug bones length|[beginX|beginY|toX|toY|...loop...] - */ - se_object_ptr getDebugData() const - { - if (_debugBuffer) - { - return _debugBuffer->getTypeArray(); - } - return nullptr; - } - - void bindNodeProxy(cocos2d::renderer::NodeProxy* node) - { - CC_SAFE_RELEASE(_nodeProxy); - _nodeProxy = node; - CC_SAFE_RETAIN(_nodeProxy); - } - - void setEffect(cocos2d::renderer::Effect* effect) - { - if (effect == _effect) return; - CC_SAFE_RELEASE(_effect); - _effect = effect; - CC_SAFE_RETAIN(_effect); - } - - void setColor(cocos2d::Color4B& color) - { - _nodeColor.r = color.r / 255.0f; - _nodeColor.g = color.g / 255.0f; - _nodeColor.b = color.b / 255.0f; - _nodeColor.a = color.a / 255.0f; - } - - void setDebugBonesEnabled(bool enabled) - { - _debugDraw = enabled; - } - - void setBatchEnabled (bool enabled) - { - _batch = enabled; - } - - void setOpacityModifyRGB (bool value) - { - _premultipliedAlpha = value; - } - - /** - * @brief Convert component position to global position. - * @param[in] pos Component position - * @return Global position - */ - cocos2d::Vec2 convertToRootSpace(const cocos2d::Vec2& pos) const; - - /** - * @return root display,if this diplay is root,then return itself. - */ - CCArmatureDisplay* getRootDisplay(); -private: - std::map _listenerIDMap; - cocos2d::middleware::IOTypedArray* _debugBuffer = nullptr; - cocos2d::Color4F _nodeColor = cocos2d::Color4F::WHITE; - - int _preBlendMode = -1; - GLuint _preTextureIndex = -1; - GLuint _curTextureIndex = -1; - cocos2d::renderer::BlendFactor _curBlendSrc; - cocos2d::renderer::BlendFactor _curBlendDst; - - int _preISegWritePos = -1; - int _curISegLen = 0; - - int _debugSlotsLen = 0; - int _materialLen = 0; - - bool _batch = false; - bool _premultipliedAlpha = false; - dbEventCallback _dbEventCallback = nullptr; - cocos2d::renderer::NodeProxy* _nodeProxy = nullptr; - cocos2d::renderer::Effect* _effect = nullptr; - cocos2d::renderer::CustomAssembler* _assembler = nullptr; -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_CC_ARMATURE_DISPLAY_CONTAINER_H diff --git a/native/cocos/editor-support/dragonbones-creator-support/CCDragonBonesHeaders.h b/native/cocos/editor-support/dragonbones-creator-support/CCDragonBonesHeaders.h deleted file mode 100644 index cf76009080..0000000000 --- a/native/cocos/editor-support/dragonbones-creator-support/CCDragonBonesHeaders.h +++ /dev/null @@ -1,33 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_CC_HEADERS_H -#define DRAGONBONES_CC_HEADERS_H - -#include "dragonbones-creator-support/CCTextureAtlasData.h" -#include "dragonbones-creator-support/CCArmatureDisplay.h" -#include "dragonbones-creator-support/CCSlot.h" -#include "dragonbones-creator-support/CCFactory.h" -#include "dragonbones-creator-support/ArmatureCacheMgr.h" -#include "dragonbones-creator-support/CCArmatureCacheDisplay.h" - -#endif // DRAGONBONES_CC_HEADERS_H diff --git a/native/cocos/editor-support/dragonbones-creator-support/CCFactory.cpp b/native/cocos/editor-support/dragonbones-creator-support/CCFactory.cpp deleted file mode 100644 index 3c7000ed08..0000000000 --- a/native/cocos/editor-support/dragonbones-creator-support/CCFactory.cpp +++ /dev/null @@ -1,240 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#include "dragonbones-creator-support/CCFactory.h" -#include "dragonbones-creator-support/CCTextureAtlasData.h" -#include "dragonbones-creator-support/CCArmatureDisplay.h" -#include "dragonbones-creator-support/CCSlot.h" -#include "platform/CCFileUtils.h" - -USING_NS_CC; - -DRAGONBONES_NAMESPACE_BEGIN - -DragonBones* CCFactory::_dragonBonesInstance = nullptr; -CCFactory* CCFactory::_factory = nullptr; - -TextureAtlasData* CCFactory::_buildTextureAtlasData(TextureAtlasData* textureAtlasData, void* textureAtlas) const -{ - if (textureAtlasData != nullptr) - { - const auto pos = _prevPath.find_last_of("/"); - if (pos != std::string::npos) - { - const auto basePath = _prevPath.substr(0, pos + 1); - textureAtlasData->imagePath = basePath + textureAtlasData->imagePath; - } - - if (textureAtlas != nullptr) - { - static_cast(textureAtlasData)->setRenderTexture(static_cast(textureAtlas)); - } - } - else - { - textureAtlasData = BaseObject::borrowObject(); - } - - return textureAtlasData; -} - -Armature* CCFactory::_buildArmature(const BuildArmaturePackage& dataPackage) const -{ - const auto armature = BaseObject::borrowObject(); - const auto armatureDisplay = CCArmatureDisplay::create(); - - // will release when armature destructor - armatureDisplay->retain(); - - armature->init( - dataPackage.armature, - armatureDisplay, armatureDisplay, _dragonBones - ); - - return armature; -} - -Slot* CCFactory::_buildSlot(const BuildArmaturePackage& dataPackage, const SlotData* slotData, Armature* armature) const -{ - const auto slot = BaseObject::borrowObject(); - - slot->init( - slotData, armature, - slot, slot - ); - - return slot; -} - -DragonBonesData* CCFactory::loadDragonBonesData(const std::string& filePath, const std::string& name, float scale) -{ - if (!name.empty()) - { - const auto existedData = getDragonBonesData(name); - if (existedData) - { - return existedData; - } - } - - const auto fullpath = cocos2d::FileUtils::getInstance()->fullPathForFilename(filePath); - if (cocos2d::FileUtils::getInstance()->isFileExist(filePath)) - { - const auto pos = fullpath.find(".json"); - - if (pos != std::string::npos) - { - const auto data = cocos2d::FileUtils::getInstance()->getStringFromFile(filePath); - - return parseDragonBonesData(data.c_str(), name, scale); - } - else - { - cocos2d::Data cocos2dData; - cocos2d::FileUtils::getInstance()->getContents(fullpath, &cocos2dData); - const auto binary = (unsigned char*)malloc(sizeof(unsigned char)* cocos2dData.getSize()); - memcpy(binary, cocos2dData.getBytes(), cocos2dData.getSize()); - const auto data = parseDragonBonesData((char*)binary, name, scale); - - return data; - } - } - - return nullptr; -} - -DragonBonesData* CCFactory::parseDragonBonesDataByPath(const std::string& filePath, const std::string& name, float scale) -{ - if (!name.empty()) - { - const auto existedData = getDragonBonesData(name); - if (existedData) - { - return existedData; - } - } - - const auto dbbinPos = filePath.find(".dbbin"); - if (dbbinPos != std::string::npos) - { - const auto fullpath = cocos2d::FileUtils::getInstance()->fullPathForFilename(filePath); - if (cocos2d::FileUtils::getInstance()->isFileExist(filePath)) - { - cocos2d::Data cocos2dData; - cocos2d::FileUtils::getInstance()->getContents(fullpath, &cocos2dData); - const auto binary = (unsigned char*)malloc(sizeof(unsigned char)* cocos2dData.getSize()); - memcpy(binary, cocos2dData.getBytes(), cocos2dData.getSize()); - - return parseDragonBonesData((char*)binary, name, scale); - } - } - else - { - return parseDragonBonesData(filePath.c_str(), name, scale); - } - - return nullptr; -} - -void CCFactory::removeDragonBonesDataByUUID(const std::string& uuid, bool disposeData) -{ - for (auto it = _dragonBonesDataMap.begin(); it != _dragonBonesDataMap.end(); ) - { - if (it->first.find(uuid) != std::string::npos) - { - if (disposeData) - { - it->second->returnToPool(); - } - it = _dragonBonesDataMap.erase(it); - } - else - { - it++; - } - } -} - -TextureAtlasData* CCFactory::loadTextureAtlasData(const std::string& filePath, const std::string& name, float scale) -{ - _prevPath = cocos2d::FileUtils::getInstance()->fullPathForFilename(filePath); - const auto data = cocos2d::FileUtils::getInstance()->getStringFromFile(_prevPath); - if (data.empty()) - { - return nullptr; - } - - return static_cast(BaseFactory::parseTextureAtlasData(data.c_str(), nullptr, name, scale)); -} - -CCArmatureDisplay* CCFactory::buildArmatureDisplay(const std::string& armatureName, const std::string& dragonBonesName, const std::string& skinName, const std::string& textureAtlasName) const -{ - const auto armature = buildArmature(armatureName, dragonBonesName, skinName, textureAtlasName); - if (armature != nullptr) - { - return static_cast(armature->getDisplay()); - } - - return nullptr; -} - -void CCFactory::removeTextureAtlasDataByIndex(const std::string& name, int textureIndex) -{ - const auto iterator = _textureAtlasDataMap.find(name); - if (iterator != _textureAtlasDataMap.end()) - { - auto& textureAtlasDataList = iterator->second; - for (auto it = textureAtlasDataList.begin(); it != textureAtlasDataList.end(); it++) - { - middleware::Texture2D* texture = ((CCTextureAtlasData*)*it)->getRenderTexture(); - if (texture && texture->getRealTextureIndex() == textureIndex) - { - textureAtlasDataList.erase(it); - break; - } - } - if (textureAtlasDataList.size() == 0) - { - _textureAtlasDataMap.erase(iterator); - } - } -} - -CCTextureAtlasData* CCFactory::getTextureAtlasDataByIndex(const std::string& name, int textureIndex) const -{ - const auto iterator = _textureAtlasDataMap.find(name); - if (iterator != _textureAtlasDataMap.end()) - { - auto& textureAtlasDataList = iterator->second; - for (auto it = textureAtlasDataList.begin(); it != textureAtlasDataList.end(); it++) - { - middleware::Texture2D* texture = ((CCTextureAtlasData*)*it)->getRenderTexture(); - if (texture && texture->getRealTextureIndex() == textureIndex) - { - return (CCTextureAtlasData*)*it; - } - } - } - return nullptr; -} - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones-creator-support/CCFactory.h b/native/cocos/editor-support/dragonbones-creator-support/CCFactory.h deleted file mode 100644 index ca6bac03c3..0000000000 --- a/native/cocos/editor-support/dragonbones-creator-support/CCFactory.h +++ /dev/null @@ -1,270 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_CC_FACTORY_H -#define DRAGONBONES_CC_FACTORY_H - -#include "dragonbones/DragonBonesHeaders.h" -#include "dragonbones-creator-support/CCArmatureDisplay.h" -#include "MiddlewareManager.h" - -DRAGONBONES_NAMESPACE_BEGIN - -class CCTextureAtlasData; - -/** - * The Cocos2d factory. - * @version DragonBones 3.0 - * @language en_US - */ -/** - * Cocos2d 工厂。 - * @version DragonBones 3.0 - * @language zh_CN - */ -class CCFactory : public BaseFactory, public cocos2d::middleware::IMiddleware -{ - DRAGONBONES_DISALLOW_COPY_AND_ASSIGN(CCFactory) - -private: - static DragonBones* _dragonBonesInstance; - static CCFactory* _factory; - -public: - static bool isInit() - { - return _factory != nullptr; - } - - /** - * A global factory instance that can be used directly. - * @version DragonBones 4.7 - * @language en_US - */ - /** - * 一个可以直接使用的全局工厂实例。 - * @version DragonBones 4.7 - * @language zh_CN - */ - static CCFactory* getFactory() - { - if (CCFactory::_factory == nullptr) - { - CCFactory::_factory = new CCFactory(); - } - - return CCFactory::_factory; - } - - static void destroyFactory() - { - if (_dragonBonesInstance) - { - delete _dragonBonesInstance; - _dragonBonesInstance = nullptr; - } - - if (_factory) - { - delete _factory; - _factory = nullptr; - } - } - -protected: - std::string _prevPath; - -public: - /** - * @inheritDoc - */ - CCFactory() : - _prevPath() - { - if (_dragonBonesInstance == nullptr) - { - const auto eventManager = CCArmatureDisplay::create(); - eventManager->retain(); - - _dragonBonesInstance = new DragonBones(eventManager); - - cocos2d::middleware::MiddlewareManager::getInstance()->addTimer(this); - } - - _dragonBones = _dragonBonesInstance; - } - - virtual void update(float dt) override - { - _dragonBonesInstance->advanceTime(dt); - } - - virtual void render(float dt) override - { - _dragonBonesInstance->render(); - } - - /** - * @note When script engine clean up is trigger,will stop dragonbones timer. - */ - void stopSchedule() - { - cocos2d::middleware::MiddlewareManager::getInstance()->removeTimer(this); - } - - /** - * @note Destructor call by jsb_dragonbones_manual,when script engine clean up is trigger. - */ - virtual ~CCFactory() - { - clear(false); - } - -protected: - virtual TextureAtlasData* _buildTextureAtlasData(TextureAtlasData* textureAtlasData, void* textureAtlas) const override; - virtual Armature* _buildArmature(const BuildArmaturePackage& dataPackage) const override; - virtual Slot* _buildSlot(const BuildArmaturePackage& dataPackage, const SlotData* slotData, Armature* armature) const override; - -public: - virtual DragonBonesData* loadDragonBonesData(const std::string& filePath, const std::string& name = "", float scale = 1.0f); - /** - * - Load and parse a texture atlas data and texture from the local and cache them to the factory. - * @param filePath - The file path of texture atlas data. - * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (If not set, use the instance name instead) - * @param scale - Specify a scaling value for the map set. (Not scaled by default) - * @returns The TextureAtlasData instance. - * @version DragonBones 4.5 - * @example - *
-     *     factory.loadTextureAtlasData("hero_tex.json");
-     * 
- * @language en_US - */ - /** - * - 从本地加载并解析一个贴图集数据和贴图并缓存到工厂中。 - * @param filePath - 贴图集数据文件路径。 - * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) - * @param scale - 为贴图集指定一个缩放值。 (默认不缩放) - * @returns TextureAtlasData 实例。 - * @version DragonBones 4.5 - * @example - *
-     *     factory.loadTextureAtlasData("hero_tex.json");
-     * 
- * @language zh_CN - */ - virtual TextureAtlasData* loadTextureAtlasData(const std::string& filePath, const std::string& name = "", float scale = 1.0f); - /** - * - Create a armature from cached DragonBonesData instances and TextureAtlasData instances, then use the {@link #clock} to update it. - * The difference is that the armature created by {@link #buildArmature} is not WorldClock instance update. - * @param armatureName - The armature data name. - * @param dragonBonesName - The cached name of the DragonBonesData instance. (If not set, all DragonBonesData instances are retrieved, and when multiple DragonBonesData instances contain a the same name armature data, it may not be possible to accurately create a specific armature) - * @param skinName - The skin name, you can set a different ArmatureData name to share it's skin data. (If not set, use the default skin data) - * @returns The armature display container. - * @version DragonBones 4.5 - * @example - *
-     *     let armatureDisplay = factory.buildArmatureDisplay("armatureName", "dragonBonesName");
-     * 
- * @language en_US - */ - /** - * - 通过缓存的 DragonBonesData 实例和 TextureAtlasData 实例创建一个骨架,并用 {@link #clock} 更新该骨架。 - * 区别在于由 {@link #buildArmature} 创建的骨架没有 WorldClock 实例驱动。 - * @param armatureName - 骨架数据名称。 - * @param dragonBonesName - DragonBonesData 实例的缓存名称。 (如果未设置,将检索所有的 DragonBonesData 实例,当多个 DragonBonesData 实例中包含同名的骨架数据时,可能无法准确的创建出特定的骨架) - * @param skinName - 皮肤名称,可以设置一个其他骨架数据名称来共享其皮肤数据。 (如果未设置,则使用默认的皮肤数据) - * @returns 骨架的显示容器。 - * @version DragonBones 4.5 - * @example - *
-     *     let armatureDisplay = factory.buildArmatureDisplay("armatureName", "dragonBonesName");
-     * 
- * @language zh_CN - */ - virtual CCArmatureDisplay* buildArmatureDisplay(const std::string& armatureName, const std::string& dragonBonesName = "", const std::string& skinName = "", const std::string& textureAtlasName = "") const; - /** - * - A global sound event manager. - * Sound events can be listened to uniformly from the manager. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 全局声音事件管理器。 - * 声音事件可以从该管理器统一侦听。 - * @version DragonBones 4.5 - * @language zh_CN - */ - virtual CCArmatureDisplay* getSoundEventManager() const - { - return dynamic_cast(static_cast(_dragonBones->getEventManager())); - } - - /** - * Deprecated, please refer to {@link #clock}. - * @deprecated - * @language en_US - */ - /** - * 已废弃,请参考 {@link #clock}。 - * @deprecated - * @language zh_CN - */ - static WorldClock* getClock() - { - return _dragonBonesInstance->getClock(); - } - - void add(Armature* armature) - { - _dragonBonesInstance->getClock()->add(armature); - } - - void remove(Armature* armature) - { - _dragonBonesInstance->getClock()->remove(armature); - } - - void setTimeScale(float timeScale) - { - _dragonBonesInstance->getClock()->timeScale = timeScale; - } - - float getTimeScale() - { - return _dragonBonesInstance->getClock()->timeScale; - } - - DragonBones* getDragonBones() - { - return _dragonBonesInstance; - } - - void removeTextureAtlasDataByIndex(const std::string& name, int textureIndex); - void removeDragonBonesDataByUUID(const std::string& uuid, bool disposeData = true); - - CCTextureAtlasData* getTextureAtlasDataByIndex(const std::string& name, int textureIndex) const; - DragonBonesData* parseDragonBonesDataByPath(const std::string& filePath, const std::string& name = "", float scale = 1.0f); -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_CC_FACTORY_H diff --git a/native/cocos/editor-support/dragonbones-creator-support/CCSlot.cpp b/native/cocos/editor-support/dragonbones-creator-support/CCSlot.cpp deleted file mode 100644 index 89c5c9914e..0000000000 --- a/native/cocos/editor-support/dragonbones-creator-support/CCSlot.cpp +++ /dev/null @@ -1,526 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#include "dragonbones-creator-support/CCSlot.h" -#include "dragonbones-creator-support/CCTextureAtlasData.h" -#include "dragonbones-creator-support/CCArmatureDisplay.h" - -USING_NS_CC; - -DRAGONBONES_NAMESPACE_BEGIN - -void CCSlot::_onClear() -{ - Slot::_onClear(); - disposeTriangles(); - _localMatrix.setIdentity(); - worldMatrix.setIdentity(); - _worldMatDirty = true; -} - -void CCSlot::disposeTriangles() -{ - if (worldVerts){ - delete[] worldVerts; - worldVerts = nullptr; - } - if (triangles.verts) - { - delete[] triangles.verts; - triangles.verts = nullptr; - } - if (triangles.indices) - { - delete[] triangles.indices; - triangles.indices = nullptr; - } - triangles.indexCount = 0; - triangles.vertCount = 0; -} - -void CCSlot::adjustTriangles(const unsigned vertexCount, const unsigned indicesCount) -{ - if (triangles.vertCount < vertexCount) - { - if (triangles.verts) - { - delete[] triangles.verts; - } - triangles.verts = new middleware::V2F_T2F_C4B[vertexCount]; - - if (worldVerts) - { - delete[] worldVerts; - } - worldVerts = new middleware::V2F_T2F_C4B[vertexCount]; - } - triangles.vertCount = vertexCount; - - if (triangles.indexCount < indicesCount) - { - if (triangles.indices) - { - delete[] triangles.indices; - } - triangles.indices = new unsigned short[indicesCount]; - } - triangles.indexCount = indicesCount; -} - -void CCSlot::_initDisplay(void* value, bool isRetain) -{ - -} - -void CCSlot::_disposeDisplay(void* value, bool isRelease) -{ - -} - -void CCSlot::_onUpdateDisplay() -{ - -} - -void CCSlot::_addDisplay() -{ - _visible = true; -} - -void CCSlot::_replaceDisplay(void* value, bool isArmatureDisplay) -{ - -} - -void CCSlot::_removeDisplay() -{ - _visible = false; -} - -void CCSlot::_updateZOrder() -{ - -} - -void CCSlot::_updateVisible() -{ - _visible = _parent->getVisible(); -} - -middleware::Texture2D* CCSlot::getTexture() const -{ - const auto currentTextureData = static_cast(_textureData); - if (!currentTextureData || !currentTextureData->spriteFrame) - { - return nullptr; - } - return currentTextureData->spriteFrame->getTexture(); -} - -void CCSlot::_updateFrame() -{ - const auto currentVerticesData = (_deformVertices != nullptr && _display == _meshDisplay) ? _deformVertices->verticesData : nullptr; - const auto currentTextureData = static_cast(_textureData); - - if (_displayIndex >= 0 && _display != nullptr && currentTextureData != nullptr) - { - if (currentTextureData->spriteFrame != nullptr) - { - const auto& region = currentTextureData->region; - const auto texture = currentTextureData->spriteFrame->getTexture(); - const auto textureWidth = texture->getPixelsWide(); - const auto textureHeight = texture->getPixelsHigh(); - - if (currentVerticesData != nullptr) // Mesh. - { - const auto data = currentVerticesData->data; - const auto intArray = data->intArray; - const auto floatArray = data->floatArray; - const unsigned vertexCount = intArray[currentVerticesData->offset + (unsigned)BinaryOffset::MeshVertexCount]; - const unsigned triangleCount = intArray[currentVerticesData->offset + (unsigned)BinaryOffset::MeshTriangleCount]; - int vertexOffset = intArray[currentVerticesData->offset + (unsigned)BinaryOffset::MeshFloatOffset]; - - if (vertexOffset < 0) - { - vertexOffset += 65536; // Fixed out of bouds bug. - } - - const unsigned uvOffset = vertexOffset + vertexCount * 2; - const unsigned indicesCount = triangleCount * 3; - adjustTriangles(vertexCount, indicesCount); - auto vertices = triangles.verts; - auto vertexIndices = triangles.indices; - - boundsRect.origin.x = 999999.0f; - boundsRect.origin.y = 999999.0f; - boundsRect.size.width = -999999.0f; - boundsRect.size.height = -999999.0f; - - for (std::size_t i = 0, l = vertexCount * 2; i < l; i += 2) - { - const auto iH = i / 2; - const auto x = floatArray[vertexOffset + i]; - const auto y = floatArray[vertexOffset + i + 1]; - auto u = floatArray[uvOffset + i]; - auto v = floatArray[uvOffset + i + 1]; - middleware::V2F_T2F_C4B& vertexData = vertices[iH]; - vertexData.vertex.x = x; - vertexData.vertex.y = -y; - - if (currentTextureData->rotated) - { - vertexData.texCoord.u = (region.x + (1.0f - v) * region.width) / textureWidth; - vertexData.texCoord.v = (region.y + u * region.height) / textureHeight; - } - else - { - vertexData.texCoord.u = (region.x + u * region.width) / textureWidth; - vertexData.texCoord.v = (region.y + v * region.height) / textureHeight; - } - - vertexData.color = cocos2d::Color4B::WHITE; - - if (boundsRect.origin.x > x) - { - boundsRect.origin.x = x; - } - - if (boundsRect.size.width < x) - { - boundsRect.size.width = x; - } - - if (boundsRect.origin.y > -y) - { - boundsRect.origin.y = -y; - } - - if (boundsRect.size.height < -y) - { - boundsRect.size.height = -y; - } - } - - boundsRect.size.width -= boundsRect.origin.x; - boundsRect.size.height -= boundsRect.origin.y; - - for (std::size_t i = 0; i < triangleCount * 3; ++i) - { - vertexIndices[i] = intArray[currentVerticesData->offset + (unsigned)BinaryOffset::MeshVertexIndices + i]; - } - - const auto isSkinned = currentVerticesData->weight != nullptr; - if (isSkinned) - { - _identityTransform(); - } - } else { - adjustTriangles(4, 6); - - auto vertices = triangles.verts; - auto vertexIndices = triangles.indices; - - float l = region.x / textureWidth; - float b = (region.y + region.height) / textureHeight; - float r = (region.x + region.width) / textureWidth; - float t = region.y / textureHeight; - - vertices[0].texCoord.u = l; vertices[0].texCoord.v = b; - vertices[1].texCoord.u = r; vertices[1].texCoord.v = b; - vertices[2].texCoord.u = l; vertices[2].texCoord.v = t; - vertices[3].texCoord.u = r; vertices[3].texCoord.v = t; - - vertices[0].vertex.x = vertices[2].vertex.x = 0; - vertices[1].vertex.x = vertices[3].vertex.x = region.width; - vertices[0].vertex.y = vertices[1].vertex.y = 0; - vertices[2].vertex.y = vertices[3].vertex.y = region.height; - - vertexIndices[0] = 0; - vertexIndices[1] = 1; - vertexIndices[2] = 2; - vertexIndices[3] = 1; - vertexIndices[4] = 3; - vertexIndices[5] = 2; - } - - memcpy(worldVerts, triangles.verts, triangles.vertCount * sizeof(middleware::V2F_T2F_C4B)); - - _visibleDirty = true; - _blendModeDirty = true; // Relpace texture will override blendMode and color. - _colorDirty = true; - - return; - } - } -} - -void CCSlot::_updateMesh() -{ - const auto scale = _armature->_armatureData->scale; - const auto& deformVertices = _deformVertices->vertices; - const auto& bones = _deformVertices->bones; - const auto verticesData = _deformVertices->verticesData; - const auto weightData = verticesData->weight; - - const auto hasFFD = !deformVertices.empty(); - const auto textureData = static_cast(_textureData); - const auto vertices = triangles.verts; - - boundsRect.origin.x = 999999.0f; - boundsRect.origin.y = 999999.0f; - boundsRect.size.width = -999999.0f; - boundsRect.size.height = -999999.0f; - - if (!textureData) - { - return; - } - - if (weightData != nullptr) - { - const auto data = verticesData->data; - const auto intArray = data->intArray; - const auto floatArray = data->floatArray; - const auto vertexCount = (std::size_t)intArray[verticesData->offset + (unsigned)BinaryOffset::MeshVertexCount]; - int weightFloatOffset = intArray[weightData->offset + (unsigned)BinaryOffset::WeigthFloatOffset]; - - if (vertexCount > triangles.vertCount) { - return; - } - - if (weightFloatOffset < 0) - { - weightFloatOffset += 65536; // Fixed out of bouds bug. - } - - for ( - std::size_t i = 0, iB = weightData->offset + (unsigned)BinaryOffset::WeigthBoneIndices + bones.size(), iV = (std::size_t)weightFloatOffset, iF = 0; - i < vertexCount; - ++i - ) - { - const auto boneCount = (std::size_t)intArray[iB++]; - auto xG = 0.0f, yG = 0.0f; - for (std::size_t j = 0; j < boneCount; ++j) - { - const auto boneIndex = (unsigned)intArray[iB++]; - const auto bone = bones[boneIndex]; - if (bone != nullptr) - { - const auto& matrix = bone->globalTransformMatrix; - const auto weight = floatArray[iV++]; - auto xL = floatArray[iV++] * scale; - auto yL = floatArray[iV++] * scale; - - if (hasFFD) - { - xL += deformVertices[iF++]; - yL += deformVertices[iF++]; - } - - xG += (matrix.a * xL + matrix.c * yL + matrix.tx) * weight; - yG += (matrix.b * xL + matrix.d * yL + matrix.ty) * weight; - } - } - - auto& vertex = vertices[i]; - auto& vertexPosition = vertex.vertex; - - vertexPosition.x = xG; - vertexPosition.y = -yG; - - if (boundsRect.origin.x > xG) - { - boundsRect.origin.x = xG; - } - - if (boundsRect.size.width < xG) - { - boundsRect.size.width = xG; - } - - if (boundsRect.origin.y > -yG) - { - boundsRect.origin.y = -yG; - } - - if (boundsRect.size.height < -yG) - { - boundsRect.size.height = -yG; - } - } - } - else if (hasFFD) - { - const auto data = verticesData->data; - const auto intArray = data->intArray; - const auto floatArray = data->floatArray; - const auto vertexCount = (std::size_t)intArray[verticesData->offset + (unsigned)BinaryOffset::MeshVertexCount]; - std::size_t vertexOffset = (std::size_t)intArray[verticesData->offset + (unsigned)BinaryOffset::MeshFloatOffset]; - - if (vertexCount > triangles.vertCount) { - return; - } - - if (vertexOffset < 0) - { - vertexOffset += 65536; // Fixed out of bouds bug. - } - - for (std::size_t i = 0, l = vertexCount * 2; i < l; i += 2) - { - const auto iH = i / 2; - const auto xG = floatArray[vertexOffset + i] * scale + deformVertices[i]; - const auto yG = floatArray[vertexOffset + i + 1] * scale + deformVertices[i + 1]; - - auto& vertex = vertices[iH]; - auto& vertexPosition = vertex.vertex; - - vertexPosition.x = xG; - vertexPosition.y = -yG; - - if (boundsRect.origin.x > xG) - { - boundsRect.origin.x = xG; - } - - if (boundsRect.size.width < xG) - { - boundsRect.size.width = xG; - } - - if (boundsRect.origin.y > -yG) - { - boundsRect.origin.y = -yG; - } - - if (boundsRect.size.height < -yG) - { - boundsRect.size.height = -yG; - } - } - } - - boundsRect.size.width -= boundsRect.origin.x; - boundsRect.size.height -= boundsRect.origin.y; - - if (weightData != nullptr) - { - _identityTransform(); - } -} - -void CCSlot::_updateTransform() -{ - _localMatrix.m[0] = globalTransformMatrix.a; - _localMatrix.m[1] = globalTransformMatrix.b; - _localMatrix.m[4] = -globalTransformMatrix.c; - _localMatrix.m[5] = -globalTransformMatrix.d; - - if (_childArmature) - { - _localMatrix.m[12] = globalTransformMatrix.tx; - _localMatrix.m[13] = globalTransformMatrix.ty; - } - else - { - _localMatrix.m[12] = globalTransformMatrix.tx - (globalTransformMatrix.a * _pivotX - globalTransformMatrix.c * _pivotY); - _localMatrix.m[13] = globalTransformMatrix.ty - (globalTransformMatrix.b * _pivotX - globalTransformMatrix.d * _pivotY); - } - - _worldMatDirty = true; -} - -void CCSlot::updateWorldMatrix() -{ - if (!_armature)return; - - CCSlot* parent = (CCSlot*)_armature->getParent(); - if (parent) - { - parent->updateWorldMatrix(); - } - - if (_worldMatDirty) - { - calculWorldMatrix(); - - Armature* childArmature = getChildArmature(); - if(!childArmature)return; - - auto& slots = childArmature->getSlots(); - for (int i = 0; i < slots.size(); i++) - { - CCSlot* slot = (CCSlot*)slots[i]; - slot->_worldMatDirty = true; - } - } -} - -void CCSlot::calculWorldMatrix() -{ - CCSlot* parent = (CCSlot*)_armature->getParent(); - if (parent) - { - worldMatrix = parent->worldMatrix * _localMatrix; - } - else - { - worldMatrix = _localMatrix; - } - - _worldMatDirty = false; -} - -void CCSlot::_identityTransform() -{ - _localMatrix.m[0] = 1.0f; - _localMatrix.m[1] = 0.0f; - _localMatrix.m[4] = -0.0f; - _localMatrix.m[5] = -1.0f; - _localMatrix.m[12] = 0.0f; - _localMatrix.m[13] = 0.0f; - - _worldMatDirty = true; -} - -void CCSlot::_updateBlendMode() -{ - if (_childArmature != nullptr) - { - for (const auto slot : _childArmature->getSlots()) - { - slot->_blendMode = _blendMode; - slot->_updateBlendMode(); - } - } -} - -void CCSlot::_updateColor() -{ - color.r = _colorTransform.redMultiplier * 255.0f; - color.g = _colorTransform.greenMultiplier * 255.0f; - color.b = _colorTransform.blueMultiplier * 255.0f; - color.a = _colorTransform.alphaMultiplier * 255.0f; -} - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones-creator-support/CCSlot.h b/native/cocos/editor-support/dragonbones-creator-support/CCSlot.h deleted file mode 100644 index cd8faaa6c0..0000000000 --- a/native/cocos/editor-support/dragonbones-creator-support/CCSlot.h +++ /dev/null @@ -1,88 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_CC_SLOT_H -#define DRAGONBONES_CC_SLOT_H - -#include "dragonbones/DragonBonesHeaders.h" -#include "cocos2d.h" -#include "middleware-adapter.h" -#include "math/CCGeometry.h" -#include "math/Mat4.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * The Cocos2d slot. - * @version DragonBones 3.0 - * @language en_US - */ -/** - * Cocos2d 插槽。 - * @version DragonBones 3.0 - * @language zh_CN - */ -class CCSlot : public Slot -{ - BIND_CLASS_TYPE_A(CCSlot); - -public: - // Global matrix (相对于骨骼部件) - cocos2d::Mat4 worldMatrix; - // Global matrix dirty flag - bool _worldMatDirty = true; - // Slot triangles - cocos2d::middleware::Triangles triangles; - // Slot vertex transform to World vertex - cocos2d::middleware::V2F_T2F_C4B* worldVerts = nullptr; - cocos2d::Color4B color; - cocos2d::Rect boundsRect; -private: - cocos2d::Mat4 _localMatrix; -private: - void disposeTriangles(); - void calculWorldMatrix(); - void adjustTriangles(const unsigned vertexCount, const unsigned indicesCount); -protected: - virtual void _onClear() override; - virtual void _initDisplay(void* value, bool isRetain) override; - virtual void _disposeDisplay(void* value, bool isRelease) override; - virtual void _onUpdateDisplay() override; - virtual void _addDisplay() override; - virtual void _replaceDisplay(void* value, bool isArmatureDisplay) override; - virtual void _removeDisplay() override; - virtual void _updateZOrder() override; - -public: - virtual void _updateVisible() override; - virtual void _updateBlendMode() override; - virtual void _updateColor() override; - void updateWorldMatrix(); - cocos2d::middleware::Texture2D* getTexture() const; -protected: - virtual void _updateFrame() override; - virtual void _updateMesh() override; - virtual void _updateTransform() override; - virtual void _identityTransform() override; -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_CC_SLOT_H diff --git a/native/cocos/editor-support/dragonbones-creator-support/CCTextureAtlasData.cpp b/native/cocos/editor-support/dragonbones-creator-support/CCTextureAtlasData.cpp deleted file mode 100644 index b132a3a6b6..0000000000 --- a/native/cocos/editor-support/dragonbones-creator-support/CCTextureAtlasData.cpp +++ /dev/null @@ -1,99 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#include "dragonbones-creator-support/CCTextureAtlasData.h" -USING_NS_CC; - -DRAGONBONES_NAMESPACE_BEGIN -void CCTextureAtlasData::_onClear() -{ - TextureAtlasData::_onClear(); - - if (_renderTexture != nullptr) - { - _renderTexture->release(); - _renderTexture = nullptr; - } -} - -TextureData* CCTextureAtlasData::createTexture() const -{ - return (TextureData*)BaseObject::borrowObject(); -} - -void CCTextureAtlasData::setRenderTexture(middleware::Texture2D* value) -{ - if (_renderTexture == value) - { - return; - } - - _renderTexture = value; - - if (_renderTexture != nullptr) - { - _renderTexture->retain(); - - for (const auto& pair : textures) - { - const auto textureData = static_cast(pair.second); - - if (textureData->spriteFrame == nullptr) - { - cocos2d::Rect rect( - textureData->region.x, textureData->region.y, - textureData->rotated ? textureData->region.height : textureData->region.width, - textureData->rotated ? textureData->region.width : textureData->region.height - ); - cocos2d::Vec2 offset(0.0f, 0.0f); - cocos2d::Size originSize(rect.size.width, rect.size.height); - textureData->spriteFrame = middleware::SpriteFrame::createWithTexture(_renderTexture, rect, textureData->rotated, offset, originSize); // TODO multiply textureAtlas - textureData->spriteFrame->retain(); - } - } - } - else - { - for (const auto& pair : textures) - { - const auto textureData = static_cast(pair.second); - - if (textureData->spriteFrame != nullptr) - { - textureData->spriteFrame->release(); - textureData->spriteFrame = nullptr; - } - } - } -} - -void CCTextureData::_onClear() -{ - TextureData::_onClear(); - - if (spriteFrame != nullptr) - { - spriteFrame->release(); - spriteFrame = nullptr; - } -} -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones-creator-support/CCTextureAtlasData.h b/native/cocos/editor-support/dragonbones-creator-support/CCTextureAtlasData.h deleted file mode 100644 index cedae793be..0000000000 --- a/native/cocos/editor-support/dragonbones-creator-support/CCTextureAtlasData.h +++ /dev/null @@ -1,107 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_CC_TEXTUREATLAS_DATA_H -#define DRAGONBONES_CC_TEXTUREATLAS_DATA_H - -#include "dragonbones/DragonBonesHeaders.h" -#include "cocos2d.h" -#include "middleware-adapter.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * The Cocos2d texture atlas data. - * @version DragonBones 3.0 - * @language en_US - */ -/** - * Cocos2d 贴图集数据。 - * @version DragonBones 3.0 - * @language zh_CN - */ -class CCTextureAtlasData : public TextureAtlasData -{ - BIND_CLASS_TYPE_B(CCTextureAtlasData); - -private: - cocos2d::middleware::Texture2D* _renderTexture; - -public: - CCTextureAtlasData() : - _renderTexture(nullptr) - { - _onClear(); - } - virtual ~CCTextureAtlasData() - { - _onClear(); - } - -protected: - virtual void _onClear() override; - -public: - /** - * @inheritDoc - */ - virtual TextureData* createTexture() const override; - /** - * The Cocos2d texture. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * Cocos2d 贴图。 - * @version DragonBones 3.0 - * @language zh_CN - */ - inline cocos2d::middleware::Texture2D* getRenderTexture() const - { - return _renderTexture; - } - void setRenderTexture(cocos2d::middleware::Texture2D* value); -}; -/** - * @internal - */ -class CCTextureData : public TextureData -{ - BIND_CLASS_TYPE_B(CCTextureData); - -public: - cocos2d::middleware::SpriteFrame* spriteFrame; - - CCTextureData() : - spriteFrame(nullptr) - { - _onClear(); - } - virtual ~CCTextureData() - { - _onClear(); - } - -protected: - virtual void _onClear() override; -}; -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_CC_TEXTUREATLAS_DATA_H diff --git a/native/cocos/editor-support/dragonbones/DragonBonesHeaders.h b/native/cocos/editor-support/dragonbones/DragonBonesHeaders.h deleted file mode 100644 index 8a7ab33d97..0000000000 --- a/native/cocos/editor-support/dragonbones/DragonBonesHeaders.h +++ /dev/null @@ -1,82 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_HEADERS_H -#define DRAGONBONES_HEADERS_H - -// core -#include "core/DragonBones.h" -#include "core/BaseObject.h" - -// geom -#include "geom/Matrix.h" -#include "geom/Transform.h" -#include "geom/ColorTransform.h" -#include "geom/Point.h" -#include "geom/Rectangle.h" - -// model -#include "model/TextureAtlasData.h" -#include "model/UserData.h" -#include "model/DragonBonesData.h" -#include "model/ArmatureData.h" -#include "model/ConstraintData.h" -#include "model/CanvasData.h" -#include "model/SkinData.h" -#include "model/DisplayData.h" -#include "model/BoundingBoxData.h" -#include "model/AnimationData.h" -#include "model/AnimationConfig.h" - -// armature -#include "armature/IArmatureProxy.h" -#include "armature/Armature.h" -#include "armature/TransformObject.h" -#include "armature/Bone.h" -#include "armature/Slot.h" -#include "armature/Constraint.h" -#include "armature/DeformVertices.h" - -// animation -#include "animation/IAnimatable.h" -#include "animation/WorldClock.h" -#include "animation/Animation.h" -#include "animation/AnimationState.h" -#include "animation/BaseTimelineState.h" -#include "animation/TimelineState.h" - -// event -#include "event/EventObject.h" -#include "event/IEventDispatcher.h" - -#ifndef EGRET_WASM - -// parser -#include "parser/DataParser.h" -#include "parser/JSONDataParser.h" -#include "parser/BinaryDataParser.h" - -// factory -#include "factory/BaseFactory.h" -#endif // EGRET_WASM - -#endif // DRAGONBONES_HEADERS_H diff --git a/native/cocos/editor-support/dragonbones/animation/Animation.cpp b/native/cocos/editor-support/dragonbones/animation/Animation.cpp deleted file mode 100644 index 87269ad72c..0000000000 --- a/native/cocos/editor-support/dragonbones/animation/Animation.cpp +++ /dev/null @@ -1,602 +0,0 @@ -#include "Animation.h" -#include "../model/DisplayData.h" -#include "../model/AnimationConfig.h" -#include "../model/AnimationData.h" -#include "../armature/Armature.h" -#include "../armature/Bone.h" -#include "../armature/Slot.h" -#include "AnimationState.h" - -DRAGONBONES_NAMESPACE_BEGIN - -void Animation::_onClear() -{ - for (const auto animationState : _animationStates) - { - animationState->returnToPool(); - } - - if (_animationConfig != nullptr) - { - _animationConfig->returnToPool(); - } - - timeScale = 1.0f; - - _animationDirty = false; - _inheritTimeScale = 1.0f; - _animations.clear(); - _animationNames.clear(); - _animationStates.clear(); - _armature = nullptr; - _animationConfig = nullptr; - _lastAnimationState = nullptr; -} - -void Animation::_fadeOut(AnimationConfig* animationConfig) -{ - switch (animationConfig->fadeOutMode) - { - case AnimationFadeOutMode::SameLayer: - for (const auto animationState : _animationStates) - { - if (animationState->layer == (unsigned)animationConfig->layer) - { - animationState->fadeOut(animationConfig->fadeOutTime, animationConfig->pauseFadeOut); - } - } - break; - - case AnimationFadeOutMode::SameGroup: - for (const auto animationState : _animationStates) - { - if (animationState->group == animationConfig->group) - { - animationState->fadeOut(animationConfig->fadeOutTime, animationConfig->pauseFadeOut); - } - } - break; - - case AnimationFadeOutMode::SameLayerAndGroup: - for (const auto animationState : _animationStates) - { - if (animationState->layer == (unsigned)animationConfig->layer && animationState->group == animationConfig->group) - { - animationState->fadeOut(animationConfig->fadeOutTime, animationConfig->pauseFadeOut); - } - } - break; - - case AnimationFadeOutMode::All: - for (const auto animationState : _animationStates) - { - animationState->fadeOut(animationConfig->fadeOutTime, animationConfig->pauseFadeOut); - } - break; - - case AnimationFadeOutMode::None: - case AnimationFadeOutMode::Single: - default: - break; - } -} - -void Animation::init(Armature* armature) -{ - if (_armature != nullptr) { - return; - } - - _armature = armature; - _animationConfig = BaseObject::borrowObject(); -} - -void Animation::advanceTime(float passedTime) -{ - if (passedTime < 0.0f) - { - passedTime = -passedTime; - } - - if (_armature->inheritAnimation && _armature->_parent != nullptr) // Inherit parent animation timeScale. - { - _inheritTimeScale = _armature->_parent->_armature->getAnimation()->_inheritTimeScale * timeScale; - } - else - { - _inheritTimeScale = timeScale; - } - - if (_inheritTimeScale != 1.0f) - { - passedTime *= _inheritTimeScale; - } - - const auto animationStateCount = _animationStates.size(); - if (animationStateCount == 1) - { - const auto animationState = _animationStates[0]; - if (animationState->_fadeState > 0 && animationState->_subFadeState > 0) - { - _armature->_dragonBones->bufferObject(animationState); - _animationStates.clear(); - _lastAnimationState = nullptr; - } - else - { - const auto animationData = animationState->_animationData; - const auto cacheFrameRate = animationData->cacheFrameRate; - if (_animationDirty && cacheFrameRate > 0.0f) // Update cachedFrameIndices. - { - _animationDirty = false; - - for (const auto bone : _armature->getBones()) - { - bone->_cachedFrameIndices = animationData->getBoneCachedFrameIndices(bone->getName()); - } - - for (const auto slot : _armature->getSlots()) - { - const auto rawDisplayDatas = slot->getRawDisplayDatas(); - if (rawDisplayDatas != nullptr && !(*rawDisplayDatas).empty()) - { - const auto rawDsplayData = (*rawDisplayDatas)[0]; - if (rawDsplayData != nullptr) - { - if (rawDsplayData->parent == _armature->getArmatureData()->defaultSkin) - { - slot->_cachedFrameIndices = animationData->getSlotCachedFrameIndices(slot->getName()); - continue; - } - } - } - - slot->_cachedFrameIndices = nullptr; - } - } - - animationState->advanceTime(passedTime, cacheFrameRate); - } - } - else if (animationStateCount > 1) - { - for (std::size_t i = 0, r = 0; i < animationStateCount; ++i) - { - const auto animationState = _animationStates[i]; - if (animationState->_fadeState > 0 && animationState->_subFadeState > 0) - { - r++; - _armature->_dragonBones->bufferObject(animationState); - _animationDirty = true; - if (_lastAnimationState == animationState) - { - _lastAnimationState = nullptr; - } - } - else - { - if (r > 0) - { - _animationStates[i - r] = animationState; - } - - animationState->advanceTime(passedTime, 0.0f); - } - - if (i == animationStateCount - 1 && r > 0) - { - _animationStates.resize(animationStateCount - r); - if (_lastAnimationState == nullptr && !_animationStates.empty()) - { - _lastAnimationState = _animationStates[_animationStates.size() - 1]; - } - } - } - - _armature->_cacheFrameIndex = -1; - } - else - { - _armature->_cacheFrameIndex = -1; - } -} - -void Animation::reset() -{ - for (const auto animationState : _animationStates) - { - animationState->returnToPool(); - } - - _animationDirty = false; - _animationConfig->clear(); - _animationStates.clear(); - _lastAnimationState = nullptr; -} - -void Animation::stop(const std::string& animationName) -{ - if (!animationName.empty()) - { - const auto animationState = getState(animationName); - if (animationState != nullptr) - { - animationState->stop(); - } - } - else - { - for (const auto animationState : _animationStates) { - animationState->stop(); - } - } -} - -AnimationState* Animation::playConfig(AnimationConfig* animationConfig) -{ - const auto& animationName = animationConfig->animation; - if (_animations.find(animationName) == _animations.end()) - { - DRAGONBONES_ASSERT( - false, - "Non-existent animation.\n" + - " DragonBones name: " + this->_armature->getArmatureData().parent->name + - " Armature name: " + this->_armature->name + - " Animation name: " + animationName - ); - - return nullptr; - } - - const auto animationData = _animations[animationName]; - - if (animationConfig->fadeOutMode == AnimationFadeOutMode::Single) - { - for (const auto animationState : _animationStates) - { - if (animationState->_animationData == animationData) - { - return animationState; - } - } - } - - if (animationConfig->fadeInTime < 0.0f) - { - if (_animationStates.empty()) - { - animationConfig->fadeInTime = 0.0f; - } - else - { - animationConfig->fadeInTime = animationData->fadeInTime; - } - } - - if (animationConfig->fadeOutTime < 0.0f) - { - animationConfig->fadeOutTime = animationConfig->fadeInTime; - } - - if (animationConfig->timeScale <= -100.0f) - { - animationConfig->timeScale = 1.0f / animationData->scale; - } - - if (animationData->frameCount > 1) - { - if (animationConfig->position < 0.0f) - { - animationConfig->position = fmod(animationConfig->position, animationData->duration); - animationConfig->position = animationData->duration - animationConfig->position; - } - else if (animationConfig->position == animationData->duration) - { - animationConfig->position -= 0.000001f; // Play a little time before end. - } - else if (animationConfig->position > animationData->duration) - { - animationConfig->position = fmod(animationConfig->position, animationData->duration); - } - - if (animationConfig->duration > 0.0f && animationConfig->position + animationConfig->duration > animationData->duration) - { - animationConfig->duration = animationData->duration - animationConfig->position; - } - - if (animationConfig->playTimes < 0) - { - animationConfig->playTimes = animationData->playTimes; - } - } - else - { - animationConfig->playTimes = 1; - animationConfig->position = 0.0f; - if (animationConfig->duration > 0.0f) - { - animationConfig->duration = 0.0f; - } - } - - if (animationConfig->duration == 0.0f) - { - animationConfig->duration = -1.0f; - } - - _fadeOut(animationConfig); - - const auto animationState = BaseObject::borrowObject(); - animationState->init(_armature, animationData, animationConfig); - _animationDirty = true; - _armature->_cacheFrameIndex = -1; - - if (!_animationStates.empty()) - { - auto added = false; - for (std::size_t i = 0, l = _animationStates.size(); i < l; ++i) - { - if (animationState->layer > _animationStates[i]->layer) - { - added = true; - auto parentInerator = std::find(_animationStates.begin(), _animationStates.end(), _animationStates[i]); - _animationStates.insert(parentInerator, animationState); - break; - } - else if (i != l - 1 && animationState->layer > _animationStates[i + 1]->layer) - { - added = true; - auto parentInerator = std::find(_animationStates.begin(), _animationStates.end(), _animationStates[i]); - _animationStates.insert(parentInerator + 1, animationState); - break; - } - } - - if (!added) - { - _animationStates.push_back(animationState); - } - } - else - { - _animationStates.push_back(animationState); - } - - // Child armature play same name animation. - for (const auto slot : _armature->getSlots()) - { - const auto childArmature = slot->getChildArmature(); - if ( - childArmature != nullptr && childArmature->inheritAnimation && - childArmature->getAnimation()->hasAnimation(animationName) && - childArmature->getAnimation()->getState(animationName) == nullptr - ) - { - childArmature->getAnimation()->fadeIn(animationName); // - } - } - - if (animationConfig->fadeInTime <= 0.0f) // Blend animation state, update armature. - { - _armature->advanceTime(0.0f); - } - - _lastAnimationState = animationState; - - return animationState; -} - -AnimationState* Animation::play(const std::string& animationName, int playTimes) -{ - _animationConfig->clear(); - _animationConfig->resetToPose = true; - _animationConfig->playTimes = playTimes; - _animationConfig->fadeInTime = 0.0f; - _animationConfig->animation = animationName; - - if (!animationName.empty()) - { - playConfig(_animationConfig); - } - else if (_lastAnimationState == nullptr) - { - const auto defaultAnimation = _armature->_armatureData->defaultAnimation; - if (defaultAnimation != nullptr) - { - _animationConfig->animation = defaultAnimation->name; - playConfig(_animationConfig); - } - } - else if (!_lastAnimationState->isPlaying() && !_lastAnimationState->isCompleted()) - { - _lastAnimationState->play(); - } - else - { - _animationConfig->animation = _lastAnimationState->name; - playConfig(_animationConfig); - } - - return _lastAnimationState; -} -#ifdef EGRET_WASM -AnimationState* Animation::fadeIn( - const std::string& animationName, float fadeInTime, int playTimes, - int layer, const std::string& group, int fadeOutMode /*AnimationFadeOutMode*/ -#else -AnimationState* Animation::fadeIn( - const std::string& animationName, float fadeInTime, int playTimes, - int layer, const std::string& group, AnimationFadeOutMode fadeOutMode -#endif // EGRET_WASM -) -{ - _animationConfig->clear(); - _animationConfig->fadeOutMode = (AnimationFadeOutMode)fadeOutMode; - _animationConfig->playTimes = playTimes; - _animationConfig->layer = layer; - _animationConfig->fadeInTime = fadeInTime; - _animationConfig->animation = animationName; - _animationConfig->group = group; - - return playConfig(_animationConfig); -} - -AnimationState* Animation::gotoAndPlayByTime(const std::string& animationName, float time, int playTimes) -{ - _animationConfig->clear(); - _animationConfig->resetToPose = true; - _animationConfig->playTimes = playTimes; - _animationConfig->position = time; - _animationConfig->fadeInTime = 0.0f; - _animationConfig->animation = animationName; - - return playConfig(_animationConfig); -} - -AnimationState* Animation::gotoAndPlayByFrame(const std::string& animationName, unsigned frame, int playTimes) -{ - _animationConfig->clear(); - _animationConfig->resetToPose = true; - _animationConfig->playTimes = playTimes; - _animationConfig->fadeInTime = 0.0f; - _animationConfig->animation = animationName; - - const auto animationData = mapFind(_animations, animationName); - if (animationData != nullptr) - { - _animationConfig->position = animationData->duration * frame / animationData->frameCount; - } - - return playConfig(_animationConfig); -} - -AnimationState* Animation::gotoAndPlayByProgress(const std::string& animationName, float progress, int playTimes) -{ - _animationConfig->clear(); - _animationConfig->resetToPose = true; - _animationConfig->playTimes = playTimes; - _animationConfig->fadeInTime = 0.0f; - _animationConfig->animation = animationName; - - const auto animationData = mapFind(_animations, animationName); - if (animationData != nullptr) { - _animationConfig->position = animationData->duration * (progress > 0.0f ? progress : 0.0f); - } - - return playConfig(_animationConfig); -} - -AnimationState* Animation::gotoAndStopByTime(const std::string& animationName, float time) -{ - const auto animationState = gotoAndPlayByTime(animationName, time, 1); - if (animationState != nullptr) - { - animationState->stop(); - } - - return animationState; -} - -AnimationState* Animation::gotoAndStopByFrame(const std::string& animationName, unsigned frame) -{ - const auto animationState = gotoAndPlayByFrame(animationName, frame, 1); - if (animationState != nullptr) - { - animationState->stop(); - } - - return animationState; -} - -AnimationState* Animation::gotoAndStopByProgress(const std::string& animationName, float progress) -{ - const auto animationState = gotoAndPlayByProgress(animationName, progress, 1); - if (animationState != nullptr) - { - animationState->stop(); - } - - return animationState; -} - -AnimationState* Animation::getState(const std::string& animationName) const -{ - int i = _animationStates.size(); - while (i--) - { - const auto animationState = _animationStates[i]; - if (animationState->name == animationName) - { - return animationState; - } - } - - return nullptr; -} - -bool Animation::hasAnimation(const std::string& animationName) const -{ - return _animations.find(animationName) != _animations.end(); -} - -bool Animation::isPlaying() const -{ - for (const auto animationState : _animationStates) - { - if (animationState->isPlaying()) - { - return true; - } - } - - return false; -} - -bool Animation::isCompleted() const -{ - for (const auto animationState : _animationStates) - { - if (!animationState->isCompleted()) - { - return false; - } - } - - return !_animationStates.empty(); -} - -const std::string& Animation::getLastAnimationName() const -{ - if (_lastAnimationState != nullptr) - { - return _lastAnimationState->name; - } - - static const std::string DEFAULT_NAME = ""; - return DEFAULT_NAME; -} - -void Animation::setAnimations(const std::map& value) -{ - if (_animations == value) - { - return; - } - - _animationNames.clear(); - _animations.clear(); - - for (const auto& pair : value) - { - _animationNames.push_back(pair.first); - _animations[pair.first] = pair.second; - } -} - -AnimationConfig* Animation::getAnimationConfig() const -{ - _animationConfig->clear(); - return _animationConfig; -} - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones/animation/Animation.h b/native/cocos/editor-support/dragonbones/animation/Animation.h deleted file mode 100644 index d2e34f04c8..0000000000 --- a/native/cocos/editor-support/dragonbones/animation/Animation.h +++ /dev/null @@ -1,478 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_ANIMATION_H -#define DRAGONBONES_ANIMATION_H - -#include "../core/BaseObject.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * - The animation player is used to play the animation data and manage the animation states. - * @see dragonBones.AnimationData - * @see dragonBones.AnimationState - * @version DragonBones 3.0 - * @language en_US - */ -/** - * - 动画播放器用来播放动画数据和管理动画状态。 - * @see dragonBones.AnimationData - * @see dragonBones.AnimationState - * @version DragonBones 3.0 - * @language zh_CN - */ -class Animation final : public BaseObject -{ - BIND_CLASS_TYPE_B(Animation); - -public: - /** - * - The play speed of all animations. [0: Stop, (0~1): Slow, 1: Normal, (1~N): Fast] - * @default 1.0 - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 所有动画的播放速度。 [0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] - * @default 1.0 - * @version DragonBones 3.0 - * @language zh_CN - */ - float timeScale; - -private: - bool _animationDirty; - float _inheritTimeScale; - std::vector _animationNames; - std::vector _animationStates; - std::map _animations; - Armature* _armature; - AnimationConfig* _animationConfig; - AnimationState* _lastAnimationState; - -public: - Animation() : - _animationConfig(nullptr) - { - _onClear(); - } - ~Animation() - { - _onClear(); - } - -private: - void _fadeOut(AnimationConfig* animationConfig); - -protected: - virtual void _onClear() override; - -public: - /** - * @internal - */ - void init(Armature* armature); - /** - * @internal - */ - void advanceTime(float passedTime); - /** - * - Clear all animations states. - * @see dragonBones.AnimationState - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 清除所有的动画状态。 - * @see dragonBones.AnimationState - * @version DragonBones 4.5 - * @language zh_CN - */ - void reset(); - /** - * - Pause a specific animation state. - * @param animationName - The name of animation state. (If not set, it will pause all animations) - * @see dragonBones.AnimationState - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 暂停指定动画状态的播放。 - * @param animationName - 动画状态名称。 (如果未设置,则暂停所有动画) - * @see dragonBones.AnimationState - * @version DragonBones 3.0 - * @language zh_CN - */ - void stop(const std::string& animationName); - /** - * - Play animation with a specific animation config. - * The API is still in the experimental phase and may encounter bugs or stability or compatibility issues when used. - * @param animationConfig - The animation config. - * @returns The playing animation state. - * @see dragonBones.AnimationConfig - * @beta - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 通过指定的动画配置来播放动画。 - * 该 API 仍在实验阶段,使用时可能遭遇 bug 或稳定性或兼容性问题。 - * @param animationConfig - 动画配置。 - * @returns 播放的动画状态。 - * @see dragonBones.AnimationConfig - * @beta - * @version DragonBones 5.0 - * @language zh_CN - */ - AnimationState* playConfig(AnimationConfig* animationConfig); - /** - * - Play a specific animation. - * @param animationName - The name of animation data. (If not set, The default animation will be played, or resume the animation playing from pause status, or replay the last playing animation) - * @param playTimes - Playing repeat times. [-1: Use default value of the animation data, 0: No end loop playing, [1~N]: Repeat N times] (default: -1) - * @returns The playing animation state. - * @example - * TypeScript style, for reference only. - *
-     *     armature.animation.play("walk");
-     * 
- * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 播放指定动画。 - * @param animationName - 动画数据名称。 (如果未设置,则播放默认动画,或将暂停状态切换为播放状态,或重新播放之前播放的动画) - * @param playTimes - 循环播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) - * @returns 播放的动画状态。 - * @example - * TypeScript 风格,仅供参考。 - *
-     *     armature.animation.play("walk");
-     * 
- * @version DragonBones 3.0 - * @language zh_CN - */ - AnimationState* play(const std::string& animationName = "", int playTimes = -1); - /** - * - Fade in a specific animation. - * @param animationName - The name of animation data. - * @param fadeInTime - The fade in time. [-1: Use the default value of animation data, [0~N]: The fade in time (In seconds)] (Default: -1) - * @param playTimes - playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) - * @param layer - The blending layer, the animation states in high level layer will get the blending weights with high priority, when the total blending weights are more than 1.0, there will be no more weights can be allocated to the other animation states. (Default: 0) - * @param group - The blending group name, it is typically used to specify the substitution of multiple animation states blending. (Default: null) - * @param fadeOutMode - The fade out mode, which is typically used to specify alternate mode of multiple animation states blending. (Default: AnimationFadeOutMode.SameLayerAndGroup) - * @returns The playing animation state. - * @example - * TypeScript style, for reference only. - *
-     *     armature.animation.fadeIn("walk", 0.3, 0, 0, "normalGroup").resetToPose = false;
-     *     armature.animation.fadeIn("attack", 0.3, 1, 0, "attackGroup").resetToPose = false;
-     * 
- * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 淡入播放指定的动画。 - * @param animationName - 动画数据名称。 - * @param fadeInTime - 淡入时间。 [-1: 使用动画数据默认值, [0~N]: 淡入时间 (以秒为单位)] (默认: -1) - * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) - * @param layer - 混合图层,图层高的动画状态会优先获取混合权重,当混合权重分配总和超过 1.0 时,剩余的动画状态将不能再获得权重分配。 (默认: 0) - * @param group - 混合组名称,该属性通常用来指定多个动画状态混合时的相互替换关系。 (默认: null) - * @param fadeOutMode - 淡出模式,该属性通常用来指定多个动画状态混合时的相互替换模式。 (默认: AnimationFadeOutMode.SameLayerAndGroup) - * @returns 播放的动画状态。 - * @example - * TypeScript 风格,仅供参考。 - *
-     *     armature.animation.fadeIn("walk", 0.3, 0, 0, "normalGroup").resetToPose = false;
-     *     armature.animation.fadeIn("attack", 0.3, 1, 0, "attackGroup").resetToPose = false;
-     * 
- * @version DragonBones 4.5 - * @language zh_CN - */ - AnimationState* fadeIn( - const std::string& animationName, float fadeInTime = -1.f, int playTimes = -1, - int layer = 0, const std::string& group = "", AnimationFadeOutMode fadeOutMode = AnimationFadeOutMode::SameLayerAndGroup - ); - /** - * - Play a specific animation from the specific time. - * @param animationName - The name of animation data. - * @param time - The start time point of playing. (In seconds) - * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) - * @returns The played animation state. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 从指定时间开始播放指定的动画。 - * @param animationName - 动画数据名称。 - * @param time - 播放开始的时间。 (以秒为单位) - * @param playTimes - 循环播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) - * @returns 播放的动画状态。 - * @version DragonBones 4.5 - * @language zh_CN - */ - AnimationState* gotoAndPlayByTime(const std::string& animationName, float time = 0.f, int playTimes = -1); - /** - * - Play a specific animation from the specific frame. - * @param animationName - The name of animation data. - * @param frame - The start frame of playing. - * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) - * @returns The played animation state. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 从指定帧开始播放指定的动画。 - * @param animationName - 动画数据名称。 - * @param frame - 播放开始的帧数。 - * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) - * @returns 播放的动画状态。 - * @version DragonBones 4.5 - * @language zh_CN - */ - AnimationState* gotoAndPlayByFrame(const std::string& animationName, unsigned frame = 0, int playTimes = -1); - /** - * - Play a specific animation from the specific progress. - * @param animationName - The name of animation data. - * @param progress - The start progress value of playing. - * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1) - * @returns The played animation state. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 从指定进度开始播放指定的动画。 - * @param animationName - 动画数据名称。 - * @param progress - 开始播放的进度。 - * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] (默认: -1) - * @returns 播放的动画状态。 - * @version DragonBones 4.5 - * @language zh_CN - */ - AnimationState* gotoAndPlayByProgress(const std::string& animationName, float progress = 0.f, int playTimes = -1); - /** - * - Stop a specific animation at the specific time. - * @param animationName - The name of animation data. - * @param time - The stop time. (In seconds) - * @returns The played animation state. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 在指定时间停止指定动画播放 - * @param animationName - 动画数据名称。 - * @param time - 停止的时间。 (以秒为单位) - * @returns 播放的动画状态。 - * @version DragonBones 4.5 - * @language zh_CN - */ - AnimationState* gotoAndStopByTime(const std::string& animationName, float time = 0.f); - /** - * - Stop a specific animation at the specific frame. - * @param animationName - The name of animation data. - * @param frame - The stop frame. - * @returns The played animation state. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 在指定帧停止指定动画的播放 - * @param animationName - 动画数据名称。 - * @param frame - 停止的帧数。 - * @returns 播放的动画状态。 - * @version DragonBones 4.5 - * @language zh_CN - */ - AnimationState* gotoAndStopByFrame(const std::string& animationName, unsigned frame = 0); - /** - * - Stop a specific animation at the specific progress. - * @param animationName - The name of animation data. - * @param progress - The stop progress value. - * @returns The played animation state. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 在指定的进度停止指定的动画播放。 - * @param animationName - 动画数据名称。 - * @param progress - 停止进度。 - * @returns 播放的动画状态。 - * @version DragonBones 4.5 - * @language zh_CN - */ - AnimationState* gotoAndStopByProgress(const std::string& animationName, float progress = 0.f); - /** - * - Get a specific animation state. - * @param animationName - The name of animation state. - * @example - * TypeScript style, for reference only. - *
-     *     armature.animation.play("walk");
-     *     let walkState = armature.animation.getState("walk");
-     *     walkState.timeScale = 0.5;
-     * 
- * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 获取指定的动画状态 - * @param animationName - 动画状态名称。 - * @example - * TypeScript 风格,仅供参考。 - *
-     *     armature.animation.play("walk");
-     *     let walkState = armature.animation.getState("walk");
-     *     walkState.timeScale = 0.5;
-     * 
- * @version DragonBones 3.0 - * @language zh_CN - */ - AnimationState* getState(const std::string& animationName) const; - /** - * - Check whether a specific animation data is included. - * @param animationName - The name of animation data. - * @see dragonBones.AnimationData - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 检查是否包含指定的动画数据 - * @param animationName - 动画数据名称。 - * @see dragonBones.AnimationData - * @version DragonBones 3.0 - * @language zh_CN - */ - bool hasAnimation(const std::string& animationName) const; - /** - * - Get all the animation states. - * @version DragonBones 5.1 - * @language en_US - */ - /** - * - 获取所有的动画状态 - * @version DragonBones 5.1 - * @language zh_CN - */ - inline const std::vector& getStates() const - { - return _animationStates; - } - /** - * - Check whether there is an animation state is playing - * @see dragonBones.AnimationState - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 检查是否有动画状态正在播放 - * @see dragonBones.AnimationState - * @version DragonBones 3.0 - * @language zh_CN - */ - bool isPlaying() const; - /** - * - Check whether all the animation states' playing were finished. - * @see dragonBones.AnimationState - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 检查是否所有的动画状态均已播放完毕。 - * @see dragonBones.AnimationState - * @version DragonBones 3.0 - * @language zh_CN - */ - bool isCompleted() const; - /** - * - The name of the last playing animation state. - * @see #lastAnimationState - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 上一个播放的动画状态名称 - * @see #lastAnimationState - * @version DragonBones 3.0 - * @language zh_CN - */ - const std::string& getLastAnimationName() const; - /** - * - The name of all animation data - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 所有动画数据的名称 - * @version DragonBones 4.5 - * @language zh_CN - */ - inline const std::vector& getAnimationNames() const - { - return _animationNames; - } - /** - * - All animation data. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 所有的动画数据。 - * @version DragonBones 4.5 - * @language zh_CN - */ - inline const std::map& getAnimations() const - { - return _animations; - } - void setAnimations(const std::map& value); - /** - * - An AnimationConfig instance that can be used quickly. - * @see dragonBones.AnimationConfig - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 一个可以快速使用的动画配置实例。 - * @see dragonBones.AnimationConfig - * @version DragonBones 5.0 - * @language zh_CN - */ - AnimationConfig* getAnimationConfig() const; - /** - * - The last playing animation state - * @see dragonBones.AnimationState - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 上一个播放的动画状态 - * @see dragonBones.AnimationState - * @version DragonBones 3.0 - * @language zh_CN - */ - inline AnimationState* getLastAnimationState() const - { - return _lastAnimationState; - } -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_ANIMATION_H diff --git a/native/cocos/editor-support/dragonbones/animation/AnimationState.cpp b/native/cocos/editor-support/dragonbones/animation/AnimationState.cpp deleted file mode 100644 index 942e786f30..0000000000 --- a/native/cocos/editor-support/dragonbones/animation/AnimationState.cpp +++ /dev/null @@ -1,952 +0,0 @@ -#include "AnimationState.h" -#include "WorldClock.h" -#include "../model/DisplayData.h" -#include "../model/AnimationConfig.h" -#include "../model/AnimationData.h" -#include "../armature/Armature.h" -#include "../armature/Bone.h" -#include "../armature/Slot.h" -#include "../armature/Constraint.h" -#include "../event/EventObject.h" -#include "../event/IEventDispatcher.h" -#include "TimelineState.h" - -DRAGONBONES_NAMESPACE_BEGIN - -void AnimationState::_onClear() -{ - for (const auto timeline : _boneTimelines) - { - timeline->returnToPool(); - } - - for (const auto timeline : _slotTimelines) - { - timeline->returnToPool(); - } - - for (const auto timeline : _constraintTimelines) - { - timeline->returnToPool(); - } - - for (const auto& pair : _bonePoses) - { - pair.second->returnToPool(); - } - - if (_actionTimeline != nullptr) { - _actionTimeline->returnToPool(); - } - - if (_zOrderTimeline != nullptr) { - _zOrderTimeline->returnToPool(); - } - - actionEnabled = false; - additiveBlending = false; - displayControl = false; - resetToPose = false; - playTimes = 1; - layer = 0; - timeScale = 1.0f; - weight = 1.0f; - autoFadeOutTime = 0.0f; - fadeTotalTime = 0.0f; - name = ""; - group = ""; - - _timelineDirty = 2; - _playheadState = 0; - _fadeState = -1; - _subFadeState = -1; - _position = 0.0f; - _duration = 0.0f; - _fadeTime = 0.0f; - _time = 0.0f; - _fadeProgress = 0.0f; - _weightResult = 0.0f; - _boneMask.clear(); - _boneTimelines.clear(); - _slotTimelines.clear(); - _constraintTimelines.clear(); - _poseTimelines.clear(); - _bonePoses.clear(); - _animationData = nullptr; - _armature = nullptr; - _actionTimeline = nullptr; - _zOrderTimeline = nullptr; -} - -void AnimationState::_updateTimelines() -{ - { // Update constraint timelines. - std::map> constraintTimelines; - for (const auto timeline : _constraintTimelines) // Create constraint timelines map. - { - constraintTimelines[timeline->constraint->getName()].push_back(timeline); - } - - for (const auto constraint : _armature->_constraints) - { - const auto& timelineName = constraint->getName(); - const auto timelineDatas = _animationData->getConstraintTimelines(timelineName); - const auto iterator = constraintTimelines.find(timelineName); - - if (iterator != constraintTimelines.end()) // Remove constraint timeline from map. - { - constraintTimelines.erase(iterator); - } - else // Create new constraint timeline. - { - if (timelineDatas != nullptr) - { - for (const auto timelineData : *timelineDatas) - { - switch (timelineData->type) - { - case TimelineType::IKConstraint: - { - const auto timeline = BaseObject::borrowObject(); - timeline->constraint = constraint; - timeline->init(_armature, this, timelineData); - _constraintTimelines.push_back(timeline); - break; - } - - default: - break; - } - } - } - else if (resetToPose) // Pose timeline. - { - const auto timeline = BaseObject::borrowObject(); - timeline->constraint = constraint; - timeline->init(_armature, this, nullptr); - _constraintTimelines.push_back(timeline); - _poseTimelines.push_back(std::make_pair(timeline, BaseTimelineType::Constraint)); - } - } - } - } -} - -void AnimationState::_updateBoneAndSlotTimelines() -{ - { // Update bone timelines. - std::map> boneTimelines; - for (const auto timeline : _boneTimelines) // Create bone timelines map. - { - boneTimelines[timeline->bone->getName()].push_back(timeline); - } - - for (const auto bone : _armature->getBones()) - { - const auto& timelineName = bone->getName(); - if (!containsBoneMask(timelineName)) - { - continue; - } - - const auto timelineDatas = _animationData->getBoneTimelines(timelineName); - const auto iterator = boneTimelines.find(timelineName); - - if (iterator != boneTimelines.end()) // Remove bone timeline from map. - { - boneTimelines.erase(iterator); - } - else // Create new bone timeline. - { - const auto bonePose = _bonePoses.find(timelineName) != _bonePoses.end() ? _bonePoses[timelineName] : (_bonePoses[timelineName] = BaseObject::borrowObject()); - - if (timelineDatas != nullptr) - { - for (const auto timelineData : *timelineDatas) - { - switch (timelineData->type) - { - case TimelineType::BoneAll: - { - const auto timeline = BaseObject::borrowObject(); - timeline->bone = bone; - timeline->bonePose = bonePose; - timeline->init(_armature, this, timelineData); - _boneTimelines.push_back(timeline); - break; - } - - case TimelineType::BoneTranslate: - { - const auto timeline = BaseObject::borrowObject(); - timeline->bone = bone; - timeline->bonePose = bonePose; - timeline->init(_armature, this, timelineData); - _boneTimelines.push_back(timeline); - break; - } - - case TimelineType::BoneRotate: - { - const auto timeline = BaseObject::borrowObject(); - timeline->bone = bone; - timeline->bonePose = bonePose; - timeline->init(_armature, this, timelineData); - _boneTimelines.push_back(timeline); - break; - } - - case TimelineType::BoneScale: - { - const auto timeline = BaseObject::borrowObject(); - timeline->bone = bone; - timeline->bonePose = bonePose; - timeline->init(_armature, this, timelineData); - _boneTimelines.push_back(timeline); - break; - } - - default: - break; - } - } - } - else if (resetToPose) // Pose timeline. - { - const auto timeline = BaseObject::borrowObject(); - timeline->bone = bone; - timeline->bonePose = bonePose; - timeline->init(_armature, this, nullptr); - _boneTimelines.push_back(timeline); - _poseTimelines.push_back(std::make_pair(timeline, BaseTimelineType::Bone)); - } - } - } - - for (const auto& pair : boneTimelines) // Remove bone timelines. - { - for (const auto timeline : pair.second) - { - _boneTimelines.erase(std::find(_boneTimelines.begin(), _boneTimelines.end(), timeline)); - timeline->returnToPool(); - } - } - } - - { // Update slot timelines. - std::map> slotTimelines; - std::vector ffdFlags; - for (const auto timeline : _slotTimelines) // Create slot timelines map. - { - slotTimelines[timeline->slot->getName()].push_back(timeline); - } - - for (const auto slot : _armature->getSlots()) - { - const auto& boneName = slot->getParent()->getName(); - if (!containsBoneMask(boneName)) - { - continue; - } - - const auto& timelineName = slot->getName(); - const auto timelineDatas = _animationData->getSlotTimelines(timelineName); - const auto iterator = slotTimelines.find(timelineName); - - if (iterator != slotTimelines.end()) // Remove slot timeline from map. - { - slotTimelines.erase(iterator); - } - else // Create new slot timeline. - { - auto displayIndexFlag = false; - auto colorFlag = false; - ffdFlags.clear(); - - if (timelineDatas != nullptr) - { - for (const auto timelineData : *timelineDatas) - { - switch (timelineData->type) - { - case TimelineType::SlotDisplay: - { - const auto timeline = BaseObject::borrowObject(); - timeline->slot = slot; - timeline->init(_armature, this, timelineData); - _slotTimelines.push_back(timeline); - displayIndexFlag = true; - break; - } - - case TimelineType::SlotColor: - { - const auto timeline = BaseObject::borrowObject(); - timeline->slot = slot; - timeline->init(_armature, this, timelineData); - _slotTimelines.push_back(timeline); - colorFlag = true; - break; - } - - case TimelineType::SlotDeform: - { - const auto timeline = BaseObject::borrowObject(); - timeline->slot = slot; - timeline->init(_armature, this, timelineData); - _slotTimelines.push_back(timeline); - ffdFlags.push_back(timeline->vertexOffset); - break; - } - - default: - break; - } - } - } - - if (resetToPose) // Pose timeline. - { - if (!displayIndexFlag) - { - const auto timeline = BaseObject::borrowObject(); - timeline->slot = slot; - timeline->init(_armature, this, nullptr); - _slotTimelines.push_back(timeline); - _poseTimelines.push_back(std::make_pair(timeline, BaseTimelineType::Slot)); - } - - if (!colorFlag) - { - const auto timeline = BaseObject::borrowObject(); - timeline->slot = slot; - timeline->init(_armature, this, nullptr); - _slotTimelines.push_back(timeline); - _poseTimelines.push_back(std::make_pair(timeline, BaseTimelineType::Slot)); - } - - if (slot->getRawDisplayDatas() != nullptr) - { - for (const auto displayData : *(slot->getRawDisplayDatas())) - { - if (displayData != nullptr && displayData->type == DisplayType::Mesh) - { - const auto meshOffset = static_cast(displayData)->vertices.offset; - if (std::find(ffdFlags.cbegin(), ffdFlags.cend(), meshOffset) == ffdFlags.cend()) - { - const auto timeline = BaseObject::borrowObject(); - timeline->vertexOffset = meshOffset; - timeline->slot = slot; - timeline->init(_armature, this, nullptr); - _slotTimelines.push_back(timeline); - _poseTimelines.push_back(std::make_pair(timeline, BaseTimelineType::Slot)); - } - } - } - } - } - } - } - - for (const auto& pair : slotTimelines) // Remove slot timelines. - { - for (const auto timeline : pair.second) - { - _slotTimelines.erase(std::find(_slotTimelines.begin(), _slotTimelines.end(), timeline)); - timeline->returnToPool(); - } - } - } -} - -void AnimationState::_advanceFadeTime(float passedTime) -{ - const auto isFadeOut = _fadeState > 0; - - if (_subFadeState < 0) - { - _subFadeState = 0; - - const auto eventType = isFadeOut ? EventObject::FADE_OUT : EventObject::FADE_IN; - if (_armature->getProxy()->hasDBEventListener(eventType)) - { - const auto eventObject = BaseObject::borrowObject(); - eventObject->type = eventType; - eventObject->armature = _armature; - eventObject->animationState = this; - _armature->_dragonBones->bufferEvent(eventObject); - } - } - - if (passedTime < 0.0f) - { - passedTime = -passedTime; - } - - _fadeTime += passedTime; - - if (_fadeTime >= fadeTotalTime) - { - _subFadeState = 1; - _fadeProgress = isFadeOut ? 0.0f : 1.0f; - } - else if (_fadeTime > 0.0f) - { - _fadeProgress = isFadeOut ? (1.0f - _fadeTime / fadeTotalTime) : (_fadeTime / fadeTotalTime); - } - else - { - _fadeProgress = isFadeOut ? 1.0f : 0.0f; - } - - if (_subFadeState > 0) - { - if (!isFadeOut) - { - _playheadState |= 1; // x1 - _fadeState = 0; - } - - const auto eventType = isFadeOut ? EventObject::FADE_OUT_COMPLETE : EventObject::FADE_IN_COMPLETE; - if (_armature->getProxy()->hasDBEventListener(eventType)) - { - const auto eventObject = BaseObject::borrowObject(); - eventObject->type = eventType; - eventObject->armature = _armature; - eventObject->animationState = this; - _armature->_dragonBones->bufferEvent(eventObject); - } - } -} - -void AnimationState::init(Armature* parmature, AnimationData* panimationData, AnimationConfig* animationConfig) -{ - if (_armature != nullptr) { - return; - } - - _armature = parmature; - _animationData = panimationData; - // - resetToPose = animationConfig->resetToPose; - additiveBlending = animationConfig->additiveBlending; - displayControl = animationConfig->displayControl; - actionEnabled = animationConfig->actionEnabled; - layer = animationConfig->layer; - playTimes = animationConfig->playTimes; - timeScale = animationConfig->timeScale; - fadeTotalTime = animationConfig->fadeInTime; - autoFadeOutTime = animationConfig->autoFadeOutTime; - weight = animationConfig->weight; - name = !animationConfig->name.empty() ? animationConfig->name : animationConfig->animation; - group = animationConfig->group; - - if (animationConfig->pauseFadeIn) - { - _playheadState = 2; // 10 - } - else - { - _playheadState = 3; // 11 - } - - if (animationConfig->duration < 0.0f) - { - _position = 0.0f; - _duration = _animationData->duration; - - if (animationConfig->position != 0.0f) - { - if (timeScale >= 0.0f) - { - _time = animationConfig->position; - } - else - { - _time = animationConfig->position - _duration; - } - } - else - { - _time = 0.0f; - } - } - else - { - _position = animationConfig->position; - _duration = animationConfig->duration; - _time = 0.0f; - } - - if (timeScale < 0.0f && _time == 0.0f) - { - _time = -0.000001f; // Can not cross last frame event. - } - - if (fadeTotalTime <= 0.0f) - { - _fadeProgress = 0.999999f; - } - - if (!animationConfig->boneMask.empty()) - { - _boneMask.resize(animationConfig->boneMask.size()); - for (std::size_t i = 0, l = _boneMask.size(); i < l; ++i) { - _boneMask[i] = animationConfig->boneMask[i]; - } - } - - _actionTimeline = BaseObject::borrowObject(); - _actionTimeline->init(_armature, this, _animationData->actionTimeline); // - _actionTimeline->currentTime = _time; - if (_actionTimeline->currentTime < 0.0f) - { - _actionTimeline->currentTime = _duration - _actionTimeline->currentTime; - } - - if (_animationData->zOrderTimeline != nullptr) - { - _zOrderTimeline = BaseObject::borrowObject(); - _zOrderTimeline->init(_armature, this, _animationData->zOrderTimeline); - } -} - -void AnimationState::advanceTime(float passedTime, float cacheFrameRate) -{ - // Update fade time. - if (_fadeState != 0 || _subFadeState != 0) - { - _advanceFadeTime(passedTime); - } - - // Update time. - if (_playheadState == 3) // 11 - { - if (timeScale != 1.0f) - { - passedTime *= timeScale; - } - - _time += passedTime; - } - - if (_timelineDirty != 0) - { - if (_timelineDirty == 2) - { - _updateTimelines(); - } - - _timelineDirty = 0; - _updateBoneAndSlotTimelines(); - } - - if (weight == 0.0f) - { - return; - } - - const auto isCacheEnabled = _fadeState == 0 && cacheFrameRate > 0.0f; - auto isUpdateTimeline = true; - auto isUpdateBoneTimeline = true; - auto time = _time; - _weightResult = weight * _fadeProgress; - - if (_actionTimeline->playState <= 0) - { - _actionTimeline->update(time); // Update main timeline. - } - - if (isCacheEnabled) // Cache time internval. - { - const auto internval = cacheFrameRate * 2.0f; - _actionTimeline->currentTime = (unsigned)(_actionTimeline->currentTime * internval) / internval; - } - - if (_zOrderTimeline != nullptr && _zOrderTimeline->playState <= 0) // Update zOrder timeline. - { - _zOrderTimeline->update(time); - } - - if (isCacheEnabled) // Update cache. - { - const auto cacheFrameIndex = (unsigned)(_actionTimeline->currentTime * cacheFrameRate); // uint - if ((unsigned)_armature->_cacheFrameIndex == cacheFrameIndex) // Same cache. - { - isUpdateTimeline = false; - isUpdateBoneTimeline = false; - } - else - { - _armature->_cacheFrameIndex = cacheFrameIndex; - if (_animationData->cachedFrames[cacheFrameIndex]) // Cached. - { - isUpdateBoneTimeline = false; - } - else // Cache. - { - _animationData->cachedFrames[cacheFrameIndex] = true; - } - } - } - - if (isUpdateTimeline) - { - if (isUpdateBoneTimeline) // Update bone timelines. - { - for (std::size_t i = 0, l = _boneTimelines.size(); i < l; ++i) - { - const auto timeline = _boneTimelines[i]; - - if (timeline->playState <= 0) - { - timeline->update(time); - } - - if (i == l - 1 || timeline->bone != _boneTimelines[i + 1]->bone) - { - const auto state = timeline->bone->_blendState.update(_weightResult, layer); - if (state != 0) - { - timeline->blend(state); - } - } - } - } - - if (displayControl) - { - for (std::size_t i = 0, l = _slotTimelines.size(); i < l; ++i) - { - const auto timeline = _slotTimelines[i]; - const auto& displayController = timeline->slot->displayController; - - if ( - displayController.empty() || - displayController == name || - displayController == group - ) - { - if (timeline->playState <= 0) - { - timeline->update(time); - } - } - } - } - - for (std::size_t i = 0, l = _constraintTimelines.size(); i < l; ++i) - { - const auto timeline = _constraintTimelines[i]; - if (timeline->playState <= 0) - { - timeline->update(time); - } - } - } - - if (_fadeState == 0) - { - if (_subFadeState > 0) - { - _subFadeState = 0; - - if (!_poseTimelines.empty()) - { - for (const auto& pair : _poseTimelines) - { - const auto timeline = pair.first; - if (pair.second == BaseTimelineType::Bone) - { - _boneTimelines.erase(std::find(_boneTimelines.begin(), _boneTimelines.end(), timeline)); - } - else if (pair.second == BaseTimelineType::Slot) - { - _slotTimelines.erase(std::find(_slotTimelines.begin(), _slotTimelines.end(), timeline)); - } - else if (pair.second == BaseTimelineType::Constraint) - { - _constraintTimelines.erase(std::find(_constraintTimelines.begin(), _constraintTimelines.end(), timeline)); - } - - timeline->returnToPool(); - } - - _poseTimelines.clear(); - } - } - - if (_actionTimeline->playState > 0) - { - if (autoFadeOutTime >= 0.0f) // Auto fade out. - { - fadeOut(autoFadeOutTime); - } - } - } -} - -void AnimationState::play() -{ - _playheadState = 3; // 11 -} - -void AnimationState::stop() -{ - _playheadState &= 1; // 0x -} - -void AnimationState::fadeOut(float fadeOutTime, bool pausePlayhead) -{ - if (fadeOutTime < 0.0f) - { - fadeOutTime = 0.0f; - } - - if (pausePlayhead) - { - _playheadState &= 2; // x0 - } - - if (_fadeState > 0) - { - if (fadeOutTime > fadeTotalTime - _fadeTime) // If the animation is already in fade out, the new fade out will be ignored. - { - return; - } - } - else - { - _fadeState = 1; - _subFadeState = -1; - - if (fadeOutTime <= 0.0f || _fadeProgress <= 0.0f) - { - _fadeProgress = 0.000001f; // Modify fade progress to different value. - } - - for (const auto timeline : _boneTimelines) - { - timeline->fadeOut(); - } - - for (const auto timeline : _slotTimelines) - { - timeline->fadeOut(); - } - } - - displayControl = false; // - fadeTotalTime = _fadeProgress > 0.000001f ? fadeOutTime / _fadeProgress : 0.0f; - _fadeTime = fadeTotalTime * (1.0f - _fadeProgress); -} - -bool AnimationState::containsBoneMask(const std::string& boneName) const -{ - return _boneMask.empty() || std::find(_boneMask.cbegin(), _boneMask.cend(), boneName) != _boneMask.cend(); -} - -void AnimationState::addBoneMask(const std::string& boneName, bool recursive) -{ - const auto currentBone = _armature->getBone(boneName); - if (currentBone == nullptr) - { - return; - } - - if (std::find(_boneMask.cbegin(), _boneMask.cend(), boneName) == _boneMask.cend()) - { - _boneMask.push_back(boneName); - } - - if (recursive) // Add recursive mixing. - { - for (const auto bone : _armature->getBones()) - { - if (std::find(_boneMask.cbegin(), _boneMask.cend(), bone->getName()) == _boneMask.cend() && currentBone->contains(bone)) - { - _boneMask.push_back(bone->getName()); - } - } - } - - _timelineDirty = 1; -} - -void AnimationState::removeBoneMask(const std::string& boneName, bool recursive) -{ - { - auto iterator = std::find(_boneMask.begin(), _boneMask.end(), boneName); - if (iterator != _boneMask.cend()) // Remove mixing. - { - _boneMask.erase(iterator); - } - } - - if (recursive) - { - const auto currentBone = _armature->getBone(boneName); - if (currentBone != nullptr) - { - const auto& bones = _armature->getBones(); - if (!_boneMask.empty()) // Remove recursive mixing. - { - for (const auto bone : bones) - { - auto iterator = std::find(_boneMask.begin(), _boneMask.end(), bone->getName()); - if (iterator != _boneMask.end() && currentBone->contains(bone)) - { - _boneMask.erase(iterator); - } - } - } - else // Add unrecursive mixing. - { - for (const auto bone : bones) - { - if (bone == currentBone) - { - continue; - } - - if (!currentBone->contains(bone)) - { - _boneMask.push_back(bone->getName()); - } - } - } - } - } - - _timelineDirty = 1; -} - -void AnimationState::removeAllBoneMask() -{ - _boneMask.clear(); - _timelineDirty = 1; -} - -bool AnimationState::isPlaying() const -{ - return (_playheadState & 2) != 0 && _actionTimeline->playState <= 0; -} - -bool AnimationState::isCompleted() const -{ - return _actionTimeline->playState > 0; -} - -unsigned AnimationState::getCurrentPlayTimes() const -{ - return _actionTimeline->currentPlayTimes; -} - -float AnimationState::getCurrentTime() const -{ - return _actionTimeline->currentTime; -} - -void AnimationState::setCurrentTime(float value) -{ - const auto currentPlayTimes = _actionTimeline->currentPlayTimes - (_actionTimeline->playState > 0 ? 1 : 0); - if (value < 0.0f || _duration < value) - { - value = fmod(value, _duration) + currentPlayTimes * _duration; - if (value < 0.0f) - { - value += _duration; - } - } - - if (playTimes > 0 && (unsigned)currentPlayTimes == playTimes - 1 && value == _duration) - { - value = _duration - 0.000001f; - } - - if (_time == value) - { - return; - } - - _time = value; - _actionTimeline->setCurrentTime(_time); - - if (_zOrderTimeline != nullptr) - { - _zOrderTimeline->playState = -1; - } - - for (const auto timeline : _boneTimelines) - { - timeline->playState = -1; - } - - for (const auto timeline : _slotTimelines) - { - timeline->playState = -1; - } -} - -void BonePose::_onClear() -{ - current.identity(); - delta.identity(); - result.identity(); -} - -int BlendState::update(float weight, int p_layer) -{ - if (dirty) - { - if (leftWeight > 0.0f) - { - if (layer != p_layer) - { - if (layerWeight >= leftWeight) - { - leftWeight = 0.0f; - - return 0; - } - else - { - layer = p_layer; - leftWeight -= layerWeight; - layerWeight = 0.0f; - } - } - } - else - { - return 0; - } - - weight *= leftWeight; - layerWeight += weight; - blendWeight = weight; - - return 2; - } - - dirty = true; - layer = p_layer; - layerWeight = weight; - leftWeight = 1.0f; - blendWeight = weight; - - return 1; -} - -void BlendState::clear() -{ - dirty = false; - layer = 0; - leftWeight = 0.0f; - layerWeight = 0.0f; - blendWeight = 0.0f; -} - - -DRAGONBONES_NAMESPACE_END - diff --git a/native/cocos/editor-support/dragonbones/animation/AnimationState.h b/native/cocos/editor-support/dragonbones/animation/AnimationState.h deleted file mode 100644 index 1ecce6c7b9..0000000000 --- a/native/cocos/editor-support/dragonbones/animation/AnimationState.h +++ /dev/null @@ -1,534 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_ANIMATION_STATE_H -#define DRAGONBONES_ANIMATION_STATE_H - -#include "../core/BaseObject.h" -#include "../geom/Transform.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * - The animation state is generated when the animation data is played. - * @see dragonBones.Animation - * @see dragonBones.AnimationData - * @version DragonBones 3.0 - * @language en_US - */ -/** - * - 动画状态由播放动画数据时产生。 - * @see dragonBones.Animation - * @see dragonBones.AnimationData - * @version DragonBones 3.0 - * @language zh_CN - */ -class AnimationState : public BaseObject -{ - BIND_CLASS_TYPE_B(AnimationState); - -private: - enum class BaseTimelineType { - Bone, - Slot, - Constraint - }; - -public: - /** - * @private - */ - bool actionEnabled; - /** - * @private - */ - bool additiveBlending; - /** - * - Whether the animation state has control over the display object properties of the slots. - * Sometimes blend a animation state does not want it to control the display object properties of the slots, - * especially if other animation state are controlling the display object properties of the slots. - * @default true - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 动画状态是否对插槽的显示对象属性有控制权。 - * 有时混合一个动画状态并不希望其控制插槽的显示对象属性, - * 尤其是其他动画状态正在控制这些插槽的显示对象属性时。 - * @default true - * @version DragonBones 5.0 - * @language zh_CN - */ - bool displayControl; - /** - * - Whether to reset the objects without animation to the armature pose when the animation state is start to play. - * This property should usually be set to false when blend multiple animation states. - * @default true - * @version DragonBones 5.1 - * @language en_US - */ - /** - * - 开始播放动画状态时是否将没有动画的对象重置为骨架初始值。 - * 通常在混合多个动画状态时应该将该属性设置为 false。 - * @default true - * @version DragonBones 5.1 - * @language zh_CN - */ - bool resetToPose; - /** - * - The play times. [0: Loop play, [1~N]: Play N times] - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 播放次数。 [0: 无限循环播放, [1~N]: 循环播放 N 次] - * @version DragonBones 3.0 - * @language zh_CN - */ - unsigned playTimes; - /** - * - The blend layer. - * High layer animation state will get the blend weight first. - * When the blend weight is assigned more than 1, the remaining animation states will no longer get the weight assigned. - * @readonly - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 混合图层。 - * 图层高的动画状态会优先获取混合权重。 - * 当混合权重分配超过 1 时,剩余的动画状态将不再获得权重分配。 - * @readonly - * @version DragonBones 5.0 - * @language zh_CN - */ - unsigned layer; - /** - * - The play speed. - * The value is an overlay relationship with {@link dragonBones.Animation#timeScale}. - * [(-N~0): Reverse play, 0: Stop play, (0~1): Slow play, 1: Normal play, (1~N): Fast play] - * @default 1.0 - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 播放速度。 - * 该值与 {@link dragonBones.Animation#timeScale} 是叠加关系。 - * [(-N~0): 倒转播放, 0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] - * @default 1.0 - * @version DragonBones 3.0 - * @language zh_CN - */ - float timeScale; - /** - * - The blend weight. - * @default 1.0 - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 混合权重。 - * @default 1.0 - * @version DragonBones 5.0 - * @language zh_CN - */ - float weight; - /** - * - The auto fade out time when the animation state play completed. - * [-1: Do not fade out automatically, [0~N]: The fade out time] (In seconds) - * @default -1.0 - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 动画状态播放完成后的自动淡出时间。 - * [-1: 不自动淡出, [0~N]: 淡出时间] (以秒为单位) - * @default -1.0 - * @version DragonBones 5.0 - * @language zh_CN - */ - float autoFadeOutTime; - /** - * @private - */ - float fadeTotalTime; - /** - * - The name of the animation state. (Can be different from the name of the animation data) - * @readonly - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 动画状态名称。 (可以不同于动画数据) - * @readonly - * @version DragonBones 5.0 - * @language zh_CN - */ - std::string name; - /** - * - The blend group name of the animation state. - * This property is typically used to specify the substitution of multiple animation states blend. - * @readonly - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 混合组名称。 - * 该属性通常用来指定多个动画状态混合时的相互替换关系。 - * @readonly - * @version DragonBones 5.0 - * @language zh_CN - */ - std::string group; - -public: - /** - * - xx: Play Enabled, Fade Play Enabled - * @internal - */ - int _playheadState; - /** - * -1: Fade in, 0: Fade complete, 1: Fade out; - * @internal - */ - int _fadeState; - /** - * -1: Fade start, 0: Fading, 1: Fade complete; - * @internal - */ - int _subFadeState; - /** - * @internal - */ - float _position; - /** - * @internal - */ - float _duration; - /** - * @internal - */ - float _fadeProgress; - /** - * @internal - */ - float _weightResult; - /** - * @internal - */ - AnimationData* _animationData; - /** - * @internal - */ - ActionTimelineState* _actionTimeline; - -private: - unsigned _timelineDirty; - float _fadeTime; - float _time; - std::vector _boneMask; - std::vector _boneTimelines; - std::vector _slotTimelines; - std::vector _constraintTimelines; - std::vector> _poseTimelines; - std::map _bonePoses; - Armature* _armature; - ZOrderTimelineState* _zOrderTimeline; - -public: - AnimationState() : - _actionTimeline(nullptr), - _zOrderTimeline(nullptr) - { - _onClear(); - } - virtual ~AnimationState() - { - _onClear(); - } - -protected: - virtual void _onClear() override; - -private: - void _updateTimelines(); - void _updateBoneAndSlotTimelines(); - void _advanceFadeTime(float passedTime); - -public: - /** - * @internal - */ - void init(Armature* armature, AnimationData* animationData, AnimationConfig* animationConfig); - /** - * @internal - */ - void advanceTime(float passedTime, float cacheFrameRate); - /** - * - Continue play. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 继续播放。 - * @version DragonBones 3.0 - * @language zh_CN - */ - void play(); - /** - * - Stop play. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 暂停播放。 - * @version DragonBones 3.0 - * @language zh_CN - */ - void stop(); - /** - * - Fade out the animation state. - * @param fadeOutTime - The fade out time. (In seconds) - * @param pausePlayhead - Whether to pause the animation playing when fade out. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 淡出动画状态。 - * @param fadeOutTime - 淡出时间。 (以秒为单位) - * @param pausePlayhead - 淡出时是否暂停播放。 - * @version DragonBones 3.0 - * @language zh_CN - */ - void fadeOut(float fadeOutTime, bool pausePlayhead = true); - /** - * - Check if a specific bone mask is included. - * @param boneName - The bone name. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 检查是否包含特定骨骼遮罩。 - * @param boneName - 骨骼名称。 - * @version DragonBones 3.0 - * @language zh_CN - */ - bool containsBoneMask(const std::string& boneName) const; - /** - * - Add a specific bone mask. - * @param boneName - The bone name. - * @param recursive - Whether or not to add a mask to the bone's sub-bone. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 添加特定的骨骼遮罩。 - * @param boneName - 骨骼名称。 - * @param recursive - 是否为该骨骼的子骨骼添加遮罩。 - * @version DragonBones 3.0 - * @language zh_CN - */ - void addBoneMask(const std::string& boneName, bool recursive = true); - /** - * - Remove the mask of a specific bone. - * @param boneName - The bone name. - * @param recursive - Whether to remove the bone's sub-bone mask. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 删除特定骨骼的遮罩。 - * @param boneName - 骨骼名称。 - * @param recursive - 是否删除该骨骼的子骨骼遮罩。 - * @version DragonBones 3.0 - * @language zh_CN - */ - void removeBoneMask(const std::string& boneName, bool recursive = true); - /** - * - Remove all bone masks. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 删除所有骨骼遮罩。 - * @version DragonBones 3.0 - * @language zh_CN - */ - void removeAllBoneMask(); - /** - * - Whether the animation state is fading in. - * @version DragonBones 5.1 - * @language en_US - */ - /** - * - 是否正在淡入。 - * @version DragonBones 5.1 - * @language zh_CN - */ - inline bool isFadeIn() const - { - return _fadeState < 0; - } - /** - * - Whether the animation state is fading out. - * @version DragonBones 5.1 - * @language en_US - */ - /** - * - 是否正在淡出。 - * @version DragonBones 5.1 - * @language zh_CN - */ - inline bool isFadeOut() const - { - return _fadeState > 0; - } - /** - * - Whether the animation state is fade completed. - * @version DragonBones 5.1 - * @language en_US - */ - /** - * - 是否淡入或淡出完毕。 - * @version DragonBones 5.1 - * @language zh_CN - */ - inline bool isFadeComplete() const - { - return _fadeState == 0; - } - /** - * - Whether the animation state is playing. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 是否正在播放。 - * @version DragonBones 3.0 - * @language zh_CN - */ - bool isPlaying() const; - /** - * - Whether the animation state is play completed. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 是否播放完毕。 - * @version DragonBones 3.0 - * @language zh_CN - */ - bool isCompleted() const; - /** - * - The times has been played. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 已经循环播放的次数。 - * @version DragonBones 3.0 - * @language zh_CN - */ - unsigned getCurrentPlayTimes() const; - /** - * - The total time. (In seconds) - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 总播放时间。 (以秒为单位) - * @version DragonBones 3.0 - * @language zh_CN - */ - inline float getTotalTime() const - { - return _duration; - } - /** - * - The time is currently playing. (In seconds) - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 当前播放的时间。 (以秒为单位) - * @version DragonBones 3.0 - * @language zh_CN - */ - float getCurrentTime() const; - void setCurrentTime(float value); - inline const std::string& getName() const - { - return name; - } - - /** - * - The animation data. - * @see dragonBones.AnimationData - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 动画数据。 - * @see dragonBones.AnimationData - * @version DragonBones 3.0 - * @language zh_CN - */ - inline const AnimationData* getAnimationData() const - { - return _animationData; - } -}; -/** - * @internal - */ -class BonePose : public BaseObject -{ - BIND_CLASS_TYPE_A(BonePose); - -public: - Transform current; - Transform delta; - Transform result; - -protected: - virtual void _onClear() override; -}; -/** - * @internal - */ -class BlendState -{ -public: - bool dirty; - int layer; - float leftWeight; - float layerWeight; - float blendWeight; - - /** - * -1: First blending, 0: No blending, 1: Blending. - */ - int update(float weight, int p_layer); - void clear(); -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_ANIMATION_STATE_H diff --git a/native/cocos/editor-support/dragonbones/animation/BaseTimelineState.cpp b/native/cocos/editor-support/dragonbones/animation/BaseTimelineState.cpp deleted file mode 100644 index 8202717632..0000000000 --- a/native/cocos/editor-support/dragonbones/animation/BaseTimelineState.cpp +++ /dev/null @@ -1,344 +0,0 @@ -#include "BaseTimelineState.h" -#include "../model/DragonBonesData.h" -#include "../model/ArmatureData.h" -#include "../model/AnimationData.h" -#include "../armature/Armature.h" -#include "../armature/Bone.h" -#include "../armature/Slot.h" -#include "AnimationState.h" -#include "TimelineState.h" - -#include - -DRAGONBONES_NAMESPACE_BEGIN - -void TimelineState::_onClear() -{ - playState = -1; - currentPlayTimes = -1; - currentTime = -1.0f; - - _tweenState = TweenState::None; - _frameRate = 0; - _frameValueOffset = 0; - _frameCount = 0; - _frameOffset = 0; - _frameIndex = -1; - _frameRateR = 0.0f; - _position = 0.0f; - _duration = 0.0f; - _timeScale = 1.0f; - _timeOffset = 0.0f; - _dragonBonesData = nullptr; - _animationData = nullptr; - _timelineData = nullptr; - _armature = nullptr; - _animationState = nullptr; - _actionTimeline = nullptr; - _frameArray = nullptr; - _frameIntArray = nullptr; - _frameFloatArray = nullptr; - _timelineArray = nullptr; - _frameIndices = nullptr; -} - -bool TimelineState::_setCurrentTime(float passedTime) -{ - const auto prevState = playState; - const auto prevPlayTimes = currentPlayTimes; - const auto prevTime = currentTime; - - if (_actionTimeline != nullptr && _frameCount <= 1) // No frame or only one frame. - { - playState = _actionTimeline->playState >= 0 ? 1 : -1; - currentPlayTimes = 1; - currentTime = _actionTimeline->currentTime; - } - else if (_actionTimeline == nullptr || _timeScale != 1.0f || _timeOffset != 0.0f) // Action timeline or has scale and offset. - { - const auto playTimes = _animationState->playTimes; - const auto totalTime = playTimes * _duration; - - passedTime *= _timeScale; - if (_timeOffset != 0.0f) - { - passedTime += _timeOffset * _animationData->duration; - } - - if (playTimes > 0 && (passedTime >= totalTime || passedTime <= -totalTime)) - { - if (playState <= 0 && _animationState->_playheadState == 3) - { - playState = 1; - } - - currentPlayTimes = playTimes; - if (passedTime < 0.0f) - { - currentTime = 0.0f; - } - else - { - currentTime = _duration + 0.000001f; // Precision problem - } - } - else - { - if (playState != 0 && _animationState->_playheadState == 3) - { - playState = 0; - } - - if (passedTime < 0.0f) - { - passedTime = -passedTime; - currentPlayTimes = (int)(passedTime / _duration); - currentTime = _duration - fmod(passedTime, _duration); - } - else - { - currentPlayTimes = (int)(passedTime / _duration); - currentTime = fmod(passedTime, _duration); - } - } - - currentTime += _position; - } - else // Multi frames. - { - playState = _actionTimeline->playState; - currentPlayTimes = _actionTimeline->currentPlayTimes; - currentTime = _actionTimeline->currentTime; - } - - if (currentPlayTimes == prevPlayTimes && currentTime == prevTime) - { - return false; - } - - // Clear frame flag when timeline start or loopComplete. - if ( - (prevState < 0 && playState != prevState) || - (playState <= 0 && currentPlayTimes != prevPlayTimes) - ) - { - _frameIndex = -1; - } - - return true; -} - -void TimelineState::init(Armature* armature, AnimationState* animationState, TimelineData* timelineData) -{ - _armature = armature; - _animationState = animationState; - _timelineData = timelineData; - _actionTimeline = _animationState->_actionTimeline; - - if (this == _actionTimeline) - { - _actionTimeline = nullptr; // - } - - _animationData = _animationState->_animationData; - - _frameRate = _animationData->parent->frameRate; - _frameRateR = 1.0f / _frameRate; - _position = _animationState->_position; - _duration = _animationState->_duration; - _dragonBonesData = _animationData->parent->parent; - - if (_timelineData != nullptr) - { - _frameIntArray = _dragonBonesData->frameIntArray; - _frameFloatArray = _dragonBonesData->frameFloatArray; - _frameArray = _dragonBonesData->frameArray; - _timelineArray = _dragonBonesData->timelineArray; - _frameIndices = &(_dragonBonesData->frameIndices); - - _frameCount = _timelineArray[_timelineData->offset + (unsigned)BinaryOffset::TimelineKeyFrameCount]; - _frameValueOffset = _timelineArray[_timelineData->offset + (unsigned)BinaryOffset::TimelineFrameValueOffset]; - _timeScale = 100.0f / _timelineArray[_timelineData->offset + (unsigned)BinaryOffset::TimelineScale]; - _timeOffset = _timelineArray[_timelineData->offset + (unsigned)BinaryOffset::TimelineOffset] * 0.01f; - } -} - -void TimelineState::update(float passedTime) -{ - if (_setCurrentTime(passedTime)) - { - if (_frameCount > 1) - { - const auto timelineFrameIndex = (unsigned)(currentTime * _frameRate); - const auto frameIndex = (*_frameIndices)[_timelineData->frameIndicesOffset + timelineFrameIndex]; - if ((unsigned)_frameIndex != frameIndex) - { - _frameIndex = frameIndex; - _frameOffset = _animationData->frameOffset + _timelineArray[_timelineData->offset + (unsigned)BinaryOffset::TimelineFrameOffset + _frameIndex]; - - _onArriveAtFrame(); - } - } - else if (_frameIndex < 0) - { - _frameIndex = 0; - if (_timelineData != nullptr) // May be pose timeline. - { - _frameOffset = _animationData->frameOffset + _timelineArray[_timelineData->offset + (unsigned)BinaryOffset::TimelineFrameOffset]; - } - - _onArriveAtFrame(); - } - - if (_tweenState != TweenState::None) - { - _onUpdateFrame(); - } - } -} - -void TweenTimelineState::_onClear() -{ - TimelineState::_onClear(); - - _tweenType = TweenType::None; - _curveCount = 0; - _framePosition = 0.0f; - _frameDurationR = 0.0f; - _tweenProgress = 0.0f; - _tweenEasing = 0.0f; -} - -void TweenTimelineState::_onArriveAtFrame() -{ - if ( - _frameCount > 1 && - ( - (unsigned)_frameIndex != _frameCount - 1 || - _animationState->playTimes == 0 || - _animationState->getCurrentPlayTimes() < _animationState->playTimes - 1 - ) - ) - { - _tweenType = (TweenType)_frameArray[_frameOffset + (unsigned)BinaryOffset::FrameTweenType]; // TODO recode ture tween type. - _tweenState = _tweenType == TweenType::None ? TweenState::Once : TweenState::Always; - - if (_tweenType == TweenType::Curve) - { - _curveCount = _frameArray[_frameOffset + (unsigned)BinaryOffset::FrameTweenEasingOrCurveSampleCount]; - } - else if (_tweenType != TweenType::None && _tweenType != TweenType::Line) - { - _tweenEasing = _frameArray[_frameOffset + (unsigned)BinaryOffset::FrameTweenEasingOrCurveSampleCount] * 0.01; - } - - _framePosition = _frameArray[_frameOffset] * _frameRateR; - - if ((unsigned)_frameIndex == _frameCount - 1) - { - _frameDurationR = 1.0f / (_animationData->duration - _framePosition); - } - else - { - const auto nextFrameOffset = _animationData->frameOffset + _timelineArray[_timelineData->offset + (unsigned)BinaryOffset::TimelineFrameOffset + _frameIndex + 1]; - const auto frameDuration = _frameArray[nextFrameOffset] * _frameRateR - _framePosition; - - if (frameDuration > 0.0f) // Fixed animation data bug. - { - _frameDurationR = 1.0f / frameDuration; - } - else - { - _frameDurationR = 0.0f; - } - } - } - else - { - _tweenState = TweenState::Once; - } -} - -void TweenTimelineState::_onUpdateFrame() -{ - if (_tweenState == TweenState::Always) - { - _tweenProgress = (currentTime - _framePosition) * _frameDurationR; - - if (_tweenType == TweenType::Curve) - { - _tweenProgress = TweenTimelineState::_getEasingCurveValue(_tweenProgress, _frameArray, _curveCount, _frameOffset + (unsigned)BinaryOffset::FrameCurveSamples); - } - else if (_tweenType != TweenType::Line) - { - _tweenProgress = TweenTimelineState::_getEasingValue(_tweenType, _tweenProgress, _tweenEasing); - } - } - else - { - _tweenProgress = 0.0f; - } -} - -void BoneTimelineState::_onClear() -{ - TweenTimelineState::_onClear(); - - bone = nullptr; - bonePose = nullptr; -} - -void BoneTimelineState::blend(int state) -{ - const auto blendWeight = bone->_blendState.blendWeight; - auto& animationPose = bone->animationPose; - const auto& result = bonePose->result; - - if (state == 2) - { - animationPose.x += result.x * blendWeight; - animationPose.y += result.y * blendWeight; - animationPose.rotation += result.rotation * blendWeight; - animationPose.skew += result.skew * blendWeight; - animationPose.scaleX += (result.scaleX - 1.0f) * blendWeight; - animationPose.scaleY += (result.scaleY - 1.0f) * blendWeight; - } - else if (blendWeight != 1.0f) - { - animationPose.x = result.x * blendWeight; - animationPose.y = result.y * blendWeight; - animationPose.rotation = result.rotation * blendWeight; - animationPose.skew = result.skew * blendWeight; - animationPose.scaleX = (result.scaleX - 1.0f) * blendWeight + 1.0f; - animationPose.scaleY = (result.scaleY - 1.0f) * blendWeight + 1.0f; - } - else - { - animationPose.x = result.x; - animationPose.y = result.y; - animationPose.rotation = result.rotation; - animationPose.skew = result.skew; - animationPose.scaleX = result.scaleX; - animationPose.scaleY = result.scaleY; - } - - if (_animationState->_fadeState != 0 || _animationState->_subFadeState != 0) - { - bone->_transformDirty = true; - } -} - -void SlotTimelineState::_onClear() -{ - TweenTimelineState::_onClear(); - - slot = nullptr; -} - -void ConstraintTimelineState::_onClear() -{ - TweenTimelineState::_onClear(); - - constraint = nullptr; -} -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones/animation/BaseTimelineState.h b/native/cocos/editor-support/dragonbones/animation/BaseTimelineState.h deleted file mode 100644 index fdf6008c1b..0000000000 --- a/native/cocos/editor-support/dragonbones/animation/BaseTimelineState.h +++ /dev/null @@ -1,199 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_BASE_TIMELINE_STATE_H -#define DRAGONBONES_BASE_TIMELINE_STATE_H - -#include "../geom/Transform.h" -#include "../core/BaseObject.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * @internal - */ -class TimelineState : public BaseObject -{ - ABSTRACT_CLASS(TimelineState) - -protected: - /** - * @internal - */ - enum class TweenState - { - None = 0, - Once = 1, - Always = 2 - }; - -public: - /** - * -1: start, 0: play, 1: complete; - */ - int playState; - int currentPlayTimes; - float currentTime; - -protected: - TweenState _tweenState; - unsigned _frameRate; - unsigned _frameValueOffset; - unsigned _frameCount; - unsigned _frameOffset; - int _frameIndex; - float _frameRateR; - float _position; - float _duration; - float _timeScale; - float _timeOffset; - DragonBonesData* _dragonBonesData; - AnimationData* _animationData; - TimelineData* _timelineData; - Armature* _armature; - AnimationState* _animationState; - TimelineState* _actionTimeline; - const int16_t* _frameArray; - const int16_t* _frameIntArray; - const float* _frameFloatArray; - const uint16_t* _timelineArray; - const std::vector* _frameIndices; - -protected: - virtual void _onClear() override; - virtual void _onArriveAtFrame() = 0; - virtual void _onUpdateFrame() = 0; - bool _setCurrentTime(float passedTime); - -public: - virtual void init(Armature* armature, AnimationState* animationState, TimelineData* timelineData); - virtual void fadeOut() {} - virtual void update(float passedTime); -}; -/** - * @internal - */ -class TweenTimelineState : public TimelineState -{ - ABSTRACT_CLASS(TweenTimelineState) - -private: - inline static float _getEasingValue(TweenType tweenType, float progress, float easing) - { - auto value = progress; - switch (tweenType) - { - case TweenType::QuadIn: - value = std::pow(progress, 2.0f); - break; - - case TweenType::QuadOut: - value = 1.0f - std::pow(1.0f - progress, 2.0f); - break; - - case TweenType::QuadInOut: - value = 0.5f * (1.0f - std::cos(progress * Transform::PI)); - break; - default: - break; - } - - return (value - progress) * easing + progress; - } - - inline static float _getEasingCurveValue(float progress, const int16_t* samples, unsigned count, unsigned offset) - { - if (progress <= 0.0f) - { - return 0.0f; - } - else if (progress >= 1.0f) - { - return 1.0f; - } - - const auto segmentCount = count + 1; // + 2 - 1 - const auto valueIndex = (unsigned)(progress * segmentCount); - const auto fromValue = valueIndex == 0 ? 0.0f : samples[offset + valueIndex - 1]; - const auto toValue = (valueIndex == segmentCount - 1) ? 10000.0f : samples[offset + valueIndex]; - - return (fromValue + (toValue - fromValue) * (progress * segmentCount - valueIndex)) * 0.0001f; - } - -protected: - TweenType _tweenType; - unsigned _curveCount; - float _framePosition; - float _frameDurationR; - float _tweenProgress; - float _tweenEasing; - -protected: - virtual void _onClear() override; - virtual void _onArriveAtFrame() override; - virtual void _onUpdateFrame() override; -}; -/** - * @internal - */ -class BoneTimelineState : public TweenTimelineState -{ - ABSTRACT_CLASS(BoneTimelineState) - -public: - Bone* bone; - BonePose* bonePose; - -protected: - virtual void _onClear() override; - -public: - void blend(int state); -}; -/** - * @internal - */ -class SlotTimelineState : public TweenTimelineState -{ - ABSTRACT_CLASS(SlotTimelineState) - -public: - Slot* slot; - -protected: - virtual void _onClear() override; -}; -/** - * @internal - */ -class ConstraintTimelineState : public TweenTimelineState -{ - ABSTRACT_CLASS(ConstraintTimelineState) - -public: - Constraint* constraint; - -protected: - virtual void _onClear() override; -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_BASE_TIMELINE_STATE_H diff --git a/native/cocos/editor-support/dragonbones/animation/IAnimatable.h b/native/cocos/editor-support/dragonbones/animation/IAnimatable.h deleted file mode 100644 index c4983fac35..0000000000 --- a/native/cocos/editor-support/dragonbones/animation/IAnimatable.h +++ /dev/null @@ -1,103 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_ANIMATEBLE_H -#define DRAGONBONES_ANIMATEBLE_H - -#include "../core/DragonBones.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * - Play animation interface. (Both Armature and Wordclock implement the interface) - * Any instance that implements the interface can be added to the Worldclock instance and advance time by Worldclock instance uniformly. - * @see dragonBones.WorldClock - * @see dragonBones.Armature - * @version DragonBones 3.0 - * @language en_US - */ -/** - * - 播放动画接口。 (Armature 和 WordClock 都实现了该接口) - * 任何实现了此接口的实例都可以添加到 WorldClock 实例中,由 WorldClock 实例统一更新时间。 - * @see dragonBones.WorldClock - * @see dragonBones.Armature - * @version DragonBones 3.0 - * @language zh_CN - */ -class IAnimatable -{ - ABSTRACT_CLASS(IAnimatable) - -public: - /** - * - Advance time. - * @param passedTime - Passed time. (In seconds) - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 更新时间。 - * @param passedTime - 前进的时间。 (以秒为单位) - * @version DragonBones 3.0 - * @language zh_CN - */ - virtual void advanceTime(float passedTime) = 0; - - /** - * - Render. - * @version Cocos creator 2.3 - * @language en_US - */ - /** - * - 渲染。 - * @version Cocos creator 2.3 - * @language zh_CN - */ - virtual void render() = 0; - - /** - * - The Wordclock instance to which the current belongs. - * @example - * TypeScript style, for reference only. - *
-     *     armature.clock = factory.clock; // Add armature to clock.
-     *     armature.clock = null; // Remove armature from clock.
-     * 
- * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 当前所属的 WordClock 实例。 - * @example - * TypeScript 风格,仅供参考。 - *
-     *     armature.clock = factory.clock; // 将骨架添加到时钟。
-     *     armature.clock = null; // 将骨架从时钟移除。
-     * 
- * @version DragonBones 5.0 - * @language zh_CN - */ - virtual WorldClock* getClock() const = 0; - virtual void setClock(WorldClock* value) = 0; -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_ANIMATEBLE_H diff --git a/native/cocos/editor-support/dragonbones/animation/TimelineState.cpp b/native/cocos/editor-support/dragonbones/animation/TimelineState.cpp deleted file mode 100644 index 34a5bde299..0000000000 --- a/native/cocos/editor-support/dragonbones/animation/TimelineState.cpp +++ /dev/null @@ -1,1036 +0,0 @@ -#include "TimelineState.h" -#include "WorldClock.h" -#include "Animation.h" -#include "../model/DragonBonesData.h" -#include "../model/UserData.h" -#include "../model/ArmatureData.h" -#include "../model/ConstraintData.h" -#include "../model/DisplayData.h" -#include "../model/AnimationData.h" -#include "../event/EventObject.h" -#include "../event/IEventDispatcher.h" -#include "../armature/Armature.h" -#include "../armature/Bone.h" -#include "../armature/Slot.h" -#include "../armature/Constraint.h" -#include "../armature/DeformVertices.h" -#include "AnimationState.h" - -DRAGONBONES_NAMESPACE_BEGIN - -void ActionTimelineState::_onCrossFrame(unsigned frameIndex) const -{ - const auto eventDispatcher = _armature->getProxy(); - - if (_animationState->actionEnabled) - { - const auto frameOffset = _animationData->frameOffset + _timelineArray[_timelineData->offset + (unsigned)BinaryOffset::TimelineFrameOffset + frameIndex]; - const unsigned actionCount = _frameArray[frameOffset + 1]; - const auto& actions = _animationData->parent->actions; // May be the animaton data not belong to this armature data. - - for (std::size_t i = 0; i < actionCount; ++i) - { - const auto actionIndex = _frameArray[frameOffset + 2 + i]; - const auto action = actions[actionIndex]; - - if (action->type == ActionType::Play) - { - const auto eventObject = BaseObject::borrowObject(); - // eventObject->time = _frameArray[frameOffset] * _frameRateR; // Precision problem - eventObject->time = _frameArray[frameOffset] / _frameRate; - eventObject->animationState = _animationState; - EventObject::actionDataToInstance(action, eventObject, _armature); - _armature->_bufferAction(eventObject, true); - } - else - { - const auto eventType = action->type == ActionType::Frame ? EventObject::FRAME_EVENT : EventObject::SOUND_EVENT; - if (action->type == ActionType::Sound || eventDispatcher->hasDBEventListener(eventType)) - { - const auto eventObject = BaseObject::borrowObject(); - // eventObject->time = _frameArray[frameOffset] * _frameRateR; // Precision problem - eventObject->time = _frameArray[frameOffset] / _frameRate; - eventObject->animationState = _animationState; - EventObject::actionDataToInstance(action, eventObject, _armature); - _armature->_dragonBones->bufferEvent(eventObject); - } - } - } - } -} - -void ActionTimelineState::update(float passedTime) -{ - const auto prevState = playState; - auto prevPlayTimes = currentPlayTimes; - auto prevTime = currentTime; - - if (_setCurrentTime(passedTime)) - { - const auto eventDispatcher = _armature->getProxy(); - if (prevState < 0) - { - if (playState != prevState) - { - if (_animationState->displayControl && _animationState->resetToPose) // Reset zorder to pose. - { - _armature->_sortZOrder(nullptr, 0); - } - - prevPlayTimes = currentPlayTimes; - - if (eventDispatcher->hasDBEventListener(EventObject::START)) - { - const auto eventObject = BaseObject::borrowObject(); - eventObject->type = EventObject::START; - eventObject->armature = _armature; - eventObject->animationState = _animationState; - _armature->_dragonBones->bufferEvent(eventObject); - } - } - else - { - return; - } - } - - const auto isReverse = _animationState->timeScale < 0.0f; - EventObject* loopCompleteEvent = nullptr; - EventObject* completeEvent = nullptr; - - if (currentPlayTimes != prevPlayTimes) - { - if (eventDispatcher->hasDBEventListener(EventObject::LOOP_COMPLETE)) - { - loopCompleteEvent = BaseObject::borrowObject(); - loopCompleteEvent->type = EventObject::LOOP_COMPLETE; - loopCompleteEvent->armature = _armature; - loopCompleteEvent->animationState = _animationState; - } - - if (playState > 0) - { - if (eventDispatcher->hasDBEventListener(EventObject::COMPLETE)) - { - completeEvent = BaseObject::borrowObject(); - completeEvent->type = EventObject::COMPLETE; - completeEvent->armature = _armature; - completeEvent->animationState = _animationState; - } - } - } - - if (_frameCount > 1) - { - const auto timelineData = _timelineData; - const auto timelineFrameIndex = (unsigned)(currentTime * _frameRate); // uint - const auto frameIndex = (*_frameIndices)[timelineData->frameIndicesOffset + timelineFrameIndex]; - - if ((unsigned)_frameIndex != frameIndex) // Arrive at frame. - { - auto crossedFrameIndex = _frameIndex; - _frameIndex = frameIndex; - - if (_timelineArray != nullptr) - { - _frameOffset = _animationData->frameOffset + _timelineArray[timelineData->offset + (unsigned)BinaryOffset::TimelineFrameOffset + _frameIndex]; - - if (isReverse) - { - if (crossedFrameIndex < 0) - { - const auto prevFrameIndex = (unsigned)(prevTime * _frameRate); - crossedFrameIndex = (*_frameIndices)[timelineData->frameIndicesOffset + prevFrameIndex]; - - if (currentPlayTimes == prevPlayTimes) // Start. - { - if ((unsigned)crossedFrameIndex == frameIndex) // Uncrossed. - { - crossedFrameIndex = -1; - } - } - } - - while (crossedFrameIndex >= 0) - { - const auto frameOffset = _animationData->frameOffset + _timelineArray[timelineData->offset + (unsigned)BinaryOffset::TimelineFrameOffset + crossedFrameIndex]; - const auto framePosition = (float)_frameArray[frameOffset] / _frameRate; - - if ( - _position <= framePosition && - framePosition <= _position + _duration - ) // Support interval play. - { - _onCrossFrame(crossedFrameIndex); - } - - if (loopCompleteEvent != nullptr && crossedFrameIndex == 0) // Add loop complete event after first frame. - { - _armature->_dragonBones->bufferEvent(loopCompleteEvent); - loopCompleteEvent = nullptr; - } - - if (crossedFrameIndex > 0) - { - crossedFrameIndex--; - } - else - { - crossedFrameIndex = _frameCount - 1; - } - - if ((unsigned)crossedFrameIndex == frameIndex) - { - break; - } - } - } - else - { - if (crossedFrameIndex < 0) - { - const auto prevFrameIndex = (unsigned)(prevTime * _frameRate); - crossedFrameIndex = (*_frameIndices)[timelineData->frameIndicesOffset + prevFrameIndex]; - const auto frameOffset = _animationData->frameOffset + _timelineArray[timelineData->offset + (unsigned)BinaryOffset::TimelineFrameOffset + crossedFrameIndex]; - const auto framePosition = (float)_frameArray[frameOffset] / _frameRate; - - if (currentPlayTimes == prevPlayTimes) // Start. - { - if (prevTime <= framePosition) // Crossed. - { - if (crossedFrameIndex > 0) - { - crossedFrameIndex--; - } - else - { - crossedFrameIndex = _frameCount - 1; - } - } - else if ((unsigned)crossedFrameIndex == frameIndex) // Uncrossed. - { - crossedFrameIndex = -1; - } - } - } - - while (crossedFrameIndex >= 0) - { - if ((unsigned)crossedFrameIndex < _frameCount - 1) - { - crossedFrameIndex++; - } - else - { - crossedFrameIndex = 0; - } - - const auto frameOffset = _animationData->frameOffset + _timelineArray[timelineData->offset + (unsigned)BinaryOffset::TimelineFrameOffset + crossedFrameIndex]; - const auto framePosition = (float)_frameArray[frameOffset] / _frameRate; - - if ( - _position <= framePosition && - framePosition <= _position + _duration - ) // Support interval play. - { - _onCrossFrame(crossedFrameIndex); - } - - if (loopCompleteEvent != nullptr && crossedFrameIndex == 0) // Add loop complete event before first frame. - { - _armature->_dragonBones->bufferEvent(loopCompleteEvent); - loopCompleteEvent = nullptr; - } - - if ((unsigned)crossedFrameIndex == frameIndex) - { - break; - } - } - } - } - } - } - else if (_frameIndex < 0) - { - _frameIndex = 0; - if (_timelineData != nullptr) - { - _frameOffset = _animationData->frameOffset + _timelineArray[_timelineData->offset + (unsigned)BinaryOffset::TimelineFrameOffset]; - // Arrive at frame. - const auto framePosition = (float)_frameArray[_frameOffset] / _frameRate; - - if (currentPlayTimes == prevPlayTimes) // Start. - { - if (prevTime <= framePosition) - { - _onCrossFrame(_frameIndex); - } - } - else if (_position <= framePosition) // Loop complete. - { - if (!isReverse && loopCompleteEvent != nullptr) // Add loop complete event before first frame. - { - _armature->_dragonBones->bufferEvent(loopCompleteEvent); - loopCompleteEvent = nullptr; - } - - _onCrossFrame(_frameIndex); - } - } - } - - if (loopCompleteEvent != nullptr) - { - _armature->_dragonBones->bufferEvent(loopCompleteEvent); - } - - if (completeEvent != nullptr) - { - _armature->_dragonBones->bufferEvent(completeEvent); - } - } -} - -void ActionTimelineState::setCurrentTime(float value) -{ - _setCurrentTime(value); - _frameIndex = -1; -} - -void ZOrderTimelineState::_onArriveAtFrame() -{ - if (playState >= 0) - { - const auto count = _frameArray[_frameOffset + 1]; - if (count > 0) - { - _armature->_sortZOrder(_frameArray, _frameOffset + 2); - } - else { - _armature->_sortZOrder(nullptr, 0); - } - } -} - -void BoneAllTimelineState::_onArriveAtFrame() -{ - BoneTimelineState::_onArriveAtFrame(); - - if (_timelineData != nullptr) - { - auto valueOffset = _animationData->frameFloatOffset + _frameValueOffset + _frameIndex * 6; // ...(timeline value offset)|xxxxxx|xxxxxx|(Value offset)xxxxx|(Next offset)xxxxx|xxxxxx|xxxxxx|... - const auto scale = _armature->_armatureData->scale; - const auto frameFloatArray = _frameFloatArray; - auto& current = bonePose->current; - auto& delta = bonePose->delta; - // - current.x = frameFloatArray[valueOffset++] * scale; - current.y = frameFloatArray[valueOffset++] * scale; - current.rotation = frameFloatArray[valueOffset++]; - current.skew = frameFloatArray[valueOffset++]; - current.scaleX = frameFloatArray[valueOffset++]; - current.scaleY = frameFloatArray[valueOffset++]; - - if (_tweenState == TweenState::Always) - { - if ((unsigned)_frameIndex == _frameCount - 1) - { - valueOffset = _animationData->frameFloatOffset + _frameValueOffset; - } - - delta.x = frameFloatArray[valueOffset++] * scale - current.x; - delta.y = frameFloatArray[valueOffset++] * scale - current.y; - delta.rotation = frameFloatArray[valueOffset++] - current.rotation; - delta.skew = frameFloatArray[valueOffset++] - current.skew; - delta.scaleX = frameFloatArray[valueOffset++] - current.scaleX; - delta.scaleY = frameFloatArray[valueOffset++] - current.scaleY; - } - else - { - delta.x = 0.0f; - delta.y = 0.0f; - delta.rotation = 0.0f; - delta.skew = 0.0f; - delta.scaleX = 0.0f; - delta.scaleY = 0.0f; - } - } - else - { - auto& current = bonePose->current; - auto& delta = bonePose->delta; - current.x = 0.0f; - current.y = 0.0f; - current.rotation = 0.0f; - current.skew = 0.0f; - current.scaleX = 1.0f; - current.scaleY = 1.0f; - delta.x = 0.0f; - delta.y = 0.0f; - delta.rotation = 0.0f; - delta.skew = 0.0f; - delta.scaleX = 0.0f; - delta.scaleY = 0.0f; - } -} - -void BoneAllTimelineState::_onUpdateFrame() -{ - BoneTimelineState::_onUpdateFrame(); - - auto& current = bonePose->current; - auto& delta = bonePose->delta; - auto& result = bonePose->result; - - bone->_transformDirty = true; - if (_tweenState != TweenState::Always) - { - _tweenState = TweenState::None; - } - - result.x = current.x + delta.x * _tweenProgress; - result.y = current.y + delta.y * _tweenProgress; - result.rotation = current.rotation + delta.rotation * _tweenProgress; - result.skew = current.skew + delta.skew * _tweenProgress; - result.scaleX = current.scaleX + delta.scaleX * _tweenProgress; - result.scaleY = current.scaleY + delta.scaleY * _tweenProgress; -} - -void BoneAllTimelineState::fadeOut() -{ - auto& result = bonePose->result; - result.rotation = Transform::normalizeRadian(result.rotation); - result.skew = Transform::normalizeRadian(result.skew); -} - -void BoneTranslateTimelineState::_onArriveAtFrame() -{ - BoneTimelineState::_onArriveAtFrame(); - - if (_timelineData != nullptr) - { - auto valueOffset = _animationData->frameFloatOffset + _frameValueOffset + _frameIndex * 2; - const auto scale = _armature->_armatureData->scale; - const auto frameFloatArray = _frameFloatArray; - auto& current = bonePose->current; - auto& delta = bonePose->delta; - - current.x = frameFloatArray[valueOffset++] * scale; - current.y = frameFloatArray[valueOffset++] * scale; - - if (_tweenState == TweenState::Always) - { - if ((unsigned)_frameIndex == _frameCount - 1) - { - valueOffset = _animationData->frameFloatOffset + _frameValueOffset; // + 0 * 2 - } - - delta.x = frameFloatArray[valueOffset++] * scale - current.x; - delta.y = frameFloatArray[valueOffset++] * scale - current.y; - } - else - { - delta.x = 0.0f; - delta.y = 0.0f; - } - } - else - { - auto& current = bonePose->current; - auto& delta = bonePose->delta; - current.x = 0.0f; - current.y = 0.0f; - delta.x = 0.0f; - delta.y = 0.0f; - } -} - -void BoneTranslateTimelineState::_onUpdateFrame() -{ - BoneTimelineState::_onUpdateFrame(); - - auto& current = bonePose->current; - auto& delta = bonePose->delta; - auto& result = bonePose->result; - - bone->_transformDirty = true; - if (_tweenState != TweenState::Always) - { - _tweenState = TweenState::None; - } - - result.x = current.x + delta.x * _tweenProgress; - result.y = current.y + delta.y * _tweenProgress; -} - -void BoneRotateTimelineState::_onArriveAtFrame() -{ - BoneTimelineState::_onArriveAtFrame(); - - if (_timelineData != nullptr) - { - auto valueOffset = _animationData->frameFloatOffset + _frameValueOffset + _frameIndex * 2; - const auto frameFloatArray = _frameFloatArray; - auto& current = bonePose->current; - auto& delta = bonePose->delta; - - current.rotation = frameFloatArray[valueOffset++]; - current.skew = frameFloatArray[valueOffset++]; - - if (_tweenState == TweenState::Always) - { - if ((unsigned)_frameIndex == _frameCount - 1) - { - valueOffset = _animationData->frameFloatOffset + _frameValueOffset; // + 0 * 2 - delta.rotation = Transform::normalizeRadian(frameFloatArray[valueOffset++] - current.rotation); - } - else - { - delta.rotation = frameFloatArray[valueOffset++] - current.rotation; - } - - delta.skew = frameFloatArray[valueOffset++] - current.skew; - } - else - { - delta.rotation = 0.0f; - delta.skew = 0.0f; - } - } - else - { - auto& current = bonePose->current; - auto& delta = bonePose->delta; - current.rotation = 0.0f; - current.skew = 0.0f; - delta.rotation = 0.0f; - delta.skew = 0.0f; - } -} - -void BoneRotateTimelineState::_onUpdateFrame() -{ - BoneTimelineState::_onUpdateFrame(); - - auto& current = bonePose->current; - auto& delta = bonePose->delta; - auto& result = bonePose->result; - - bone->_transformDirty = true; - if (_tweenState != TweenState::Always) - { - _tweenState = TweenState::None; - } - - result.rotation = current.rotation + delta.rotation * _tweenProgress; - result.skew = current.skew + delta.skew * _tweenProgress; -} - -void BoneRotateTimelineState::fadeOut() -{ - auto& result = bonePose->result; - result.rotation = Transform::normalizeRadian(result.rotation); - result.skew = Transform::normalizeRadian(result.skew); -} - -void BoneScaleTimelineState::_onArriveAtFrame() -{ - BoneTimelineState::_onArriveAtFrame(); - - if (_timelineData != nullptr) - { - auto valueOffset = _animationData->frameFloatOffset + _frameValueOffset + _frameIndex * 2; - const auto frameFloatArray = _frameFloatArray; - auto& current = bonePose->current; - auto& delta = bonePose->delta; - - current.scaleX = frameFloatArray[valueOffset++]; - current.scaleY = frameFloatArray[valueOffset++]; - - if (_tweenState == TweenState::Always) - { - if ((unsigned)_frameIndex == _frameCount - 1) - { - valueOffset = _animationData->frameFloatOffset + _frameValueOffset; // + 0 * 2 - } - - delta.scaleX = frameFloatArray[valueOffset++] - current.scaleX; - delta.scaleY = frameFloatArray[valueOffset++] - current.scaleY; - } - else - { - delta.scaleX = 0.0f; - delta.scaleY = 0.0f; - } - } - else - { - auto& current = bonePose->current; - auto& delta = bonePose->delta; - current.scaleX = 1.0f; - current.scaleY = 1.0f; - delta.scaleX = 0.0f; - delta.scaleY = 0.0f; - } -} - -void BoneScaleTimelineState::_onUpdateFrame() -{ - BoneTimelineState::_onUpdateFrame(); - - auto& current = bonePose->current; - auto& delta = bonePose->delta; - auto& result = bonePose->result; - - bone->_transformDirty = true; - if (_tweenState != TweenState::Always) - { - _tweenState = TweenState::None; - } - - result.scaleX = current.scaleX + delta.scaleX * _tweenProgress; - result.scaleY = current.scaleY + delta.scaleY * _tweenProgress; -} - -void SlotDislayTimelineState::_onArriveAtFrame() -{ - if (playState >= 0) - { - const auto displayIndex = _timelineData != nullptr ? _frameArray[_frameOffset + 1] : slot->_slotData->displayIndex; - if (slot->getDisplayIndex() != displayIndex) - { - slot->_setDisplayIndex(displayIndex, true); - } - } -} - -void SlotColorTimelineState::_onClear() -{ - SlotTimelineState::_onClear(); - - _dirty = false; -} - -void SlotColorTimelineState::_onArriveAtFrame() -{ - SlotTimelineState::_onArriveAtFrame(); - - if (_timelineData != nullptr) - { - const auto intArray = _dragonBonesData->intArray; - const auto frameIntArray = _frameIntArray; - const auto valueOffset = _animationData->frameIntOffset + _frameValueOffset + _frameIndex * 1; // ...(timeline value offset)|x|x|(Value offset)|(Next offset)|x|x|... - int colorOffset = frameIntArray[valueOffset]; - - if (colorOffset < 0) - { - colorOffset += 65536; // Fixed out of bouds bug. - } - - _current[0] = intArray[colorOffset++]; - _current[1] = intArray[colorOffset++]; - _current[2] = intArray[colorOffset++]; - _current[3] = intArray[colorOffset++]; - _current[4] = intArray[colorOffset++]; - _current[5] = intArray[colorOffset++]; - _current[6] = intArray[colorOffset++]; - _current[7] = intArray[colorOffset++]; - - if (_tweenState == TweenState::Always) - { - if ((unsigned)_frameIndex == _frameCount - 1) - { - colorOffset = frameIntArray[_animationData->frameIntOffset + _frameValueOffset]; - } - else - { - colorOffset = frameIntArray[valueOffset + 1 * 1]; - } - - if (colorOffset < 0) - { - colorOffset += 65536; // Fixed out of bouds bug. - } - - _delta[0] = intArray[colorOffset++] - _current[0]; - _delta[1] = intArray[colorOffset++] - _current[1]; - _delta[2] = intArray[colorOffset++] - _current[2]; - _delta[3] = intArray[colorOffset++] - _current[3]; - _delta[4] = intArray[colorOffset++] - _current[4]; - _delta[5] = intArray[colorOffset++] - _current[5]; - _delta[6] = intArray[colorOffset++] - _current[6]; - _delta[7] = intArray[colorOffset++] - _current[7]; - } - } - else - { - const auto color = slot->_slotData->color; - - _current[0] = color->alphaMultiplier * 100.0f; - _current[1] = color->redMultiplier * 100.0f; - _current[2] = color->greenMultiplier * 100.0f; - _current[3] = color->blueMultiplier * 100.0f; - _current[4] = color->alphaOffset; - _current[5] = color->redOffset; - _current[6] = color->greenOffset; - _current[7] = color->blueOffset; - } -} - -void SlotColorTimelineState::_onUpdateFrame() -{ - SlotTimelineState::_onUpdateFrame(); - - _dirty = true; - if (_tweenState != TweenState::Always) - { - _tweenState = TweenState::None; - } - - _result[0] = (_current[0] + _delta[0] * _tweenProgress) * 0.01f; - _result[1] = (_current[1] + _delta[1] * _tweenProgress) * 0.01f; - _result[2] = (_current[2] + _delta[2] * _tweenProgress) * 0.01f; - _result[3] = (_current[3] + _delta[3] * _tweenProgress) * 0.01f; - _result[4] = _current[4] + _delta[4] * _tweenProgress; - _result[5] = _current[5] + _delta[5] * _tweenProgress; - _result[6] = _current[6] + _delta[6] * _tweenProgress; - _result[7] = _current[7] + _delta[7] * _tweenProgress; -} - -void SlotColorTimelineState::fadeOut() -{ - _tweenState = TweenState::None; - _dirty = false; -} - -void SlotColorTimelineState::update(float passedTime) -{ - SlotTimelineState::update(passedTime); - - // Fade animation. - if (_tweenState != TweenState::None || _dirty) - { - auto& result = slot->_colorTransform; - - if (_animationState->_fadeState != 0 || _animationState->_subFadeState != 0) - { - if ( - result.alphaMultiplier != _result[0] || - result.redMultiplier != _result[1] || - result.greenMultiplier != _result[2] || - result.blueMultiplier != _result[3] || - result.alphaOffset != _result[4] || - result.redOffset != _result[5] || - result.greenOffset != _result[6] || - result.blueOffset != _result[7] - ) - { - const auto fadeProgress = pow(_animationState->_fadeProgress, 2); - - result.alphaMultiplier += (_result[0] - result.alphaMultiplier) * fadeProgress; - result.redMultiplier += (_result[1] - result.redMultiplier) * fadeProgress; - result.greenMultiplier += (_result[2] - result.greenMultiplier) * fadeProgress; - result.blueMultiplier += (_result[3] - result.blueMultiplier) * fadeProgress; - result.alphaOffset += (_result[4] - result.alphaOffset) * fadeProgress; - result.redOffset += (_result[5] - result.redOffset) * fadeProgress; - result.greenOffset += (_result[6] - result.greenOffset) * fadeProgress; - result.blueOffset += (_result[7] - result.blueOffset) * fadeProgress; - - slot->_colorDirty = true; - } - } - else if (_dirty) - { - _dirty = false; - if ( - result.alphaMultiplier != _result[0] || - result.redMultiplier != _result[1] || - result.greenMultiplier != _result[2] || - result.blueMultiplier != _result[3] || - result.alphaOffset != _result[4] || - result.redOffset != _result[5] || - result.greenOffset != _result[6] || - result.blueOffset != _result[7] - ) - { - result.alphaMultiplier = _result[0]; - result.redMultiplier = _result[1]; - result.greenMultiplier = _result[2]; - result.blueMultiplier = _result[3]; - result.alphaOffset = _result[4]; - result.redOffset = _result[5]; - result.greenOffset = _result[6]; - result.blueOffset = _result[7]; - - slot->_colorDirty = true; - } - } - } -} - -void DeformTimelineState::_onClear() -{ - SlotTimelineState::_onClear(); - - vertexOffset = 0; - - _dirty = false; - _frameFloatOffset = 0; - _deformCount = 0; - _valueCount = 0; - _valueOffset = 0; - _current.clear(); - _delta.clear(); - _result.clear(); -} - -void DeformTimelineState::_onArriveAtFrame() -{ - SlotTimelineState::_onArriveAtFrame(); - - if (_timelineData != nullptr) - { - const auto valueOffset = _animationData->frameFloatOffset + _frameValueOffset + _frameIndex * _valueCount; - const auto scale = _armature->_armatureData->scale; - const auto frameFloatArray = _frameFloatArray; - - if (_tweenState == TweenState::Always) - { - auto nextValueOffset = valueOffset + _valueCount; - if ((unsigned)_frameIndex == _frameCount - 1) - { - nextValueOffset = _animationData->frameFloatOffset + _frameValueOffset; - } - - for (std::size_t i = 0; i < _valueCount; ++i) - { - _delta[i] = frameFloatArray[nextValueOffset + i] * scale - (_current[i] = frameFloatArray[valueOffset + i] * scale); - } - } - else - { - for (std::size_t i = 0; i < _valueCount; ++i) - { - _current[i] = frameFloatArray[valueOffset + i] * scale; - } - } - } - else - { - for (std::size_t i = 0; i < _valueCount; ++i) - { - _current[i] = 0.0f; - } - } -} - -void DeformTimelineState::_onUpdateFrame() -{ - SlotTimelineState::_onUpdateFrame(); - - _dirty = true; - if (_tweenState != TweenState::Always) - { - _tweenState = TweenState::None; - } - - for (std::size_t i = 0; i < _valueCount; ++i) - { - _result[i] = _current[i] + _delta[i] * _tweenProgress; - } -} - -void DeformTimelineState::init(Armature* armature, AnimationState* animationState, TimelineData* timelineData) -{ - SlotTimelineState::init(armature, animationState, timelineData); - - if (_timelineData != nullptr) - { - const auto frameIntOffset = _animationData->frameIntOffset + _timelineArray[_timelineData->offset + (unsigned)BinaryOffset::TimelineFrameValueCount]; - vertexOffset = _frameIntArray[frameIntOffset + (unsigned)BinaryOffset::DeformVertexOffset]; - - if (vertexOffset < 0) - { - vertexOffset += 65536; // Fixed out of bouds bug. - } - - _deformCount = _frameIntArray[frameIntOffset + (unsigned)BinaryOffset::DeformCount]; - _valueCount = _frameIntArray[frameIntOffset + (unsigned)BinaryOffset::DeformValueCount]; - _valueOffset = _frameIntArray[frameIntOffset + (unsigned)BinaryOffset::DeformValueOffset]; - _frameFloatOffset = _frameIntArray[frameIntOffset + (unsigned)BinaryOffset::DeformFloatOffset] + _animationData->frameFloatOffset; - } - else - { - const auto deformVertices = slot->_deformVertices; - _deformCount = deformVertices != nullptr ? deformVertices->vertices.size() : 0; - _valueCount = _deformCount; - _valueOffset = 0; - _frameFloatOffset = 0; - } - - _current.resize(_valueCount); - _delta.resize(_valueCount, 0.0f); - _result.resize(_valueCount); -} - -void DeformTimelineState::fadeOut() -{ - _tweenState = TweenState::None; - _dirty = false; -} - -void DeformTimelineState::update(float passedTime) -{ - const auto deformVertices = slot->_deformVertices; - if (deformVertices == nullptr || deformVertices->verticesData == nullptr || deformVertices->verticesData->offset != vertexOffset) - { - return; - } - else if (_timelineData != nullptr && _dragonBonesData != deformVertices->verticesData->data) - { - return; - } - - SlotTimelineState::update(passedTime); - - // Fade animation. - if (_tweenState != TweenState::None || _dirty) - { - auto& result = deformVertices->vertices; - - if (_animationState->_fadeState != 0 || _animationState->_subFadeState != 0) - { - const auto fadeProgress = pow(_animationState->_fadeProgress, 2); - - if (_timelineData != nullptr) - { - for (std::size_t i = 0; i < _deformCount; ++i) - { - if (i < _valueOffset) - { - result[i] += (_frameFloatArray[_frameFloatOffset + i] - result[i]) * fadeProgress; - } - else if (i < _valueOffset + _valueCount) - { - result[i] += (_result[i - _valueOffset] - result[i]) * fadeProgress; - } - else - { - result[i] += (_frameFloatArray[_frameFloatOffset + i - _valueCount] - result[i]) * fadeProgress; - } - } - } - else - { - _deformCount = result.size(); - - for (std::size_t i = 0; i < _deformCount; ++i) - { - result[i] += (0.0f - result[i]) * fadeProgress; - } - } - - deformVertices->verticesDirty = true; - } - else if (_dirty) - { - _dirty = false; - - if (_timelineData != nullptr) - { - for (std::size_t i = 0; i < _deformCount; ++i) - { - if (i < _valueOffset) - { - result[i] = _frameFloatArray[_frameFloatOffset + i]; - } - else if (i < _valueOffset + _valueCount) - { - result[i] = _result[i - _valueOffset]; - } - else - { - result[i] = _frameFloatArray[_frameFloatOffset + i - _valueCount]; - } - } - } - else - { - _deformCount = result.size(); - - for (std::size_t i = 0; i < _deformCount; ++i) - { - result[i] = 0.0f; - } - } - - deformVertices->verticesDirty = true; - } - } -} - -void IKConstraintTimelineState::_onClear() -{ - ConstraintTimelineState::_onClear(); - - _current = 0.0f; - _delta = 0.0f; -} - -void IKConstraintTimelineState::_onArriveAtFrame() -{ - ConstraintTimelineState::_onArriveAtFrame(); - - const auto ikConstraint = static_cast(constraint); - - if (_timelineData != nullptr) - { - auto valueOffset = _animationData->frameIntOffset + _frameValueOffset + _frameIndex * 2; - const auto frameIntArray = _frameIntArray; - const auto bendPositive = frameIntArray[valueOffset++] != 0; - _current = frameIntArray[valueOffset++] * 0.01f; - - if (_tweenState == TweenState::Always) - { - if ((unsigned)_frameIndex == _frameCount - 1) - { - valueOffset = _animationData->frameIntOffset + _frameValueOffset; // + 0 * 2 - } - - _delta = frameIntArray[valueOffset + 1] * 0.01f - _current; - } - else - { - _delta = 0.0f; - } - - ikConstraint->_bendPositive = bendPositive; - } - else - { - const auto ikConstraintData = static_cast(ikConstraint->_constraintData); - _current = ikConstraintData->weight; - _delta = 0.0f; - ikConstraint->_bendPositive = ikConstraintData->bendPositive; - } - - ikConstraint->invalidUpdate(); -} - -void IKConstraintTimelineState::_onUpdateFrame() -{ - ConstraintTimelineState::_onUpdateFrame(); - - if (_tweenState != TweenState::Always) - { - _tweenState = TweenState::None; - } - - const auto ikConstraint = static_cast(constraint); - ikConstraint->_weight = _current + _delta * _tweenProgress; - ikConstraint->invalidUpdate(); -} - - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones/animation/TimelineState.h b/native/cocos/editor-support/dragonbones/animation/TimelineState.h deleted file mode 100644 index 2481ca3991..0000000000 --- a/native/cocos/editor-support/dragonbones/animation/TimelineState.h +++ /dev/null @@ -1,205 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_TIMELINE_STATE_H -#define DRAGONBONES_TIMELINE_STATE_H - -#include "BaseTimelineState.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * @internal - */ -class ActionTimelineState : public TimelineState -{ - BIND_CLASS_TYPE_A(ActionTimelineState); - - void _onCrossFrame(unsigned frameIndex) const; - -protected: - virtual void _onArriveAtFrame() override {} - virtual void _onUpdateFrame() override {} - -public: - void update(float passedTime) override; - void setCurrentTime(float value); -}; -/** - * @internal - */ -class ZOrderTimelineState : public TimelineState -{ - BIND_CLASS_TYPE_A(ZOrderTimelineState); - -protected: - virtual void _onArriveAtFrame() override; - virtual void _onUpdateFrame() override {} -}; -/** - * @internal - */ -class BoneAllTimelineState : public BoneTimelineState -{ - BIND_CLASS_TYPE_A(BoneAllTimelineState); - -protected: - virtual void _onArriveAtFrame() override; - virtual void _onUpdateFrame() override; - -public: - virtual void fadeOut() override; -}; -/** - * @internal - */ -class BoneTranslateTimelineState : public BoneTimelineState -{ - BIND_CLASS_TYPE_A(BoneTranslateTimelineState); - -protected: - virtual void _onArriveAtFrame() override; - virtual void _onUpdateFrame() override; -}; -/** - * @internal - */ -class BoneRotateTimelineState : public BoneTimelineState -{ - BIND_CLASS_TYPE_A(BoneRotateTimelineState); - -protected: - virtual void _onArriveAtFrame() override; - virtual void _onUpdateFrame() override; - -public: - virtual void fadeOut() override; -}; -/** - * @internal - */ -class BoneScaleTimelineState : public BoneTimelineState -{ - BIND_CLASS_TYPE_A(BoneScaleTimelineState); - -protected: - virtual void _onArriveAtFrame() override; - virtual void _onUpdateFrame() override; -}; -/** - * @internal - */ -class SlotDislayTimelineState : public SlotTimelineState -{ - BIND_CLASS_TYPE_A(SlotDislayTimelineState); - -protected: - virtual void _onArriveAtFrame() override; -}; -/** - * @internal - */ -class SlotColorTimelineState : public SlotTimelineState -{ - BIND_CLASS_TYPE_B(SlotColorTimelineState); - -private: - bool _dirty; - int* _current; - int* _delta; - float* _result; - -public: - SlotColorTimelineState() : - _current(new int[8]{ 0 }), - _delta(new int[8]{ 0 }), - _result(new float[8]{ 0.0f }) - { - _onClear(); - } - ~SlotColorTimelineState() - { - _onClear(); - - delete _current; - delete _delta; - delete _result; - } - -protected: - void _onClear() override; - void _onArriveAtFrame() override; - void _onUpdateFrame() override; - -public: - void fadeOut() override; - void update(float passedTime) override; -}; -/** - * @internal - */ -class DeformTimelineState : public SlotTimelineState -{ - BIND_CLASS_TYPE_A(DeformTimelineState); - -public: - unsigned vertexOffset; - -private: - bool _dirty; - unsigned _frameFloatOffset; - unsigned _deformCount; - unsigned _valueCount; - unsigned _valueOffset; - std::vector _current; - std::vector _delta; - std::vector _result; - -protected: - virtual void _onClear() override; - virtual void _onArriveAtFrame() override; - virtual void _onUpdateFrame() override; - -public: - virtual void init(Armature* armature, AnimationState* animationState, TimelineData* timelineData) override; - virtual void fadeOut() override; - virtual void update(float passedTime) override; -}; - -/** - * @internal - */ -class IKConstraintTimelineState : public ConstraintTimelineState -{ - BIND_CLASS_TYPE_A(IKConstraintTimelineState); - -private: - float _current; - float _delta; - -protected: - virtual void _onClear() override; - virtual void _onArriveAtFrame() override; - virtual void _onUpdateFrame() override; -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_TIMELINE_STATE_H diff --git a/native/cocos/editor-support/dragonbones/animation/WorldClock.cpp b/native/cocos/editor-support/dragonbones/animation/WorldClock.cpp deleted file mode 100644 index 046f07a3e8..0000000000 --- a/native/cocos/editor-support/dragonbones/animation/WorldClock.cpp +++ /dev/null @@ -1,158 +0,0 @@ -#include "WorldClock.h" - -DRAGONBONES_NAMESPACE_BEGIN - -WorldClock WorldClock::clock; - -void WorldClock::advanceTime(float passedTime) -{ - if (passedTime < 0.0f || passedTime != passedTime) - { - passedTime = 0.0f; - } - - const auto currentTime = 0.0f; - - if (passedTime < 0.0f) - { - passedTime = currentTime - _systemTime; - } - - _systemTime = currentTime; - - if (timeScale != 1.0f) - { - passedTime *= timeScale; - } - - if (passedTime == 0.0f) - { - return; - } - - if (passedTime < 0.0f) - { - time -= passedTime; - } - else - { - time += passedTime; - } - - std::size_t i = 0, r = 0, l = _animatebles.size(); - for (; i < l; ++i) - { - const auto animatable = _animatebles[i]; - if (animatable != nullptr) - { - if (r > 0) - { - _animatebles[i - r] = animatable; - _animatebles[i] = nullptr; - } - - animatable->advanceTime(passedTime); - } - else - { - r++; - } - } - - if (r > 0) - { - l = _animatebles.size(); - for (; i < l; ++i) - { - const auto animateble = _animatebles[i]; - if (animateble != nullptr) - { - _animatebles[i - r] = animateble; - } - else - { - r++; - } - } - - _animatebles.resize(l - r); - } -} - -bool WorldClock::contains(const IAnimatable* value) const -{ - if (value == this) { - return false; - } - - auto ancestor = value; - while (ancestor != this && ancestor != nullptr) - { - ancestor = ancestor->getClock(); - } - - return ancestor == this; -} - -void WorldClock::add(IAnimatable* value) -{ - if (std::find(_animatebles.begin(), _animatebles.end(), value) == _animatebles.end()) - { - _animatebles.push_back(value); - value->setClock(this); - } -} - -void WorldClock::remove(IAnimatable* value) -{ - const auto iterator = std::find(_animatebles.begin(), _animatebles.end(), value); - if (iterator != _animatebles.end()) - { - *iterator = nullptr; - value->setClock(nullptr); - } -} - -void WorldClock::render() -{ - for (const auto animatable : _animatebles) - { - if (animatable != nullptr) - { - animatable->render(); - } - } -} - -void WorldClock::clear() -{ - for (const auto animatable : _animatebles) - { - if (animatable != nullptr) - { - animatable->setClock(nullptr); - } - } -} - -void WorldClock::setClock(WorldClock* value) -{ - if (_clock == value) - { - return; - } - - if (_clock != nullptr) - { - _clock->remove(this); - } - - _clock = value; - - if (_clock != nullptr) - { - _clock->add(this); - } -} - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones/animation/WorldClock.h b/native/cocos/editor-support/dragonbones/animation/WorldClock.h deleted file mode 100644 index 60155a5037..0000000000 --- a/native/cocos/editor-support/dragonbones/animation/WorldClock.h +++ /dev/null @@ -1,209 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_WORLD_CLOCK_H -#define DRAGONBONES_WORLD_CLOCK_H - -#include "../core/DragonBones.h" -#include "IAnimatable.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * - Worldclock provides clock support for animations, advance time for each IAnimatable object added to the instance. - * @see dragonBones.IAnimateble - * @see dragonBones.Armature - * @version DragonBones 3.0 - * @language en_US - */ -/** - * - WorldClock 对动画提供时钟支持,为每个加入到该实例的 IAnimatable 对象更新时间。 - * @see dragonBones.IAnimateble - * @see dragonBones.Armature - * @version DragonBones 3.0 - * @language zh_CN - */ -class WorldClock : public IAnimatable -{ - DRAGONBONES_DISALLOW_COPY_AND_ASSIGN(WorldClock) - -public: - /** - * - Deprecated, please refer to {@link dragonBones.BaseFactory#clock}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link dragonBones.BaseFactory#clock}。 - * @deprecated - * @language zh_CN - */ - static WorldClock clock; - -public: - /** - * - Current time. (In seconds) - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 当前的时间。 (以秒为单位) - * @version DragonBones 3.0 - * @language zh_CN - */ - float time; - /** - * - The play speed, used to control animation speed-shift play. - * [0: Stop play, (0~1): Slow play, 1: Normal play, (1~N): Fast play] - * @default 1.0 - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 播放速度,用于控制动画变速播放。 - * [0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] - * @default 1.0 - * @version DragonBones 3.0 - * @language zh_CN - */ - float timeScale; - -private: - float _systemTime; - std::vector _animatebles; - WorldClock* _clock; - -public: - /** - * - Creating a Worldclock instance. Typically, you do not need to create Worldclock instance. - * When multiple Worldclock instances are running at different speeds, can achieving some specific animation effects, such as bullet time. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 创建一个 WorldClock 实例。通常并不需要创建 WorldClock 实例。 - * 当多个 WorldClock 实例使用不同的速度运行时,可以实现一些特殊的动画效果,比如子弹时间等。 - * @version DragonBones 3.0 - * @language zh_CN - */ - WorldClock(float timeValue = 0.0f) : - time(timeValue), - timeScale(1.0f), - _systemTime(0.0f), - _animatebles(), - _clock(nullptr) - { - _systemTime = 0.0f; - } - virtual ~WorldClock() - { - clear(); - } - /** - * - Advance time for all IAnimatable instances. - * @param passedTime - Passed time. [-1: Automatically calculates the time difference between the current frame and the previous frame, [0~N): Passed time] (In seconds) - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 为所有的 IAnimatable 实例更新时间。 - * @param passedTime - 前进的时间。 [-1: 自动计算当前帧与上一帧的时间差, [0~N): 前进的时间] (以秒为单位) - * @version DragonBones 3.0 - * @language zh_CN - */ - virtual void advanceTime(float passedTime) override; - /** - * - render all IAnimatable instances. - * @version Cocos creator 2.3 - * @language en_US - */ - /** - * - 渲染所有的 IAnimatable 实例。 - * @version Cocos creator 2.3 - * @language zh_CN - */ - virtual void render() override; - - /** - * - Check whether contains a specific instance of IAnimatable. - * @param value - The IAnimatable instance. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 检查是否包含特定的 IAnimatable 实例。 - * @param value - IAnimatable 实例。 - * @version DragonBones 3.0 - * @language zh_CN - */ - bool contains(const IAnimatable* value) const; - /** - * - Add IAnimatable instance. - * @param value - The IAnimatable instance. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 添加 IAnimatable 实例。 - * @param value - IAnimatable 实例。 - * @version DragonBones 3.0 - * @language zh_CN - */ - void add(IAnimatable* value); - /** - * - Removes a specified IAnimatable instance. - * @param value - The IAnimatable instance. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 移除特定的 IAnimatable 实例。 - * @param value - IAnimatable 实例。 - * @version DragonBones 3.0 - * @language zh_CN - */ - void remove(IAnimatable* value); - /** - * - Clear all IAnimatable instances. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 清除所有的 IAnimatable 实例。 - * @version DragonBones 3.0 - * @language zh_CN - */ - void clear(); - /** - * @inheritDoc - */ - inline virtual WorldClock* getClock() const override - { - return _clock; - } - virtual void setClock(WorldClock* value) override; - -public: // For WebAssembly. - static WorldClock* getStaticClock() { return &clock; } -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_WORLD_CLOCK_H diff --git a/native/cocos/editor-support/dragonbones/armature/Armature.cpp b/native/cocos/editor-support/dragonbones/armature/Armature.cpp deleted file mode 100644 index d1fdcfbc0c..0000000000 --- a/native/cocos/editor-support/dragonbones/armature/Armature.cpp +++ /dev/null @@ -1,554 +0,0 @@ -#include "Armature.h" -#include "../model/TextureAtlasData.h" -#include "../model/UserData.h" -#include "../animation/WorldClock.h" -#include "../animation/Animation.h" -#include "../event/EventObject.h" -#include "IArmatureProxy.h" -#include "Bone.h" -#include "Slot.h" -#include "Constraint.h" - -DRAGONBONES_NAMESPACE_BEGIN - -bool Armature::_onSortSlots(Slot* a, Slot* b) -{ - return a->_zOrder < b->_zOrder ? true : false; -} - -void Armature::_onClear() -{ - if (_clock != nullptr) // Remove clock before slots clear. - { - _clock->remove(this); - } - - for (const auto bone : _bones) - { - bone->returnToPool(); - } - - for (const auto slot : _slots) - { - slot->returnToPool(); - } - - for (const auto constraint : _constraints) - { - constraint->returnToPool(); - } - - for (const auto action : _actions) - { - action->returnToPool(); - } - - if(_animation != nullptr) - { - _animation->returnToPool(); - } - - if (_proxy != nullptr) - { - _proxy->dbClear(); - } - - if (_replaceTextureAtlasData != nullptr) - { - _replaceTextureAtlasData->returnToPool(); - } - - inheritAnimation = true; - userData = nullptr; - - _debugDraw = false; - _lockUpdate = false; - _slotsDirty = false; - _zOrderDirty = false; - _flipX = false; - _flipY = false; - _cacheFrameIndex = -1; - _bones.clear(); - _slots.clear(); - _constraints.clear(); - _actions.clear(); - _armatureData = nullptr; - _animation = nullptr; - _proxy = nullptr; - _display = nullptr; - _replaceTextureAtlasData = nullptr; - _replacedTexture = nullptr; - _dragonBones = nullptr; - _clock = nullptr; - _parent = nullptr; -} - -void Armature::_sortZOrder(const int16_t* slotIndices, unsigned offset) -{ - const auto& slotDatas = _armatureData->sortedSlots; - const auto isOriginal = slotIndices == nullptr; - - if (_zOrderDirty || !isOriginal) - { - for (std::size_t i = 0, l = slotDatas.size(); i < l; ++i) - { - const auto slotIndex = isOriginal ? i : (std::size_t)slotIndices[offset + i]; - if (slotIndex < 0 || slotIndex >= l) - { - continue; - } - - const auto slotData = slotDatas[slotIndex]; - const auto slot = getSlot(slotData->name); - if (slot != nullptr) - { - slot->_setZorder(i); - } - } - - _slotsDirty = true; - _zOrderDirty = !isOriginal; - } -} - -void Armature::_addBone(Bone* value) -{ - if (std::find(_bones.begin(), _bones.end(), value) == _bones.end()) - { - _bones.push_back(value); - } -} - -void Armature::_addSlot(Slot* value) -{ - if (std::find(_slots.begin(), _slots.end(), value) == _slots.end()) - { - _slots.push_back(value); - } -} - -void Armature::_addConstraint(Constraint* value) -{ - if (std::find(_constraints.cbegin(), _constraints.cend(), value) == _constraints.cend()) - { - _constraints.push_back(value); - } -} - -void Armature::_bufferAction(EventObject* action, bool append) -{ - if (std::find(_actions.cbegin(), _actions.cend(), action) == _actions.cend()) - { - if (append) - { - _actions.push_back(action); - } - else - { - _actions.insert(_actions.begin(), action); - } - } -} - -void Armature::dispose() -{ - if (_armatureData != nullptr) - { - _lockUpdate = true; - _dragonBones->bufferObject(this); - } -} - -void Armature::init(ArmatureData *armatureData, IArmatureProxy* proxy, void* display, DragonBones* dragonBones) -{ - if (_armatureData != nullptr) - { - return; - } - - _armatureData = armatureData; - _animation = BaseObject::borrowObject(); - _proxy = proxy; - _display = display; - _dragonBones = dragonBones; - - _proxy->dbInit(this); - _animation->init(this); - _animation->setAnimations(_armatureData->animations); -} - -void Armature::advanceTime(float passedTime) -{ - if (_lockUpdate) - { - return; - } - - if (_armatureData == nullptr) - { - DRAGONBONES_ASSERT(false, "The armature has been disposed."); - return; - } - else if(_armatureData->parent == nullptr) - { - DRAGONBONES_ASSERT(false, "The armature data has been disposed.\nPlease make sure dispose armature before call factory.clear()."); - return; - } - - const auto prevCacheFrameIndex = _cacheFrameIndex; - - // Update animation. - _animation->advanceTime(passedTime); - - // Sort slots. - if (_slotsDirty) - { - _slotsDirty = false; - std::sort(_slots.begin(), _slots.end(), Armature::_onSortSlots); - } - - // Update bones and slots. - if (_cacheFrameIndex < 0 || _cacheFrameIndex != prevCacheFrameIndex) - { - for (const auto bone : _bones) - { - bone->update(_cacheFrameIndex); - } - - for (const auto slot : _slots) - { - slot->update(_cacheFrameIndex); - } - } - - // Do actions. - if (!_actions.empty()) - { - _lockUpdate = true; - - for (const auto action : _actions) - { - const auto actionData = action->actionData; - - if (actionData != nullptr) - { - if (actionData->type == ActionType::Play) - { - if (action->slot != nullptr) - { - const auto childArmature = action->slot->getChildArmature(); - if (childArmature != nullptr) - { - childArmature->getAnimation()->fadeIn(actionData->name); - } - } - else if (action->bone != nullptr) - { - for (const auto slot : getSlots()) - { - if (slot->getParent() == action->bone) - { - const auto childArmature = slot->getChildArmature(); - if (childArmature != nullptr) - { - childArmature->getAnimation()->fadeIn(actionData->name); - } - } - } - } - else - { - _animation->fadeIn(actionData->name); - } - } - } - - action->returnToPool(); - } - - _actions.clear(); - _lockUpdate = false; - } - - _proxy->dbUpdate(); -} - -void Armature::render() -{ - if (_proxy) - { - _proxy->dbRender(); - } -} - -void Armature::invalidUpdate(const std::string& boneName, bool updateSlot) -{ - if (!boneName.empty()) - { - const auto bone = getBone(boneName); - if (bone != nullptr) - { - bone->invalidUpdate(); - - if (updateSlot) - { - for (const auto slot : _slots) - { - if (slot->getParent() == bone) - { - slot->invalidUpdate(); - } - } - } - } - } - else - { - for (const auto bone : _bones) - { - bone->invalidUpdate(); - } - - if (updateSlot) - { - for (const auto slot : _slots) - { - slot->invalidUpdate(); - } - } - } -} - -Slot* Armature::containsPoint(float x, float y) const -{ - for(const auto slot : _slots) - { - if(slot->containsPoint(x,y)) { - return slot; - } - } - - return nullptr; -} - -Slot* Armature::intersectsSegment( - float xA, float yA, float xB, float yB, - Point* intersectionPointA, - Point* intersectionPointB, - Point* normalRadians -) const -{ - const auto isV = xA == xB; - auto dMin = 0.0f; - auto dMax = 0.0f; - auto intXA = 0.0f; - auto intYA = 0.0f; - auto intXB = 0.0f; - auto intYB = 0.0f; - auto intAN = 0.0f; - auto intBN = 0.0f; - Slot* intSlotA = nullptr; - Slot* intSlotB = nullptr; - - for (const auto & slot : _slots) - { - auto intersectionCount = slot->intersectsSegment(xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians); - if (intersectionCount > 0) - { - if (intersectionPointA != nullptr || intersectionPointB != nullptr) - { - if (intersectionPointA != nullptr) - { - float d = isV ? intersectionPointA->y - yA : intersectionPointA->x - xA; - if (d < 0.0f) - { - d = -d; - } - - if (intSlotA == nullptr || d < dMin) - { - dMin = d; - intXA = intersectionPointA->x; - intYA = intersectionPointA->y; - intSlotA = slot; - - if (normalRadians) { - intAN = normalRadians->x; - } - } - } - - if (intersectionPointB != nullptr) - { - float d = intersectionPointB->x - xA; - if (d < 0.0f) - { - d = -d; - } - - if (intSlotB == nullptr || d > dMax) - { - dMax = d; - intXB = intersectionPointB->x; - intYB = intersectionPointB->y; - intSlotB = slot; - - if (normalRadians != nullptr) - { - intBN = normalRadians->y; - } - } - } - } - else - { - intSlotA = slot; - break; - } - } - } - - if (intSlotA != nullptr && intersectionPointA != nullptr) - { - intersectionPointA->x = intXA; - intersectionPointA->y = intYA; - - if (normalRadians != nullptr) - { - normalRadians->x = intAN; - } - } - - if (intSlotB != nullptr && intersectionPointB != nullptr) - { - intersectionPointB->x = intXB; - intersectionPointB->y = intYB; - - if (normalRadians != nullptr) - { - normalRadians->y = intBN; - } - } - - return intSlotA; -} - -Bone* Armature::getBone(const std::string& name) const -{ - for (const auto& bone : _bones) - { - if (bone->getName() == name) - { - return bone; - } - } - - return nullptr; -} - -Bone* Armature::getBoneByDisplay(void* display) const -{ - const auto slot = getSlotByDisplay(display); - - return slot != nullptr ? slot->getParent() : nullptr; -} - -Slot* Armature::getSlot(const std::string& name) const -{ - for (const auto slot : _slots) - { - if (slot->getName() == name) - { - return slot; - } - } - - return nullptr; -} - -Slot* Armature::getSlotByDisplay(void* display) const -{ - if (display != nullptr) - { - for (const auto slot : _slots) - { - if (slot->getDisplay() == display) - { - return slot; - } - } - } - - return nullptr; -} - -void Armature::setCacheFrameRate(unsigned value) -{ - if (_armatureData->cacheFrameRate != value) - { - _armatureData->cacheFrames(value); - - for (const auto & slot : _slots) - { - const auto childArmature = slot->getChildArmature(); - if (childArmature != nullptr && childArmature->getCacheFrameRate() == 0) - { - childArmature->setCacheFrameRate(value); - } - } - } -} - -void Armature::setClock(WorldClock* value) -{ - if(_clock == value) - { - return; - } - - if(_clock) - { - _clock->remove(this); - } - - _clock = value; - - if(_clock) - { - _clock->add(this); - } - - // Update childArmature clock. - for (const auto& slot : _slots) - { - const auto childArmature = slot->getChildArmature(); - if (childArmature != nullptr) - { - childArmature->setClock(_clock); - } - } -} - -void Armature::setReplacedTexture(void* value) -{ - if (_replacedTexture == value) - { - return; - } - - if (_replaceTextureAtlasData != nullptr) - { - _replaceTextureAtlasData->returnToPool(); - _replaceTextureAtlasData = nullptr; - } - - _replacedTexture = value; - - for (const auto &slot : _slots) - { - slot->invalidUpdate(); - slot->update(-1); - } -} - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones/armature/Armature.h b/native/cocos/editor-support/dragonbones/armature/Armature.h deleted file mode 100644 index dc23ef3d13..0000000000 --- a/native/cocos/editor-support/dragonbones/armature/Armature.h +++ /dev/null @@ -1,559 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_ARMATURE_H -#define DRAGONBONES_ARMATURE_H - -#include "../core/BaseObject.h" -#include "../animation/IAnimatable.h" -#include "../model/ArmatureData.h" -#include "IArmatureProxy.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * - Armature is the core of the skeleton animation system. - * @see dragonBones.ArmatureData - * @see dragonBones.Bone - * @see dragonBones.Slot - * @see dragonBones.Animation - * @version DragonBones 3.0 - * @language en_US - */ -/** - * - 骨架是骨骼动画系统的核心。 - * @see dragonBones.ArmatureData - * @see dragonBones.Bone - * @see dragonBones.Slot - * @see dragonBones.Animation - * @version DragonBones 3.0 - * @language zh_CN - */ -class Armature : public virtual IAnimatable, public BaseObject -{ - BIND_CLASS_TYPE_B(Armature); - -private: - static bool _onSortSlots(Slot* a, Slot* b); - -public: - /** - * - Whether to inherit the animation control of the parent armature. - * True to try to have the child armature play an animation with the same name when the parent armature play the animation. - * @default true - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 是否继承父骨架的动画控制。 - * 如果该值为 true,当父骨架播放动画时,会尝试让子骨架播放同名动画。 - * @default true - * @version DragonBones 4.5 - * @language zh_CN - */ - bool inheritAnimation; - /** - * @private - */ - void* userData; - -public: - /** - * @internal - */ - int _cacheFrameIndex; - /** - * @internal - */ - ArmatureData* _armatureData; - /** - * @internal - */ - DragonBones* _dragonBones; - /** - * @internal - */ - Slot* _parent; - /** - * @internal - */ - TextureAtlasData* _replaceTextureAtlasData; - /** - * @internal - */ - std::vector _constraints; - -protected: - bool _debugDraw; - bool _lockUpdate; - bool _slotsDirty; - bool _zOrderDirty; - bool _flipX; - bool _flipY; - std::vector _bones; - std::vector _slots; - std::vector _actions; - Animation* _animation; - IArmatureProxy* _proxy; - void* _display; - WorldClock* _clock; - void* _replacedTexture; - -public: - Armature() : - _animation(nullptr), - _proxy(nullptr), - _clock(nullptr), - _replaceTextureAtlasData(nullptr) - { - _onClear(); - } - virtual ~Armature() - { - _onClear(); - } - -protected: - virtual void _onClear() override; - -private: - void _sortSlots(); - -public: - /** - * @internal - */ - void _sortZOrder(const int16_t* slotIndices, unsigned offset); - /** - * @internal - */ - void _addBone(Bone* value); - /** - * @internal - */ - void _addSlot(Slot* value); - /** - * @internal - */ - void _addConstraint(Constraint* value); - /** - * @internal - */ - void _bufferAction(EventObject* action, bool append); - /** - * - Dispose the armature. (Return to the object pool) - * @example - * TypeScript style, for reference only. - *
-     *     removeChild(armature.display);
-     *     armature.dispose();
-     * 
- * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 释放骨架。 (回收到对象池) - * @example - * TypeScript 风格,仅供参考。 - *
-     *     removeChild(armature.display);
-     *     armature.dispose();
-     * 
- * @version DragonBones 3.0 - * @language zh_CN - */ - void dispose(); - /** - * @internal - */ - void init(ArmatureData *armatureData, IArmatureProxy* proxy, void* display, DragonBones* dragonBones); - /** - * @inheritDoc - */ - void advanceTime(float passedTime) override; - /** - * @inheritDoc - */ - void render() override; - /** - * - Forces a specific bone or its owning slot to update the transform or display property in the next frame. - * @param boneName - The bone name. (If not set, all bones will be update) - * @param updateSlot - Whether to update the bone's slots. (Default: false) - * @see dragonBones.Bone#invalidUpdate() - * @see dragonBones.Slot#invalidUpdate() - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 强制特定骨骼或其拥有的插槽在下一帧更新变换或显示属性。 - * @param boneName - 骨骼名称。 (如果未设置,将更新所有骨骼) - * @param updateSlot - 是否更新骨骼的插槽。 (默认: false) - * @see dragonBones.Bone#invalidUpdate() - * @see dragonBones.Slot#invalidUpdate() - * @version DragonBones 3.0 - * @language zh_CN - */ - void invalidUpdate(const std::string& boneName = "", bool updateSlot = false); - /** - * - Check whether a specific point is inside a custom bounding box in a slot. - * The coordinate system of the point is the inner coordinate system of the armature. - * Custom bounding boxes need to be customized in Dragonbones Pro. - * @param x - The horizontal coordinate of the point. - * @param y - The vertical coordinate of the point. - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 检查特定点是否在某个插槽的自定义边界框内。 - * 点的坐标系为骨架内坐标系。 - * 自定义边界框需要在 DragonBones Pro 中自定义。 - * @param x - 点的水平坐标。 - * @param y - 点的垂直坐标。 - * @version DragonBones 5.0 - * @language zh_CN - */ - Slot* containsPoint(float x, float y) const; - /** - * - Check whether a specific segment intersects a custom bounding box for a slot in the armature. - * The coordinate system of the segment and intersection is the inner coordinate system of the armature. - * Custom bounding boxes need to be customized in Dragonbones Pro. - * @param xA - The horizontal coordinate of the beginning of the segment. - * @param yA - The vertical coordinate of the beginning of the segment. - * @param xB - The horizontal coordinate of the end point of the segment. - * @param yB - The vertical coordinate of the end point of the segment. - * @param intersectionPointA - The first intersection at which a line segment intersects the bounding box from the beginning to the end. (If not set, the intersection point will not calculated) - * @param intersectionPointB - The first intersection at which a line segment intersects the bounding box from the end to the beginning. (If not set, the intersection point will not calculated) - * @param normalRadians - The normal radians of the tangent of the intersection boundary box. [x: Normal radian of the first intersection tangent, y: Normal radian of the second intersection tangent] (If not set, the normal will not calculated) - * @returns The slot of the first custom bounding box where the segment intersects from the start point to the end point. - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 检查特定线段是否与骨架的某个插槽的自定义边界框相交。 - * 线段和交点的坐标系均为骨架内坐标系。 - * 自定义边界框需要在 DragonBones Pro 中自定义。 - * @param xA - 线段起点的水平坐标。 - * @param yA - 线段起点的垂直坐标。 - * @param xB - 线段终点的水平坐标。 - * @param yB - 线段终点的垂直坐标。 - * @param intersectionPointA - 线段从起点到终点与边界框相交的第一个交点。 (如果未设置,则不计算交点) - * @param intersectionPointB - 线段从终点到起点与边界框相交的第一个交点。 (如果未设置,则不计算交点) - * @param normalRadians - 交点边界框切线的法线弧度。 [x: 第一个交点切线的法线弧度, y: 第二个交点切线的法线弧度] (如果未设置,则不计算法线) - * @returns 线段从起点到终点相交的第一个自定义边界框的插槽。 - * @version DragonBones 5.0 - * @language zh_CN - */ - Slot* intersectsSegment( - float xA, float yA, float xB, float yB, - Point* intersectionPointA = nullptr, - Point* intersectionPointB = nullptr, - Point* normalRadians = nullptr - ) const; - /** - * - Get a specific bone. - * @param name - The bone name. - * @see dragonBones.Bone - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 获取特定的骨骼。 - * @param name - 骨骼名称。 - * @see dragonBones.Bone - * @version DragonBones 3.0 - * @language zh_CN - */ - Bone* getBone(const std::string& name) const; - /** - * - Get a specific bone by the display. - * @param display - The display object. - * @see dragonBones.Bone - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 通过显示对象获取特定的骨骼。 - * @param display - 显示对象。 - * @see dragonBones.Bone - * @version DragonBones 3.0 - * @language zh_CN - */ - Bone* getBoneByDisplay(void* display) const; - /** - * - Get a specific slot. - * @param name - The slot name. - * @see dragonBones.Slot - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 获取特定的插槽。 - * @param name - 插槽名称。 - * @see dragonBones.Slot - * @version DragonBones 3.0 - * @language zh_CN - */ - Slot* getSlot(const std::string& name) const; - /** - * - Get a specific slot by the display. - * @param display - The display object. - * @see dragonBones.Slot - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 通过显示对象获取特定的插槽。 - * @param display - 显示对象。 - * @see dragonBones.Slot - * @version DragonBones 3.0 - * @language zh_CN - */ - Slot* getSlotByDisplay(void* display) const; - /** - * - Get all bones. - * @see dragonBones.Bone - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 获取所有的骨骼。 - * @see dragonBones.Bone - * @version DragonBones 3.0 - * @language zh_CN - */ - inline const std::vector& getBones() const - { - return _bones; - } - /** - * - Get all slots. - * @see dragonBones.Slot - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 获取所有的插槽。 - * @see dragonBones.Slot - * @version DragonBones 3.0 - * @language zh_CN - */ - inline const std::vector& getSlots() const - { - return _slots; - } - /** - * - Whether to flip the armature horizontally. - * @version DragonBones 5.5 - * @language en_US - */ - /** - * - 是否将骨架水平翻转。 - * @version DragonBones 5.5 - * @language zh_CN - */ - bool getFlipX() const - { - return _flipX; - } - void setFlipX(bool value) - { - _flipX = value; - invalidUpdate(""); - } - - /** - * - Whether to flip the armature vertically. - * @version DragonBones 5.5 - * @language en_US - */ - /** - * - 是否将骨架垂直翻转。 - * @version DragonBones 5.5 - * @language zh_CN - */ - bool getFlipY() const - { - return _flipY; - } - void setFlipY(bool value) - { - _flipY = value; - invalidUpdate(""); - } - /** - * - The animation cache frame rate, which turns on the animation cache when the set value is greater than 0. - * There is a certain amount of memory overhead to improve performance by caching animation data in memory. - * The frame rate should not be set too high, usually with the frame rate of the animation is similar and lower than the program running frame rate. - * When the animation cache is turned on, some features will fail, such as the offset property of bone. - * @example - * TypeScript style, for reference only. - *
-     *     armature.cacheFrameRate = 24;
-     * 
- * @see dragonBones.DragonBonesData#frameRate - * @see dragonBones.ArmatureData#frameRate - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 动画缓存帧率,当设置的值大于 0 的时,将会开启动画缓存。 - * 通过将动画数据缓存在内存中来提高运行性能,会有一定的内存开销。 - * 帧率不宜设置的过高,通常跟动画的帧率相当且低于程序运行的帧率。 - * 开启动画缓存后,某些功能将会失效,比如骨骼的 offset 属性等。 - * @example - * TypeScript 风格,仅供参考。 - *
-     *     armature.cacheFrameRate = 24;
-     * 
- * @see dragonBones.DragonBonesData#frameRate - * @see dragonBones.ArmatureData#frameRate - * @version DragonBones 4.5 - * @language zh_CN - */ - inline unsigned getCacheFrameRate() const - { - return _armatureData->cacheFrameRate; - } - void setCacheFrameRate(unsigned value); - /** - * - The armature name. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 骨架名称。 - * @version DragonBones 3.0 - * @language zh_CN - */ - inline const std::string& getName() const - { - return _armatureData->name; - } - /** - * - The armature data. - * @see dragonBones.ArmatureData - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 骨架数据。 - * @see dragonBones.ArmatureData - * @version DragonBones 4.5 - * @language zh_CN - */ - inline const ArmatureData* getArmatureData() const - { - return _armatureData; - } - /** - * - The animation player. - * @see dragonBones.Animation - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 动画播放器。 - * @see dragonBones.Animation - * @version DragonBones 3.0 - * @language zh_CN - */ - inline Animation* getAnimation() const - { - return _animation; - } - /** - * @pivate - */ - inline IArmatureProxy* getProxy() const - { - return _proxy; - } - /** - * - The EventDispatcher instance of the armature. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 该骨架的 EventDispatcher 实例。 - * @version DragonBones 4.5 - * @language zh_CN - */ - inline IEventDispatcher* getEventDispatcher() const - { - return _proxy; - } - /** - * - The display container. - * The display of the slot is displayed as the parent. - * Depending on the rendering engine, the type will be different, usually the DisplayObjectContainer type. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 显示容器实例。 - * 插槽的显示对象都会以此显示容器为父级。 - * 根据渲染引擎的不同,类型会不同,通常是 DisplayObjectContainer 类型。 - * @version DragonBones 3.0 - * @language zh_CN - */ - inline void* getDisplay() const - { - return _display; - } - /** - * @private - */ - inline void* getReplacedTexture() const - { - return _replacedTexture; - } - void setReplacedTexture(void* value); - /** - * @inheritDoc - */ - inline WorldClock* getClock() const override - { - return _clock; - } - void setClock(WorldClock* value) override; - /** - * - Get the parent slot which the armature belongs to. - * @see dragonBones.Slot - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 该骨架所属的父插槽。 - * @see dragonBones.Slot - * @version DragonBones 4.5 - * @language zh_CN - */ - inline Slot* getParent() const - { - return _parent; - } - -public: // For WebAssembly. - IAnimatable* getAnimatable() const { return (IAnimatable*)this; } -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_ARMATURE_H diff --git a/native/cocos/editor-support/dragonbones/armature/Bone.cpp b/native/cocos/editor-support/dragonbones/armature/Bone.cpp deleted file mode 100644 index c84a7058c8..0000000000 --- a/native/cocos/editor-support/dragonbones/armature/Bone.cpp +++ /dev/null @@ -1,432 +0,0 @@ -#include "Bone.h" -#include "../geom/Matrix.h" -#include "../geom/Transform.h" -#include "Armature.h" -#include "Slot.h" -#include "Constraint.h" -#include "../animation/AnimationState.h" - -DRAGONBONES_NAMESPACE_BEGIN - -void Bone::_onClear() -{ - TransformObject::_onClear(); - - offsetMode = OffsetMode::Additive; - animationPose.identity(); - - _transformDirty = false; - _childrenTransformDirty = false; - _localDirty = true; - _hasConstraint = false; - _visible = true; - _cachedFrameIndex = -1; - _blendState.clear(); - _boneData = nullptr; - _parent = nullptr; - _cachedFrameIndices = nullptr; -} - -void Bone::_updateGlobalTransformMatrix(bool isCache) -{ - const auto flipX = _armature->getFlipX(); - const auto flipY = _armature->getFlipY() == DragonBones::yDown; - auto inherit = _parent != nullptr; - auto rotation = 0.0f; - - if (offsetMode == OffsetMode::Additive) - { - if (origin != nullptr) - { - // global = *origin; // Copy. - // global.add(offset).add(animationPose); - global.x = origin->x + offset.x + animationPose.x; - global.scaleX = origin->scaleX * offset.scaleX * animationPose.scaleX; - global.scaleY = origin->scaleY * offset.scaleY * animationPose.scaleY; - if (DragonBones::yDown) - { - global.y = origin->y + offset.y + animationPose.y; - global.skew = origin->skew + offset.skew + animationPose.skew; - global.rotation = origin->rotation + offset.rotation + animationPose.rotation; - } - else - { - global.y = origin->y - offset.y + animationPose.y; - global.skew = origin->skew - offset.skew + animationPose.skew; - global.rotation = origin->rotation - offset.rotation + animationPose.rotation; - } - } - else - { - global = offset; // Copy. - if (!DragonBones::yDown) - { - global.y = -global.y; - global.skew = -global.skew; - global.rotation = -global.rotation; - } - global.add(animationPose); - } - } - else if (offsetMode == OffsetMode::None) - { - if (origin != nullptr) - { - global = *origin; - global.add(animationPose); - } - else - { - global = animationPose; - } - } - else - { - inherit = false; - global = offset; - if (!DragonBones::yDown) - { - global.y = -global.y; - global.skew = -global.skew; - global.rotation = -global.rotation; - } - } - - if (inherit) - { - const auto& parentMatrix = _parent->globalTransformMatrix; - if (_boneData->inheritScale) - { - if (!_boneData->inheritRotation) - { - _parent->updateGlobalTransform(); - - if (flipX && flipY) - { - rotation = global.rotation - (_parent->global.rotation + Transform::PI); - } - else if (flipX) - { - rotation = global.rotation + _parent->global.rotation + Transform::PI; - } - else if (flipY) - { - rotation = global.rotation + _parent->global.rotation; - } - else - { - rotation = global.rotation - _parent->global.rotation; - } - - global.rotation = rotation; - } - - global.toMatrix(globalTransformMatrix); - globalTransformMatrix.concat(parentMatrix); - - if (_boneData->inheritTranslation) - { - global.x = globalTransformMatrix.tx; - global.y = globalTransformMatrix.ty; - } - else - { - globalTransformMatrix.tx = global.x; - globalTransformMatrix.ty = global.y; - } - - if (isCache) - { - global.fromMatrix(globalTransformMatrix); - } - else - { - _globalDirty = true; - } - } - else - { - if (_boneData->inheritTranslation) - { - const auto x = global.x; - const auto y = global.y; - global.x = parentMatrix.a * x + parentMatrix.c * y + parentMatrix.tx; - global.y = parentMatrix.b * x + parentMatrix.d * y + parentMatrix.ty; - } - else - { - if (flipX) - { - global.x = -global.x; - } - - if (flipY) - { - global.y = -global.y; - } - } - - if (_boneData->inheritRotation) - { - _parent->updateGlobalTransform(); - - if (_parent->global.scaleX < 0.0f) - { - rotation = global.rotation + _parent->global.rotation + Transform::PI; - } - else - { - rotation = global.rotation + _parent->global.rotation; - } - - if (parentMatrix.a * parentMatrix.d - parentMatrix.b * parentMatrix.c < 0.0f) - { - rotation -= global.rotation * 2.0f; - - if (flipX != flipY || _boneData->inheritReflection) - { - global.skew += Transform::PI; - } - - if (!DragonBones::yDown) - { - global.skew = -global.skew; - } - } - - global.rotation = rotation; - } - else if (flipX || flipY) - { - if (flipX && flipY) - { - rotation = global.rotation + Transform::PI; - } - else - { - if (flipX) - { - rotation = Transform::PI - global.rotation; - } - else - { - rotation = -global.rotation; - } - - global.skew += Transform::PI; - } - - global.rotation = rotation; - } - - global.toMatrix(globalTransformMatrix); - } - } - else - { - if (flipX || flipY) - { - if (flipX) - { - global.x = -global.x; - } - - if (flipY) - { - global.y = -global.y; - } - - if (flipX && flipY) - { - rotation = global.rotation + Transform::PI; - } - else - { - if (flipX) - { - rotation = Transform::PI - global.rotation; - } - else - { - rotation = -global.rotation; - } - - global.skew += Transform::PI; - } - - global.rotation = rotation; - } - - global.toMatrix(globalTransformMatrix); - } -} - -void Bone::init(const BoneData* boneData, Armature* armatureValue) -{ - if (_boneData != nullptr) - { - return; - } - - _boneData = boneData; - _armature = armatureValue; - - if (_boneData->parent != nullptr) - { - _parent = _armature->getBone(_boneData->parent->name); - } - - _armature->_addBone(this); - // - origin = &(_boneData->transform); -} - -void Bone::update(int cacheFrameIndex) -{ - _blendState.dirty = false; - - if (cacheFrameIndex >= 0 && _cachedFrameIndices != nullptr) - { - const auto cachedFrameIndex = (*_cachedFrameIndices)[cacheFrameIndex]; - if (cachedFrameIndex >= 0 && _cachedFrameIndex == cachedFrameIndex) // Same cache. - { - _transformDirty = false; - } - else if (cachedFrameIndex >= 0) // Has been Cached. - { - _transformDirty = true; - _cachedFrameIndex = cachedFrameIndex; - } - else - { - if (_hasConstraint) // Update constraints. - { - for (const auto constraint : _armature->_constraints) - { - if (constraint->_root == this) - { - constraint->update(); - } - } - } - - if ( _transformDirty || (_parent != nullptr && _parent->_childrenTransformDirty)) // Dirty. - { - _transformDirty = true; - _cachedFrameIndex = -1; - } - else if (_cachedFrameIndex >= 0) // Same cache, but not set index yet. - { - _transformDirty = false; - (*_cachedFrameIndices)[cacheFrameIndex] = _cachedFrameIndex; - } - else // Dirty. - { - _transformDirty = true; - _cachedFrameIndex = -1; - } - } - } - else - { - if (_hasConstraint) // Update constraints. - { - for (const auto constraint : _armature->_constraints) - { - if (constraint->_root == this) - { - constraint->update(); - } - } - } - - if ( _transformDirty || (_parent != nullptr && _parent->_childrenTransformDirty)) // Dirty. - { - cacheFrameIndex = -1; - _transformDirty = true; - _cachedFrameIndex = -1; - } - } - - if (_transformDirty) - { - _transformDirty = false; - _childrenTransformDirty = true; - // - if (_cachedFrameIndex < 0) - { - const auto isCache = cacheFrameIndex >= 0; - if (_localDirty) - { - _updateGlobalTransformMatrix(isCache); - } - - if (isCache && _cachedFrameIndices != nullptr) - { - _cachedFrameIndex = (*_cachedFrameIndices)[cacheFrameIndex] = _armature->_armatureData->setCacheFrame(globalTransformMatrix, global); - } - } - else - { - _armature->_armatureData->getCacheFrame(globalTransformMatrix, global, _cachedFrameIndex); - } - // - } - else if (_childrenTransformDirty) - { - _childrenTransformDirty = false; - } - - _localDirty = true; -} - -void Bone::updateByConstraint() -{ - if (_localDirty) - { - _localDirty = false; - - if (_transformDirty || (_parent != nullptr && _parent->_childrenTransformDirty)) - { - _updateGlobalTransformMatrix(true); - } - - _transformDirty = true; - } -} - -bool Bone::contains(const Bone* value) const -{ - if (value == this) - { - return false; - } - - auto ancestor = value; - while (ancestor != this && ancestor != nullptr) - { - ancestor = ancestor->getParent(); - } - - return ancestor == this; -} - -void Bone::setVisible(bool value) -{ - if (_visible == value) - { - return; - } - - _visible = value; - - for (const auto & slot : _armature->getSlots()) - { - if (slot->getParent() == this) - { - slot->_updateVisible(); - } - } -} - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones/armature/Bone.h b/native/cocos/editor-support/dragonbones/armature/Bone.h deleted file mode 100644 index 3395b8a097..0000000000 --- a/native/cocos/editor-support/dragonbones/armature/Bone.h +++ /dev/null @@ -1,235 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_BONE_H -#define DRAGONBONES_BONE_H - -#include "TransformObject.h" -#include "../model/ArmatureData.h" -#include "../animation/AnimationState.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * - Bone is one of the most important logical units in the armature animation system, - * and is responsible for the realization of translate, rotation, scaling in the animations. - * A armature can contain multiple bones. - * @see dragonBones.BoneData - * @see dragonBones.Armature - * @see dragonBones.Slot - * @version DragonBones 3.0 - * @language en_US - */ -/** - * - 骨骼在骨骼动画体系中是最重要的逻辑单元之一,负责动画中的平移、旋转、缩放的实现。 - * 一个骨架中可以包含多个骨骼。 - * @see dragonBones.BoneData - * @see dragonBones.Armature - * @see dragonBones.Slot - * @version DragonBones 3.0 - * @language zh_CN - */ -class Bone final : public TransformObject -{ - BIND_CLASS_TYPE_A(Bone); - -public: - /** - * - The offset mode. - * @see #offset - * @version DragonBones 5.5 - * @language en_US - */ - /** - * - 偏移模式。 - * @see #offset - * @version DragonBones 5.5 - * @language zh_CN - */ - OffsetMode offsetMode; - /** - * @internal - */ - Transform animationPose; - /** - * @internal - */ - bool _transformDirty; - /** - * @internal - */ - bool _childrenTransformDirty; - /** - * @internal - */ - bool _hasConstraint; - /** - * @internal - */ - BlendState _blendState; - /** - * @internal - */ - const BoneData* _boneData; - /** - * @internal - */ - std::vector* _cachedFrameIndices; - -protected: - bool _localDirty; - bool _visible; - int _cachedFrameIndex; - /** - * @private - */ - Bone* _parent; - -protected: - void _onClear() override; - void _updateGlobalTransformMatrix(bool isCache); - -public: - /** - * @internal - */ - void init(const BoneData* boneData, Armature* armatureValue); - /** - * @internal - */ - void update(int cacheFrameIndex); - /** - * @internal - */ - void updateByConstraint(); - /** - * - Forces the bone to update the transform in the next frame. - * When the bone is not animated or its animation state is finished, the bone will not continue to update, - * and when the skeleton must be updated for some reason, the method needs to be called explicitly. - * @example - * TypeScript style, for reference only. - *
-     *     let bone = armature.getBone("arm");
-     *     bone.offset.scaleX = 2.0;
-     *     bone.invalidUpdate();
-     * 
- * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 强制骨骼在下一帧更新变换。 - * 当该骨骼没有动画状态或其动画状态播放完成时,骨骼将不在继续更新,而此时由于某些原因必须更新骨骼时,则需要显式调用该方法。 - * @example - * TypeScript 风格,仅供参考。 - *
-     *     let bone = armature.getBone("arm");
-     *     bone.offset.scaleX = 2.0;
-     *     bone.invalidUpdate();
-     * 
- * @version DragonBones 3.0 - * @language zh_CN - */ - inline void invalidUpdate() - { - _transformDirty = true; - } - /** - * - Check whether the bone contains a specific bone. - * @see dragonBones.Bone - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 检查该骨骼是否包含特定的骨骼。 - * @see dragonBones.Bone - * @version DragonBones 3.0 - * @language zh_CN - */ - bool contains(const Bone* value) const; - /** - * - The bone data. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 骨骼数据。 - * @version DragonBones 4.5 - * @language zh_CN - */ - inline const BoneData* getBoneData() const - { - return _boneData; - } - /** - * - The visible of all slots in the bone. - * @default true - * @see dragonBones.Slot#visible - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 此骨骼所有插槽的可见。 - * @default true - * @see dragonBones.Slot#visible - * @version DragonBones 3.0 - * @language zh_CN - */ - inline bool getVisible() const - { - return _visible; - } - void setVisible(bool value); - /** - * - The bone name. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 骨骼名称。 - * @version DragonBones 3.0 - * @language zh_CN - */ - inline const std::string& getName() const - { - return _boneData->name; - } - /** - * - The parent bone to which it belongs. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 所属的父骨骼。 - * @version DragonBones 3.0 - * @language zh_CN - */ - inline Bone* getParent() const - { - return _parent; - } - -public: // For WebAssembly. - inline int getOffsetMode() const { return (int)offsetMode; } - inline void setOffsetMode(int value) { offsetMode = (OffsetMode)value; } -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_BONE_H diff --git a/native/cocos/editor-support/dragonbones/armature/Constraint.cpp b/native/cocos/editor-support/dragonbones/armature/Constraint.cpp deleted file mode 100644 index b1943017d2..0000000000 --- a/native/cocos/editor-support/dragonbones/armature/Constraint.cpp +++ /dev/null @@ -1,183 +0,0 @@ -// -// Created by liangshuochen on 12/06/2017. -// - -#include "Constraint.h" -#include "Armature.h" -#include "Bone.h" - -DRAGONBONES_NAMESPACE_BEGIN - -Matrix Constraint::_helpMatrix; -Transform Constraint::_helpTransform; -Point Constraint::_helpPoint; - -void Constraint::_onClear() -{ - _constraintData = nullptr; - _armature = nullptr; - _target = nullptr; - _root = nullptr; - _bone = nullptr; -} - -void IKConstraint::_onClear() -{ - Constraint::_onClear(); - - _scaleEnabled = false; - _bendPositive = false; - _weight = 1.0f; -} - -void IKConstraint::_computeA() -{ - const auto& ikGlobal = _target->global; - auto& global = _root->global; - auto& globalTransformMatrix = _root->globalTransformMatrix; - - auto radian = std::atan2(ikGlobal.y - global.y, ikGlobal.x - global.x); - if (global.scaleX < 0.0f) - { - radian += Transform::PI; - } - - global.rotation += Transform::normalizeRadian(radian - global.rotation) * _weight; - global.toMatrix(globalTransformMatrix); -} - -void IKConstraint::_computeB() -{ - const auto boneLength = _bone->_boneData->length; - const auto parent = _root; - const auto& ikGlobal = _target->global; - auto& parentGlobal = parent->global; - auto& global = _bone->global; - auto& globalTransformMatrix = _bone->globalTransformMatrix; - - const auto x = globalTransformMatrix.a * boneLength; - const auto y = globalTransformMatrix.b * boneLength; - const auto lLL = x * x + y * y; - const auto lL = sqrt(lLL); - auto dX = global.x - parentGlobal.x; - auto dY = global.y - parentGlobal.y; - const auto lPP = dX * dX + dY * dY; - const auto lP = sqrt(lPP); - const auto rawRadian = global.rotation; - const auto rawParentRadian = parentGlobal.rotation; - const auto rawRadianA = std::atan2(dY, dX); - - dX = ikGlobal.x - parentGlobal.x; - dY = ikGlobal.y - parentGlobal.y; - const auto lTT = dX * dX + dY * dY; - const auto lT = sqrt(lTT); - - auto radianA = 0.0f; - if (lL + lP <= lT || lT + lL <= lP || lT + lP <= lL) - { - radianA = std::atan2(ikGlobal.y - parentGlobal.y, ikGlobal.x - parentGlobal.x); - if (lL + lP <= lT) - { - } - else if (lP < lL) - { - radianA += Transform::PI; - } - } - else - { - const auto h = (lPP - lLL + lTT) / (2.0f * lTT); - const auto r = sqrt(lPP - h * h * lTT) / lT; - const auto hX = parentGlobal.x + (dX * h); - const auto hY = parentGlobal.y + (dY * h); - const auto rX = -dY * r; - const auto rY = dX * r; - - auto isPPR = false; - const auto parentParent = parent->getParent(); - if (parentParent != nullptr) - { - auto parentParentMatrix = parentParent->globalTransformMatrix; - isPPR = parentParentMatrix.a * parentParentMatrix.d - parentParentMatrix.b * parentParentMatrix.c < 0.0f; - } - - if (isPPR != _bendPositive) - { - global.x = hX - rX; - global.y = hY - rY; - } - else - { - global.x = hX + rX; - global.y = hY + rY; - } - - radianA = std::atan2(global.y - parentGlobal.y, global.x - parentGlobal.x); - } - - const auto dR = Transform::normalizeRadian(radianA - rawRadianA); - parentGlobal.rotation = rawParentRadian + dR * _weight; - parentGlobal.toMatrix(parent->globalTransformMatrix); - // - const auto currentRadianA = rawRadianA + dR * _weight; - global.x = parentGlobal.x + cos(currentRadianA) * lP; - global.y = parentGlobal.y + sin(currentRadianA) * lP; - // - auto radianB = std::atan2(ikGlobal.y - global.y, ikGlobal.x - global.x); - if (global.scaleX < 0.0f) { - radianB += Transform::PI; - } - - global.rotation = parentGlobal.rotation + rawRadian - rawParentRadian + Transform::normalizeRadian(radianB - dR - rawRadian) * _weight; - global.toMatrix(globalTransformMatrix); -} - -void IKConstraint::init(ConstraintData* constraintData, Armature* armature) -{ - if (_constraintData != nullptr) - { - return; - } - - _constraintData = constraintData; - _armature = armature; - _target = _armature->getBone(_constraintData->target->name); - _root = _armature->getBone(_constraintData->root->name); - _bone = _constraintData->bone != nullptr ? _armature->getBone(_constraintData->bone->name) : nullptr; - - { - const auto ikConstraintData = static_cast(_constraintData); - _bendPositive = ikConstraintData->bendPositive; - _scaleEnabled = ikConstraintData->scaleEnabled; - _weight = ikConstraintData->weight; - } - - _root->_hasConstraint = true; -} - -void IKConstraint::update() -{ - _root->updateByConstraint(); - - if (_bone != nullptr) - { - _bone->updateByConstraint(); - _computeB(); - } - else - { - _computeA(); - } -} - -void IKConstraint::invalidUpdate() -{ - _root->invalidUpdate(); - - if (_bone != nullptr) - { - _bone->invalidUpdate(); - } -} - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones/armature/Constraint.h b/native/cocos/editor-support/dragonbones/armature/Constraint.h deleted file mode 100644 index 13abed418a..0000000000 --- a/native/cocos/editor-support/dragonbones/armature/Constraint.h +++ /dev/null @@ -1,119 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -// -// Created by liangshuochen on 12/06/2017. -// - -#ifndef DRAGONBONESCPP_CONSTRAINTS_H -#define DRAGONBONESCPP_CONSTRAINTS_H - -#include "../core/BaseObject.h" -#include "../geom/Matrix.h" -#include "../geom/Transform.h" -#include "../geom/Point.h" -#include "../model/ArmatureData.h" -#include "../model/ConstraintData.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * @internal - */ -class Constraint : public BaseObject -{ - ABSTRACT_CLASS(Constraint) - -protected: - static Matrix _helpMatrix; - static Transform _helpTransform; - static Point _helpPoint; - -public: - /** - * - For timeline state. - * @internal - */ - ConstraintData* _constraintData; - /** - * - For sort bones. - * @internal - */ - Bone* _target; - /** - * - For sort bones. - * @internal - */ - Bone* _root; - -protected: - Armature* _armature; - Bone* _bone; - - virtual void _onClear() override; - -public: - virtual void init(ConstraintData* constraintData, Armature* armature) = 0; - virtual void update() = 0; - virtual void invalidUpdate() = 0; - - inline const std::string& getName() - { - return _constraintData->name; - } -}; -/** - * @internal - */ -class IKConstraint : public Constraint -{ - BIND_CLASS_TYPE_A(IKConstraint); - -public: - /** - * - For timeline state. - * @internal - */ - bool _bendPositive; - /** - * - For timeline state. - * @internal - */ - float _weight; - -private: - bool _scaleEnabled; - -protected: - virtual void _onClear() override; - -private: - void _computeA(); - void _computeB(); - -public: - virtual void init(ConstraintData* constraintData, Armature* armature) override; - virtual void update() override; - virtual void invalidUpdate() override; -}; - -DRAGONBONES_NAMESPACE_END -#endif //DRAGONBONESCPP_CONSTRAINTS_H diff --git a/native/cocos/editor-support/dragonbones/armature/DeformVertices.cpp b/native/cocos/editor-support/dragonbones/armature/DeformVertices.cpp deleted file mode 100644 index b6c68b212c..0000000000 --- a/native/cocos/editor-support/dragonbones/armature/DeformVertices.cpp +++ /dev/null @@ -1,75 +0,0 @@ -#include "DeformVertices.h" -#include "../model/DragonBonesData.h" -#include "../model/DisplayData.h" -#include "../armature/Armature.h" -#include "../armature/Bone.h" - -DRAGONBONES_NAMESPACE_BEGIN - -void DeformVertices::_onClear() -{ - verticesDirty = false; - vertices.clear(); - bones.clear(); - verticesData = nullptr; -} - -void DeformVertices::init(const VerticesData* verticesDataValue, Armature* armature) -{ - verticesData = verticesDataValue; - - if (verticesData != nullptr) - { - unsigned vertexCount = 0; - if (verticesData->weight != nullptr) - { - vertexCount = verticesData->weight->count * 2; - } - else { - vertexCount = verticesData->data->intArray[verticesData->offset + (unsigned)BinaryOffset::MeshVertexCount] * 2; - } - - verticesDirty = true; - vertices.resize(vertexCount); - bones.clear(); - // - for (std::size_t i = 0, l = vertices.size(); i < l; ++i) - { - vertices[i] = 0.0f; - } - - if (verticesData->weight != nullptr) - { - for (std::size_t i = 0, l = verticesData->weight->bones.size(); i < l; ++i) - { - const auto bone = armature->getBone(verticesData->weight->bones[i]->name); - if (bone != nullptr) - { - bones.push_back(bone); - } - } - } - } - else - { - verticesDirty = false; - vertices.clear(); - bones.clear(); - verticesData = nullptr; - } -} - -bool DeformVertices::isBonesUpdate() const -{ - for (const auto bone : bones) - { - if (bone != nullptr && bone->_childrenTransformDirty) - { - return true; - } - } - - return false; -} - -DRAGONBONES_NAMESPACE_END \ No newline at end of file diff --git a/native/cocos/editor-support/dragonbones/armature/DeformVertices.h b/native/cocos/editor-support/dragonbones/armature/DeformVertices.h deleted file mode 100644 index 49a67eb167..0000000000 --- a/native/cocos/editor-support/dragonbones/armature/DeformVertices.h +++ /dev/null @@ -1,52 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_DEFORMVERTICES_H -#define DRAGONBONES_DEFORMVERTICES_H - -#include "../core/BaseObject.h" - -DRAGONBONES_NAMESPACE_BEGIN - -/** - * @internal - */ -class DeformVertices : public BaseObject -{ - BIND_CLASS_TYPE_A(DeformVertices); - -public: - bool verticesDirty; - std::vector vertices; - std::vector bones; - const VerticesData* verticesData; - -protected: - virtual void _onClear() override; - -public: - void init(const VerticesData* weightData, Armature* armature); - bool isBonesUpdate() const; -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_DEFORMVERTICES_H \ No newline at end of file diff --git a/native/cocos/editor-support/dragonbones/armature/IArmatureProxy.h b/native/cocos/editor-support/dragonbones/armature/IArmatureProxy.h deleted file mode 100644 index 351d07c7c6..0000000000 --- a/native/cocos/editor-support/dragonbones/armature/IArmatureProxy.h +++ /dev/null @@ -1,112 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_IARMATURE_PROXY_H -#define DRAGONBONES_IARMATURE_PROXY_H - -#include "../core/DragonBones.h" -#include "../event/IEventDispatcher.h" -#include "MiddlewareManager.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * - The armature proxy interface, the docking engine needs to implement it concretely. - * @see dragonBones.Armature - * @version DragonBones 5.0 - * @language en_US - */ -/** - * - 骨架代理接口,对接的引擎需要对其进行具体实现。 - * @see dragonBones.Armature - * @version DragonBones 5.0 - * @language zh_CN - */ -class IArmatureProxy : public IEventDispatcher -{ - ABSTRACT_CLASS(IArmatureProxy); - -public: - /** - * @internal - */ - virtual void dbInit(Armature* armature) = 0; - /** - * @internal - */ - virtual void dbClear() = 0; - /** - * @internal - */ - virtual void dbUpdate() = 0; - /** - * @internal - */ - virtual void dbRender() = 0; - /** - * - Dispose the instance and the Armature instance. (The Armature instance will return to the object pool) - * @example - * TypeScript style, for reference only. - *
-     *     removeChild(armatureDisplay);
-     *     armatureDisplay.dispose();
-     * 
- * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 释放该实例和骨架。 (骨架会回收到对象池) - * @example - * TypeScript 风格,仅供参考。 - *
-     *     removeChild(armatureDisplay);
-     *     armatureDisplay.dispose();
-     * 
- * @version DragonBones 4.5 - * @language zh_CN - */ - virtual void dispose(bool disposeProxy) = 0; - /** - * - The armature. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 骨架。 - * @version DragonBones 4.5 - * @language zh_CN - */ - virtual Armature* getArmature() const = 0; - /** - * - The animation player. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 动画播放器。 - * @version DragonBones 3.0 - * @language zh_CN - */ - virtual Animation* getAnimation() const = 0; -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_IARMATURE_PROXY_H diff --git a/native/cocos/editor-support/dragonbones/armature/Slot.cpp b/native/cocos/editor-support/dragonbones/armature/Slot.cpp deleted file mode 100644 index 67370ab355..0000000000 --- a/native/cocos/editor-support/dragonbones/armature/Slot.cpp +++ /dev/null @@ -1,919 +0,0 @@ -#include "Slot.h" -#include "../model/DragonBonesData.h" -#include "../model/UserData.h" -#include "../model/SkinData.h" -#include "../model/DisplayData.h" -#include "../model/BoundingBoxData.h" -#include "../model/TextureAtlasData.h" -#include "Armature.h" -#include "Bone.h" -#include "DeformVertices.h" -#include "../animation/Animation.h" -#include "../event/EventObject.h" - -DRAGONBONES_NAMESPACE_BEGIN - -void Slot::_onClear() -{ - TransformObject::_onClear(); - - std::vector> disposeDisplayList; - for (const auto& pair : this->_displayList) - { - if ( - pair.first != nullptr && pair.first != _rawDisplay && pair.first != _meshDisplay && - std::find(disposeDisplayList.cbegin(), disposeDisplayList.cend(), pair) == disposeDisplayList.cend() - ) - { - disposeDisplayList.push_back(pair); - } - } - - for (const auto& pair : disposeDisplayList) - { - if (pair.second == DisplayType::Armature) - { - static_cast(pair.first)->returnToPool(); - } - else - { - _disposeDisplay(pair.first, true); - } - } - - if (_deformVertices != nullptr) - { - _deformVertices->returnToPool(); - } - - if (_meshDisplay && _meshDisplay != _rawDisplay) - { - _disposeDisplay(_meshDisplay, false); - } - - if (_rawDisplay) { - _disposeDisplay(_rawDisplay, false); - } - - displayController = ""; - - _displayDirty = false; - _zOrderDirty = false; - _blendModeDirty = false; - _colorDirty = false; - _transformDirty = false; - _visible = true; - _blendMode = BlendMode::Normal; - _displayIndex = -1; - _animationDisplayIndex = -1; - _zOrder = 0; - _cachedFrameIndex = -1; - _pivotX = 0.0f; - _pivotY = 0.0f; - _localMatrix.identity(); - _colorTransform.identity(); - _displayList.clear(); - _displayDatas.clear(); - _slotData = nullptr; - _rawDisplayDatas = nullptr; // - _displayData = nullptr; - _boundingBoxData = nullptr; - _textureData = nullptr; - _deformVertices = nullptr; - _rawDisplay = nullptr; - _meshDisplay = nullptr; - _display = nullptr; - _childArmature = nullptr; - _parent = nullptr; - _cachedFrameIndices = nullptr; -} - -DisplayData* Slot::_getDefaultRawDisplayData(unsigned displayIndex) const -{ - const auto defaultSkin = _armature->_armatureData->defaultSkin; - if (defaultSkin != nullptr) - { - const auto defaultRawDisplayDatas = defaultSkin->getDisplays(_slotData->name); - if (defaultRawDisplayDatas != nullptr) - { - return displayIndex < defaultRawDisplayDatas->size() ? (*defaultRawDisplayDatas)[displayIndex] : nullptr; - } - } - - return nullptr; -} - -void Slot::_updateDisplayData() -{ - const auto prevDisplayData = _displayData; - const auto prevVerticesData = _deformVertices != nullptr ? _deformVertices->verticesData : nullptr; - const auto prevTextureData = _textureData; - - DisplayData* rawDisplayData = nullptr; - VerticesData* currentVerticesData = nullptr; - - _displayData = nullptr; - _boundingBoxData = nullptr; - _textureData = nullptr; - - if (_displayIndex >= 0) - { - if (_rawDisplayDatas != nullptr) - { - rawDisplayData = (unsigned)_displayIndex < _rawDisplayDatas->size() ? (*_rawDisplayDatas)[_displayIndex] : nullptr; - } - - if (rawDisplayData == nullptr) - { - rawDisplayData = _getDefaultRawDisplayData(_displayIndex); - } - - if ((unsigned)_displayIndex < _displayDatas.size()) - { - _displayData = _displayDatas[_displayIndex]; - } - } - - // Update texture and mesh data. - if (_displayData != nullptr) - { - if (_displayData->type == DisplayType::Mesh) - { - currentVerticesData = &static_cast(_displayData)->vertices; - } - else if (_displayData->type == DisplayType::Path) - { - // TODO - } - else if (rawDisplayData != nullptr) - { - if (rawDisplayData->type == DisplayType::Mesh) - { - currentVerticesData = &static_cast(rawDisplayData)->vertices; - } - else if (rawDisplayData->type == DisplayType::Path) - { - // TODO - } - } - - if (_displayData->type == DisplayType::BoundingBox) - { - _boundingBoxData = static_cast(_displayData)->boundingBox; - } - else if (rawDisplayData != nullptr) - { - if (rawDisplayData->type == DisplayType::BoundingBox) - { - _boundingBoxData = static_cast(rawDisplayData)->boundingBox; - } - } - - if (_displayData->type == DisplayType::Image) - { - _textureData = static_cast(_displayData)->texture; - } - else if (_displayData->type == DisplayType::Mesh) - { - _textureData = static_cast(_displayData)->texture; - } - } - - // Update bounding box data. - if (_displayData != nullptr && _displayData->type == DisplayType::BoundingBox) - { - _boundingBoxData = static_cast(_displayData)->boundingBox; - } - else if (rawDisplayData != nullptr && rawDisplayData->type == DisplayType::BoundingBox) - { - _boundingBoxData = static_cast(rawDisplayData)->boundingBox; - } - else - { - _boundingBoxData = nullptr; - } - - if (_displayData != prevDisplayData || currentVerticesData != prevVerticesData || _textureData != prevTextureData) - { - if (currentVerticesData == nullptr && _textureData != nullptr) - { - const auto imageDisplayData = static_cast(_displayData); - const auto scale = _textureData->parent->scale * _armature->_armatureData->scale; - const auto frame = _textureData->frame; - - _pivotX = imageDisplayData->pivot.x; - _pivotY = imageDisplayData->pivot.y; - - const auto& rect = frame != nullptr ? *frame : _textureData->region; - float width = rect.width; - float height = rect.height; - - if (_textureData->rotated && frame == nullptr) - { - width = rect.height; - height = rect.width; - } - - _pivotX *= width * scale; - _pivotY *= height * scale; - - if (frame != nullptr) - { - _pivotX += frame->x * scale; - _pivotY += frame->y * scale; - } - - // Update replace pivot. - if (_displayData != nullptr && rawDisplayData != nullptr && _displayData != rawDisplayData) - { - rawDisplayData->transform.toMatrix(_helpMatrix); - _helpMatrix.invert(); - _helpMatrix.transformPoint(0.0f, 0.0f, _helpPoint); - _pivotX -= _helpPoint.x; - _pivotY -= _helpPoint.y; - - _displayData->transform.toMatrix(_helpMatrix); - _helpMatrix.invert(); - _helpMatrix.transformPoint(0.0f, 0.0f, _helpPoint); - _pivotX += _helpPoint.x; - _pivotY += _helpPoint.y; - } - - if (!DragonBones::yDown) - { - _pivotY = (_textureData->rotated ? _textureData->region.width : _textureData->region.height) * scale - _pivotY; - } - } - else - { - _pivotX = 0.0f; - _pivotY = 0.0f; - } - - // Update original transform. - if (rawDisplayData != nullptr) - { - origin = &rawDisplayData->transform; - } - else if (_displayData != nullptr) - { - origin = &_displayData->transform; - } - else - { - origin = nullptr; - } - - // Update vertices. - if (currentVerticesData != prevVerticesData) - { - if (_deformVertices == nullptr) - { - _deformVertices = BaseObject::borrowObject(); - } - - _deformVertices->init(currentVerticesData, _armature); - } - else if (_deformVertices != nullptr && _textureData != prevTextureData) // Update mesh after update frame. - { - _deformVertices->verticesDirty = true; - } - - _displayDirty = true; - _transformDirty = true; - } -} - -void Slot::_updateDisplay() -{ - const auto prevDisplay = _display != nullptr ? _display : _rawDisplay; - const auto prevChildArmature = _childArmature; - - // Update display and child armature. - if (_displayIndex >= 0 && (std::size_t)_displayIndex < _displayList.size()) - { - const auto& displayPair = _displayList[_displayIndex]; - _display = displayPair.first; - if (_display != nullptr && displayPair.second == DisplayType::Armature) - { - _childArmature = static_cast(displayPair.first); - _display = _childArmature->getDisplay(); - } - else - { - _childArmature = nullptr; - } - } - else - { - _display = nullptr; - _childArmature = nullptr; - } - - const auto currentDisplay = _display != nullptr ? _display : _rawDisplay; - if (currentDisplay != prevDisplay) - { - _onUpdateDisplay(); - _replaceDisplay(prevDisplay, prevChildArmature != nullptr); - - _transformDirty = true; - _visibleDirty = true; - _blendModeDirty = true; - _colorDirty = true; - } - - // Update frame. - if (currentDisplay == _rawDisplay || currentDisplay == _meshDisplay) - { - _updateFrame(); - } - - // Update child armature. - if (_childArmature != prevChildArmature) - { - if (prevChildArmature != nullptr) - { - prevChildArmature->_parent = nullptr; // Update child armature parent. - prevChildArmature->setClock(nullptr); - if (prevChildArmature->inheritAnimation) - { - prevChildArmature->getAnimation()->reset(); - } - } - - if (_childArmature != nullptr) - { - _childArmature->_parent = this; // Update child armature parent. - _childArmature->setClock(_armature->getClock()); - if (_childArmature->inheritAnimation) // Set child armature cache frameRate. - { - if (_childArmature->getCacheFrameRate() == 0) - { - const auto chacheFrameRate = this->_armature->getCacheFrameRate(); - if (chacheFrameRate != 0) - { - _childArmature->setCacheFrameRate(chacheFrameRate); - } - } - - // Child armature action. - std::vector* actions = nullptr; - if (_displayData != nullptr && _displayData->type == DisplayType::Armature) - { - actions = &(static_cast(_displayData)->actions); - } - else if(_displayIndex >= 0 && _rawDisplayDatas != nullptr) - { - auto rawDisplayData = (unsigned)_displayIndex < _rawDisplayDatas->size() ? (*_rawDisplayDatas)[_displayIndex] : nullptr; - - if (rawDisplayData == nullptr) - { - rawDisplayData = _getDefaultRawDisplayData(_displayIndex); - } - - if (rawDisplayData != nullptr && rawDisplayData->type == DisplayType::Armature) - { - actions = &(static_cast(rawDisplayData)->actions); - } - } - - if (actions != nullptr && !actions->empty()) - { - for (const auto action : *actions) - { - const auto eventObject = BaseObject::borrowObject(); - EventObject::actionDataToInstance(action, eventObject, _armature); - eventObject->slot = this; - _armature->_bufferAction(eventObject, false); - } - } - else - { - _childArmature->getAnimation()->play(); - } - } - } - } -} - -void Slot::_updateGlobalTransformMatrix(bool isCache) -{ - const auto& parentMatrix = _parent->globalTransformMatrix; - globalTransformMatrix = _localMatrix; // Copy. - globalTransformMatrix.concat(parentMatrix); - - if (isCache) - { - global.fromMatrix(globalTransformMatrix); - } - else - { - _globalDirty = true; - } -} - -bool Slot::_setDisplayIndex(int value, bool isAnimation) -{ - if (isAnimation) - { - if (_animationDisplayIndex == value) - { - return false; - } - - _animationDisplayIndex = value; - } - - if (_displayIndex == value) - { - return false; - } - - _displayIndex = value; - _displayDirty = true; - - _updateDisplayData(); - - return _displayDirty; -} - -bool Slot::_setZorder(int value) -{ - if (_zOrder == value) - { - //return false; - } - - _zOrder = value; - _zOrderDirty = true; - - return _zOrderDirty; -} - -bool Slot::_setColor(const ColorTransform& value) -{ - _colorTransform = value; // copy - _colorDirty = true; - - return true; -} - -bool Slot::_setDisplayList(const std::vector>& value) -{ - if (!value.empty()) - { - if (_displayList.size() != value.size()) - { - _displayList.resize(value.size()); - } - - for (std::size_t i = 0, l = value.size(); i < l; ++i) - { - const auto& eachPair = value[i]; - if ( - eachPair.first != nullptr && eachPair.first != _rawDisplay && eachPair.first != _meshDisplay && - eachPair.second != DisplayType::Armature && - std::find(_displayList.cbegin(), _displayList.cend(), eachPair) == _displayList.cend() - ) - { - _initDisplay(eachPair.first, true); - } - - _displayList[i].first = eachPair.first; - _displayList[i].second = eachPair.second; - } - } - else if (!_displayList.empty()) - { - _displayList.clear(); - } - - if (_displayIndex >= 0 && (std::size_t)_displayIndex < _displayList.size()) - { - _displayDirty = _display != _displayList[_displayIndex].first; - } - else - { - _displayDirty = _display != nullptr; - } - - _updateDisplayData(); - - return _displayDirty; -} - -void Slot::init(const SlotData* slotData, Armature* armatureValue, void* rawDisplay, void* meshDisplay) -{ - if (_slotData != nullptr) - { - return; - } - - _slotData = slotData; - // - _visibleDirty = true; - _blendModeDirty = true; - _colorDirty = true; - _blendMode = _slotData->blendMode; - _zOrder = _slotData->zOrder; - _colorTransform = *(_slotData->color); - _rawDisplay = rawDisplay; - _meshDisplay = meshDisplay; - // - _armature = armatureValue; - // - const auto slotParent = _armature->getBone(_slotData->parent->name); - if (slotParent != nullptr) - { - _parent = slotParent; - } - else - { - // Never; - } - - _armature->_addSlot(this); - // - _initDisplay(_rawDisplay, false); - if (_rawDisplay != _meshDisplay) - { - _initDisplay(_meshDisplay, false); - } - - _onUpdateDisplay(); - _addDisplay(); -} - -void Slot::update(int cacheFrameIndex) -{ - if (_displayDirty) - { - _displayDirty = false; - _updateDisplay(); - - // TODO remove slot offset. - if (_transformDirty) // Update local matrix. (Only updated when both display and transform are dirty.) - { - if (origin != nullptr) - { - global = *origin; // Copy. - global.add(offset).toMatrix(_localMatrix); - } - else - { - global = offset; // Copy. - global.toMatrix(_localMatrix); - } - } - } - - if (_zOrderDirty) - { - _zOrderDirty = false; - _updateZOrder(); - } - - if (cacheFrameIndex >= 0 && _cachedFrameIndices != nullptr) - { - const auto cachedFrameIndex = (*_cachedFrameIndices)[cacheFrameIndex]; - if (cachedFrameIndex >= 0 && _cachedFrameIndex == cachedFrameIndex) // Same cache. - { - _transformDirty = false; - } - else if (cachedFrameIndex >= 0) // Has been Cached. - { - _transformDirty = true; - _cachedFrameIndex = cachedFrameIndex; - } - else if (_transformDirty || _parent->_childrenTransformDirty) // Dirty. - { - _transformDirty = true; - _cachedFrameIndex = -1; - } - else if (_cachedFrameIndex >= 0) // Same cache, but not set index yet. - { - _transformDirty = false; - (*_cachedFrameIndices)[cacheFrameIndex] = _cachedFrameIndex; - } - else // Dirty. - { - _transformDirty = true; - _cachedFrameIndex = -1; - } - } - else if (_transformDirty || this->_parent->_childrenTransformDirty) - { - cacheFrameIndex = -1; - _transformDirty = true; - _cachedFrameIndex = -1; - } - - if (_display == nullptr) - { - return; - } - - if (_visibleDirty) - { - _visibleDirty = false; - _updateVisible(); - } - - if (_blendModeDirty) - { - _blendModeDirty = false; - _updateBlendMode(); - } - - if (_colorDirty) - { - _colorDirty = false; - _updateColor(); - } - - if (_deformVertices != nullptr && _deformVertices->verticesData != nullptr && _display == _meshDisplay) - { - const auto isSkinned = _deformVertices->verticesData->weight != nullptr; - - if ( - _deformVertices->verticesDirty || - (isSkinned && _deformVertices->isBonesUpdate()) - ) - { - _deformVertices->verticesDirty = false; - _updateMesh(); - } - - if (isSkinned) // Compatible. - { - return; - } - } - - if (_transformDirty) - { - _transformDirty = false; - - if (_cachedFrameIndex < 0) - { - const auto isCache = cacheFrameIndex >= 0; - _updateGlobalTransformMatrix(isCache); - - if (isCache && _cachedFrameIndices != nullptr) - { - _cachedFrameIndex = (*_cachedFrameIndices)[cacheFrameIndex] = _armature->_armatureData->setCacheFrame(globalTransformMatrix, global); - } - } - else - { - _armature->_armatureData->getCacheFrame(globalTransformMatrix, global, _cachedFrameIndex); - } - - _updateTransform(); - } -} - -void Slot::updateTransformAndMatrix() -{ - if (_transformDirty) - { - _transformDirty = false; - _updateGlobalTransformMatrix(false); - } -} - -void Slot::replaceDisplayData(DisplayData *displayData, int displayIndex) -{ - if (displayIndex < 0) - { - if (_displayIndex < 0) - { - displayIndex = 0; - } - else - { - displayIndex = _displayIndex; - } - } - - if (_displayDatas.size() <= (unsigned)displayIndex) { - _displayDatas.resize(displayIndex + 1, nullptr); - } - - _displayDatas[displayIndex] = displayData; -} - -bool Slot::containsPoint(float x, float y) -{ - if (_boundingBoxData == nullptr) - { - return false; - } - - updateTransformAndMatrix(); - - _helpMatrix = globalTransformMatrix; // Copy. - _helpMatrix.invert(); - _helpMatrix.transformPoint(x, y, _helpPoint); - - return _boundingBoxData->containsPoint(_helpPoint.x, _helpPoint.y); -} - -int Slot::intersectsSegment( - float xA, float yA, float xB, float yB, - Point* intersectionPointA, - Point* intersectionPointB, - Point* normalRadians -) -{ - if (_boundingBoxData == nullptr) - { - return 0; - } - - updateTransformAndMatrix(); - _helpMatrix = globalTransformMatrix; - _helpMatrix.invert(); - _helpMatrix.transformPoint(xA, yA, _helpPoint); - xA = _helpPoint.x; - yA = _helpPoint.y; - _helpMatrix.transformPoint(xB, yB, _helpPoint); - xB = _helpPoint.x; - yB = _helpPoint.y; - - const auto intersectionCount = _boundingBoxData->intersectsSegment(xA, yA, xB, yB, intersectionPointA, intersectionPointB, normalRadians); - if (intersectionCount > 0) - { - if (intersectionCount == 1 || intersectionCount == 2) - { - if (intersectionPointA != nullptr) - { - globalTransformMatrix.transformPoint(intersectionPointA->x, intersectionPointA->y, *intersectionPointA); - if (intersectionPointB != nullptr) - { - intersectionPointB->x = intersectionPointA->x; - intersectionPointB->y = intersectionPointA->y; - } - } - else if (intersectionPointB != nullptr) - { - globalTransformMatrix.transformPoint(intersectionPointB->x, intersectionPointB->y, *intersectionPointB); - } - } - else - { - if (intersectionPointA != nullptr) - { - globalTransformMatrix.transformPoint(intersectionPointA->x, intersectionPointA->y, *intersectionPointA); - } - - if (intersectionPointB != nullptr) - { - globalTransformMatrix.transformPoint(intersectionPointB->x, intersectionPointB->y, *intersectionPointB); - } - } - - if (normalRadians != nullptr) - { - globalTransformMatrix.transformPoint(cos(normalRadians->x), sin(normalRadians->x), _helpPoint, true); - normalRadians->x = atan2(_helpPoint.y, _helpPoint.x); - - globalTransformMatrix.transformPoint(cos(normalRadians->y), sin(normalRadians->y), _helpPoint, true); - normalRadians->y = atan2(_helpPoint.y, _helpPoint.x); - } - } - - return intersectionCount; -} - -void Slot::setVisible(bool value) -{ - if (_visible == value) - { - return; - } - - _visible = value; - _updateVisible(); -} - -void Slot::setDisplayIndex(int value) -{ - if (_setDisplayIndex(value)) - { - update(-1); - } -} - -//TODO lsc check -void Slot::setDisplayList(const std::vector>& value) -{ - const auto backupDisplayList = _displayList; // copy - auto disposeDisplayList = backupDisplayList; // copy - disposeDisplayList.clear(); - - if (_setDisplayList(value)) - { - update(-1); - } - - for (const auto& pair : backupDisplayList) - { - if ( - pair.first != nullptr && pair.first != _rawDisplay && pair.first != _meshDisplay && - std::find(_displayList.cbegin(), _displayList.cend(), pair) == _displayList.cend() && - std::find(disposeDisplayList.cbegin(), disposeDisplayList.cend(), pair) == disposeDisplayList.cend() - ) - { - disposeDisplayList.push_back(pair); - } - } - - for (const auto& pair : disposeDisplayList) - { - if (pair.second == DisplayType::Armature) - { - static_cast(pair.first)->returnToPool(); - } - else - { - _disposeDisplay(pair.first, true); - } - } -} - -void Slot::setRawDisplayDatas(const std::vector* value) -{ - if (_rawDisplayDatas == value) - { - return; - } - - _displayDirty = true; - _rawDisplayDatas = value; - - if (_rawDisplayDatas != nullptr) - { - _displayDatas.resize(_rawDisplayDatas->size()); - - for (std::size_t i = 0, l = _displayDatas.size(); i < l; ++i) - { - auto rawDisplayData = (*_rawDisplayDatas)[i]; - - if (rawDisplayData == nullptr) - { - rawDisplayData = _getDefaultRawDisplayData(i); - } - - _displayDatas[i] = rawDisplayData; - } - } - else - { - _displayDatas.clear(); - } -} - -void Slot::setDisplay(void* value, DisplayType displayType) -{ - if (_display == value) - { - return; - } - - const auto displayListLength = _displayList.size(); - if (_displayIndex < 0 && displayListLength == 0) // Emprty - { - _displayIndex = 0; - } - - if (_displayIndex < 0) - { - return; - } - else - { - auto relpaceDisplayList = _displayList; // copy - if (displayListLength <= (std::size_t)_displayIndex) - { - relpaceDisplayList.resize(_displayIndex + 1); - } - - relpaceDisplayList[_displayIndex].first = value; - relpaceDisplayList[_displayIndex].second = displayType; - - setDisplayList(relpaceDisplayList); - } -} - -void Slot::setChildArmature(Armature* value) -{ - if (_childArmature == value) - { - return; - } - - setDisplay(value, DisplayType::Armature); -} - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones/armature/Slot.h b/native/cocos/editor-support/dragonbones/armature/Slot.h deleted file mode 100644 index 8fb54d215f..0000000000 --- a/native/cocos/editor-support/dragonbones/armature/Slot.h +++ /dev/null @@ -1,507 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_SLOT_H -#define DRAGONBONES_SLOT_H - -#include "TransformObject.h" - -#include "../geom/ColorTransform.h" -#include "../model/ArmatureData.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * - The slot attached to the armature, controls the display status and properties of the display object. - * A bone can contain multiple slots. - * A slot can contain multiple display objects, displaying only one of the display objects at a time, - * but you can toggle the display object into frame animation while the animation is playing. - * The display object can be a normal texture, or it can be a display of a child armature, a grid display object, - * and a custom other display object. - * @see dragonBones.Armature - * @see dragonBones.Bone - * @see dragonBones.SlotData - * @version DragonBones 3.0 - * @language en_US - */ -/** - * - 插槽附着在骨骼上,控制显示对象的显示状态和属性。 - * 一个骨骼上可以包含多个插槽。 - * 一个插槽中可以包含多个显示对象,同一时间只能显示其中的一个显示对象,但可以在动画播放的过程中切换显示对象实现帧动画。 - * 显示对象可以是普通的图片纹理,也可以是子骨架的显示容器,网格显示对象,还可以是自定义的其他显示对象。 - * @see dragonBones.Armature - * @see dragonBones.Bone - * @see dragonBones.SlotData - * @version DragonBones 3.0 - * @language zh_CN - */ -class Slot : public TransformObject -{ -public: - /** - * - Displays the animated state or mixed group name controlled by the object, set to null to be controlled by all animation states. - * @default null - * @see dragonBones.AnimationState#displayControl - * @see dragonBones.AnimationState#name - * @see dragonBones.AnimationState#group - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 显示对象受到控制的动画状态或混合组名称,设置为 null 则表示受所有的动画状态控制。 - * @default null - * @see dragonBones.AnimationState#displayControl - * @see dragonBones.AnimationState#name - * @see dragonBones.AnimationState#group - * @version DragonBones 4.5 - * @language zh_CN - */ - std::string displayController; - -public: - /** - * @internal - */ - bool _colorDirty; - BlendMode _blendMode; - /** - * @internal - */ - int _zOrder; - /** - * @internal - */ - float _pivotX; - /** - * @internal - */ - float _pivotY; - - /** - * @internal - */ - ColorTransform _colorTransform; - /** - * @internal - */ - const SlotData* _slotData; - /** - * @internal - */ - DisplayData* _displayData; - /** - * @internal - */ - DeformVertices* _deformVertices; - void* _rawDisplay; - void* _meshDisplay; - /** - * @internal - */ - std::vector* _cachedFrameIndices; - -protected: - bool _displayDirty; - bool _zOrderDirty; - bool _visibleDirty; - bool _blendModeDirty; - bool _transformDirty; - bool _visible; - int _displayIndex; - int _animationDisplayIndex; - int _cachedFrameIndex; - Matrix _localMatrix; - std::vector _displayDatas; - std::vector> _displayList; - const std::vector* _rawDisplayDatas; - BoundingBoxData* _boundingBoxData; - TextureData* _textureData; - void* _display; - Armature* _childArmature; - /** - * @private - */ - Bone* _parent; - -public: - Slot() : - _deformVertices(nullptr), - _rawDisplay(nullptr), - _meshDisplay(nullptr) - {} - virtual ~Slot() {}; - -protected: - virtual void _onClear() override; - - virtual void _initDisplay(void* value, bool isRetain) = 0; - virtual void _disposeDisplay(void* value, bool isRelease) = 0; - virtual void _onUpdateDisplay() = 0; - virtual void _addDisplay() = 0; - virtual void _replaceDisplay(void* value, bool isArmatureDisplay) = 0; - virtual void _removeDisplay() = 0; - virtual void _updateZOrder() = 0; - virtual void _updateFrame() = 0; - virtual void _updateMesh() = 0; - virtual void _updateTransform() = 0; - virtual void _identityTransform() = 0; - /** - * - Support default skin data. - */ - DisplayData* _getDefaultRawDisplayData(unsigned displayIndex) const; - void _updateDisplay(); - void _updateDisplayData(); - void _updateGlobalTransformMatrix(bool isCache); - -public: - /** - * @internal - */ - virtual void _updateVisible() = 0; - virtual void _updateBlendMode() = 0; - virtual void _updateColor() = 0; - -public: - /** - * @internal - */ - bool _setDisplayIndex(int value, bool isAnimation = false); - /** - * @internal - */ - bool _setZorder(int value); - /** - * @internal - */ - bool _setColor(const ColorTransform& value); - /** - * @internal - */ - bool _setDisplayList(const std::vector>& value); - -public: - /** - * @internal - */ - void init(const SlotData* slotData, Armature* armatureValue, void* rawDisplay, void* meshDisplay); - /** - * @internal - */ - void update(int cacheFrameIndex); - /** - * @private - */ - void updateTransformAndMatrix(); - /** - * @private - */ - void replaceDisplayData(DisplayData* displayData, int displayIndex); - /** - * - Check whether a specific point is inside a custom bounding box in the slot. - * The coordinate system of the point is the inner coordinate system of the armature. - * Custom bounding boxes need to be customized in Dragonbones Pro. - * @param x - The horizontal coordinate of the point. - * @param y - The vertical coordinate of the point. - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 检查特定点是否在插槽的自定义边界框内。 - * 点的坐标系为骨架内坐标系。 - * 自定义边界框需要在 DragonBones Pro 中自定义。 - * @param x - 点的水平坐标。 - * @param y - 点的垂直坐标。 - * @version DragonBones 5.0 - * @language zh_CN - */ - bool containsPoint(float x, float y); - /** - * - Check whether a specific segment intersects a custom bounding box for the slot. - * The coordinate system of the segment and intersection is the inner coordinate system of the armature. - * Custom bounding boxes need to be customized in Dragonbones Pro. - * @param xA - The horizontal coordinate of the beginning of the segment. - * @param yA - The vertical coordinate of the beginning of the segment. - * @param xB - The horizontal coordinate of the end point of the segment. - * @param yB - The vertical coordinate of the end point of the segment. - * @param intersectionPointA - The first intersection at which a line segment intersects the bounding box from the beginning to the end. (If not set, the intersection point will not calculated) - * @param intersectionPointB - The first intersection at which a line segment intersects the bounding box from the end to the beginning. (If not set, the intersection point will not calculated) - * @param normalRadians - The normal radians of the tangent of the intersection boundary box. [x: Normal radian of the first intersection tangent, y: Normal radian of the second intersection tangent] (If not set, the normal will not calculated) - * @returns Intersection situation. [1: Disjoint and segments within the bounding box, 0: Disjoint, 1: Intersecting and having a nodal point and ending in the bounding box, 2: Intersecting and having a nodal point and starting at the bounding box, 3: Intersecting and having two intersections, N: Intersecting and having N intersections] - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 检查特定线段是否与插槽的自定义边界框相交。 - * 线段和交点的坐标系均为骨架内坐标系。 - * 自定义边界框需要在 DragonBones Pro 中自定义。 - * @param xA - 线段起点的水平坐标。 - * @param yA - 线段起点的垂直坐标。 - * @param xB - 线段终点的水平坐标。 - * @param yB - 线段终点的垂直坐标。 - * @param intersectionPointA - 线段从起点到终点与边界框相交的第一个交点。 (如果未设置,则不计算交点) - * @param intersectionPointB - 线段从终点到起点与边界框相交的第一个交点。 (如果未设置,则不计算交点) - * @param normalRadians - 交点边界框切线的法线弧度。 [x: 第一个交点切线的法线弧度, y: 第二个交点切线的法线弧度] (如果未设置,则不计算法线) - * @returns 相交的情况。 [-1: 不相交且线段在包围盒内, 0: 不相交, 1: 相交且有一个交点且终点在包围盒内, 2: 相交且有一个交点且起点在包围盒内, 3: 相交且有两个交点, N: 相交且有 N 个交点] - * @version DragonBones 5.0 - * @language zh_CN - */ - int intersectsSegment( - float xA, float yA, float xB, float yB, - Point* intersectionPointA = nullptr, - Point* intersectionPointB = nullptr, - Point* normalRadians = nullptr - ); - /** - * - Forces the slot to update the state of the display object in the next frame. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 强制插槽在下一帧更新显示对象的状态。 - * @version DragonBones 4.5 - * @language zh_CN - */ - inline void invalidUpdate() - { - _displayDirty = true; - _transformDirty = true; - } - /** - * - The visible of slot's display object. - * @default true - * @version DragonBones 5.6 - * @language en_US - */ - /** - * - 插槽的显示对象的可见。 - * @default true - * @version DragonBones 5.6 - * @language zh_CN - */ - inline bool getVisible() const - { - return _visible; - } - void setVisible(bool value); - /** - * - The index of the display object displayed in the display list. - * @example - * TypeScript style, for reference only. - *
-     *     let slot = armature.getSlot("weapon");
-     *     slot.displayIndex = 3;
-     *     slot.displayController = "none";
-     * 
- * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 此时显示的显示对象在显示列表中的索引。 - * @example - * TypeScript 风格,仅供参考。 - *
-     *     let slot = armature.getSlot("weapon");
-     *     slot.displayIndex = 3;
-     *     slot.displayController = "none";
-     * 
- * @version DragonBones 4.5 - * @language zh_CN - */ - inline int getDisplayIndex() const - { - return _displayIndex; - } - void setDisplayIndex(int value); - - /** - * - The slot name. - * @see dragonBones.SlotData#name - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 插槽名称。 - * @see dragonBones.SlotData#name - * @version DragonBones 3.0 - * @language zh_CN - */ - inline const std::string& getName() const - { - return _slotData->name; - } - /** - * - Contains a display list of display objects or child armatures. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 包含显示对象或子骨架的显示列表。 - * @version DragonBones 3.0 - * @language zh_CN - */ - inline std::vector> getDisplayList() const - { - return _displayList; - } - void setDisplayList(const std::vector>& value); - /** - * @private - */ - inline const std::vector* getRawDisplayDatas() const - { - return _rawDisplayDatas; - } - void setRawDisplayDatas(const std::vector* value); - /** - * - The slot data. - * @see dragonBones.SlotData - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 插槽数据。 - * @see dragonBones.SlotData - * @version DragonBones 4.5 - * @language zh_CN - */ - const SlotData* getSlotData() const - { - return _slotData; - } - /** - * - The custom bounding box data for the slot at current time. - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 插槽此时的自定义包围盒数据。 - * @version DragonBones 5.0 - * @language zh_CN - */ - inline BoundingBoxData* getBoundingBoxData() const - { - return _boundingBoxData; - } - /** - * @private - */ - inline void* getRawDisplay() const - { - return _rawDisplay; - } - /** - * @private - */ - inline void* getMeshDisplay() const - { - return _meshDisplay; - } - /** - * - The display object that the slot displays at this time. - * @example - * TypeScript style, for reference only. - *
-     *     let slot = armature.getSlot("text");
-     *     slot.display = new yourEngine.TextField();
-     * 
- * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 插槽此时显示的显示对象。 - * @example - * TypeScript 风格,仅供参考。 - *
-     *     let slot = armature.getSlot("text");
-     *     slot.display = new yourEngine.TextField();
-     * 
- * @version DragonBones 3.0 - * @language zh_CN - */ - inline void* getDisplay() const - { - return _display; - } - /** - * - Deprecated, please refer to {@link #display}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link #display}。 - * @deprecated - * @language zh_CN - */ - void setDisplay(void* value, DisplayType displayType); - /** - * - The child armature that the slot displayed at current time. - * @example - * TypeScript style, for reference only. - *
-     *     let slot = armature.getSlot("weapon");
-     * let prevChildArmature = slot.childArmature;
-     * if (prevChildArmature) {
-     * prevChildArmature.dispose();
-     *     }
-     *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
-     * 
- * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 插槽此时显示的子骨架。 - * 注意,被替换的对象或子骨架并不会被回收,根据语言和引擎的不同,需要额外处理。 - * @example - * TypeScript 风格,仅供参考。 - *
-     *     let slot = armature.getSlot("weapon");
-     * let prevChildArmature = slot.childArmature;
-     * if (prevChildArmature) {
-     * prevChildArmature.dispose();
-     *     }
-     *     slot.childArmature = factory.buildArmature("weapon_blabla", "weapon_blabla_project");
-     * 
- * @version DragonBones 3.0 - * @language zh_CN - */ - inline Armature* getChildArmature() const - { - return _childArmature; - } - void setChildArmature(Armature* value); - /** - * - The parent bone to which it belongs. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 所属的父骨骼。 - * @version DragonBones 3.0 - * @language zh_CN - */ - inline Bone* getParent() const - { - return _parent; - } -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_SLOT_H diff --git a/native/cocos/editor-support/dragonbones/armature/TransformObject.cpp b/native/cocos/editor-support/dragonbones/armature/TransformObject.cpp deleted file mode 100644 index c295246df9..0000000000 --- a/native/cocos/editor-support/dragonbones/armature/TransformObject.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// -// Created by liangshuochen on 12/06/2017. -// - -#include "TransformObject.h" - -DRAGONBONES_NAMESPACE_BEGIN - -Matrix TransformObject::_helpMatrix; -Transform TransformObject::_helpTransform; -Point TransformObject::_helpPoint; - -void TransformObject::_onClear() -{ - globalTransformMatrix.identity(); - global.identity(); - offset.identity(); - origin = nullptr; - userData = nullptr; - - _globalDirty = false; - _armature = nullptr; -} - -void TransformObject::updateGlobalTransform() -{ - if (_globalDirty) - { - _globalDirty = false; - global.fromMatrix(globalTransformMatrix); - } -} - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones/armature/TransformObject.h b/native/cocos/editor-support/dragonbones/armature/TransformObject.h deleted file mode 100644 index 593477f866..0000000000 --- a/native/cocos/editor-support/dragonbones/armature/TransformObject.h +++ /dev/null @@ -1,161 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_TRANSFORM_OBJECT_H -#define DRAGONBONES_TRANSFORM_OBJECT_H - -#include "../core/BaseObject.h" -#include "../geom/Matrix.h" -#include "../geom/Transform.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * - The base class of the transform object. - * @see dragonBones.Transform - * @version DragonBones 4.5 - * @language en_US - */ -/** - * - 变换对象的基类。 - * @see dragonBones.Transform - * @version DragonBones 4.5 - * @language zh_CN - */ -class TransformObject : public BaseObject -{ - ABSTRACT_CLASS(TransformObject); - -protected: - static Matrix _helpMatrix; - static Transform _helpTransform; - static Point _helpPoint; - -public: - /** - * - A matrix relative to the armature coordinate system. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 相对于骨架坐标系的矩阵。 - * @version DragonBones 3.0 - * @language zh_CN - */ - Matrix globalTransformMatrix; - /** - * - A transform relative to the armature coordinate system. - * @see #updateGlobalTransform() - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 相对于骨架坐标系的变换。 - * @see #updateGlobalTransform() - * @version DragonBones 3.0 - * @language zh_CN - */ - Transform global; - /** - * - The offset transform relative to the armature or the parent bone coordinate system. - * @see #dragonBones.Bone#invalidUpdate() - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 相对于骨架或父骨骼坐标系的偏移变换。 - * @see #dragonBones.Bone#invalidUpdate() - * @version DragonBones 3.0 - * @language zh_CN - */ - Transform offset; - /** - * @private - */ - const Transform* origin; - /** - * @private - */ - void* userData; - -public: - /** - * @internal - */ - Armature* _armature; - -protected: - bool _globalDirty; - -protected: - virtual void _onClear() override; - -public: - /** - * - For performance considerations, rotation or scale in the {@link #global} attribute of the bone or slot is not always properly accessible, - * some engines do not rely on these attributes to update rendering, such as Egret. - * The use of this method ensures that the access to the {@link #global} property is correctly rotation or scale. - * @example - * TypeScript style, for reference only. - *
-     *     bone.updateGlobalTransform();
-     *     let rotation = bone.global.rotation;
-     * 
- * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 出于性能的考虑,骨骼或插槽的 {@link #global} 属性中的旋转或缩放并不总是正确可访问的,有些引擎并不依赖这些属性更新渲染,比如 Egret。 - * 使用此方法可以保证访问到 {@link #global} 属性中正确的旋转或缩放。 - * @example - * TypeScript 风格,仅供参考。 - *
-     *     bone.updateGlobalTransform();
-     *     let rotation = bone.global.rotation;
-     * 
- * @version DragonBones 3.0 - * @language zh_CN - */ - void updateGlobalTransform(); - /** - * - The armature to which it belongs. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 所属的骨架。 - * @version DragonBones 3.0 - * @language zh_CN - */ - inline Armature* getArmature() const - { - return _armature; - } - -public: // For WebAssembly. - Matrix* getGlobalTransformMatrix() { return &globalTransformMatrix; } - Transform* getGlobal() { return &global; } - Transform* getOffset() { return &offset; } - const Transform* getOrigin() const { return origin; } -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_TRANSFORM_OBJECT_H diff --git a/native/cocos/editor-support/dragonbones/core/BaseObject.cpp b/native/cocos/editor-support/dragonbones/core/BaseObject.cpp deleted file mode 100644 index 4d795b1351..0000000000 --- a/native/cocos/editor-support/dragonbones/core/BaseObject.cpp +++ /dev/null @@ -1,160 +0,0 @@ -#include "BaseObject.h" -DRAGONBONES_NAMESPACE_BEGIN - -std::vector BaseObject::__allDragonBonesObjects; -unsigned BaseObject::_hashCode = 0; -unsigned BaseObject::_defaultMaxCount = 3000; -std::map BaseObject::_maxCountMap; -std::map> BaseObject::_poolsMap; -BaseObject::RecycleOrDestroyCallback BaseObject::_recycleOrDestroyCallback = nullptr; - -void BaseObject::_returnObject(BaseObject* object) -{ - const auto classType = object->getClassTypeIndex(); - const auto maxCountIterator = _maxCountMap.find(classType); - const auto maxCount = maxCountIterator != _maxCountMap.end() ? maxCountIterator->second : _defaultMaxCount; - auto& pool = _poolsMap[classType]; - // If script engine gc,then alway push object into pool,not immediately delete - // Because object will be referenced more then one place possibly,if delete it immediately,will - // crash. - if (!DragonBones::checkInPool || pool.size() < maxCount) - { - if (!object->_isInPool) - { - object->_isInPool = true; - pool.push_back(object); - if (_recycleOrDestroyCallback != nullptr) - _recycleOrDestroyCallback(object, 0); - } - else - { - // If script engine gc,repeat push into pool will happen. - if(DragonBones::checkInPool) - { - DRAGONBONES_ASSERT(false, "The object is already in the pool."); - } - } - } - else - { - delete object; - } -} - -void BaseObject::setObjectRecycleOrDestroyCallback(const std::function& cb) -{ - _recycleOrDestroyCallback = cb; -} - -void BaseObject::setMaxCount(std::size_t classType, unsigned maxCount) -{ - if (classType > 0) - { - const auto iterator = _poolsMap.find(classType); - if (iterator != _poolsMap.end()) - { - auto& pool = iterator->second; - if (pool.size() > (size_t)maxCount) - { - for (auto i = (size_t)maxCount, l = pool.size(); i < l; ++i) - { - delete pool[i]; - } - - pool.resize(maxCount); - } - } - - _maxCountMap[classType] = maxCount; - } - else - { - _defaultMaxCount = maxCount; - for (auto& pair : _poolsMap) - { - auto& pool = pair.second; - if (pool.size() > (size_t)maxCount) - { - for (auto i = (size_t)maxCount, l = pool.size(); i < l; ++i) - { - delete pool[i]; - } - - pool.resize(maxCount); - } - - if (_maxCountMap.find(pair.first) != _maxCountMap.end()) - { - _maxCountMap[pair.first] = maxCount; - } - } - } -} -void BaseObject::clearPool(std::size_t classType) -{ - if (classType > 0) - { - const auto iterator = _poolsMap.find(classType); - if (iterator != _poolsMap.end()) - { - auto& pool = iterator->second; - if (!pool.empty()) - { - for (auto object : pool) - { - delete object; - } - - pool.clear(); - } - } - } - else - { - for (auto& pair : _poolsMap) - { - auto& pool = pair.second; - if (!pool.empty()) - { - for (auto object : pool) - { - delete object; - } - - pool.clear(); - } - } - } -} - -BaseObject::BaseObject() -:hashCode(BaseObject::_hashCode++) -,_isInPool(false) -{ - __allDragonBonesObjects.push_back(this); -} - -BaseObject::~BaseObject() -{ - if (_recycleOrDestroyCallback != nullptr) - _recycleOrDestroyCallback(this, 1); - - auto iter = std::find(__allDragonBonesObjects.begin(), __allDragonBonesObjects.end(), this); - if (iter != __allDragonBonesObjects.end()) - { - __allDragonBonesObjects.erase(iter); - } -} - -void BaseObject::returnToPool() -{ - _onClear(); - BaseObject::_returnObject(this); -} - -std::vector& BaseObject::getAllObjects() -{ - return __allDragonBonesObjects; -} - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones/core/BaseObject.h b/native/cocos/editor-support/dragonbones/core/BaseObject.h deleted file mode 100644 index 775987e453..0000000000 --- a/native/cocos/editor-support/dragonbones/core/BaseObject.h +++ /dev/null @@ -1,161 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_BASE_OBJECT_H -#define DRAGONBONES_BASE_OBJECT_H - -#include "DragonBones.h" -#include - -DRAGONBONES_NAMESPACE_BEGIN -/** - * - The BaseObject is the base class for all objects in the DragonBones framework. - * All BaseObject instances are cached to the object pool to reduce the performance consumption of frequent requests for memory or memory recovery. - * @version DragonBones 4.5 - * @language en_US - */ -/** - * - 基础对象,通常 DragonBones 的对象都继承自该类。 - * 所有基础对象的实例都会缓存到对象池,以减少频繁申请内存或内存回收的性能消耗。 - * @version DragonBones 4.5 - * @language zh_CN - */ -class BaseObject -{ -public: - typedef std::function RecycleOrDestroyCallback; -private: - static unsigned _hashCode; - static unsigned _defaultMaxCount; - static std::map _maxCountMap; - static std::map> _poolsMap; - static void _returnObject(BaseObject *object); - - static RecycleOrDestroyCallback _recycleOrDestroyCallback; -public: - static void setObjectRecycleOrDestroyCallback(const RecycleOrDestroyCallback& cb); - /** - * - Set the maximum cache count of the specify object pool. - * @param objectConstructor - The specify class. (Set all object pools max cache count if not set) - * @param maxCount - Max count. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 设置特定对象池的最大缓存数量。 - * @param objectConstructor - 特定的类。 (不设置则设置所有对象池的最大缓存数量) - * @param maxCount - 最大缓存数量。 - * @version DragonBones 4.5 - * @language zh_CN - */ - static void setMaxCount(std::size_t classTypeIndex, unsigned maxCount); - /** - * - Clear the cached instances of a specify object pool. - * @param objectConstructor - Specify class. (Clear all cached instances if not set) - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 清除特定对象池的缓存实例。 - * @param objectConstructor - 特定的类。 (不设置则清除所有缓存的实例) - * @version DragonBones 4.5 - * @language zh_CN - */ - static void clearPool(std::size_t classTypeIndex = 0); - template - /** - * - Get an instance of the specify class from object pool. - * @param objectConstructor - The specify class. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 从对象池中获取特定类的实例。 - * @param objectConstructor - 特定的类。 - * @version DragonBones 4.5 - * @language zh_CN - */ - static T* borrowObject() - { - const auto classTypeIndex = T::getTypeIndex(); - const auto iterator = _poolsMap.find(classTypeIndex); - if (iterator != _poolsMap.end()) - { - auto& pool = iterator->second; - if (!pool.empty()) - { - const auto object = static_cast(pool.back()); - pool.pop_back(); - object->_isInPool = false; - return object; - } - } - - const auto object = new (std::nothrow) T(); - - return object; - } - - static std::vector& getAllObjects(); -public: - /** - * - A unique identification number assigned to the object. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 分配给此实例的唯一标识号。 - * @version DragonBones 4.5 - * @language zh_CN - */ - const unsigned hashCode; - -private: - static std::vector __allDragonBonesObjects; - bool _isInPool; - -public: - virtual ~BaseObject(); - -protected: - BaseObject(); - - virtual void _onClear() = 0; - -public: - virtual std::size_t getClassTypeIndex() const = 0; - /** - * - Clear the object and return it back to object pool。 - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 清除该实例的所有数据并将其返还对象池。 - * @version DragonBones 4.5 - * @language zh_CN - */ - void returnToPool(); - inline bool isInPool() const { return _isInPool; } -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_BASE_OBJECT_H diff --git a/native/cocos/editor-support/dragonbones/core/DragonBones.cpp b/native/cocos/editor-support/dragonbones/core/DragonBones.cpp deleted file mode 100644 index c4ce982584..0000000000 --- a/native/cocos/editor-support/dragonbones/core/DragonBones.cpp +++ /dev/null @@ -1,99 +0,0 @@ -#include "DragonBones.h" -#include "../armature/Armature.h" -#include "../animation/WorldClock.h" -#include "../animation/Animation.h" -#include "../event/EventObject.h" -#include "../event/IEventDispatcher.h" - -DRAGONBONES_NAMESPACE_BEGIN - -const std::string DragonBones::VEISION = "5.6.300"; - -bool DragonBones::yDown = false; -bool DragonBones::debug = false; -bool DragonBones::debugDraw = false; -bool DragonBones::webAssembly = false; -bool DragonBones::checkInPool = true; - -DragonBones::DragonBones(IEventDispatcher* eventManager) : - _events(), - _clock(nullptr), - _eventManager(eventManager) -{ - _clock = new WorldClock(); - _eventManager = eventManager; -} - -DragonBones::~DragonBones() -{ - if (_clock != nullptr) - { - delete _clock; - } - - _clock = nullptr; - _eventManager = nullptr; -} - -void DragonBones::advanceTime(float passedTime) -{ - if (!_objectsMap.empty()) - { - for (auto it = _objectsMap.begin(); it != _objectsMap.end(); it ++) - { - auto object = it->first; - if (object) { - object->returnToPool(); - } - } - _objectsMap.clear(); - } - - if (!_events.empty()) - { - for (std::size_t i = 0; i < _events.size(); ++i) - { - const auto eventObject = _events[i]; - const auto armature = eventObject->armature; - if (armature->_armatureData != nullptr) - { - armature->getProxy()->dispatchDBEvent(eventObject->type, eventObject); - if (eventObject->type == EventObject::SOUND_EVENT) - { - _eventManager->dispatchDBEvent(eventObject->type, eventObject); - } - } - - bufferObject(eventObject); - } - - _events.clear(); - } - - _clock->advanceTime(passedTime); -} - -void DragonBones::render() -{ - _clock->render(); -} - -void DragonBones::bufferEvent(EventObject* value) -{ - _events.push_back(value); -} - -void DragonBones::bufferObject(BaseObject* object) -{ - if(object == nullptr || object->isInPool())return; - // Just mark object will be put in pool next frame, 'true' is useless. - _objectsMap[object] = true; -} - -WorldClock* DragonBones::getClock() -{ - return _clock; -} - - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones/core/DragonBones.h b/native/cocos/editor-support/dragonbones/core/DragonBones.h deleted file mode 100644 index 86e11c6978..0000000000 --- a/native/cocos/editor-support/dragonbones/core/DragonBones.h +++ /dev/null @@ -1,487 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_H -#define DRAGONBONES_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -// dragonBones assert -#define DRAGONBONES_ASSERT(cond, msg) \ -do { \ - assert(cond); \ -} while (0) - -// namespace dragonBones {} -#define DRAGONBONES_NAMESPACE_BEGIN namespace dragonBones { -#define DRAGONBONES_NAMESPACE_END } - -// using dragonBones namespace -#define DRAGONBONES_USING_NAME_SPACE using namespace dragonBones - -#define ABSTRACT_CLASS(CLASS) \ -public:\ - CLASS(){}\ - virtual ~CLASS(){}; - -#define BIND_CLASS_TYPE(CLASS) \ -public:\ - static std::size_t getTypeIndex()\ - {\ - static const auto typeIndex = typeid(CLASS).hash_code();\ - return typeIndex;\ - }\ - virtual std::size_t getClassTypeIndex() const override\ - {\ - return CLASS::getTypeIndex();\ - }\ - -#define BIND_CLASS_TYPE_A(CLASS) \ -public:\ - static std::size_t getTypeIndex()\ - {\ - static const auto typeIndex = typeid(CLASS).hash_code();\ - return typeIndex;\ - }\ - virtual std::size_t getClassTypeIndex() const override\ - {\ - return CLASS::getTypeIndex();\ - }\ -public:\ - CLASS(){_onClear();}\ - ~CLASS(){_onClear();}\ -private:\ - CLASS(const CLASS&);\ - void operator=(const CLASS&) - -#define BIND_CLASS_TYPE_B(CLASS) \ -public:\ - static std::size_t getTypeIndex()\ - {\ - static const auto typeIndex = typeid(CLASS).hash_code();\ - return typeIndex;\ - }\ - virtual std::size_t getClassTypeIndex() const override\ - {\ - return CLASS::getTypeIndex();\ - }\ -private:\ - CLASS(const CLASS&);\ - void operator=(const CLASS&) - -#define DRAGONBONES_DISALLOW_COPY_AND_ASSIGN(CLASS) \ -private:\ - CLASS(const CLASS&);\ - void operator=(const CLASS&); - -DRAGONBONES_NAMESPACE_BEGIN - -/** - * @internal - */ -enum class BinaryOffset -{ - WeigthBoneCount = 0, - WeigthFloatOffset = 1, - WeigthBoneIndices = 2, - - MeshVertexCount = 0, - MeshTriangleCount = 1, - MeshFloatOffset = 2, - MeshWeightOffset = 3, - MeshVertexIndices = 4, - - TimelineScale = 0, - TimelineOffset = 1, - TimelineKeyFrameCount = 2, - TimelineFrameValueCount = 3, - TimelineFrameValueOffset = 4, - TimelineFrameOffset = 5, - - FramePosition = 0, - FrameTweenType = 1, - FrameTweenEasingOrCurveSampleCount = 2, - FrameCurveSamples = 3, - - DeformVertexOffset = 0, - DeformCount = 1, - DeformValueCount = 2, - DeformValueOffset = 3, - DeformFloatOffset = 4 -}; - -/** - * @internal - */ -enum class ArmatureType -{ - Armature = 0, - MovieClip = 1, - Stage = 2 -}; - -/** - * - Offset mode. - * @version DragonBones 5.5 - * @language en_US - */ -/** - * - 偏移模式。 - * @version DragonBones 5.5 - * @language zh_CN - */ -enum class OffsetMode { - None, - Additive, - Override -}; - -/** - * @private - */ -enum class DisplayType -{ - Image = 0, - Armature = 1, - Mesh = 2, - BoundingBox = 3, - Path = 4 -}; - -/** - * - Bounding box type. - * @version DragonBones 5.0 - * @language en_US - */ -/** - * - 边界框类型。 - * @version DragonBones 5.0 - * @language zh_CN - */ -enum class BoundingBoxType -{ - Rectangle = 0, - Ellipse = 1, - Polygon = 2 -}; - -/** - * @internal - */ -enum class ActionType { - Play = 0, - Frame = 10, - Sound = 11 -}; - -/** - * @internal - */ -enum class BlendMode -{ - Normal = 0, - Add = 1, - Alpha = 2, - Darken = 3, - Difference = 4, - Erase = 5, - HardLight = 6, - Invert = 7, - Layer = 8, - Lighten = 9, - Multiply = 10, - Overlay = 11, - Screen = 12, - Subtract = 13 -}; - -/** - * @internal - */ -enum class TweenType { - None = 0, - Line = 1, - Curve = 2, - QuadIn = 3, - QuadOut = 4, - QuadInOut = 5 -}; - -/** - * @internal - */ -enum class TimelineType { - Action = 0, - ZOrder = 1, - - BoneAll = 10, - - BoneTranslate = 11, - BoneRotate = 12, - BoneScale = 13, - - SlotDisplay = 20, - SlotColor = 21, - SlotDeform = 22, - - IKConstraint = 30, - - AnimationTime = 40, - AnimationWeight = 41 -}; - -/** - * - Animation fade out mode. - * @version DragonBones 4.5 - * @language en_US - */ -/** - * - 动画淡出模式。 - * @version DragonBones 4.5 - * @language zh_CN - */ -enum class AnimationFadeOutMode { - /** - * - Do not fade out of any animation states. - * @language en_US - */ - /** - * - 不淡出任何的动画状态。 - * @language zh_CN - */ - None, - /** - * - Fade out the animation states of the same layer. - * @language en_US - */ - /** - * - 淡出同层的动画状态。 - * @language zh_CN - */ - SameLayer, - /** - * - Fade out the animation states of the same group. - * @language en_US - */ - /** - * - 淡出同组的动画状态。 - * @language zh_CN - */ - SameGroup, - /** - * - Fade out the animation states of the same layer and group. - * @language en_US - */ - /** - * - 淡出同层并且同组的动画状态。 - * @language zh_CN - */ - SameLayerAndGroup, - /** - * - Fade out of all animation states. - * @language en_US - */ - /** - * - 淡出所有的动画状态。 - * @language zh_CN - */ - All, - /** - * - Does not replace the animation state with the same name. - * @language en_US - */ - /** - * - 不替换同名的动画状态。 - * @language zh_CN - */ - Single -}; - -enum class TextureFormat -{ - DEFAULT, - RGBA8888, - BGRA8888, - RGBA4444, - RGB888, - RGB565, - RGBA5551 -}; - -template -std::string to_string(const T& value) -{ - std::ostringstream stream; - stream << value; - return stream.str(); -} - -template -inline int indexOf(const std::vector& vector, const T& value) -{ - for (std::size_t i = 0, l = vector.size(); i < l; ++i) - { - if (vector[i] == value) - { - return (int) i; - } - } - - return -1; -} - -template -inline T* mapFind(const std::map& map, const std::string& key) -{ - auto iterator = map.find(key); - return (iterator != map.end()) ? iterator->second : nullptr; -} - -template -inline T* mapFindB(std::map& map, const std::string& key) -{ - auto iterator = map.find(key); - return (iterator != map.end()) ? &iterator->second : nullptr; -} - -class Matrix; -class Transform; -class ColorTransform; -class Point; -class Rectangle; - -class BaseObject; - -class UserData; -class ActionData; -class DragonBonesData; -class ArmatureData; -class CanvasData; -class BoneData; -class SlotData; -class SkinData; -class ConstraintData; -class IKConstraintData; -class DisplayData; -class ImageDisplayData; -class ArmatureDisplayData; -class MeshDisplayData; -class VerticesData; -class WeightData; -class BoundingBoxDisplayData; -class BoundingBoxData; -class RectangleBoundingBoxData; -class EllipseBoundingBoxData; -class PolygonBoundingBoxData; -class AnimationData; -class TimelineData; -class AnimationConfig; -class TextureAtlasData; -class TextureData; - -class IArmatureProxy; -class Armature; -class TransformObject; -class Bone; -class Slot; -class Constraint; -class IKConstraint; -class DeformVertices; - -class IAnimatable; -class WorldClock; -class Animation; -class AnimationState; -class BonePose; -class BlendState; -class TimelineState; -class TweenTimelineState; -class BoneTimelineState; -class SlotTimelineState; -class ConstraintTimelineState; -class ActionTimelineState; -class ZOrderTimelineState; -class BoneAllTimelineState; -class SlotDislayTimelineState; -class SlotColorTimelineState; -class DeformTimelineState; -class IKConstraintTimelineState; - -class IEventDispatcher; -class EventObject; - -class DataParser; -class JSONDataParser; -class BinaryDataParser; - -class BaseFactory; -class BuildArmaturePackage; - -/** - * @private - */ -class DragonBones -{ - DRAGONBONES_DISALLOW_COPY_AND_ASSIGN(DragonBones) - -public: - static const std::string VEISION; - - static bool yDown; - static bool debug; - static bool debugDraw; - static bool webAssembly; - static bool checkInPool; - -private: - std::map _objectsMap; - std::vector _events; - WorldClock* _clock; - IEventDispatcher* _eventManager; - -public: - DragonBones(IEventDispatcher* eventManager); - virtual ~DragonBones(); - - void advanceTime(float passedTime); - void render(); - void bufferEvent(EventObject* value); - void bufferObject(BaseObject* object); - - WorldClock* getClock(); - IEventDispatcher* getEventManager() const - { - return _eventManager; - } -}; - -DRAGONBONES_NAMESPACE_END - -#endif // DRAGONBONES_H diff --git a/native/cocos/editor-support/dragonbones/event/EventObject.cpp b/native/cocos/editor-support/dragonbones/event/EventObject.cpp deleted file mode 100644 index d2a99c7ab0..0000000000 --- a/native/cocos/editor-support/dragonbones/event/EventObject.cpp +++ /dev/null @@ -1,57 +0,0 @@ -#include "EventObject.h" -#include "../model/UserData.h" -#include "../armature/Armature.h" - -DRAGONBONES_NAMESPACE_BEGIN - -const char* EventObject::START = "start"; -const char* EventObject::LOOP_COMPLETE = "loopComplete"; -const char* EventObject::COMPLETE = "complete"; -const char* EventObject::FADE_IN = "fadeIn"; -const char* EventObject::FADE_IN_COMPLETE = "fadeInComplete"; -const char* EventObject::FADE_OUT = "fadeOut"; -const char* EventObject::FADE_OUT_COMPLETE = "fadeOutComplete"; -const char* EventObject::FRAME_EVENT = "frameEvent"; -const char* EventObject::SOUND_EVENT = "soundEvent"; - -void EventObject::actionDataToInstance(const ActionData* data, EventObject* instance, Armature* armature) -{ - if (data->type == ActionType::Play) - { - instance->type = EventObject::FRAME_EVENT; - } - else - { - instance->type = data->type == ActionType::Frame ? EventObject::FRAME_EVENT : EventObject::SOUND_EVENT; - } - - instance->name = data->name; - instance->armature = armature; - instance->actionData = data; - instance->data = data->data; - - if (data->bone != nullptr) - { - instance->bone = armature->getBone(data->bone->name); - } - - if (data->slot != nullptr) - { - instance->slot = armature->getSlot(data->slot->name); - } -} - -void EventObject::_onClear() -{ - time = 0.0f; - type = ""; - name = ""; - armature = nullptr; - bone = nullptr; - slot = nullptr; - animationState = nullptr; - actionData = nullptr; - data = nullptr; -} - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones/event/EventObject.h b/native/cocos/editor-support/dragonbones/event/EventObject.h deleted file mode 100644 index 0c6500373d..0000000000 --- a/native/cocos/editor-support/dragonbones/event/EventObject.h +++ /dev/null @@ -1,267 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_EVENT_OBJECT_H -#define DRAGONBONES_EVENT_OBJECT_H - -#include "../core/BaseObject.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * - The properties of the object carry basic information about an event, - * which are passed as parameter or parameter's parameter to event listeners when an event occurs. - * @version DragonBones 4.5 - * @language en_US - */ -/** - * - 事件对象,包含有关事件的基本信息,当发生事件时,该实例将作为参数或参数的参数传递给事件侦听器。 - * @version DragonBones 4.5 - * @language zh_CN - */ -class EventObject : public BaseObject -{ - BIND_CLASS_TYPE_A(EventObject); - -public: - /** - * - Animation start play. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 动画开始播放。 - * @version DragonBones 4.5 - * @language zh_CN - */ - static const char* START; - /** - * - Animation loop play complete once. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 动画循环播放完成一次。 - * @version DragonBones 4.5 - * @language zh_CN - */ - static const char* LOOP_COMPLETE; - /** - * - Animation play complete. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 动画播放完成。 - * @version DragonBones 4.5 - * @language zh_CN - */ - static const char* COMPLETE; - /** - * - Animation fade in start. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 动画淡入开始。 - * @version DragonBones 4.5 - * @language zh_CN - */ - static const char* FADE_IN; - /** - * - Animation fade in complete. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 动画淡入完成。 - * @version DragonBones 4.5 - * @language zh_CN - */ - static const char* FADE_IN_COMPLETE; - /** - * - Animation fade out start. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 动画淡出开始。 - * @version DragonBones 4.5 - * @language zh_CN - */ - static const char* FADE_OUT; - /** - * - Animation fade out complete. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 动画淡出完成。 - * @version DragonBones 4.5 - * @language zh_CN - */ - static const char* FADE_OUT_COMPLETE; - /** - * - Animation frame event. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 动画帧事件。 - * @version DragonBones 4.5 - * @language zh_CN - */ - static const char* FRAME_EVENT; - /** - * - Animation frame sound event. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 动画帧声音事件。 - * @version DragonBones 4.5 - * @language zh_CN - */ - static const char* SOUND_EVENT; - - /** - * @internal - */ - static void actionDataToInstance(const ActionData* data, EventObject* instance, Armature* armature); - -public: - /** - * - If is a frame event, the value is used to describe the time that the event was in the animation timeline. (In seconds) - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 如果是帧事件,此值用来描述该事件在动画时间轴中所处的时间。(以秒为单位) - * @version DragonBones 4.5 - * @language zh_CN - */ - float time; - /** - * - The event type。 - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 事件类型。 - * @version DragonBones 4.5 - * @language zh_CN - */ - std::string type; - /** - * - The event name. (The frame event name or the frame sound name) - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 事件名称。 (帧事件的名称或帧声音的名称) - * @version DragonBones 4.5 - * @language zh_CN - */ - std::string name; - /** - * - The armature that dispatch the event. - * @see dragonBones.Armature - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 发出该事件的骨架。 - * @see dragonBones.Armature - * @version DragonBones 4.5 - * @language zh_CN - */ - Armature* armature; - /** - * - The bone that dispatch the event. - * @see dragonBones.Bone - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 发出该事件的骨骼。 - * @see dragonBones.Bone - * @version DragonBones 4.5 - * @language zh_CN - */ - Bone* bone; - /** - * - The slot that dispatch the event. - * @see dragonBones.Slot - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 发出该事件的插槽。 - * @see dragonBones.Slot - * @version DragonBones 4.5 - * @language zh_CN - */ - Slot* slot; - /** - * - The animation state that dispatch the event. - * @see dragonBones.AnimationState - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 发出该事件的动画状态。 - * @see dragonBones.AnimationState - * @version DragonBones 4.5 - * @language zh_CN - */ - AnimationState* animationState; - /** - * @private - */ - const ActionData* actionData; - /** - * - The custom data. - * @see dragonBones.CustomData - * @private - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 自定义数据。 - * @see dragonBones.CustomData - * @private - * @version DragonBones 5.0 - * @language zh_CN - */ - UserData* data; - -protected: - virtual void _onClear() override; - -public: // For WebAssembly. - Armature* getArmature() const { return armature; } - Bone* getBone() const { return bone; } - Slot* getSlot() const { return slot; } - AnimationState* getAnimationState() const { return animationState; } - UserData* getData() const { return data; } -}; -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_EVENT_OBJECT_H diff --git a/native/cocos/editor-support/dragonbones/event/IEventDispatcher.h b/native/cocos/editor-support/dragonbones/event/IEventDispatcher.h deleted file mode 100644 index c46f9f064f..0000000000 --- a/native/cocos/editor-support/dragonbones/event/IEventDispatcher.h +++ /dev/null @@ -1,113 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_IEVENT_DISPATCHER_H -#define DRAGONBONES_IEVENT_DISPATCHER_H - -#include "../core/DragonBones.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * - The event dispatcher interface. - * Dragonbones event dispatch usually relies on docking engine to implement, which defines the event method to be implemented when docking the engine. - * @version DragonBones 4.5 - * @language en_US - */ -/** - * - 事件派发接口。 - * DragonBones 的事件派发通常依赖于对接的引擎来实现,该接口定义了对接引擎时需要实现的事件方法。 - * @version DragonBones 4.5 - * @language zh_CN - */ -class IEventDispatcher -{ - ABSTRACT_CLASS(IEventDispatcher) - -public: - /** - * - Checks whether the object has any listeners registered for a specific type of event。 - * @param type - Event type. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 检查是否为特定的事件类型注册了任何侦听器。 - * @param type - 事件类型。 - * @version DragonBones 4.5 - * @language zh_CN - */ - virtual bool hasDBEventListener(const std::string& type) const = 0; - /** - * - Dispatches an event into the event flow. - * @param type - Event type. - * @param eventObject - Event object. - * @see dragonBones.EventObject - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 分派特定的事件到事件流中。 - * @param type - 事件类型。 - * @param eventObject - 事件数据。 - * @see dragonBones.EventObject - * @version DragonBones 4.5 - * @language zh_CN - */ - virtual void dispatchDBEvent(const std::string& type, EventObject* value) = 0; - /** - * - Add an event listener object so that the listener receives notification of an event. - * @param type - Event type. - * @param listener - Event listener. - * @param thisObject - The listener function's "this". - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 添加特定事件类型的事件侦听器,以使侦听器能够接收事件通知。 - * @param type - 事件类型。 - * @param listener - 事件侦听器。 - * @param thisObject - 侦听函数绑定的 this 对象。 - * @version DragonBones 4.5 - * @language zh_CN - */ - virtual void addDBEventListener(const std::string& type, const std::function & listener) = 0; - /** - * - Removes a listener from the object. - * @param type - Event type. - * @param listener - Event listener. - * @param thisObject - The listener function's "this". - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 删除特定事件类型的侦听器。 - * @param type - 事件类型。 - * @param listener - 事件侦听器。 - * @param thisObject - 侦听函数绑定的 this 对象。 - * @version DragonBones 4.5 - * @language zh_CN - */ - virtual void removeDBEventListener(const std::string& type, const std::function& listener) = 0; -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_IEVENT_DISPATCHER_H diff --git a/native/cocos/editor-support/dragonbones/factory/BaseFactory.cpp b/native/cocos/editor-support/dragonbones/factory/BaseFactory.cpp deleted file mode 100644 index 2cb750a07b..0000000000 --- a/native/cocos/editor-support/dragonbones/factory/BaseFactory.cpp +++ /dev/null @@ -1,659 +0,0 @@ -#include "BaseFactory.h" - -DRAGONBONES_NAMESPACE_BEGIN - -JSONDataParser BaseFactory::_jsonParser; -BinaryDataParser BaseFactory::_binaryParser; - -TextureData* BaseFactory::_getTextureData(const std::string& textureAtlasName, const std::string& textureName) const -{ - const auto iterator = _textureAtlasDataMap.find(textureAtlasName); - if (iterator != _textureAtlasDataMap.end()) - { - for (const auto textureAtlasData : iterator->second) - { - const auto textureData = textureAtlasData->getTexture(textureName); - if (textureData != nullptr) - { - return textureData; - } - } - } - - if (autoSearch) - { - for (const auto& pair : _textureAtlasDataMap) - { - for (const auto textureAtlasData : pair.second) - { - if (textureAtlasData->autoSearch) - { - const auto textureData = textureAtlasData->getTexture(textureName); - if (textureData != nullptr) - { - return textureData; - } - } - } - } - } - - return nullptr; -} - -bool BaseFactory::_fillBuildArmaturePackage( - BuildArmaturePackage& dataPackage, - const std::string& dragonBonesName, const std::string& armatureName, const std::string& skinName, const std::string& textureAtlasName -) const -{ - std::string mapName = dragonBonesName; - DragonBonesData* dragonBonesData = nullptr; - ArmatureData* armatureData = nullptr; - - if (!mapName.empty()) - { - const auto iterator = _dragonBonesDataMap.find(mapName); - if (iterator != _dragonBonesDataMap.end()) - { - dragonBonesData = iterator->second; - armatureData = dragonBonesData->getArmature(armatureName); - } - } - - if (armatureData == nullptr && (mapName.empty() || autoSearch)) - { - for (const auto& pair : _dragonBonesDataMap) - { - dragonBonesData = pair.second; - if (mapName.empty() || dragonBonesData->autoSearch) - { - armatureData = dragonBonesData->getArmature(armatureName); - if (armatureData != nullptr) - { - mapName = pair.first; - break; - } - } - } - } - - if (armatureData != nullptr) - { - dataPackage.dataName = mapName; - dataPackage.textureAtlasName = textureAtlasName; - dataPackage.data = dragonBonesData; - dataPackage.armature = armatureData; - dataPackage.skin = nullptr; - - if (!skinName.empty()) - { - dataPackage.skin = armatureData->getSkin(skinName); - if (dataPackage.skin == nullptr && autoSearch) - { - for (const auto& pair : _dragonBonesDataMap) - { - const auto skinDragonBonesData = pair.second; - const auto skinArmatureData = skinDragonBonesData->getArmature(skinName); - if (skinArmatureData != nullptr) - { - dataPackage.skin = skinArmatureData->defaultSkin; - break; - } - } - } - } - - if (dataPackage.skin == nullptr) - { - dataPackage.skin = armatureData->defaultSkin; - } - - return true; - } - - return false; -} - -void BaseFactory::_buildBones(const BuildArmaturePackage& dataPackage, Armature* armature) const -{ - for (const auto boneData : dataPackage.armature->sortedBones) - { - const auto bone = BaseObject::borrowObject(); - bone->init(boneData, armature); - } - - for (const auto& pair : dataPackage.armature->constraints) - { - // TODO more constraint type. - const auto constraint = BaseObject::borrowObject(); - constraint->init(pair.second, armature); - armature->_addConstraint(constraint); - } -} - -void BaseFactory::_buildSlots(const BuildArmaturePackage& dataPackage, Armature* armature) const -{ - const auto currentSkin = dataPackage.skin; - const auto defaultSkin = dataPackage.armature->defaultSkin; - if (currentSkin == nullptr || defaultSkin == nullptr) - { - return; - } - - std::map*> skinSlots; - for (auto& pair : defaultSkin->displays) - { - auto& displays = pair.second; - skinSlots[pair.first] = &displays; - } - - if (currentSkin != defaultSkin) - { - for (auto& pair : currentSkin->displays) - { - auto& displays = pair.second; - skinSlots[pair.first] = &displays; - } - } - - for (const auto slotData : dataPackage.armature->sortedSlots) - { - const auto displayDatas = skinSlots[slotData->name]; - const auto slot = _buildSlot(dataPackage, slotData, armature); - slot->setRawDisplayDatas(displayDatas); - - if (displayDatas != nullptr) - { - std::vector> displayList; - - for (const auto displayData : *displayDatas) - { - if (displayData != nullptr) - { - displayList.push_back(_getSlotDisplay(&dataPackage, displayData, nullptr, slot)); - } - else - { - displayList.push_back(std::make_pair(nullptr, DisplayType::Image)); - } - } - - slot->_setDisplayList(displayList); - } - - slot->_setDisplayIndex(slotData->displayIndex, true); - } -} - -Armature* BaseFactory::_buildChildArmature(const BuildArmaturePackage* dataPackage, Slot* slot, DisplayData* displayData) const -{ - return buildArmature(displayData->path, dataPackage != nullptr ? dataPackage->dataName : "", "", dataPackage != nullptr ? dataPackage->textureAtlasName : ""); -} - -std::pair BaseFactory::_getSlotDisplay(const BuildArmaturePackage* dataPackage, DisplayData* displayData, DisplayData* rawDisplayData, Slot* slot) const -{ - std::string dataName = ""; - - if (dataPackage != nullptr) - { - dataName = dataPackage->dataName; - } - else - { - for (const auto& pair : _dragonBonesDataMap) - { - if (pair.second == displayData->parent->parent->parent) - { - dataName = pair.first; - } - } - - if (dataName.empty()) - { - dataName = displayData->parent->parent->parent->name; - } - } - - std::pair display(nullptr, DisplayType::Image); - switch (displayData->type) - { - case DisplayType::Image: - { - auto imageDisplayData = static_cast(displayData); - - if (dataPackage != nullptr && !dataPackage->textureAtlasName.empty()) - { - imageDisplayData->texture = _getTextureData(dataPackage->textureAtlasName, displayData->path); - } - - if (imageDisplayData->texture == nullptr) - { - imageDisplayData->texture = _getTextureData(dataName, displayData->path); - } - - display.first = slot->_rawDisplay; - display.second = DisplayType::Image; - break; - } - - case DisplayType::Mesh: - { - auto meshDisplayData = static_cast(displayData); - - if (dataPackage != nullptr && !dataPackage->textureAtlasName.empty()) - { - meshDisplayData->texture = _getTextureData(dataPackage->textureAtlasName, meshDisplayData->path); - } - - if (meshDisplayData->texture == nullptr) - { - meshDisplayData->texture = _getTextureData(dataName, meshDisplayData->path); - } - - if (_isSupportMesh()) - { - display.first = slot->_meshDisplay; - display.second = DisplayType::Mesh; - } - else - { - display.first = slot->_rawDisplay; - display.second = DisplayType::Image; - } - break; - } - - case DisplayType::Armature: - { - auto armatureDisplayData = static_cast(displayData); - const auto childArmature = _buildChildArmature(dataPackage, slot, displayData); - if (childArmature != nullptr) - { - childArmature->inheritAnimation = armatureDisplayData->inheritAnimation; - if (!childArmature->inheritAnimation) - { - const auto actions = !armatureDisplayData->actions.empty() ? &(armatureDisplayData->actions) : &(childArmature->_armatureData->defaultActions); - if (!actions->empty()) - { - for (const auto action : *actions) - { - childArmature->getAnimation()->fadeIn(action->name); - } - } - else { - childArmature->getAnimation()->play(); - } - } - - armatureDisplayData->armature = childArmature->_armatureData; // - } - - display.first = childArmature; - display.second = DisplayType::Armature; - break; - } - - case DisplayType::BoundingBox: - break; - - default: - break; - } - - return display; -} - -DragonBonesData* BaseFactory::parseDragonBonesData(const char* rawData, const std::string& name, float scale) -{ - DRAGONBONES_ASSERT(rawData != nullptr, ""); - - DataParser* dataParser = nullptr; - - if ( - rawData[0] == 'D' && - rawData[1] == 'B' && - rawData[2] == 'D' && - rawData[3] == 'T' - ) - { - dataParser = &_binaryParser; - } - else - { - dataParser = _dataParser; - } - - const auto dragonBonesData = dataParser->parseDragonBonesData(rawData, scale); - - while (true) - { - const auto textureAtlasData = _buildTextureAtlasData(nullptr, nullptr); - if (dataParser->parseTextureAtlasData(nullptr, *textureAtlasData, scale)) - { - addTextureAtlasData(textureAtlasData, name); - } - else - { - textureAtlasData->returnToPool(); - break; - } - } - - if (dragonBonesData != nullptr) - { - addDragonBonesData(dragonBonesData, name); - } - - return dragonBonesData; -} - -TextureAtlasData* BaseFactory::parseTextureAtlasData(const char* rawData, void* textureAtlas, const std::string& name, float scale) -{ - const auto textureAtlasData = _buildTextureAtlasData(nullptr, nullptr); - _dataParser->parseTextureAtlasData(rawData, *textureAtlasData, scale); - _buildTextureAtlasData(textureAtlasData, textureAtlas); - addTextureAtlasData(textureAtlasData, name); - - return textureAtlasData; -} - -void BaseFactory::addDragonBonesData(DragonBonesData* data, const std::string& name) -{ - const auto& mapName = !name.empty()? name : data->name; - if (_dragonBonesDataMap.find(mapName) != _dragonBonesDataMap.cend()) - { - if (_dragonBonesDataMap[name] == data) - { - return; - } - - DRAGONBONES_ASSERT(false, "Can not add same name data: " + name); - return; - } - - _dragonBonesDataMap[mapName] = data; -} - -void BaseFactory::removeDragonBonesData(const std::string& name, bool disposeData) -{ - const auto iterator = _dragonBonesDataMap.find(name); - if (iterator != _dragonBonesDataMap.cend()) - { - if (disposeData) - { - iterator->second->returnToPool(); - } - - _dragonBonesDataMap.erase(iterator); - } -} - -void BaseFactory::addTextureAtlasData(TextureAtlasData* data, const std::string& name) -{ - const auto& mapName = !name.empty() ? name : data->name; - auto& textureAtlasList = _textureAtlasDataMap[mapName]; - if (std::find(textureAtlasList.cbegin(), textureAtlasList.cend(), data) == textureAtlasList.cend()) - { - textureAtlasList.push_back(data); - } -} - -void BaseFactory::removeTextureAtlasData(const std::string& name, bool disposeData) -{ - const auto iterator = _textureAtlasDataMap.find(name); - if (iterator != _textureAtlasDataMap.end()) - { - if (disposeData) - { - for (const auto textureAtlasData : iterator->second) - { - textureAtlasData->returnToPool(); - } - } - - _textureAtlasDataMap.erase(iterator); - } -} - -ArmatureData* BaseFactory::getArmatureData(const std::string& name, const std::string& dragonBonesName) const -{ - BuildArmaturePackage dataPackage; - if (!_fillBuildArmaturePackage(dataPackage, dragonBonesName, name, "", "")) - { - return nullptr; - } - - return dataPackage.armature; -} - -void BaseFactory::clear(bool disposeData) -{ - if (disposeData) - { - for (const auto& pair : _dragonBonesDataMap) - { - pair.second->returnToPool(); - } - - for (const auto& pair : _textureAtlasDataMap) - { - for (const auto textureAtlasData : pair.second) - { - textureAtlasData->returnToPool(); - } - } - } - - _dragonBonesDataMap.clear(); - _textureAtlasDataMap.clear(); -} - -Armature * BaseFactory::buildArmature(const std::string& armatureName, const std::string& dragonBonesName, const std::string& skinName, const std::string& textureAtlasName) const -{ - BuildArmaturePackage dataPackage; - if (!_fillBuildArmaturePackage(dataPackage, dragonBonesName, armatureName, skinName, textureAtlasName)) - { - DRAGONBONES_ASSERT(false, "No armature data: " + armatureName + ", " + (!dragonBonesName.empty() ? dragonBonesName : "")); - return nullptr; - } - - const auto armature = _buildArmature(dataPackage); - _buildBones(dataPackage, armature); - _buildSlots(dataPackage, armature); - armature->invalidUpdate("", true); - armature->advanceTime(0.0f); // Update armature pose. - - return armature; -} - -void BaseFactory::replaceDisplay(Slot* slot, DisplayData* displayData, int displayIndex) const -{ - if (displayIndex < 0) - { - displayIndex = slot->getDisplayIndex(); - } - - if (displayIndex < 0) - { - displayIndex = 0; - } - - slot->replaceDisplayData(displayData, displayIndex); - - auto displayList = slot->getDisplayList(); // Copy. - if (displayList.size() <= (unsigned)displayIndex) - { - displayList.resize(displayIndex + 1, std::make_pair(nullptr, DisplayType::Image)); - } - - if (displayData != nullptr) - { - const auto rawDisplayDatas = slot->getRawDisplayDatas(); - displayList[displayIndex] = _getSlotDisplay( - nullptr, - displayData, - rawDisplayDatas != nullptr && (unsigned)displayIndex < rawDisplayDatas->size() ? rawDisplayDatas->at(displayIndex) : nullptr, - slot - ); - } - else - { - displayList[displayIndex] = std::make_pair(nullptr, DisplayType::Image); - } - - slot->setDisplayList(displayList); -} - -bool BaseFactory::replaceSlotDisplay(const std::string& dragonBonesName, const std::string& armatureName, const std::string& slotName, const std::string& displayName, Slot* slot, int displayIndex) const -{ - DRAGONBONES_ASSERT(slot, "Arguments error."); - - const auto armatureData = getArmatureData(armatureName, dragonBonesName); - if (!armatureData || !armatureData->defaultSkin) - { - return false; - } - - const auto displayData = armatureData->defaultSkin->getDisplay(slotName, displayName); - if (!displayData) - { - return false; - } - - replaceDisplay(slot, displayData, displayIndex); - - return true; -} - -bool BaseFactory::replaceSlotDisplayList(const std::string& dragonBonesName, const std::string& armatureName, const std::string& slotName, Slot* slot) const -{ - DRAGONBONES_ASSERT(slot, "Arguments error."); - - const auto armatureData = getArmatureData(armatureName, dragonBonesName); - if (!armatureData || !armatureData->defaultSkin) - { - return false; - } - - const auto displays = armatureData->defaultSkin->getDisplays(slotName); - if (!displays) - { - return false; - } - - auto displayIndex = 0; - for (const auto displayData : *displays) - { - replaceDisplay(slot, displayData, displayIndex++); - } - - return true; -} - -bool BaseFactory::replaceSkin(Armature* armature, SkinData* skin, bool isOverride, const std::vector& exclude) const -{ - DRAGONBONES_ASSERT(armature && skin, "Arguments error."); - - auto success = false; - const auto defaultSkin = skin->parent->defaultSkin; - - for (const auto slot : armature->getSlots()) - { - if (std::find(exclude.cbegin(), exclude.cend(), slot->getName()) != exclude.cend()) - { - continue; - } - - auto displays = skin->getDisplays(slot->getName()); - if (displays == nullptr) - { - if (defaultSkin != nullptr && skin != defaultSkin) - { - displays = defaultSkin->getDisplays(slot->getName()); - } - - if (isOverride) - { - std::vector> displayList; - slot->setRawDisplayDatas(nullptr); - slot->setDisplayList(displayList); - } - continue; - } - - auto displayList = slot->getDisplayList(); // Copy. - displayList.resize(displays->size(), std::make_pair(nullptr, DisplayType::Image)); - for (std::size_t i = 0, l = displays->size(); i < l; ++i) - { - const auto displayData = displays->at(i); - if (displayData != nullptr) - { - displayList[i] = _getSlotDisplay(nullptr, displayData, nullptr, slot); - } - else - { - displayList[i] = std::make_pair(nullptr, DisplayType::Image); - } - } - - success = true; - slot->setRawDisplayDatas(displays); - slot->setDisplayList(displayList); - } - - return success; -} - -bool BaseFactory::replaceAnimation(Armature* armature, ArmatureData* armatureData, bool isReplaceAll) const -{ - const auto skinData = armatureData->defaultSkin; - if (skinData == nullptr) - { - return false; - } - - if (isReplaceAll) - { - armature->getAnimation()->setAnimations(armatureData->animations); - } - else - { - auto animations = armature->getAnimation()->getAnimations(); // Copy. - for (const auto& pair : armatureData->animations) - { - animations[pair.first] = pair.second; - } - - armature->getAnimation()->setAnimations(animations); - } - - for (const auto slot : armature->getSlots()) - { - unsigned index = 0; - for (const auto& pair : slot->getDisplayList()) - { - if (pair.second == DisplayType::Armature) - { - auto displayDatas = skinData->getDisplays(slot->getName()); - if (displayDatas != nullptr && index < displayDatas->size()) - { - const auto displayData = (*displayDatas)[index]; - if (displayData != nullptr && displayData->type == DisplayType::Armature) - { - const auto childArmatureData = getArmatureData(displayData->path, displayData->parent->parent->parent->name); - if (childArmatureData != nullptr) - { - replaceAnimation((Armature*)pair.first, childArmatureData, isReplaceAll); - } - } - } - } - - index++; - } - } - - return true; -} - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones/factory/BaseFactory.h b/native/cocos/editor-support/dragonbones/factory/BaseFactory.h deleted file mode 100644 index 0b788fadf2..0000000000 --- a/native/cocos/editor-support/dragonbones/factory/BaseFactory.h +++ /dev/null @@ -1,592 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_BASE_FACTORY_H -#define DRAGONBONES_BASE_FACTORY_H - -#include "../parser/JSONDataParser.h" -#include "../parser/BinaryDataParser.h" -#include "../armature/Armature.h" -#include "../armature/Bone.h" -#include "../armature/Slot.h" -#include "../armature/Constraint.h" -#include "../animation/Animation.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * - Base class for the factory that create the armatures. (Typically only one global factory instance is required) - * The factory instance create armatures by parsed and added DragonBonesData instances and TextureAtlasData instances. - * Once the data has been parsed, it has been cached in the factory instance and does not need to be parsed again until it is cleared by the factory instance. - * @see dragonBones.DragonBonesData - * @see dragonBones.TextureAtlasData - * @see dragonBones.ArmatureData - * @see dragonBones.Armature - * @version DragonBones 3.0 - * @language en_US - */ -/** - * - 创建骨架的工厂基类。 (通常只需要一个全局工厂实例) - * 工厂通过解析并添加的 DragonBonesData 实例和 TextureAtlasData 实例来创建骨架。 - * 当数据被解析过之后,已经添加到工厂中,在没有被工厂清理之前,不需要再次解析。 - * @see dragonBones.DragonBonesData - * @see dragonBones.TextureAtlasData - * @see dragonBones.ArmatureData - * @see dragonBones.Armature - * @version DragonBones 3.0 - * @language zh_CN - */ -class BaseFactory -{ -protected: - static JSONDataParser _jsonParser; - static BinaryDataParser _binaryParser; - -public: - /** - * @private - */ - bool autoSearch; - -protected: - std::map _dragonBonesDataMap; - std::map> _textureAtlasDataMap; - DragonBones* _dragonBones; - DataParser* _dataParser; - -public: - /** - * - Create a factory instance. (typically only one global factory instance is required) - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 创建一个工厂实例。 (通常只需要一个全局工厂实例) - * @version DragonBones 3.0 - * @language zh_CN - */ - BaseFactory(DataParser* dataParser = nullptr) : - autoSearch(false), - _dragonBonesDataMap(), - _textureAtlasDataMap(), - _dragonBones(nullptr), - _dataParser(nullptr) - { - _dataParser = dataParser != nullptr ? dataParser : &BaseFactory::_jsonParser; - } - virtual ~BaseFactory() - { - clear(); - - _dragonBones = nullptr; - _dataParser = nullptr; - } - -protected: - virtual inline bool _isSupportMesh() const - { - return true; - } - virtual TextureData* _getTextureData(const std::string& textureAtlasName, const std::string& textureName) const; - virtual bool _fillBuildArmaturePackage( - BuildArmaturePackage& dataPackage, - const std::string& dragonBonesName, const std::string& armatureName, const std::string& skinName, const std::string& textureAtlasName - ) const; - virtual void _buildBones(const BuildArmaturePackage& dataPackage, Armature* armature) const; - /** - * @private - */ - virtual void _buildSlots(const BuildArmaturePackage& dataPackage, Armature* armature) const; - virtual Armature* _buildChildArmature(const BuildArmaturePackage* dataPackage, Slot* slot, DisplayData* displayData) const; - virtual std::pair _getSlotDisplay(const BuildArmaturePackage* dataPackage, DisplayData* displayData, DisplayData* rawDisplayData, Slot* slot) const; - virtual TextureAtlasData* _buildTextureAtlasData(TextureAtlasData* textureAtlasData, void* textureAtlas) const = 0; - virtual Armature* _buildArmature(const BuildArmaturePackage& dataPackage) const = 0; - virtual Slot* _buildSlot(const BuildArmaturePackage& dataPackage, const SlotData* slotData, Armature* armature) const = 0; - -public: - /** - * - Parse the raw data to a DragonBonesData instance and cache it to the factory. - * @param rawData - The raw data. - * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (If not set, use the instance name instead) - * @param scale - Specify a scaling value for all armatures. (Default: 1.0) - * @returns DragonBonesData instance - * @see #getDragonBonesData() - * @see #addDragonBonesData() - * @see #removeDragonBonesData() - * @see dragonBones.DragonBonesData - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 将原始数据解析为 DragonBonesData 实例,并缓存到工厂中。 - * @param rawData - 原始数据。 - * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) - * @param scale - 为所有的骨架指定一个缩放值。 (默认: 1.0) - * @returns DragonBonesData 实例 - * @see #getDragonBonesData() - * @see #addDragonBonesData() - * @see #removeDragonBonesData() - * @see dragonBones.DragonBonesData - * @version DragonBones 4.5 - * @language zh_CN - */ - virtual DragonBonesData* parseDragonBonesData(const char* rawData, const std::string& name = "", float scale = 1.0f); - /** - * - Parse the raw texture atlas data and the texture atlas object to a TextureAtlasData instance and cache it to the factory. - * @param rawData - The raw texture atlas data. - * @param textureAtlas - The texture atlas object. - * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (If not set, use the instance name instead) - * @param scale - Specify a scaling value for the map set. (Default: 1.0) - * @returns TextureAtlasData instance - * @see #getTextureAtlasData() - * @see #addTextureAtlasData() - * @see #removeTextureAtlasData() - * @see dragonBones.TextureAtlasData - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 将原始贴图集数据和贴图集对象解析为 TextureAtlasData 实例,并缓存到工厂中。 - * @param rawData - 原始贴图集数据。 - * @param textureAtlas - 贴图集对象。 - * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) - * @param scale - 为贴图集指定一个缩放值。 (默认: 1.0) - * @returns TextureAtlasData 实例 - * @see #getTextureAtlasData() - * @see #addTextureAtlasData() - * @see #removeTextureAtlasData() - * @see dragonBones.TextureAtlasData - * @version DragonBones 4.5 - * @language zh_CN - */ - virtual TextureAtlasData* parseTextureAtlasData(const char* rawData, void* textureAtlas, const std::string& name = "", float scale = 1.0f); - /** - * - Get a specific DragonBonesData instance. - * @param name - The DragonBonesData instance cache name. - * @returns DragonBonesData instance - * @see #parseDragonBonesData() - * @see #addDragonBonesData() - * @see #removeDragonBonesData() - * @see dragonBones.DragonBonesData - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 获取特定的 DragonBonesData 实例。 - * @param name - DragonBonesData 实例的缓存名称。 - * @returns DragonBonesData 实例 - * @see #parseDragonBonesData() - * @see #addDragonBonesData() - * @see #removeDragonBonesData() - * @see dragonBones.DragonBonesData - * @version DragonBones 3.0 - * @language zh_CN - */ - inline DragonBonesData* getDragonBonesData(const std::string& name) const - { - return mapFind(_dragonBonesDataMap, name); - } - /** - * - Cache a DragonBonesData instance to the factory. - * @param data - The DragonBonesData instance. - * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (if not set, use the instance name instead) - * @see #parseDragonBonesData() - * @see #getDragonBonesData() - * @see #removeDragonBonesData() - * @see dragonBones.DragonBonesData - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 将 DragonBonesData 实例缓存到工厂中。 - * @param data - DragonBonesData 实例。 - * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) - * @see #parseDragonBonesData() - * @see #getDragonBonesData() - * @see #removeDragonBonesData() - * @see dragonBones.DragonBonesData - * @version DragonBones 3.0 - * @language zh_CN - */ - virtual void addDragonBonesData(DragonBonesData* data, const std::string& name = ""); - /** - * - Remove a DragonBonesData instance. - * @param name - The DragonBonesData instance cache name. - * @param disposeData - Whether to dispose data. (Default: true) - * @see #parseDragonBonesData() - * @see #getDragonBonesData() - * @see #addDragonBonesData() - * @see dragonBones.DragonBonesData - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 移除 DragonBonesData 实例。 - * @param name - DragonBonesData 实例缓存名称。 - * @param disposeData - 是否释放数据。 (默认: true) - * @see #parseDragonBonesData() - * @see #getDragonBonesData() - * @see #addDragonBonesData() - * @see dragonBones.DragonBonesData - * @version DragonBones 3.0 - * @language zh_CN - */ - virtual void removeDragonBonesData(const std::string& name, bool disposeData = true); - /** - * - Get a list of specific TextureAtlasData instances. - * @param name - The TextureAtlasData cahce name. - * @see #parseTextureAtlasData() - * @see #addTextureAtlasData() - * @see #removeTextureAtlasData() - * @see dragonBones.TextureAtlasData - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 获取特定的 TextureAtlasData 实例列表。 - * @param name - TextureAtlasData 实例缓存名称。 - * @see #parseTextureAtlasData() - * @see #addTextureAtlasData() - * @see #removeTextureAtlasData() - * @see dragonBones.TextureAtlasData - * @version DragonBones 3.0 - * @language zh_CN - */ - inline std::vector* getTextureAtlasData(const std::string& name) - { - return mapFindB(_textureAtlasDataMap, name); - } - /** - * - Cache a TextureAtlasData instance to the factory. - * @param data - The TextureAtlasData instance. - * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (if not set, use the instance name instead) - * @see #parseTextureAtlasData() - * @see #getTextureAtlasData() - * @see #removeTextureAtlasData() - * @see dragonBones.TextureAtlasData - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 将 TextureAtlasData 实例缓存到工厂中。 - * @param data - TextureAtlasData 实例。 - * @param name - 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称) - * @see #parseTextureAtlasData() - * @see #getTextureAtlasData() - * @see #removeTextureAtlasData() - * @see dragonBones.TextureAtlasData - * @version DragonBones 3.0 - * @language zh_CN - */ - virtual void addTextureAtlasData(TextureAtlasData* data, const std::string& name = ""); - /** - * - Remove a TextureAtlasData instance. - * @param name - The TextureAtlasData instance cache name. - * @param disposeData - Whether to dispose data. - * @see #parseTextureAtlasData() - * @see #getTextureAtlasData() - * @see #addTextureAtlasData() - * @see dragonBones.TextureAtlasData - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 移除 TextureAtlasData 实例。 - * @param name - TextureAtlasData 实例的缓存名称。 - * @param disposeData - 是否释放数据。 - * @see #parseTextureAtlasData() - * @see #getTextureAtlasData() - * @see #addTextureAtlasData() - * @see dragonBones.TextureAtlasData - * @version DragonBones 3.0 - * @language zh_CN - */ - virtual void removeTextureAtlasData(const std::string& name, bool disposeData = true); - /** - * - Get a specific armature data. - * @param name - The armature data name. - * @param dragonBonesName - The cached name for DragonbonesData instance. - * @see dragonBones.ArmatureData - * @version DragonBones 5.1 - * @language en_US - */ - /** - * - 获取特定的骨架数据。 - * @param name - 骨架数据名称。 - * @param dragonBonesName - DragonBonesData 实例的缓存名称。 - * @see dragonBones.ArmatureData - * @version DragonBones 5.1 - * @language zh_CN - */ - virtual ArmatureData* getArmatureData(const std::string& name, const std::string& dragonBonesName = "") const; - /** - * - Clear all cached DragonBonesData instances and TextureAtlasData instances. - * @param disposeData - Whether to dispose data. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 清除缓存的所有 DragonBonesData 实例和 TextureAtlasData 实例。 - * @param disposeData - 是否释放数据。 - * @version DragonBones 4.5 - * @language zh_CN - */ - virtual void clear(bool disposeData = true); - /** - * - Create a armature from cached DragonBonesData instances and TextureAtlasData instances. - * Note that when the created armature that is no longer in use, you need to explicitly dispose {@link #dragonBones.Armature#dispose()}. - * @param armatureName - The armature data name. - * @param dragonBonesName - The cached name of the DragonBonesData instance. (If not set, all DragonBonesData instances are retrieved, and when multiple DragonBonesData instances contain a the same name armature data, it may not be possible to accurately create a specific armature) - * @param skinName - The skin name, you can set a different ArmatureData name to share it's skin data. (If not set, use the default skin data) - * @returns The armature. - * @example - * TypeScript style, for reference only. - *
-     *     let armature = factory.buildArmature("armatureName", "dragonBonesName");
-     *     armature.clock = factory.clock;
-     * 
- * @see dragonBones.DragonBonesData - * @see dragonBones.ArmatureData - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 通过缓存的 DragonBonesData 实例和 TextureAtlasData 实例创建一个骨架。 - * 注意,创建的骨架不再使用时,需要显式释放 {@link #dragonBones.Armature#dispose()}。 - * @param armatureName - 骨架数据名称。 - * @param dragonBonesName - DragonBonesData 实例的缓存名称。 (如果未设置,将检索所有的 DragonBonesData 实例,当多个 DragonBonesData 实例中包含同名的骨架数据时,可能无法准确的创建出特定的骨架) - * @param skinName - 皮肤名称,可以设置一个其他骨架数据名称来共享其皮肤数据。(如果未设置,则使用默认的皮肤数据) - * @returns 骨架。 - * @example - * TypeScript 风格,仅供参考。 - *
-     *     let armature = factory.buildArmature("armatureName", "dragonBonesName");
-     *     armature.clock = factory.clock;
-     * 
- * @see dragonBones.DragonBonesData - * @see dragonBones.ArmatureData - * @version DragonBones 3.0 - * @language zh_CN - */ - virtual Armature* buildArmature(const std::string& armatureName, const std::string& dragonBonesName = "", const std::string& skinName = "", const std::string & textureAtlasName = "") const; - /** - * @private - */ - virtual void replaceDisplay(Slot* slot, DisplayData* displayData, int displayIndex) const; - /** - * - Replaces the current display data for a particular slot with a specific display data. - * Specify display data with "dragonBonesName/armatureName/slotName/displayName". - * @param dragonBonesName - The DragonBonesData instance cache name. - * @param armatureName - The armature data name. - * @param slotName - The slot data name. - * @param displayName - The display data name. - * @param slot - The slot. - * @param displayIndex - The index of the display data that is replaced. (If it is not set, replaces the current display data) - * @example - * TypeScript style, for reference only. - *
-     *     let slot = armature.getSlot("weapon");
-     *     factory.replaceSlotDisplay("dragonBonesName", "armatureName", "slotName", "displayName", slot);
-     * 
- * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 用特定的显示对象数据替换特定插槽当前的显示对象数据。 - * 用 "dragonBonesName/armatureName/slotName/displayName" 指定显示对象数据。 - * @param dragonBonesName - DragonBonesData 实例的缓存名称。 - * @param armatureName - 骨架数据名称。 - * @param slotName - 插槽数据名称。 - * @param displayName - 显示对象数据名称。 - * @param slot - 插槽。 - * @param displayIndex - 被替换的显示对象数据的索引。 (如果未设置,则替换当前的显示对象数据) - * @example - * TypeScript 风格,仅供参考。 - *
-     *     let slot = armature.getSlot("weapon");
-     *     factory.replaceSlotDisplay("dragonBonesName", "armatureName", "slotName", "displayName", slot);
-     * 
- * @version DragonBones 4.5 - * @language zh_CN - */ - virtual bool replaceSlotDisplay( - const std::string& dragonBonesName, const std::string& armatureName, const std::string& slotName, const std::string& displayName, - Slot* slot, int displayIndex = -1 - ) const; - /** - * @private - */ - virtual bool replaceSlotDisplayList( - const std::string& dragonBonesName, const std::string& armatureName, const std::string& slotName, - Slot* slot - ) const; - /** - * - Share specific skin data with specific armature. - * @param armature - The armature. - * @param skin - The skin data. - * @param isOverride - Whether it completely override the original skin. (Default: false) - * @param exclude - A list of slot names that do not need to be replace. - * @example - * TypeScript style, for reference only. - *
-     *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
-     *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
-     *     if (armatureDataB && armatureDataB.defaultSkin) {
-     *     factory.replaceSkin(armatureA, armatureDataB.defaultSkin, false, ["arm_l", "weapon_l"]);
-     *     }
-     * 
- * @see dragonBones.Armature - * @see dragonBones.SkinData - * @version DragonBones 5.6 - * @language en_US - */ - /** - * - 将特定的皮肤数据共享给特定的骨架使用。 - * @param armature - 骨架。 - * @param skin - 皮肤数据。 - * @param isOverride - 是否完全覆盖原来的皮肤。 (默认: false) - * @param exclude - 不需要被替换的插槽名称列表。 - * @example - * TypeScript 风格,仅供参考。 - *
-     *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
-     *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
-     *     if (armatureDataB && armatureDataB.defaultSkin) {
-     *     factory.replaceSkin(armatureA, armatureDataB.defaultSkin, false, ["arm_l", "weapon_l"]);
-     *     }
-     * 
- * @see dragonBones.Armature - * @see dragonBones.SkinData - * @version DragonBones 5.6 - * @language zh_CN - */ - virtual bool replaceSkin(Armature* armature, SkinData* skin, bool isOverride, const std::vector& exclude) const; - /** - * - Replaces the existing animation data for a specific armature with the animation data for the specific armature data. - * This enables you to make a armature template so that other armature without animations can share it's animations. - * @param armature - The armtaure. - * @param armatureData - The armature data. - * @param isOverride - Whether to completely overwrite the original animation. (Default: false) - * @example - * TypeScript style, for reference only. - *
-     *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
-     *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
-     *     if (armatureDataB) {
-     *     factory.replaceAnimation(armatureA, armatureDataB);
-     *     }
-     * 
- * @see dragonBones.Armature - * @see dragonBones.ArmatureData - * @version DragonBones 5.6 - * @language en_US - */ - /** - * - 用特定骨架数据的动画数据替换特定骨架现有的动画数据。 - * 这样就能实现制作一个骨架动画模板,让其他没有制作动画的骨架共享该动画。 - * @param armature - 骨架。 - * @param armatureData - 骨架数据。 - * @param isOverride - 是否完全覆盖原来的动画。(默认: false) - * @example - * TypeScript 风格,仅供参考。 - *
-     *     let armatureA = factory.buildArmature("armatureA", "dragonBonesA");
-     *     let armatureDataB = factory.getArmatureData("armatureB", "dragonBonesB");
-     *     if (armatureDataB) {
-     *     factory.replaceAnimation(armatureA, armatureDataB);
-     *     }
-     * 
- * @see dragonBones.Armature - * @see dragonBones.ArmatureData - * @version DragonBones 5.6 - * @language zh_CN - */ - virtual bool replaceAnimation(Armature* armature, ArmatureData* armatureData, bool isReplaceAll = true) const; - /** - * @private - */ - inline const std::map>& getAllTextureAtlasData() const - { - return _textureAtlasDataMap; - } - /** - * @private - */ - inline const std::map& getAllDragonBonesData() const - { - return _dragonBonesDataMap; - } - /** - * - An Worldclock instance updated by engine. - * @version DragonBones 5.7 - * @language en_US - */ - /** - * - 由引擎驱动的 WorldClock 实例。 - * @version DragonBones 5.7 - * @language zh_CN - */ - inline WorldClock* getClock() const - { - return _dragonBones->getClock(); - } - - /** - * - Deprecated, please refer to {@link #replaceSkin}. - * @deprecated - * @language en_US - */ - /** - * - 已废弃,请参考 {@link #replaceSkin}。 - * @deprecated - * @language zh_CN - */ - inline bool changeSkin(Armature* armature, SkinData* skin, const std::vector& exclude) const - { - return replaceSkin(armature, skin, false, exclude); - } -}; -/** - * @internal - */ -class BuildArmaturePackage -{ - DRAGONBONES_DISALLOW_COPY_AND_ASSIGN(BuildArmaturePackage) - -public: - std::string dataName; - std::string textureAtlasName; - DragonBonesData* data; - ArmatureData* armature; - SkinData* skin; - - BuildArmaturePackage() : - dataName(), - textureAtlasName(), - data(nullptr), - armature(nullptr), - skin(nullptr) - {} - ~BuildArmaturePackage() {} -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_BASE_FACTORY_H diff --git a/native/cocos/editor-support/dragonbones/geom/ColorTransform.h b/native/cocos/editor-support/dragonbones/geom/ColorTransform.h deleted file mode 100644 index 0e52a1471e..0000000000 --- a/native/cocos/editor-support/dragonbones/geom/ColorTransform.h +++ /dev/null @@ -1,80 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_COLOR_TRANSFORM_H -#define DRAGONBONES_COLOR_TRANSFORM_H - -#include "../core/DragonBones.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * @internal - */ -class ColorTransform -{ -public: - float alphaMultiplier; - float redMultiplier; - float greenMultiplier; - float blueMultiplier; - int alphaOffset; - int redOffset; - int greenOffset; - int blueOffset; - - ColorTransform(): - alphaMultiplier(1.0f), - redMultiplier(1.0f), - greenMultiplier(1.0f), - blueMultiplier(1.0f), - alphaOffset(0), - redOffset(0), - greenOffset(0), - blueOffset(0) - {} - ColorTransform(const ColorTransform &value) - { - operator=(value); - } - ~ColorTransform() {} - - inline void operator=(const ColorTransform &value) - { - alphaMultiplier = value.alphaMultiplier; - redMultiplier = value.redMultiplier; - greenMultiplier = value.greenMultiplier; - blueMultiplier = value.blueMultiplier; - alphaOffset = value.alphaOffset; - redOffset = value.redOffset; - greenOffset = value.greenOffset; - blueOffset = value.blueOffset; - } - - inline void identity() - { - alphaMultiplier = redMultiplier = greenMultiplier = blueMultiplier = 1.0f; - alphaOffset = redOffset = greenOffset = blueOffset = 0; - } -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_COLOR_TRANSFORM_H diff --git a/native/cocos/editor-support/dragonbones/geom/Matrix.h b/native/cocos/editor-support/dragonbones/geom/Matrix.h deleted file mode 100644 index febf9fd5b3..0000000000 --- a/native/cocos/editor-support/dragonbones/geom/Matrix.h +++ /dev/null @@ -1,317 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_MATRIX_H -#define DRAGONBONES_MATRIX_H - -#include "../core/DragonBones.h" -#include "Point.h" -#include "Rectangle.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * - 2D Transform matrix. - * @version DragonBones 3.0 - * @language en_US - */ -/** - * - 2D 转换矩阵。 - * @version DragonBones 3.0 - * @language zh_CN - */ -class Matrix -{ -public: - /** - * - The value that affects the positioning of pixels along the x axis when scaling or rotating an image. - * @default 1.0 - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 缩放或旋转图像时影响像素沿 x 轴定位的值。 - * @default 1.0 - * @version DragonBones 3.0 - * @language zh_CN - */ - float a; - /** - * - The value that affects the positioning of pixels along the y axis when rotating or skewing an image. - * @default 0.0 - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 旋转或倾斜图像时影响像素沿 y 轴定位的值。 - * @default 0.0 - * @version DragonBones 3.0 - * @language zh_CN - */ - float b; - /** - * - The value that affects the positioning of pixels along the x axis when rotating or skewing an image. - * @default 0.0 - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 旋转或倾斜图像时影响像素沿 x 轴定位的值。 - * @default 0.0 - * @version DragonBones 3.0 - * @language zh_CN - */ - float c; - /** - * - The value that affects the positioning of pixels along the y axis when scaling or rotating an image. - * @default 1.0 - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 缩放或旋转图像时影响像素沿 y 轴定位的值。 - * @default 1.0 - * @version DragonBones 3.0 - * @language zh_CN - */ - float d; - /** - * - The distance by which to translate each point along the x axis. - * @default 0.0 - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 沿 x 轴平移每个点的距离。 - * @default 0.0 - * @version DragonBones 3.0 - * @language zh_CN - */ - float tx; - /** - * - The distance by which to translate each point along the y axis. - * @default 0.0 - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 沿 y 轴平移每个点的距离。 - * @default 0.0 - * @version DragonBones 3.0 - * @language zh_CN - */ - float ty; - - Matrix(): - a(1.0f), - b(0.0f), - c(0.0f), - d(1.0f), - tx(0.0f), - ty(0.0f) - {} - /** - * @private - */ - Matrix(const Matrix& value) - { - operator=(value); - } - ~Matrix() {} - - inline void operator=(const Matrix& value) - { - a = value.a; - b = value.b; - c = value.c; - d = value.d; - tx = value.tx; - ty = value.ty; - } - /** - * - Convert to unit matrix. - * The resulting matrix has the following properties: a=1, b=0, c=0, d=1, tx=0, ty=0. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 转换为单位矩阵。 - * 该矩阵具有以下属性:a=1、b=0、c=0、d=1、tx=0、ty=0。 - * @version DragonBones 3.0 - * @language zh_CN - */ - inline void identity() - { - a = d = 1.0f; - b = c = 0.0f; - tx = ty = 0.0f; - } - /** - * - Multiplies the current matrix with another matrix. - * @param value - The matrix that needs to be multiplied. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 将当前矩阵与另一个矩阵相乘。 - * @param value - 需要相乘的矩阵。 - * @version DragonBones 3.0 - * @language zh_CN - */ - inline void concat(const Matrix& value) - { - const auto aA = a; - const auto bA = b; - const auto cA = c; - const auto dA = d; - const auto txA = tx; - const auto tyA = ty; - const auto aB = value.a; - const auto bB = value.b; - const auto cB = value.c; - const auto dB = value.d; - const auto txB = value.tx; - const auto tyB = value.ty; - - a = aA * aB + bA * cB; - b = aA * bB + bA * dB; - c = cA * aB + dA * cB; - d = cA * bB + dA * dB; - tx = aB * txA + cB * tyA + txB; - ty = dB * tyA + bB * txA + tyB; - } - /** - * - Convert to inverse matrix. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 转换为逆矩阵。 - * @version DragonBones 3.0 - * @language zh_CN - */ - inline void invert() - { - const auto aA = a; - const auto bA = b; - const auto cA = c; - const auto dA = d; - const auto txA = tx; - const auto tyA = ty; - const auto n = aA * dA - bA * cA; - - a = dA / n; - b = -bA / n; - c = -cA / n; - d = aA / n; - tx = (cA * tyA - dA * txA) / n; - ty = -(aA * tyA - bA * txA) / n; - } - /** - * - Apply a matrix transformation to a specific point. - * @param x - X coordinate. - * @param y - Y coordinate. - * @param result - The point after the transformation is applied. - * @param delta - Whether to ignore tx, ty's conversion to point. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 将矩阵转换应用于特定点。 - * @param x - 横坐标。 - * @param y - 纵坐标。 - * @param result - 应用转换之后的点。 - * @param delta - 是否忽略 tx,ty 对点的转换。 - * @version DragonBones 3.0 - * @language zh_CN - */ - inline void transformPoint(float x, float y, Point& result, bool delta = false) const - { - result.x = a * x + c * y; - result.y = b * x + d * y; - - if (!delta) - { - result.x += tx; - result.y += ty; - } - } - /** - * @private - */ - inline void transformRectangle(Rectangle& rectangle, bool delta = false) const - { - const auto offsetX = delta ? 0.0f : this->tx; - const auto offsetY = delta ? 0.0f : this->ty; - - const auto x = rectangle.x; - const auto y = rectangle.y; - const auto xMax = x + rectangle.width; - const auto yMax = y + rectangle.height; - - auto x0 = a * x + c * y + offsetX; - auto y0 = b * x + d * y + offsetY; - auto x1 = a * xMax + c * y + offsetX; - auto y1 = b * xMax + d * y + offsetY; - auto x2 = a * xMax + c * yMax + offsetX; - auto y2 = b * xMax + d * yMax + offsetY; - auto x3 = a * x + c * yMax + offsetX; - auto y3 = b * x + d * yMax + offsetY; - auto tmp = 0.0f; - - if (x0 > x1) - { - tmp = x0; - x0 = x1; - x1 = tmp; - } - - if (x2 > x3) - { - tmp = x2; - x2 = x3; - x3 = tmp; - } - - rectangle.x = std::floor(x0 < x2 ? x0 : x2); - rectangle.width = std::ceil((x1 > x3 ? x1 : x3) - rectangle.x); - - if (y0 > y1) - { - tmp = y0; - y0 = y1; - y1 = tmp; - } - - if (y2 > y3) - { - tmp = y2; - y2 = y3; - y3 = tmp; - } - - rectangle.y = std::floor(y0 < y2 ? y0 : y2); - rectangle.height = std::ceil((y1 > y3 ? y1 : y3) - rectangle.y); - } -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_MATRIX_H diff --git a/native/cocos/editor-support/dragonbones/geom/Point.cpp b/native/cocos/editor-support/dragonbones/geom/Point.cpp deleted file mode 100644 index b584e4bb81..0000000000 --- a/native/cocos/editor-support/dragonbones/geom/Point.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "Point.h" - -DRAGONBONES_NAMESPACE_BEGIN - -Point Point::helpPointA; -Point Point::helpPointB; -Point Point::helpPointC; -Point Point::helpPointD; - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones/geom/Point.h b/native/cocos/editor-support/dragonbones/geom/Point.h deleted file mode 100644 index 3824a16009..0000000000 --- a/native/cocos/editor-support/dragonbones/geom/Point.h +++ /dev/null @@ -1,121 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_POINT_H -#define DRAGONBONES_POINT_H - -#include "../core/DragonBones.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * - The Point object represents a location in a two-dimensional coordinate system. - * @version DragonBones 3.0 - * @language en_US - */ -/** - * - Point 对象表示二维坐标系统中的某个位置。 - * @version DragonBones 3.0 - * @language zh_CN - */ -class Point -{ -public: - static Point helpPointA; - static Point helpPointB; - static Point helpPointC; - static Point helpPointD; - -public: - /** - * - The horizontal coordinate. - * @default 0.0 - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 该点的水平坐标。 - * @default 0.0 - * @version DragonBones 3.0 - * @language zh_CN - */ - float x; - /** - * - The vertical coordinate. - * @default 0.0 - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 该点的垂直坐标。 - * @default 0.0 - * @version DragonBones 3.0 - * @language zh_CN - */ - float y; - - Point(): - x(0.0f), - y(0.0f) - {} - /** - * - Creates a new point. If you pass no parameters to this method, a point is created at (0,0). - * @param x - The horizontal coordinate. - * @param y - The vertical coordinate. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 创建一个 egret.Point 对象.若不传入任何参数,将会创建一个位于(0,0)位置的点。 - * @param x - 该对象的x属性值,默认为 0.0。 - * @param y - 该对象的y属性值,默认为 0.0。 - * @version DragonBones 3.0 - * @language zh_CN - */ - Point(const Point& value) - { - operator=(value); - } - ~Point() {} - - inline void operator=(const Point& value) - { - x = value.x; - y = value.y; - } - - /** - * @private - */ - inline void clear() - { - x = y = 0.0f; - } - -public: // For WebAssembly. - static Point* getHelpPointA() { return &helpPointA; } - static Point* getHelpPointB() { return &helpPointB; } - static Point* getHelpPointC() { return &helpPointC; } - static Point* getHelpPointD() { return &helpPointD; } -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_POINT_H diff --git a/native/cocos/editor-support/dragonbones/geom/Rectangle.h b/native/cocos/editor-support/dragonbones/geom/Rectangle.h deleted file mode 100644 index ec2d0c7dec..0000000000 --- a/native/cocos/editor-support/dragonbones/geom/Rectangle.h +++ /dev/null @@ -1,137 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_RECTANGLE_H -#define DRAGONBONES_RECTANGLE_H - -#include "../core/DragonBones.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * - A Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its - * width and its height.
- * The x, y, width, and height properties of the Rectangle class are independent of each other; changing the value of - * one property has no effect on the others. However, the right and bottom properties are integrally related to those - * four properties. For example, if you change the value of the right property, the value of the width property changes; - * if you change the bottom property, the value of the height property changes. - * @version DragonBones 3.0 - * @language en_US - */ -/** - * - Rectangle 对象是按其位置(由它左上角的点 (x, y) 确定)以及宽度和高度定义的区域。
- * Rectangle 类的 x、y、width 和 height 属性相互独立;更改一个属性的值不会影响其他属性。 - * 但是,right 和 bottom 属性与这四个属性是整体相关的。例如,如果更改 right 属性的值,则 width - * 属性的值将发生变化;如果更改 bottom 属性,则 height 属性的值将发生变化。 - * @version DragonBones 3.0 - * @language zh_CN - */ -class Rectangle -{ -public: - /** - * - The x coordinate of the top-left corner of the rectangle. - * @default 0.0 - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 矩形左上角的 x 坐标。 - * @default 0.0 - * @version DragonBones 3.0 - * @language zh_CN - */ - float x; - /** - * - The y coordinate of the top-left corner of the rectangle. - * @default 0.0 - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 矩形左上角的 y 坐标。 - * @default 0.0 - * @version DragonBones 3.0 - * @language zh_CN - */ - float y; - /** - * - The width of the rectangle, in pixels. - * @default 0.0 - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 矩形的宽度(以像素为单位)。 - * @default 0.0 - * @version DragonBones 3.0 - * @language zh_CN - */ - float width; - /** - * - 矩形的高度(以像素为单位)。 - * @default 0.0 - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - The height of the rectangle, in pixels. - * @default 0.0 - * @version DragonBones 3.0 - * @language zh_CN - */ - float height; - - Rectangle(): - x(0.0f), - y(0.0f), - width(0.0f), - height(0.0f) - {} - /** - * @private - */ - Rectangle(const Rectangle& value) - { - operator=(value); - } - ~Rectangle() {} - - inline void operator=(const Rectangle& value) - { - x = value.x; - y = value.y; - width = value.width; - height = value.height; - } - - /** - * @private - */ - void clear() - { - x = y = 0.0f; - width = height = 0.0f; - } -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_RECTANGLE_H diff --git a/native/cocos/editor-support/dragonbones/geom/Transform.cpp b/native/cocos/editor-support/dragonbones/geom/Transform.cpp deleted file mode 100644 index 329196452c..0000000000 --- a/native/cocos/editor-support/dragonbones/geom/Transform.cpp +++ /dev/null @@ -1,13 +0,0 @@ - -#include "Transform.h" - -DRAGONBONES_NAMESPACE_BEGIN - -const float Transform::PI = 3.14159265358979323846f; -const float Transform::PI_D = PI * 2.0f; -const float Transform::PI_H = PI * 0.5f; -const float Transform::PI_Q = PI * 0.25f; -const float Transform::DEG_RAD = PI / 180.f; -const float Transform::RAD_DEG = 180.f / PI; - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones/geom/Transform.h b/native/cocos/editor-support/dragonbones/geom/Transform.h deleted file mode 100644 index 432bc57bb5..0000000000 --- a/native/cocos/editor-support/dragonbones/geom/Transform.h +++ /dev/null @@ -1,289 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_TRANSFORM_H -#define DRAGONBONES_TRANSFORM_H - -#include "../core/DragonBones.h" -#include "Matrix.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * - 2D Transform. - * @version DragonBones 3.0 - * @language en_US - */ -/** - * - 2D 变换。 - * @version DragonBones 3.0 - * @language zh_CN - */ -class Transform final -{ -public: - /** - * @private - */ - static const float PI; - /** - * @private - */ - static const float PI_D; - /** - * @private - */ - static const float PI_H; - /** - * @private - */ - static const float PI_Q; - /** - * @private - */ - static const float DEG_RAD; - /** - * @private - */ - static const float RAD_DEG; - - /** - * @private - */ - static float normalizeRadian(float value) - { - value = fmod(value + Transform::PI, Transform::PI * 2.0f); - value += value > 0.0f ? -Transform::PI : Transform::PI; - - return value; - } - -public: - /** - * - Horizontal translate. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 水平位移。 - * @version DragonBones 3.0 - * @language zh_CN - */ - float x; - /** - * - Vertical translate. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 垂直位移。 - * @version DragonBones 3.0 - * @language zh_CN - */ - float y; - /** - * - Skew. (In radians) - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 倾斜。 (以弧度为单位) - * @version DragonBones 3.0 - * @language zh_CN - */ - float skew; - /** - * - rotation. (In radians) - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 旋转。 (以弧度为单位) - * @version DragonBones 3.0 - * @language zh_CN - */ - float rotation; - /** - * - Horizontal Scaling. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 水平缩放。 - * @version DragonBones 3.0 - * @language zh_CN - */ - float scaleX; - /** - * - Vertical scaling. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 垂直缩放。 - * @version DragonBones 3.0 - * @language zh_CN - */ - float scaleY; - - Transform(): - x(0.0f), - y(0.0f), - skew(0.0f), - rotation(0.0f), - scaleX(1.0f), - scaleY(1.0f) - {} - /** - * @private - */ - Transform(const Transform& value) - { - operator=(value); - } - ~Transform() {} - - inline void operator=(const Transform& value) - { - x = value.x; - y = value.y; - skew = value.skew; - rotation = value.rotation; - scaleX = value.scaleX; - scaleY = value.scaleY; - } - /** - * @private - */ - inline Transform& identity() - { - x = y = skew = rotation = 0.0f; - scaleX = scaleY = 1.0f; - - return *this; - } - /** - * @private - */ - inline Transform& add(const Transform& value) - { - x += value.x; - y += value.y; - skew += value.skew; - rotation += value.rotation; - scaleX *= value.scaleX; - scaleY *= value.scaleY; - - return *this; - } - /** - * @private - */ - inline Transform& minus(const Transform& value) - { - x -= value.x; - y -= value.y; - skew -= value.skew; - rotation -= value.rotation; - scaleX /= value.scaleX; - scaleY /= value.scaleY; - - return *this; - } - /** - * @private - */ - inline Transform& fromMatrix(const Matrix& matrix) - { - const auto backupScaleX = scaleX, backupScaleY = scaleY; - - x = matrix.tx; - y = matrix.ty; - - rotation = std::atan(matrix.b / matrix.a); - auto skewX = std::atan(-matrix.c / matrix.d); - - scaleX = (rotation > -PI_Q && rotation < PI_Q) ? matrix.a / std::cos(rotation) : matrix.b / std::sin(rotation); - scaleY = (skewX > -PI_Q && skewX < PI_Q) ? matrix.d / std::cos(skewX) : -matrix.c / std::sin(skewX); - - if (backupScaleX >= 0.0f && scaleX < 0.0f) - { - scaleX = -scaleX; - rotation = rotation - PI; - } - - if (backupScaleY >= 0.0f && scaleY < 0.0f) - { - scaleY = -scaleY; - skewX = skewX - PI; - } - - skew = skewX - rotation; - - return *this; - } - /** - * @private - */ - inline Transform& toMatrix(Matrix& matrix) - { - if (rotation == 0.0f) - { - matrix.a = 1.0f; - matrix.b = 0.0f; - } - else - { - matrix.a = std::cos(rotation); - matrix.b = std::sin(rotation); - } - - if (skew == 0.0f) - { - matrix.c = -matrix.b; - matrix.d = matrix.a; - } - else { - matrix.c = -std::sin(skew + rotation); - matrix.d = std::cos(skew + rotation); - } - - if (scaleX != 1.0f) - { - matrix.a *= scaleX; - matrix.b *= scaleX; - } - - if (scaleY != 1.0f) - { - matrix.c *= scaleY; - matrix.d *= scaleY; - } - - matrix.tx = x; - matrix.ty = y; - - return *this; - } -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_TRANSFORM_H diff --git a/native/cocos/editor-support/dragonbones/model/AnimationConfig.cpp b/native/cocos/editor-support/dragonbones/model/AnimationConfig.cpp deleted file mode 100644 index 5a59c39a58..0000000000 --- a/native/cocos/editor-support/dragonbones/model/AnimationConfig.cpp +++ /dev/null @@ -1,141 +0,0 @@ -#include "AnimationConfig.h" -#include "../armature/Armature.h" -#include "../armature/Bone.h" - -DRAGONBONES_NAMESPACE_BEGIN - -void AnimationConfig::_onClear() -{ - pauseFadeOut = true; - fadeOutMode = AnimationFadeOutMode::All; - fadeOutTweenType = TweenType::Line; - fadeOutTime = -1.0f; - - actionEnabled = true; - additiveBlending = false; - displayControl = true; - pauseFadeIn = true; - resetToPose = true; - fadeInTweenType = TweenType::Line; - playTimes = -1; - layer = 0; - position = 0.0f; - duration = -1.0f; - timeScale = -100.0f; - weight = 1.0f; - fadeInTime = -1.0f; - autoFadeOutTime = -1.0f; - name = ""; - animation = ""; - group = ""; - boneMask.clear(); -} - -void AnimationConfig::clear() -{ - _onClear(); -} - -void AnimationConfig::copyFrom(AnimationConfig* value) -{ - pauseFadeOut = value->pauseFadeOut; - fadeOutMode = value->fadeOutMode; - autoFadeOutTime = value->autoFadeOutTime; - fadeOutTweenType = value->fadeOutTweenType; - - actionEnabled = value->actionEnabled; - additiveBlending = value->additiveBlending; - displayControl = value->displayControl; - pauseFadeIn = value->pauseFadeIn; - resetToPose = value->resetToPose; - playTimes = value->playTimes; - layer = value->layer; - position = value->position; - duration = value->duration; - timeScale = value->timeScale; - weight = value->weight; - fadeInTime = value->fadeInTime; - fadeOutTime = value->fadeOutTime; - fadeInTweenType = value->fadeInTweenType; - name = value->name; - animation = value->animation; - group = value->group; - boneMask = value->boneMask; -} - -bool AnimationConfig::containsBoneMask(const std::string& boneName) const -{ - return boneMask.empty() || std::find(boneMask.cbegin(), boneMask.cend(), boneName) != boneMask.cend(); -} - -void AnimationConfig::addBoneMask(Armature* armature, const std::string& boneName, bool recursive) -{ - const auto currentBone = armature->getBone(boneName); - if (currentBone == nullptr) - { - return; - } - - if (std::find(boneMask.cbegin(), boneMask.cend(), boneName) == boneMask.cend()) // Add mixing - { - boneMask.push_back(boneName); - } - - if (recursive) // Add recursive mixing. - { - for (const auto bone : armature->getBones()) - { - if (std::find(boneMask.cbegin(), boneMask.cend(), bone->getName()) == boneMask.cend() && currentBone->contains(bone)) - { - boneMask.push_back(bone->getName()); - } - } - } -} - -void AnimationConfig::removeBoneMask(Armature* armature, const std::string& boneName, bool recursive) -{ - { - auto iterator = std::find(boneMask.begin(), boneMask.end(), boneName); - if (iterator != boneMask.end()) // Remove mixing. - { - boneMask.erase(iterator); - } - } - - if (recursive) - { - const auto currentBone = armature->getBone(boneName); - if (currentBone != nullptr) - { - if (!boneMask.empty()) // Remove recursive mixing. - { - for (const auto bone : armature->getBones()) - { - auto iterator = std::find(boneMask.begin(), boneMask.end(), bone->getName()); - if (iterator != boneMask.end() && currentBone->contains(bone)) - { - boneMask.erase(iterator); - } - } - } - else // Add unrecursive mixing. - { - for (const auto bone : armature->getBones()) - { - if (bone == currentBone) - { - continue; - } - - if (!currentBone->contains(bone)) - { - boneMask.push_back(bone->getName()); - } - } - } - } - } -} - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones/model/AnimationConfig.h b/native/cocos/editor-support/dragonbones/model/AnimationConfig.h deleted file mode 100644 index 67b3a7570f..0000000000 --- a/native/cocos/editor-support/dragonbones/model/AnimationConfig.h +++ /dev/null @@ -1,320 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_ANIMATION_CONFIG_H -#define DRAGONBONES_ANIMATION_CONFIG_H - -#include "../core/BaseObject.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * - The animation config is used to describe all the information needed to play an animation state. - * The API is still in the experimental phase and may encounter bugs or stability or compatibility issues when used. - * @see dragonBones.AnimationState - * @beta - * @version DragonBones 5.0 - * @language en_US - */ -/** - * - 动画配置用来描述播放一个动画状态所需要的全部信息。 - * 该 API 仍在实验阶段,使用时可能遭遇 bug 或稳定性或兼容性问题。 - * @see dragonBones.AnimationState - * @beta - * @version DragonBones 5.0 - * @language zh_CN - */ -class AnimationConfig : public BaseObject -{ - BIND_CLASS_TYPE_A(AnimationConfig); - -public: - /** - * @private - */ - bool pauseFadeOut; - /** - * - Fade out the pattern of other animation states when the animation state is fade in. - * This property is typically used to specify the substitution of multiple animation states blend. - * @default dragonBones.AnimationFadeOutMode.All - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 淡入动画状态时淡出其他动画状态的模式。 - * 该属性通常用来指定多个动画状态混合时的相互替换关系。 - * @default dragonBones.AnimationFadeOutMode.All - * @version DragonBones 5.0 - * @language zh_CN - */ - AnimationFadeOutMode fadeOutMode; - /** - * @private - */ - TweenType fadeOutTweenType; - /** - * @private - */ - float fadeOutTime; - /** - * @private - */ - bool actionEnabled; - /** - * @private - */ - bool additiveBlending; - /** - * - Whether the animation state has control over the display property of the slots. - * Sometimes blend a animation state does not want it to control the display properties of the slots, - * especially if other animation state are controlling the display properties of the slots. - * @default true - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 动画状态是否对插槽的显示对象属性有控制权。 - * 有时混合一个动画状态并不希望其控制插槽的显示对象属性, - * 尤其是其他动画状态正在控制这些插槽的显示对象属性时。 - * @default true - * @version DragonBones 5.0 - * @language zh_CN - */ - bool displayControl; - /** - * @private - */ - bool pauseFadeIn; - /** - * - Whether to reset the objects without animation to the armature pose when the animation state is start to play. - * This property should usually be set to false when blend multiple animation states. - * @default true - * @version DragonBones 5.1 - * @language en_US - */ - /** - * - 开始播放动画状态时是否将没有动画的对象重置为骨架初始值。 - * 通常在混合多个动画状态时应该将该属性设置为 false。 - * @default true - * @version DragonBones 5.1 - * @language zh_CN - */ - bool resetToPose; - /** - * @private - */ - TweenType fadeInTweenType; - /** - * - The play times. [0: Loop play, [1~N]: Play N times] - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 播放次数。 [0: 无限循环播放, [1~N]: 循环播放 N 次] - * @version DragonBones 3.0 - * @language zh_CN - */ - int playTimes; - /** - * - The blend layer. - * High layer animation state will get the blend weight first. - * When the blend weight is assigned more than 1, the remaining animation states will no longer get the weight assigned. - * @readonly - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 混合图层。 - * 图层高的动画状态会优先获取混合权重。 - * 当混合权重分配超过 1 时,剩余的动画状态将不再获得权重分配。 - * @readonly - * @version DragonBones 5.0 - * @language zh_CN - */ - int layer; - /** - * - The start time of play. (In seconds) - * @default 0.0 - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 播放的开始时间。 (以秒为单位) - * @default 0.0 - * @version DragonBones 5.0 - * @language zh_CN - */ - float position; - /** - * - The duration of play. - * [-1: Use the default value of the animation data, 0: Stop play, (0~N]: The duration] (In seconds) - * @default -1.0 - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 播放的持续时间。 - * [-1: 使用动画数据默认值, 0: 动画停止, (0~N]: 持续时间] (以秒为单位) - * @default -1.0 - * @version DragonBones 5.0 - * @language zh_CN - */ - float duration; - /** - * - The play speed. - * The value is an overlay relationship with {@link dragonBones.Animation#timeScale}. - * [(-N~0): Reverse play, 0: Stop play, (0~1): Slow play, 1: Normal play, (1~N): Fast play] - * @default 1.0 - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 播放速度。 - * 该值与 {@link dragonBones.Animation#timeScale} 是叠加关系。 - * [(-N~0): 倒转播放, 0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放] - * @default 1.0 - * @version DragonBones 3.0 - * @language zh_CN - */ - float timeScale; - /** - * - The blend weight. - * @default 1.0 - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 混合权重。 - * @default 1.0 - * @version DragonBones 5.0 - * @language zh_CN - */ - float weight; - /** - * - The fade in time. - * [-1: Use the default value of the animation data, [0~N]: The fade in time] (In seconds) - * @default -1.0 - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 淡入时间。 - * [-1: 使用动画数据默认值, [0~N]: 淡入时间] (以秒为单位) - * @default -1.0 - * @version DragonBones 5.0 - * @language zh_CN - */ - float fadeInTime; - /** - * - The auto fade out time when the animation state play completed. - * [-1: Do not fade out automatically, [0~N]: The fade out time] (In seconds) - * @default -1.0 - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 动画状态播放完成后的自动淡出时间。 - * [-1: 不自动淡出, [0~N]: 淡出时间] (以秒为单位) - * @default -1.0 - * @version DragonBones 5.0 - * @language zh_CN - */ - float autoFadeOutTime; - /** - * - The name of the animation state. (Can be different from the name of the animation data) - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 动画状态名称。 (可以不同于动画数据) - * @version DragonBones 5.0 - * @language zh_CN - */ - std::string name; - /** - * - The animation data name. - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 动画数据名称。 - * @version DragonBones 5.0 - * @language zh_CN - */ - std::string animation; - /** - * - The blend group name of the animation state. - * This property is typically used to specify the substitution of multiple animation states blend. - * @readonly - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 混合组名称。 - * 该属性通常用来指定多个动画状态混合时的相互替换关系。 - * @readonly - * @version DragonBones 5.0 - * @language zh_CN - */ - std::string group; - /** - * @private - */ - std::vector boneMask; - -protected: - virtual void _onClear() override; - -public: - /** - * @private - */ - void clear(); - /** - * @private - */ - void copyFrom(AnimationConfig* value); - /** - * @private - */ - bool containsBoneMask(const std::string& boneName) const; - /** - * @private - */ - void addBoneMask(Armature* armature, const std::string& boneName, bool recursive); - /** - * @private - */ - void removeBoneMask(Armature* armature, const std::string& boneName, bool recursive); - -public: // For WebAssembly. - int getFadeOutMode() const { return (int)fadeOutMode; } - void setFadeOutMode(int value) { fadeOutMode = (AnimationFadeOutMode)value; } - - int getFadeOutTweenType() const { return (int)fadeOutTweenType; } - void setFadeOutTweenType(int value) { fadeOutTweenType = (TweenType)value; } - - int getFadeInTweenType() const { return (int)fadeInTweenType; } - void setFadeInTweenType(int value) { fadeInTweenType = (TweenType)value; } -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_ANIMATION_CONFIG_H diff --git a/native/cocos/editor-support/dragonbones/model/AnimationData.cpp b/native/cocos/editor-support/dragonbones/model/AnimationData.cpp deleted file mode 100644 index 24147c4a1f..0000000000 --- a/native/cocos/editor-support/dragonbones/model/AnimationData.cpp +++ /dev/null @@ -1,121 +0,0 @@ -#include "AnimationData.h" -#include "ArmatureData.h" -#include "ConstraintData.h" - -DRAGONBONES_NAMESPACE_BEGIN - -void AnimationData::_onClear() -{ - for (const auto& pair : boneTimelines) - { - for (const auto timeline : pair.second) - { - timeline->returnToPool(); - } - } - - for (const auto& pair : slotTimelines) - { - for (const auto timeline : pair.second) - { - timeline->returnToPool(); - } - } - - for (const auto& pair : constraintTimelines) - { - for (const auto timeline : pair.second) - { - timeline->returnToPool(); - } - } - - if (actionTimeline != nullptr) - { - actionTimeline->returnToPool(); - } - - if (zOrderTimeline != nullptr) - { - zOrderTimeline->returnToPool(); - } - - frameIntOffset = 0; - frameFloatOffset = 0; - frameOffset = 0; - frameCount = 0; - playTimes = 0; - duration = 0.0f; - scale = 1.0f; - fadeInTime = 0.0f; - cacheFrameRate = 0.0f; - name = ""; - cachedFrames.clear(); - boneTimelines.clear(); - slotTimelines.clear(); - constraintTimelines.clear(); - boneCachedFrameIndices.clear(); - slotCachedFrameIndices.clear(); - parent = nullptr; - actionTimeline = nullptr; - zOrderTimeline = nullptr; -} - -void AnimationData::cacheFrames(unsigned frameRate) -{ - if (cacheFrameRate > 0.0f) // TODO clear cache. - { - return; - } - - cacheFrameRate = std::max(std::ceil(frameRate * scale), 1.0f); - const auto cacheFrameCount = std::ceil(cacheFrameRate * duration) + 1; // Cache one more frame. - - cachedFrames.resize(cacheFrameCount, false); - - for (const auto bone : parent->sortedBones) - { - boneCachedFrameIndices[bone->name].resize(cacheFrameCount, -1); - } - - for (const auto slot : parent->sortedSlots) - { - slotCachedFrameIndices[slot->name].resize(cacheFrameCount, -1); - } -} - -void AnimationData::addBoneTimeline(BoneData* bone, TimelineData* value) -{ - auto& timelines = boneTimelines[bone->name]; - if(std::find(timelines.cbegin(), timelines.cend(), value) == timelines.cend()) - { - timelines.push_back(value); - } -} - -void AnimationData::addSlotTimeline(SlotData* slot, TimelineData* value) -{ - auto& timelines = slotTimelines[slot->name]; - if (std::find(timelines.cbegin(), timelines.cend(), value) == timelines.cend()) - { - timelines.push_back(value); - } -} - -void AnimationData::addConstraintTimeline(ConstraintData* constraint, TimelineData* value) -{ - auto& timelines = constraintTimelines[constraint->name]; - if (std::find(timelines.cbegin(), timelines.cend(), value) == timelines.cend()) - { - timelines.push_back(value); - } -} - -void TimelineData::_onClear() -{ - type = TimelineType::BoneAll; - offset = 0; - frameIndicesOffset = -1; -} - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones/model/AnimationData.h b/native/cocos/editor-support/dragonbones/model/AnimationData.h deleted file mode 100644 index 81e5ec7b4c..0000000000 --- a/native/cocos/editor-support/dragonbones/model/AnimationData.h +++ /dev/null @@ -1,256 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_ANIMATION_DATA_H -#define DRAGONBONES_ANIMATION_DATA_H - -#include "ArmatureData.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * - The animation data. - * @version DragonBones 3.0 - * @language en_US - */ -/** - * - 动画数据。 - * @version DragonBones 3.0 - * @language zh_CN - */ -class AnimationData : public BaseObject -{ - BIND_CLASS_TYPE_B(AnimationData); - -public: - /** - * - FrameIntArray. - * @internal - */ - unsigned frameIntOffset; - /** - * - FrameFloatArray. - * @internal - */ - unsigned frameFloatOffset; - /** - * - FrameArray. - * @internal - */ - unsigned frameOffset; - /** - * - The frame count of the animation. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 动画的帧数。 - * @version DragonBones 3.0 - * @language zh_CN - */ - unsigned frameCount; - /** - * - The play times of the animation. [0: Loop play, [1~N]: Play N times] - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 动画的播放次数。 [0: 无限循环播放, [1~N]: 循环播放 N 次] - * @version DragonBones 3.0 - * @language zh_CN - */ - unsigned playTimes; - /** - * - The duration of the animation. (In seconds) - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 动画的持续时间。 (以秒为单位) - * @version DragonBones 3.0 - * @language zh_CN - */ - float duration; - /** - * @private - */ - float scale; - /** - * - The fade in time of the animation. (In seconds) - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 动画的淡入时间。 (以秒为单位) - * @version DragonBones 3.0 - * @language zh_CN - */ - float fadeInTime; - /** - * @private - */ - float cacheFrameRate; - /** - * - The animation name. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 动画名称。 - * @version DragonBones 3.0 - * @language zh_CN - */ - std::string name; - /** - * @private - */ - std::vector cachedFrames; - /** - * @private - */ - std::map> boneTimelines; - /** - * @private - */ - std::map> slotTimelines; - /** - * @private - */ - std::map> constraintTimelines; - /** - * @private - */ - std::map> boneCachedFrameIndices; - /** - * @private - */ - std::map> slotCachedFrameIndices; - /** - * @private - */ - TimelineData* actionTimeline; - /** - * @private - */ - TimelineData* zOrderTimeline; - /** - * @private - */ - ArmatureData* parent; - AnimationData() : - actionTimeline(nullptr), - zOrderTimeline(nullptr) - { - _onClear(); - } - ~AnimationData() - { - _onClear(); - } - -protected: - virtual void _onClear() override; - -public: - /** - * @internal - */ - void cacheFrames(unsigned frameRate); - /** - * @private - */ - void addBoneTimeline(BoneData* bone, TimelineData* value); - /** - * @private - */ - void addSlotTimeline(SlotData* slot, TimelineData* value); - /** - * @private - */ - void addConstraintTimeline(ConstraintData* constraint, TimelineData* value); - /** - * @private - */ - std::vector* getBoneTimelines(const std::string& timelineName) - { - return mapFindB(boneTimelines, timelineName); - } - /** - * @private - */ - inline std::vector* getSlotTimelines(const std::string& timelineName) - { - return mapFindB(slotTimelines, timelineName); - } - /** - * @private - */ - inline std::vector* getConstraintTimelines(const std::string& timelineName) - { - return mapFindB(constraintTimelines, timelineName); - } - /** - * @private - */ - inline std::vector* getBoneCachedFrameIndices(const std::string& boneName) - { - return mapFindB(boneCachedFrameIndices, boneName); - } - /** - * @private - */ - inline std::vector* getSlotCachedFrameIndices(const std::string& slotName) - { - return mapFindB(slotCachedFrameIndices, slotName); - } - -public: // For WebAssembly. - TimelineData* getActionTimeline() const { return actionTimeline; } - void setActionTimeline(TimelineData* pactionTimeline) { actionTimeline = pactionTimeline; } - - TimelineData* getZOrderTimeline() const { return zOrderTimeline; } - void setZOrderTimeline(TimelineData* value) { zOrderTimeline = value; } - - ArmatureData* getParent() const { return parent; } - void setParent(ArmatureData* value) { parent = value; } -}; -/** - * @internal - */ -class TimelineData : public BaseObject -{ - BIND_CLASS_TYPE_A(TimelineData); - -public: - TimelineType type; - unsigned offset; - int frameIndicesOffset; - -protected: - virtual void _onClear() override; - -public: // For WebAssembly. - int getType() const { return (int)type; } - void setType(int value) { type = (TimelineType)value; } -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_ANIMATION_DATA_H diff --git a/native/cocos/editor-support/dragonbones/model/ArmatureData.cpp b/native/cocos/editor-support/dragonbones/model/ArmatureData.cpp deleted file mode 100644 index 152f270a51..0000000000 --- a/native/cocos/editor-support/dragonbones/model/ArmatureData.cpp +++ /dev/null @@ -1,320 +0,0 @@ -#include "ArmatureData.h" -#include "UserData.h" -#include "DragonBonesData.h" -#include "ConstraintData.h" -#include "CanvasData.h" -#include "SkinData.h" -#include "DisplayData.h" -#include "AnimationData.h" - -DRAGONBONES_NAMESPACE_BEGIN - -void ArmatureData::_onClear() -{ - for (const auto action : defaultActions) - { - action->returnToPool(); - } - - for (const auto action : actions) - { - action->returnToPool(); - } - - for (const auto& pair : bones) - { - pair.second->returnToPool(); - } - - for (const auto& pair : slots) - { - pair.second->returnToPool(); - } - - for (const auto& pair : constraints) - { - pair.second->returnToPool(); - } - - for (const auto& pair : skins) - { - pair.second->returnToPool(); - } - - for (const auto& pair : animations) - { - pair.second->returnToPool(); - } - - if (canvas != nullptr) - { - canvas->returnToPool(); - } - - if (userData != nullptr) - { - userData->returnToPool(); - } - - type = ArmatureType::Armature; - frameRate = 0; - cacheFrameRate = 0; - scale = 1.0f; - name = ""; - aabb.clear(); - animationNames.clear(); - sortedBones.clear(); - sortedSlots.clear(); - defaultActions.clear(); - actions.clear(); - bones.clear(); - slots.clear(); - constraints.clear(); - skins.clear(); - animations.clear(); - parent = nullptr; - defaultSkin = nullptr; - defaultAnimation = nullptr; - canvas = nullptr; - userData = nullptr; -} - -void ArmatureData::sortBones() -{ - const auto total = sortedBones.size(); - if (total <= 0) - { - return; - } - - const auto sortHelper = sortedBones; // Copy. - unsigned index = 0; - unsigned count = 0; - sortedBones.clear(); - while (count < total) - { - const auto bone = sortHelper[index++]; - if (index >= total) - { - index = 0; - } - - if (std::find(sortedBones.cbegin(), sortedBones.cend(), bone) != sortedBones.cend()) - { - continue; - } - - auto flag = false; - for(const auto& pair : constraints) - { - const auto constrait = pair.second; - if(constrait->root == bone && std::find(sortedBones.cbegin(), sortedBones.cend(), constrait->target) == sortedBones.cend()) - { - flag = true; - break; - } - } - - if(flag) - { - continue; - } - - if (bone->parent != nullptr && std::find(sortedBones.cbegin(), sortedBones.cend(), bone->parent) == sortedBones.cend()) - { - continue; - } - - sortedBones.push_back(bone); - count++; - } -} - -void ArmatureData::cacheFrames(unsigned value) -{ - if (cacheFrameRate > value) // TODO clear cache. - { - return; - } - - cacheFrameRate = value; - for (const auto& pair : animations) - { - pair.second->cacheFrames(cacheFrameRate); - } -} - -int ArmatureData::setCacheFrame(const Matrix& globalTransformMatrix, const Transform& transform) -{ - auto& dataArray = *&parent->cachedFrames; - auto arrayOffset = dataArray.size(); - - dataArray.resize(arrayOffset + 10); - dataArray[arrayOffset] = globalTransformMatrix.a; - dataArray[arrayOffset + 1] = globalTransformMatrix.b; - dataArray[arrayOffset + 2] = globalTransformMatrix.c; - dataArray[arrayOffset + 3] = globalTransformMatrix.d; - dataArray[arrayOffset + 4] = globalTransformMatrix.tx; - dataArray[arrayOffset + 5] = globalTransformMatrix.ty; - dataArray[arrayOffset + 6] = transform.rotation; - dataArray[arrayOffset + 7] = transform.skew; - dataArray[arrayOffset + 8] = transform.scaleX; - dataArray[arrayOffset + 9] = transform.scaleY; - - return arrayOffset; -} - -void ArmatureData::getCacheFrame(Matrix& globalTransformMatrix, Transform& transform, unsigned arrayOffset) const -{ - auto& dataArray = *&parent->cachedFrames; - globalTransformMatrix.a = dataArray[arrayOffset]; - globalTransformMatrix.b = dataArray[arrayOffset + 1]; - globalTransformMatrix.c = dataArray[arrayOffset + 2]; - globalTransformMatrix.d = dataArray[arrayOffset + 3]; - globalTransformMatrix.tx = dataArray[arrayOffset + 4]; - globalTransformMatrix.ty = dataArray[arrayOffset + 5]; - transform.rotation = dataArray[arrayOffset + 6]; - transform.skew = dataArray[arrayOffset + 7]; - transform.scaleX = dataArray[arrayOffset + 8]; - transform.scaleY = dataArray[arrayOffset + 9]; - transform.x = globalTransformMatrix.tx; - transform.y = globalTransformMatrix.ty; -} - -void ArmatureData::addBone(BoneData* value) -{ - if (bones.find(value->name) != bones.cend()) - { - DRAGONBONES_ASSERT(false, "Same bone: " + value->name); - return; - } - - bones[value->name] = value; - sortedBones.push_back(value); -} - -void ArmatureData::addSlot(SlotData* value) -{ - if (slots.find(value->name) != slots.cend()) - { - DRAGONBONES_ASSERT(false, "Same slot: " + value->name); - return; - } - - slots[value->name] = value; - sortedSlots.push_back(value); -} - -void ArmatureData::addConstraint(ConstraintData * value) -{ - if (constraints.find(value->name) != constraints.cend()) - { - DRAGONBONES_ASSERT(false, "Same constaint: " + value->name); - return; - } - - constraints[value->name] = value; -} - -void ArmatureData::addSkin(SkinData* value) -{ - if (skins.find(value->name) != skins.cend()) - { - DRAGONBONES_ASSERT(false, "Same skin: " + value->name); - return; - } - - value->parent = this; - skins[value->name] = value; - - if (defaultSkin == nullptr) - { - defaultSkin = value; - } -} - -void ArmatureData::addAnimation(AnimationData* value) -{ - if (animations.find(value->name) != animations.cend()) - { - DRAGONBONES_ASSERT(false, "Same animation: " + value->name); - return; - } - - value->parent = this; - animations[value->name] = value; - animationNames.push_back(value->name); - if (defaultAnimation == nullptr) - { - defaultAnimation = value; - } -} - -void ArmatureData::addAction(ActionData* value, bool isDefault) -{ - if (isDefault) - { - defaultActions.push_back(value); - } - else - { - actions.push_back(value); - } -} - -MeshDisplayData* ArmatureData::getMesh(const std::string& skinName, const std::string& slotName, const std::string& meshName) const -{ - const auto skin = getSkin(skinName); - if (skin == nullptr) { - return nullptr; - } - - return static_cast(skin->getDisplay(slotName, meshName)); -} - -void BoneData::_onClear() -{ - if (userData != nullptr) - { - userData->returnToPool(); - } - - inheritTranslation = false; - inheritRotation = false; - inheritScale = false; - inheritReflection = false; - length = 0.0f; - name = ""; - transform.identity(); - parent = nullptr; - userData = nullptr; -} - -ColorTransform SlotData::DEFAULT_COLOR; -ColorTransform* SlotData::createColor() -{ - return new ColorTransform(); -} - -void SlotData::_onClear() -{ - if (userData != nullptr) - { - userData->returnToPool(); - } - - if (color != nullptr && color != &DEFAULT_COLOR) - { - delete color; - } - - blendMode = BlendMode::Normal; - displayIndex = 0; - zOrder = 0; - name = ""; - parent = nullptr; - color = nullptr; - userData = nullptr; -} - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones/model/ArmatureData.h b/native/cocos/editor-support/dragonbones/model/ArmatureData.h deleted file mode 100644 index f4f9d62902..0000000000 --- a/native/cocos/editor-support/dragonbones/model/ArmatureData.h +++ /dev/null @@ -1,513 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_ARMATURE_DATA_H -#define DRAGONBONES_ARMATURE_DATA_H - -#include "../core/BaseObject.h" -#include "../geom/Matrix.h" -#include "../geom/Transform.h" -#include "../geom/ColorTransform.h" -#include "../geom/Rectangle.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * - The armature data. - * @version DragonBones 3.0 - * @language en_US - */ -/** - * - 骨架数据。 - * @version DragonBones 3.0 - * @language zh_CN - */ -class ArmatureData : public BaseObject -{ - BIND_CLASS_TYPE_B(ArmatureData); - -public: - /** - * @private - */ - ArmatureType type; - /** - * - The animation frame rate. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 动画帧率。 - * @version DragonBones 3.0 - * @language zh_CN - */ - unsigned frameRate; - /** - * @private - */ - unsigned cacheFrameRate; - /** - * @private - */ - float scale; - /** - * - The armature name. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 骨架名称。 - * @version DragonBones 3.0 - * @language zh_CN - */ - std::string name; - /** - * @private - */ - Rectangle aabb; - /** - * - The names of all the animation data. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 所有的动画数据名称。 - * @version DragonBones 3.0 - * @language zh_CN - */ - std::vector animationNames; - /** - * @private - */ - std::vector sortedBones; - /** - * @private - */ - std::vector sortedSlots; - /** - * @private - */ - std::vector defaultActions; - /** - * @private - */ - std::vector actions; - /** - * @private - */ - std::map bones; - /** - * @private - */ - std::map slots; - /** - * @private - */ - std::map constraints; - /** - * @private - */ - std::map skins; - /** - * @private - */ - std::map animations; - /** - * - The default skin data. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 默认插槽数据。 - * @version DragonBones 4.5 - * @language zh_CN - */ - SkinData* defaultSkin; - /** - * - The default animation data. - * @version DragonBones 4.5 - * @language en_US - */ - /** - * - 默认动画数据。 - * @version DragonBones 4.5 - * @language zh_CN - */ - AnimationData* defaultAnimation; - /** - * @private - */ - CanvasData* canvas; - /** - * @private - */ - UserData* userData; - /** - * @private - */ - DragonBonesData* parent; - ArmatureData() : - canvas(nullptr), - userData(nullptr) - { - _onClear(); - } - ~ArmatureData() - { - _onClear(); - } - -protected: -virtual void _onClear() override; - -public: - /** - * @internal - */ - void sortBones(); - /** - * @internal - */ - void cacheFrames(unsigned frameRate); - /** - * @internal - */ - int setCacheFrame(const Matrix& globalTransformMatrix, const Transform& transform); - /** - * @internal - */ - void getCacheFrame(Matrix& globalTransformMatrix, Transform& transform, unsigned arrayOffset) const; - /** - * @internal - */ - void addBone(BoneData* value); - /** - * @internal - */ - void addSlot(SlotData* value); - /** - * @internal - */ - void addConstraint(ConstraintData* value); - /** - * @internal - */ - void addSkin(SkinData* value); - /** - * @internal - */ - void addAnimation(AnimationData* value); - /** - * @internal - */ - void addAction(ActionData* value, bool isDefault); - /** - * - Get a specific done data. - * @param boneName - The bone name. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 获取特定的骨骼数据。 - * @param boneName - 骨骼名称。 - * @version DragonBones 3.0 - * @language zh_CN - */ - inline BoneData* getBone(const std::string& boneName) const - { - return mapFind(bones, boneName); - } - /** - * - Get a specific slot data. - * @param slotName - The slot name. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 获取特定的插槽数据。 - * @param slotName - 插槽名称。 - * @version DragonBones 3.0 - * @language zh_CN - */ - inline SlotData* getSlot(const std::string& slotName) const - { - return mapFind(slots, slotName); - } - /** - * @private - */ - inline ConstraintData* getConstraint(const std::string& constraintName) const - { - return mapFind(constraints, constraintName); - } - /** - * - Get a specific skin data. - * @param skinName - The skin name. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 获取特定皮肤数据。 - * @param skinName - 皮肤名称。 - * @version DragonBones 3.0 - * @language zh_CN - */ - inline SkinData* getSkin(const std::string& skinName) const - { - return mapFind(skins, skinName); - } - /** - * @private - */ - MeshDisplayData* getMesh(const std::string& skinName, const std::string& slotName, const std::string& meshName) const; - /** - * - Get a specific animation data. - * @param animationName - The animation animationName. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 获取特定的动画数据。 - * @param animationName - 动画名称。 - * @version DragonBones 3.0 - * @language zh_CN - */ - inline AnimationData* getAnimation(const std::string& animationName) const - { - return mapFind(animations, animationName); - } - -public: // For WebAssembly. - int getType() const { return (int)type; } - void setType(int value) { type = (ArmatureType)value; } - - Rectangle* getAABB() { return &aabb; } - const std::vector& getAnimationNames() const { return animationNames; } - const std::vector& getSortedBones() const { return sortedBones; } - const std::vector& getSortedSlots() const { return sortedSlots; } - const std::vector& getDefaultActions() const { return defaultActions; } - const std::vector& getActions() const { return actions; } - - SkinData* getDefaultSkin() const { return defaultSkin; } - void setDefaultSkin(SkinData* value) { defaultSkin = value; } - - AnimationData* getDefaultAnimation() const { return defaultAnimation; } - void setDefaultAnimation(AnimationData* value) { defaultAnimation = value; } - - const UserData* getUserData() const { return userData; } - void setUserData(UserData* value) { userData = value; } - - const DragonBonesData* getParent() const { return parent; } - void setParent(DragonBonesData* value) { parent = value; } -}; -/** - * - The bone data. - * @version DragonBones 3.0 - * @language en_US - */ -/** - * - 骨骼数据。 - * @version DragonBones 3.0 - * @language zh_CN - */ -class BoneData : public BaseObject -{ - BIND_CLASS_TYPE_B(BoneData); - -public: - /** - * @private - */ - bool inheritTranslation; - /** - * @private - */ - bool inheritRotation; - /** - * @private - */ - bool inheritScale; - /** - * @private - */ - bool inheritReflection; - /** - * - The bone length. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 骨骼长度。 - * @version DragonBones 3.0 - * @language zh_CN - */ - float length; - /** - * - The bone name. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 骨骼名称。 - * @version DragonBones 3.0 - * @language zh_CN - */ - std::string name; - /** - * @private - */ - Transform transform; - /** - * @private - */ - UserData* userData; - /** - * - The parent bone data. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 父骨骼数据。 - * @version DragonBones 3.0 - * @language zh_CN - */ - BoneData* parent; - BoneData() : - userData(nullptr) - { - _onClear(); - } - ~BoneData() - { - _onClear(); - } - -protected: - virtual void _onClear() override; - -public: // For WebAssembly. - Transform* getTransfrom() { return &transform; } - - const UserData* getUserData() const { return userData; } - void setUserData(UserData* value) { userData = value; } - - const BoneData* getParent() const { return parent; } - void setParent(BoneData* value) { parent = value; } -}; -/** - * - The slot data. - * @version DragonBones 3.0 - * @language en_US - */ -/** - * - 插槽数据。 - * @version DragonBones 3.0 - * @language zh_CN - */ -class SlotData : public BaseObject -{ - BIND_CLASS_TYPE_B(SlotData); - -public: - /** - * @internal - */ - static ColorTransform DEFAULT_COLOR; - /** - * @internal - */ - static ColorTransform* createColor(); - -public: - /** - * @private - */ - BlendMode blendMode; - /** - * @private - */ - int displayIndex; - /** - * @private - */ - int zOrder; - /** - * - The slot name. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 插槽名称。 - * @version DragonBones 3.0 - * @language zh_CN - */ - std::string name; - /** - * @private - */ - ColorTransform* color; - /** - * @private - */ - UserData* userData; - /** - * - The parent bone data. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 父骨骼数据。 - * @version DragonBones 3.0 - * @language zh_CN - */ - BoneData* parent; - SlotData() : - color(nullptr), - userData(nullptr) - { - _onClear(); - } - ~SlotData() - { - _onClear(); - } - -protected: - virtual void _onClear() override; - -public: // For WebAssembly. - static ColorTransform* getDefaultColor() { return &DEFAULT_COLOR; } - - int getBlendMode() const { return (int)blendMode; } - void setBlendMode(int value) { blendMode = (BlendMode)value; } - - ColorTransform* getColor() const { return color; } - void setColor(ColorTransform* value) { color = value; } - - const BoneData* getParent() const { return parent; } - void setParent(BoneData* value) { parent = value; } - - const UserData* getUserData() const { return userData; } - void setUserData(UserData* value) { userData = value; } -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_ARMATURE_DATA_H diff --git a/native/cocos/editor-support/dragonbones/model/BoundingBoxData.cpp b/native/cocos/editor-support/dragonbones/model/BoundingBoxData.cpp deleted file mode 100644 index 556f024e64..0000000000 --- a/native/cocos/editor-support/dragonbones/model/BoundingBoxData.cpp +++ /dev/null @@ -1,644 +0,0 @@ - -#include "BoundingBoxData.h" -#include "DisplayData.h" - - -DRAGONBONES_NAMESPACE_BEGIN - -void BoundingBoxData::_onClear() -{ - color = 0x000000; - width = 0.0f; - height = 0.0f; -} - -int RectangleBoundingBoxData::_computeOutCode(float x, float y, float xMin, float yMin, float xMax, float yMax) -{ - int code = OutCode::InSide; // initialised as being inside of [[clip window]] - - if (x < xMin) // to the left of clip window - { - code |= OutCode::Left; - } - else if (x > xMax) // to the right of clip window - { - code |= OutCode::Right; - } - - if (y < yMin) // below the clip window - { - code |= OutCode::Top; - } - else if (y > yMax) // above the clip window - { - code |= OutCode::Bottom; - } - - return code; -} - -int RectangleBoundingBoxData::rectangleIntersectsSegment( - float xA, float yA, float xB, float yB, - float xMin, float yMin, float xMax, float yMax, - Point* intersectionPointA, - Point* intersectionPointB, - Point* normalRadians -) -{ - const auto inSideA = xA > xMin && xA < xMax && yA > yMin && yA < yMax; - const auto inSideB = xB > xMin && xB < xMax && yB > yMin && yB < yMax; - - if (inSideA && inSideB) - { - return -1; - } - - auto intersectionCount = 0; - auto outcode0 = RectangleBoundingBoxData::_computeOutCode(xA, yA, xMin, yMin, xMax, yMax); - auto outcode1 = RectangleBoundingBoxData::_computeOutCode(xB, yB, xMin, yMin, xMax, yMax); - - while (true) - { - if ((outcode0 | outcode1) == 0) // Bitwise OR is 0. Trivially accept and get out of loop - { - intersectionCount = 2; - break; - } - else if ((outcode0 & outcode1) != 0) // Bitwise AND is not 0. Trivially reject and get out of loop - { - break; - } - - // failed both tests, so calculate the line segment to clip - // from an outside point to an intersection with clip edge - auto x = 0.0f; - auto y = 0.0f; - auto normalRadian = 0.0f; - - // At least one endpoint is outside the clip rectangle; pick it. - const auto outcodeOut = outcode0 != 0 ? outcode0 : outcode1; - - // Now find the intersection point; - if ((outcodeOut & OutCode::Top) != 0) // point is above the clip rectangle - { - x = xA + (xB - xA) * (yMin - yA) / (yB - yA); - y = yMin; - - if (normalRadians != nullptr) - { - normalRadian = -Transform::PI * 0.5f; - } - } - else if ((outcodeOut & OutCode::Bottom) != 0) // point is below the clip rectangle - { - x = xA + (xB - xA) * (yMax - yA) / (yB - yA); - y = yMax; - - if (normalRadians != nullptr) - { - normalRadian = Transform::PI * 0.5; - } - } - else if ((outcodeOut & OutCode::Right) != 0) // point is to the right of clip rectangle - { - y = yA + (yB - yA) * (xMax - xA) / (xB - xA); - x = xMax; - - if (normalRadians != nullptr) - { - normalRadian = 0; - } - } - else if ((outcodeOut & OutCode::Left) != 0) // point is to the left of clip rectangle - { - y = yA + (yB - yA) * (xMin - xA) / (xB - xA); - x = xMin; - - if (normalRadians != nullptr) - { - normalRadian = Transform::PI; - } - } - - // Now we move outside point to intersection point to clip - // and get ready for next pass. - if (outcodeOut == outcode0) - { - xA = x; - yA = y; - outcode0 = RectangleBoundingBoxData::_computeOutCode(xA, yA, xMin, yMin, xMax, yMax); - - if (normalRadians != nullptr) - { - normalRadians->x = normalRadian; - } - } - else - { - xB = x; - yB = y; - outcode1 = RectangleBoundingBoxData::_computeOutCode(xB, yB, xMin, yMin, xMax, yMax); - - if (normalRadians != nullptr) - { - normalRadians->y = normalRadian; - } - } - } - - if (intersectionCount) - { - if (inSideA) - { - intersectionCount = 2; // 10 - - if (intersectionPointA != nullptr) - { - intersectionPointA->x = xB; - intersectionPointA->y = yB; - } - - if (intersectionPointB != nullptr) - { - intersectionPointB->x = xB; - intersectionPointB->y = xB; - } - - if (normalRadians != nullptr) - { - normalRadians->x = normalRadians->y + Transform::PI; - } - } - else if (inSideB) - { - intersectionCount = 1; // 01 - - if (intersectionPointA != nullptr) - { - intersectionPointA->x = xA; - intersectionPointA->y = yA; - } - - if (intersectionPointB != nullptr) - { - intersectionPointB->x = xA; - intersectionPointB->y = yA; - } - - if (normalRadians != nullptr) - { - normalRadians->y = normalRadians->x + Transform::PI; - } - } - else - { - intersectionCount = 3; // 11 - if (intersectionPointA != nullptr) - { - intersectionPointA->x = xA; - intersectionPointA->y = yA; - } - - if (intersectionPointB != nullptr) - { - intersectionPointB->x = xB; - intersectionPointB->y = yB; - } - } - } - - return intersectionCount; -} - -void RectangleBoundingBoxData::_onClear() -{ - BoundingBoxData::_onClear(); - - type = BoundingBoxType::Rectangle; -} - -bool RectangleBoundingBoxData::containsPoint(float pX, float pY) -{ - const auto widthH = width * 0.5f; - if (pX >= -widthH && pX <= widthH) - { - const auto heightH = height * 0.5f; - if (pY >= -heightH && pY <= heightH) - { - return true; - } - } - - return false; -} - -int RectangleBoundingBoxData::intersectsSegment( - float xA, float yA, float xB, float yB, - Point* intersectionPointA, - Point* intersectionPointB, - Point* normalRadians -) -{ - const auto widthH = width * 0.5f; - const auto heightH = height * 0.5f; - const auto intersectionCount = RectangleBoundingBoxData::rectangleIntersectsSegment( - xA, yA, xB, yB, - -widthH, -heightH, widthH, heightH, - intersectionPointA, intersectionPointB, normalRadians - ); - - return intersectionCount; -} - -int EllipseBoundingBoxData::ellipseIntersectsSegment( - float xA, float yA, float xB, float yB, - float xC, float yC, float widthH, float heightH, - Point* intersectionPointA, - Point* intersectionPointB, - Point* normalRadians -) -{ - const auto d = widthH / heightH; - const auto dd = d * d; - - yA *= d; - yB *= d; - - const auto dX = xB - xA; - const auto dY = yB - yA; - const auto lAB = sqrt(dX * dX + dY * dY); - const auto xD = dX / lAB; - const auto yD = dY / lAB; - const auto a = (xC - xA) * xD + (yC - yA) * yD; - const auto aa = a * a; - const auto ee = xA * xA + yA * yA; - const auto rr = widthH * widthH; - const auto dR = rr - ee + aa; - auto intersectionCount = 0; - - if (dR >= 0.0f) - { - const auto dT = sqrt(dR); - const auto sA = a - dT; - const auto sB = a + dT; - const auto inSideA = sA < 0.0f ? -1 : (sA <= lAB ? 0 : 1); - const auto inSideB = sB < 0.0f ? -1 : (sB <= lAB ? 0 : 1); - const auto sideAB = inSideA * inSideB; - - if (sideAB < 0) - { - return -1; - } - else if (sideAB == 0) - { - if (inSideA == -1) - { - intersectionCount = 2; // 10 - xB = xA + sB * xD; - yB = (yA + sB * yD) / d; - - if (intersectionPointA != nullptr) - { - intersectionPointA->x = xB; - intersectionPointA->y = yB; - } - - if (intersectionPointB != nullptr) - { - intersectionPointB->x = xB; - intersectionPointB->y = yB; - } - - if (normalRadians != nullptr) - { - normalRadians->x = atan2(yB / rr * dd, xB / rr); - normalRadians->y = normalRadians->x + Transform::PI; - } - } - else if (inSideB == 1) - { - intersectionCount = 1; // 01 - xA = xA + sA * xD; - yA = (yA + sA * yD) / d; - - if (intersectionPointA != nullptr) - { - intersectionPointA->x = xA; - intersectionPointA->y = yA; - } - - if (intersectionPointB != nullptr) - { - intersectionPointB->x = xA; - intersectionPointB->y = yA; - } - - if (normalRadians != nullptr) - { - normalRadians->x = atan2(yA / rr * dd, xA / rr); - normalRadians->y = normalRadians->x + Transform::PI; - } - } - else - { - intersectionCount = 3; // 11 - - if (intersectionPointA != nullptr) - { - intersectionPointA->x = xA + sA * xD; - intersectionPointA->y = (yA + sA * yD) / d; - - if (normalRadians != nullptr) - { - normalRadians->x = atan2(intersectionPointA->y / rr * dd, intersectionPointA->x / rr); - } - } - - if (intersectionPointB != nullptr) - { - intersectionPointB->x = xA + sB * xD; - intersectionPointB->y = (yA + sB * yD) / d; - - if (normalRadians != nullptr) - { - normalRadians->y = atan2(intersectionPointB->y / rr * dd, intersectionPointB->x / rr); - } - } - } - } - } - - return intersectionCount; -} - -void EllipseBoundingBoxData::_onClear() - -{ - BoundingBoxData::_onClear(); - - type = BoundingBoxType::Ellipse; -} - -bool EllipseBoundingBoxData::containsPoint(float pX, float pY) -{ - const auto widthH = width * 0.5f; - if (pX >= -widthH && pX <= widthH) - { - const auto heightH = height * 0.5f; - if (pY >= -heightH && pY <= heightH) - { - pY *= widthH / heightH; - return sqrt(pX * pX + pY * pY) <= widthH; - } - } - - return false; -} - -int EllipseBoundingBoxData::intersectsSegment( - float xA, float yA, float xB, float yB, - Point* intersectionPointA, - Point* intersectionPointB, - Point* normalRadians -) -{ - const auto intersectionCount = EllipseBoundingBoxData::ellipseIntersectsSegment( - xA, yA, xB, yB, - 0.0f, 0.0f, width * 0.5f, height * 0.5f, - intersectionPointA, intersectionPointB, normalRadians - ); - - return intersectionCount; -} - -int PolygonBoundingBoxData::polygonIntersectsSegment( - float xA, float yA, float xB, float yB, - const std::vector& vertices, - Point* intersectionPointA, - Point* intersectionPointB, - Point* normalRadians) -{ - if (xA == xB) - { - xA = xB + 0.000001f; - } - - if (yA == yB) - { - yA = yB + 0.000001f; - } - - const auto count = vertices.size(); - const auto dXAB = xA - xB; - const auto dYAB = yA - yB; - const auto llAB = xA * yB - yA * xB; - auto intersectionCount = 0; - auto xC = vertices[count - 2]; - auto yC = vertices[count - 1]; - auto dMin = 0.0f; - auto dMax = 0.0f; - auto xMin = 0.0f; - auto yMin = 0.0f; - auto xMax = 0.0f; - auto yMax = 0.0f; - - for (std::size_t i = 0; i < count; i += 2) - { - const auto xD = vertices[i]; - const auto yD = vertices[i + 1]; - - if (xC == xD) - { - xC = xD + 0.000001f; - } - - if (yC == yD) - { - yC = yD + 0.000001f; - } - - const auto dXCD = xC - xD; - const auto dYCD = yC - yD; - const auto llCD = xC * yD - yC * xD; - const auto ll = dXAB * dYCD - dYAB * dXCD; - const auto x = (llAB * dXCD - dXAB * llCD) / ll; - - if (((x >= xC && x <= xD) || (x >= xD && x <= xC)) && (dXAB == 0.0f || (x >= xA && x <= xB) || (x >= xB && x <= xA))) - { - const auto y = (llAB * dYCD - dYAB * llCD) / ll; - if (((y >= yC && y <= yD) || (y >= yD && y <= yC)) && (dYAB == 0.0f || (y >= yA && y <= yB) || (y >= yB && y <= yA))) - { - if (intersectionPointB != nullptr) - { - float d = x - xA; - if (d < 0.0f) - { - d = -d; - } - - if (intersectionCount == 0) - { - dMin = d; - dMax = d; - xMin = x; - yMin = y; - xMax = x; - yMax = y; - - if (normalRadians != nullptr) - { - normalRadians->x = atan2(yD - yC, xD - xC) - Transform::PI * 0.5f; - normalRadians->y = normalRadians->x; - } - } - else - { - if (d < dMin) - { - dMin = d; - xMin = x; - yMin = y; - - if (normalRadians != nullptr) - { - normalRadians->x = atan2(yD - yC, xD - xC) - Transform::PI * 0.5f; - } - } - - if (d > dMax) - { - dMax = d; - xMax = x; - yMax = y; - - if (normalRadians != nullptr) { - normalRadians->y = atan2(yD - yC, xD - xC) - Transform::PI * 0.5f; - } - } - } - - intersectionCount++; - } - else - { - xMin = x; - yMin = y; - xMax = x; - yMax = y; - intersectionCount++; - - if (normalRadians != nullptr) - { - normalRadians->x = atan2(yD - yC, xD - xC) - Transform::PI * 0.5f; - normalRadians->y = normalRadians->x; - } - break; - } - } - } - - xC = xD; - yC = yD; - } - - if (intersectionCount == 1) - { - if (intersectionPointA != nullptr) - { - intersectionPointA->x = xMin; - intersectionPointA->y = yMin; - } - - if (intersectionPointB != nullptr) - { - intersectionPointB->x = xMin; - intersectionPointB->y = yMin; - } - - if (normalRadians != nullptr) - { - normalRadians->y = normalRadians->x + Transform::PI; - } - } - else if (intersectionCount > 1) - { - intersectionCount++; - - if (intersectionPointA != nullptr) - { - intersectionPointA->x = xMin; - intersectionPointA->y = yMin; - } - - if (intersectionPointB != nullptr) - { - intersectionPointB->x = xMax; - intersectionPointB->y = yMax; - } - } - - return intersectionCount; -} - -void PolygonBoundingBoxData::_onClear() -{ - BoundingBoxData::_onClear(); - - if (weight != nullptr) - { - weight->returnToPool(); - } - - type = BoundingBoxType::Polygon; - x = 0.0f; - y = 0.0f; - vertices.clear(); - weight = nullptr; -} - -bool PolygonBoundingBoxData::containsPoint(float pX, float pY) -{ - auto isInSide = false; - if (pX >= x && pX <= width && pY >= y && pY <= height) - { - for (std::size_t i = 0, l = vertices.size(), iP = l - 2; i < l; i += 2) - { - const auto yA = vertices[iP + 1]; - const auto yB = vertices[i + 1]; - if ((yB < pY && yA >= pY) || (yA < pY && yB >= pY)) - { - const auto xA = vertices[iP]; - const auto xB = vertices[i]; - if ((pY - yB) * (xA - xB) / (yA - yB) + xB < pX) - { - isInSide = !isInSide; - } - } - - iP = i; - } - } - - return isInSide; -} - -int PolygonBoundingBoxData::intersectsSegment( - float xA, float yA, float xB, float yB, - Point* intersectionPointA, - Point* intersectionPointB, - Point* normalRadians -) -{ - auto intersectionCount = 0; - if (RectangleBoundingBoxData::rectangleIntersectsSegment(xA, yA, xB, yB, x, y, x + width, y + height, nullptr, nullptr, nullptr) != 0) { - intersectionCount = PolygonBoundingBoxData::polygonIntersectsSegment( - xA, yA, xB, yB, - vertices, - intersectionPointA, intersectionPointB, normalRadians - ); - } - - return intersectionCount; -} - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones/model/BoundingBoxData.h b/native/cocos/editor-support/dragonbones/model/BoundingBoxData.h deleted file mode 100644 index cb653ef73c..0000000000 --- a/native/cocos/editor-support/dragonbones/model/BoundingBoxData.h +++ /dev/null @@ -1,289 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONESCPP_BOUNDINGBOXDATA_H -#define DRAGONBONESCPP_BOUNDINGBOXDATA_H - -#include "../core/BaseObject.h" -#include "../geom/Point.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * - The base class of bounding box data. - * @see dragonBones.RectangleData - * @see dragonBones.EllipseData - * @see dragonBones.PolygonData - * @version DragonBones 5.0 - * @language en_US - */ -/** - * - 边界框数据基类。 - * @see dragonBones.RectangleData - * @see dragonBones.EllipseData - * @see dragonBones.PolygonData - * @version DragonBones 5.0 - * @language zh_CN - */ -class BoundingBoxData : public BaseObject -{ - ABSTRACT_CLASS(BoundingBoxData); - -public: - /** - * - The bounding box type. - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 边界框类型。 - * @version DragonBones 5.0 - * @language zh_CN - */ - BoundingBoxType type; - /** - * @private - */ - unsigned color; - /** - * @private - */ - float width; - /** - * @private - */ - float height; - -protected: - virtual void _onClear() override; - -public: - /** - * - Check whether the bounding box contains a specific point. (Local coordinate system) - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 检查边界框是否包含特定点。(本地坐标系) - * @version DragonBones 5.0 - * @language zh_CN - */ - virtual bool containsPoint(float pX, float pY) = 0; - /** - * - Check whether the bounding box intersects a specific segment. (Local coordinate system) - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 检查边界框是否与特定线段相交。(本地坐标系) - * @version DragonBones 5.0 - * @language zh_CN - */ - virtual int intersectsSegment( - float xA, float yA, float xB, float yB, - Point* intersectionPointA = nullptr, - Point* intersectionPointB = nullptr, - Point* normalRadians = nullptr - ) = 0; - -public: // For WebAssembly. - int getType() const { return (int)type; } - void setType(int value) { type = (BoundingBoxType)value; } -}; -/** - * - The rectangle bounding box data. - * @version DragonBones 5.1 - * @language en_US - */ -/** - * - 矩形边界框数据。 - * @version DragonBones 5.1 - * @language zh_CN - */ -class RectangleBoundingBoxData : public BoundingBoxData -{ - BIND_CLASS_TYPE_A(RectangleBoundingBoxData); - -private: - enum OutCode { - InSide = 0, // 0000 - Left = 1, // 0001 - Right = 2, // 0010 - Top = 4, // 0100 - Bottom = 8 // 1000 - }; - /** - * - Compute the bit code for a point (x, y) using the clip rectangle - */ - static int _computeOutCode(float x, float y, float xMin, float yMin, float xMax, float yMax); - -public: - /** - * @private - */ - static int rectangleIntersectsSegment( - float xA, float yA, float xB, float yB, - float xMin, float yMin, float xMax, float yMax, - Point* intersectionPointA = nullptr, - Point* intersectionPointB = nullptr, - Point* normalRadians = nullptr - ); - /** - * @inheritDoc - */ - virtual bool containsPoint(float pX, float pY) override; - /** - * @inheritDoc - */ - virtual int intersectsSegment( - float xA, float yA, float xB, float yB, - Point* intersectionPointA = nullptr, - Point* intersectionPointB = nullptr, - Point* normalRadians = nullptr - ) override; - -protected: - virtual void _onClear() override; -}; -/** - * - The ellipse bounding box data. - * @version DragonBones 5.1 - * @language en_US - */ -/** - * - 椭圆边界框数据。 - * @version DragonBones 5.1 - * @language zh_CN - */ -class EllipseBoundingBoxData : public BoundingBoxData -{ - BIND_CLASS_TYPE_A(EllipseBoundingBoxData); - -public: - /** - * @private - */ - static int ellipseIntersectsSegment( - float xA, float yA, float xB, float yB, - float xC, float yC, float widthH, float heightH, - Point* intersectionPointA = nullptr, - Point* intersectionPointB = nullptr, - Point* normalRadians = nullptr - ); - /** - * @inheritDoc - */ - virtual bool containsPoint(float pX, float pY) override; - /** - * @inheritDoc - */ - virtual int intersectsSegment( - float xA, float yA, float xB, float yB, - Point* intersectionPointA = nullptr, - Point* intersectionPointB = nullptr, - Point* normalRadians = nullptr - ) override; - -protected: - virtual void _onClear() override; -}; -/** - * - The polygon bounding box data. - * @version DragonBones 5.1 - * @language en_US - */ -/** - * - 多边形边界框数据。 - * @version DragonBones 5.1 - * @language zh_CN - */ -class PolygonBoundingBoxData : public BoundingBoxData -{ - BIND_CLASS_TYPE_B(PolygonBoundingBoxData); - -public: - /** - * @private - */ - static int polygonIntersectsSegment( - float xA, float yA, float xB, float yB, - const std::vector& vertices, - Point* intersectionPointA = nullptr, - Point* intersectionPointB = nullptr, - Point* normalRadians = nullptr - ); - /** - * @private - */ - float x; - /** - * @private - */ - float y; - /** - * - The polygon vertices. - * @version DragonBones 5.1 - * @language en_US - */ - /** - * - 多边形顶点。 - * @version DragonBones 5.1 - * @language zh_CN - */ - std::vector vertices; - WeightData* weight; - /** - * @inheritDoc - */ - virtual bool containsPoint(float pX, float pY) override; - /** - * @inheritDoc - */ - virtual int intersectsSegment( - float xA, float yA, float xB, float yB, - Point* intersectionPointA = nullptr, - Point* intersectionPointB = nullptr, - Point* normalRadians = nullptr - ) override; - - PolygonBoundingBoxData() : - weight(nullptr) - { - _onClear(); - } - ~PolygonBoundingBoxData() - { - _onClear(); - } - -protected: - virtual void _onClear() override; - -public: // For WebAssembly. - std::vector* getVertices() { return &vertices; } - - /*WeightData* getWeight() const { return weight; } - void setWeight(WeightData* value) { weight = value; } - */ -}; - -DRAGONBONES_NAMESPACE_END -#endif //DRAGONBONESCPP_BOUNDINGBOXDATA_H diff --git a/native/cocos/editor-support/dragonbones/model/CanvasData.cpp b/native/cocos/editor-support/dragonbones/model/CanvasData.cpp deleted file mode 100644 index 722ffd4a7e..0000000000 --- a/native/cocos/editor-support/dragonbones/model/CanvasData.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include "CanvasData.h" - -DRAGONBONES_NAMESPACE_BEGIN - -void CanvasData::_onClear() -{ - hasBackground = false; - color = 0x000000; - aabb.clear(); -} - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones/model/CanvasData.h b/native/cocos/editor-support/dragonbones/model/CanvasData.h deleted file mode 100644 index 954c769eb6..0000000000 --- a/native/cocos/editor-support/dragonbones/model/CanvasData.h +++ /dev/null @@ -1,46 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_CANVAS_DATA_H -#define DRAGONBONES_CANVAS_DATA_H - -#include "../core/BaseObject.h" -#include "../geom/Rectangle.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * @internal - */ -class CanvasData : public BaseObject -{ - BIND_CLASS_TYPE_A(CanvasData); - -public: - bool hasBackground; - unsigned color; - Rectangle aabb; - -protected: - virtual void _onClear() override; -}; -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_CANVAS_DATA_H diff --git a/native/cocos/editor-support/dragonbones/model/ConstraintData.cpp b/native/cocos/editor-support/dragonbones/model/ConstraintData.cpp deleted file mode 100644 index 5dde00a540..0000000000 --- a/native/cocos/editor-support/dragonbones/model/ConstraintData.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// -// Created by liangshuochen on 09/06/2017. -// - -#include "ConstraintData.h" - -DRAGONBONES_NAMESPACE_BEGIN - -void ConstraintData::_onClear() -{ - order = 0; - name = ""; - target = nullptr; - root = nullptr; - bone = nullptr; -} - -void IKConstraintData::_onClear() -{ - ConstraintData::_onClear(); - - scaleEnabled = false; - bendPositive = false; - weight = 1.0f; -} - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones/model/ConstraintData.h b/native/cocos/editor-support/dragonbones/model/ConstraintData.h deleted file mode 100644 index 8483a6b6db..0000000000 --- a/native/cocos/editor-support/dragonbones/model/ConstraintData.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -// -// Created by liangshuochen on 09/06/2017. -// - -#ifndef DRAGONBONESCPP_CONSTRAINTDATA_H -#define DRAGONBONESCPP_CONSTRAINTDATA_H - -#include "../core/BaseObject.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * @internal - */ -class ConstraintData : public BaseObject -{ - ABSTRACT_CLASS(ConstraintData) - -public: - int order; - std::string name; - const BoneData* target; - const BoneData* root; - const BoneData* bone; - -protected: - virtual void _onClear() override; - -public: // For WebAssembly. - const BoneData* getTarget() const { return target; } - void setTarget(const BoneData* value) { target = value; } - - const BoneData* getBone() const { return bone; } - void setBone(const BoneData* value) { bone = value; } - - const BoneData* getRoot() const { return root; } - void setRoot(const BoneData* value) { root = value; } -}; -/** - * @internal - */ -class IKConstraintData : public ConstraintData -{ - BIND_CLASS_TYPE_A(IKConstraintData); - -public: - bool scaleEnabled; - bool bendPositive; - float weight; - -protected: - virtual void _onClear() override; -}; - -DRAGONBONES_NAMESPACE_END -#endif //DRAGONBONESCPP_CONSTRAINTDATA_H diff --git a/native/cocos/editor-support/dragonbones/model/DisplayData.cpp b/native/cocos/editor-support/dragonbones/model/DisplayData.cpp deleted file mode 100644 index 66e67e6814..0000000000 --- a/native/cocos/editor-support/dragonbones/model/DisplayData.cpp +++ /dev/null @@ -1,103 +0,0 @@ -// -// Created by liangshuochen on 08/06/2017. -// - -#include "DisplayData.h" -#include "UserData.h" -#include "BoundingBoxData.h" - -DRAGONBONES_NAMESPACE_BEGIN - -void VerticesData::clear() -{ - if (!isShared && weight != nullptr) - { - weight->returnToPool(); - } - - isShared = false; - inheritDeform = false; - offset = 0; - data = nullptr; - weight = nullptr; -} - -void VerticesData::shareFrom(const VerticesData& value) -{ - isShared = true; - offset = value.offset; - weight = value.weight; -} - -void DisplayData::_onClear() -{ - name = ""; - path = ""; - transform.identity(); - parent = nullptr; -} - -void ImageDisplayData::_onClear() -{ - DisplayData::_onClear(); - - type = DisplayType::Image; - pivot.clear(); - texture = nullptr; -} - -void ArmatureDisplayData::_onClear() -{ - DisplayData::_onClear(); - - for(const auto action : actions) - { - action->returnToPool(); - } - - type = DisplayType::Armature; - inheritAnimation = false; - actions.clear(); - armature = nullptr; -} - -void ArmatureDisplayData::addAction(ActionData* value) -{ - actions.push_back(value); -} - -void MeshDisplayData::_onClear() -{ - DisplayData::_onClear(); - - type = DisplayType::Mesh; - vertices.clear(); - texture = nullptr; -} - -void BoundingBoxDisplayData::_onClear() -{ - DisplayData::_onClear(); - - if(boundingBox != nullptr) - { - boundingBox->returnToPool(); - } - - type = DisplayType::BoundingBox; - boundingBox = nullptr; -} - -void WeightData::_onClear() -{ - count = 0; - offset = 0; - bones.clear(); -} - -void WeightData::addBone(BoneData* value) -{ - bones.push_back(value); -} - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones/model/DisplayData.h b/native/cocos/editor-support/dragonbones/model/DisplayData.h deleted file mode 100644 index 2e441d8917..0000000000 --- a/native/cocos/editor-support/dragonbones/model/DisplayData.h +++ /dev/null @@ -1,192 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONESCPP_DISPLAYDATA_H -#define DRAGONBONESCPP_DISPLAYDATA_H - -#include "../core/BaseObject.h" -#include "../geom/Transform.h" -#include "BoundingBoxData.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * @internal - */ -class VerticesData -{ -public: - bool isShared; - bool inheritDeform; - unsigned offset; - DragonBonesData* data; - WeightData* weight; - - VerticesData() : - weight(nullptr) - { - } - ~VerticesData() - { - } - - void clear(); - void shareFrom(const VerticesData& value); -}; -/** - * @internal - */ -class DisplayData : public BaseObject -{ - ABSTRACT_CLASS(DisplayData) - -public: - DisplayType type; - std::string name; - std::string path; - Transform transform; - SkinData* parent; - -protected: - virtual void _onClear() override; - -public: // For WebAssembly. - int getType() const { return (int)type; } - void setType(int value) { type = (DisplayType)value; } - - Transform* getTransform() { return &transform; } - - SkinData* getParent() const { return parent; } - void setParent(SkinData* value) { parent = value; } -}; -/** - * @internal - */ -class ImageDisplayData : public DisplayData -{ - BIND_CLASS_TYPE_A(ImageDisplayData); - -public: - Point pivot; - TextureData* texture; - -protected: - virtual void _onClear() override; - -public: // For WebAssembly. - Point* getPivot() { return &pivot; } - - TextureData* getTexture() const { return texture; } - void setTexture(TextureData* value) { texture = value; } -}; -/** - * @internal - */ -class ArmatureDisplayData : public DisplayData -{ - BIND_CLASS_TYPE_A(ArmatureDisplayData); - -public: - bool inheritAnimation; - std::vector actions; - ArmatureData* armature; - -protected: - virtual void _onClear() override; - -public: - /** - * @private - */ - void addAction(ActionData* value); - -public: // For WebAssembly. - const std::vector& getActions() const { return actions; } - - ArmatureData* getArmature() const { return armature; } - void setArmature(ArmatureData* value) { armature = value; } -}; -/** - * @internal - */ -class MeshDisplayData : public DisplayData -{ - BIND_CLASS_TYPE_A(MeshDisplayData); - -public: - VerticesData vertices; - TextureData* texture; - -protected: - virtual void _onClear() override; -}; -/** - * @internal - */ -class BoundingBoxDisplayData : public DisplayData -{ - BIND_CLASS_TYPE_B(BoundingBoxDisplayData); - -public: - BoundingBoxData* boundingBox; - - BoundingBoxDisplayData() : - boundingBox(nullptr) - { - _onClear(); - } - ~BoundingBoxDisplayData() - { - _onClear(); - } - -protected: - virtual void _onClear() override; - -public: // For WebAssembly. - const BoundingBoxData* getBoundingBox() const { return boundingBox; } - void setBoundingBox(BoundingBoxData* value) { boundingBox = value; } -}; -/** - * @internal - */ -class WeightData : public BaseObject -{ - BIND_CLASS_TYPE_A(WeightData); - -public: - unsigned count; - unsigned offset; - std::vector bones; - -protected: - virtual void _onClear() override; - -public: - void addBone(BoneData* value); - -public: // For WebAssembly. - const std::vector& getBones() const { return bones; } -}; - -DRAGONBONES_NAMESPACE_END - -#endif //DRAGONBONESCPP_DISPLAYDATA_H diff --git a/native/cocos/editor-support/dragonbones/model/DragonBonesData.cpp b/native/cocos/editor-support/dragonbones/model/DragonBonesData.cpp deleted file mode 100644 index c5fe80910d..0000000000 --- a/native/cocos/editor-support/dragonbones/model/DragonBonesData.cpp +++ /dev/null @@ -1,56 +0,0 @@ -#include "DragonBonesData.h" -#include "UserData.h" -#include "ArmatureData.h" - - -DRAGONBONES_NAMESPACE_BEGIN - -void DragonBonesData::_onClear() -{ - for (const auto& pair : armatures) - { - pair.second->returnToPool(); - } - - if (binary != nullptr) - { - delete binary; - } - - if (userData != nullptr) - { - userData->returnToPool(); - } - - autoSearch = false; - frameRate = 0; - version = ""; - name = ""; - frameIndices.clear(); - cachedFrames.clear(); - armatureNames.clear(); - armatures.clear(); - binary = nullptr; - intArray = nullptr; - floatArray = nullptr; - frameIntArray = nullptr; - frameFloatArray = nullptr; - frameArray = nullptr; - timelineArray = nullptr; - userData = nullptr; -} - -void DragonBonesData::addArmature(ArmatureData* value) -{ - if (armatures.find(value->name) != armatures.end()) - { - DRAGONBONES_ASSERT(false, "Same armature: " + value->name); - return; - } - - value->parent = this; - armatures[value->name] = value; - armatureNames.push_back(value->name); -} - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones/model/DragonBonesData.h b/native/cocos/editor-support/dragonbones/model/DragonBonesData.h deleted file mode 100644 index d498b27dd1..0000000000 --- a/native/cocos/editor-support/dragonbones/model/DragonBonesData.h +++ /dev/null @@ -1,193 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_DRAGONBONES_DATA_H -#define DRAGONBONES_DRAGONBONES_DATA_H - -#include "../core/BaseObject.h" -#include "ArmatureData.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * - The DragonBones data. - * A DragonBones data contains multiple armature data. - * @see dragonBones.ArmatureData - * @version DragonBones 3.0 - * @language en_US - */ -/** - * - 龙骨数据。 - * 一个龙骨数据包含多个骨架数据。 - * @see dragonBones.ArmatureData - * @version DragonBones 3.0 - * @language zh_CN - */ -class DragonBonesData : public BaseObject -{ - BIND_CLASS_TYPE_B(DragonBonesData); - -public: - /** - * @private - */ - bool autoSearch; - /** - * - The animation frame rate. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 动画帧频。 - * @version DragonBones 3.0 - * @language zh_CN - */ - unsigned frameRate; - /** - * - The data version. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 数据版本。 - * @version DragonBones 3.0 - * @language zh_CN - */ - std::string version; - /** - * - The DragonBones data name. - * The name is consistent with the DragonBones project name. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 龙骨数据名称。 - * 该名称与龙骨项目名保持一致。 - * @version DragonBones 3.0 - * @language zh_CN - */ - std::string name; - /** - * @internal - */ - std::vector frameIndices; - /** - * @internal - */ - std::vector cachedFrames; - /** - * - All armature data names. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 所有的骨架数据名称。 - * @version DragonBones 3.0 - * @language zh_CN - */ - std::vector armatureNames; - /** - * @private - */ - std::map armatures; - /** - * @internal - */ - const char* binary; - /** - * @internal - */ - const int16_t* intArray; - /** - * @internal - */ - const float* floatArray; - /** - * @internal - */ - const int16_t* frameIntArray; - /** - * @internal - */ - const float* frameFloatArray; - /** - * @internal - */ - const int16_t* frameArray; - /** - * @internal - */ - const uint16_t* timelineArray; - /** - * @private - */ - UserData* userData; - DragonBonesData() : - binary(nullptr), - userData(nullptr) - { - _onClear(); - } - ~DragonBonesData() - { - _onClear(); - } - /** - * @internal - */ - void addArmature(ArmatureData* value); - /** - * - Get a specific armature data. - * @param armatureName - The armature data name. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 获取特定的骨架数据。 - * @param armatureName - 骨架数据名称。 - * @version DragonBones 3.0 - * @language zh_CN - */ - inline ArmatureData* getArmature(const std::string& armatureName) const - { - return mapFind(armatures, armatureName); - } - -protected: - virtual void _onClear() override; - -public: // For WebAssembly. - std::vector* getFrameIndices() { return &frameIndices; } - const std::vector& getArmatureNames() const { return armatureNames; } - -#if EGRET_WASM - unsigned getBinary() const - { - return (unsigned)binary; - } -#endif // EGRET_WASM - - const UserData* getUserData() const { return userData; } - void setUserData(UserData* value) { userData = value; } -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_DRAGONBONES_DATA_H diff --git a/native/cocos/editor-support/dragonbones/model/SkinData.cpp b/native/cocos/editor-support/dragonbones/model/SkinData.cpp deleted file mode 100644 index e3b1883595..0000000000 --- a/native/cocos/editor-support/dragonbones/model/SkinData.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include "SkinData.h" -#include "DisplayData.h" - -DRAGONBONES_NAMESPACE_BEGIN - -void SkinData::_onClear() -{ - for (const auto& pair : displays) - { - for (const auto display : pair.second) - { - if (display != nullptr) - { - display->returnToPool(); - } - } - } - - name = ""; - displays.clear(); - parent = nullptr; -} - -void SkinData::addDisplay(const std::string& slotName, DisplayData* value) -{ - if (value != nullptr) - { - value->parent = this; - } - - displays[slotName].push_back(value); // TODO clear prev -} - -DisplayData* SkinData::getDisplay(const std::string& slotName, const std::string& displayName) -{ - const auto slotDisplays = getDisplays(slotName); - if (slotDisplays != nullptr) - { - for (const auto display : *slotDisplays) - { - if (display != nullptr && display->name == displayName) - { - return display; - } - } - } - - return nullptr; -} - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones/model/SkinData.h b/native/cocos/editor-support/dragonbones/model/SkinData.h deleted file mode 100644 index 14daef6e76..0000000000 --- a/native/cocos/editor-support/dragonbones/model/SkinData.h +++ /dev/null @@ -1,89 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_SKIN_DATA_H -#define DRAGONBONES_SKIN_DATA_H - -#include "../core/BaseObject.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * - The skin data, typically a armature data instance contains at least one skinData. - * @version DragonBones 3.0 - * @language en_US - */ -/** - * - 皮肤数据,通常一个骨架数据至少包含一个皮肤数据。 - * @version DragonBones 3.0 - * @language zh_CN - */ -class SkinData : public BaseObject -{ - BIND_CLASS_TYPE_A(SkinData); - -public: - /** - * - The skin name. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 皮肤名称。 - * @version DragonBones 3.0 - * @language zh_CN - */ - std::string name; - /** - * @private - */ - std::map> displays; - /** - * @private - */ - ArmatureData* parent; - -protected: - virtual void _onClear() override; - -public: - /** - * @internal - */ - void addDisplay(const std::string& slotName, DisplayData* value); - /** - * @private - */ - DisplayData* getDisplay(const std::string& slotName, const std::string& displayName); - /** - * @private - */ - std::vector* getDisplays(const std::string& slotName) - { - return mapFindB(displays, slotName); - } - -public: // For WebAssembly. TODO parent - const std::map>& getSlotDisplays() const { return displays; } -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_SKIN_DATA_H diff --git a/native/cocos/editor-support/dragonbones/model/TextureAtlasData.cpp b/native/cocos/editor-support/dragonbones/model/TextureAtlasData.cpp deleted file mode 100644 index 207c864522..0000000000 --- a/native/cocos/editor-support/dragonbones/model/TextureAtlasData.cpp +++ /dev/null @@ -1,105 +0,0 @@ -#include "TextureAtlasData.h" - -DRAGONBONES_NAMESPACE_BEGIN - -void TextureAtlasData::_onClear() -{ - for (const auto& pair : textures) - { - pair.second->returnToPool(); - } - - autoSearch = false; - format = TextureFormat::DEFAULT; - width = 0; - height = 0; - scale = 1.0f; - name = ""; - imagePath.clear(); - textures.clear(); -} - -void TextureAtlasData::copyFrom(const TextureAtlasData& value) -{ - autoSearch = value.autoSearch; - format = value.format; - width = value.width; - height = value.height; - scale = value.scale; - name = value.name; - imagePath = value.imagePath; - - for (const auto& pair : textures) - { - pair.second->returnToPool(); - } - - textures.clear(); - - for (const auto& pair : value.textures) - { - const auto texture = createTexture(); - texture->copyFrom(*(pair.second)); - textures[pair.first] = texture; - } -} - -void TextureAtlasData::addTexture(TextureData* value) -{ - if (textures.find(value->name) != textures.cend()) - { - DRAGONBONES_ASSERT(false, "Same texture: " + value->name); - return; - } - - textures[value->name] = value; - value->parent = this; -} - -Rectangle* TextureData::createRectangle() -{ - return new Rectangle(); -} - -TextureData::~TextureData() -{ -} - -void TextureData::_onClear() -{ - if (frame != nullptr) - { - delete frame; - } - - rotated = false; - name = ""; - region.clear(); - parent = nullptr; - frame = nullptr; -} - -void TextureData::copyFrom(const TextureData &value) -{ - rotated = value.rotated; - name = value.name; - region = value.region; // Copy. - parent = value.parent; - - if (frame == nullptr && value.frame != nullptr) - { - frame = TextureData::createRectangle(); - } - else if (frame != nullptr && value.frame == nullptr) - { - delete frame; - frame = nullptr; - } - - if (frame != nullptr && value.frame != nullptr) - { - *frame = *(value.frame); // Copy. - } -} - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones/model/TextureAtlasData.h b/native/cocos/editor-support/dragonbones/model/TextureAtlasData.h deleted file mode 100644 index 6458dc994b..0000000000 --- a/native/cocos/editor-support/dragonbones/model/TextureAtlasData.h +++ /dev/null @@ -1,148 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_TEXTUREATLAS_DATA_H -#define DRAGONBONES_TEXTUREATLAS_DATA_H - -#include "../core/BaseObject.h" -#include "../geom/Rectangle.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * - The texture atlas data. - * @version DragonBones 3.0 - * @language en_US - */ -/** - * - 贴图集数据。 - * @version DragonBones 3.0 - * @language zh_CN - */ -class TextureAtlasData : public BaseObject -{ - ABSTRACT_CLASS(TextureAtlasData); - -public: - /** - * @private - */ - bool autoSearch; - TextureFormat format; - /** - * @private - */ - unsigned width; - /** - * @private - */ - unsigned height; - /** - * @private - */ - float scale; - /** - * - The texture atlas name. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 贴图集名称。 - * @version DragonBones 3.0 - * @language zh_CN - */ - std::string name; - /** - * - The image path of the texture atlas. - * @version DragonBones 3.0 - * @language en_US - */ - /** - * - 贴图集图片路径。 - * @version DragonBones 3.0 - * @language zh_CN - */ - std::string imagePath; - /** - * @private - */ - std::map textures; - /** - * @private - */ - void copyFrom(const TextureAtlasData& value); - /** - * @internal - */ - virtual TextureData* createTexture() const = 0; - /** - * @internal - */ - virtual void addTexture(TextureData* value); - /** - * @private - */ - inline TextureData* getTexture(const std::string& textureName) const - { - return mapFind(textures, textureName); - } - -protected: - virtual void _onClear() override; - -public: // For WebAssembly. - const std::map& getTextures() const { return textures; } -}; -/** - * @internal - */ -class TextureData : public BaseObject -{ -public: - static Rectangle* createRectangle(); - -public: - bool rotated; - std::string name; - Rectangle region; - Rectangle* frame; - TextureAtlasData* parent; - - TextureData() : - frame(nullptr) - {} - virtual ~TextureData() = 0; - - void copyFrom(const TextureData& value); - -protected: - virtual void _onClear() override; - -public: // For WebAssembly. - Rectangle* getRegion() { return ®ion; } - const Rectangle* getFrame() const { return frame; } - void setFrame(Rectangle* value) { frame = value; } - const TextureAtlasData* getParent() const { return parent; } - void setParent(TextureAtlasData* value) { parent = value; } -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_TEXTUREATLAS_DATA_H diff --git a/native/cocos/editor-support/dragonbones/model/UserData.cpp b/native/cocos/editor-support/dragonbones/model/UserData.cpp deleted file mode 100644 index b197980d63..0000000000 --- a/native/cocos/editor-support/dragonbones/model/UserData.cpp +++ /dev/null @@ -1,56 +0,0 @@ -#include "UserData.h" - -DRAGONBONES_NAMESPACE_BEGIN - -void UserData::_onClear() -{ - ints.clear(); - floats.clear(); - strings.clear(); -} - -void UserData::addInt(int value) -{ - ints.push_back(value); -} - -void UserData::addFloat(float value) -{ - floats.push_back(value); -} - -void UserData::addString(std::string value) -{ - strings.push_back(value); -} - -int UserData::getInt(unsigned index) const -{ - return index < ints.size() ? ints[index] : 0; -} - -float UserData::getFloat(unsigned index) const -{ - return index < floats.size() ? floats[index] : 0; -} - -std::string UserData::getString(unsigned index) const -{ - return index < strings.size() ? strings[index] : 0; -} - -void ActionData::_onClear() -{ - if (data != nullptr) - { - data->returnToPool(); - } - - type = ActionType::Play; - name = ""; - bone = nullptr; - slot = nullptr; - data = nullptr; -} - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones/model/UserData.h b/native/cocos/editor-support/dragonbones/model/UserData.h deleted file mode 100644 index 68b4e4b24e..0000000000 --- a/native/cocos/editor-support/dragonbones/model/UserData.h +++ /dev/null @@ -1,175 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_USER_DATA_H -#define DRAGONBONES_USER_DATA_H - -#include "../core/BaseObject.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * - The user custom data. - * @version DragonBones 5.0 - * @language en_US - */ -/** - * - 用户自定义数据。 - * @version DragonBones 5.0 - * @language zh_CN - */ -class UserData : public BaseObject -{ - BIND_CLASS_TYPE_A(UserData); - -public: - /** - * - The custom int numbers. - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 自定义整数。 - * @version DragonBones 5.0 - * @language zh_CN - */ - std::vector ints; - /** - * - The custom float numbers. - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 自定义浮点数。 - * @version DragonBones 5.0 - * @language zh_CN - */ - std::vector floats; - /** - * - The custom strings. - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 自定义字符串。 - * @version DragonBones 5.0 - * @language zh_CN - */ - std::vector strings; - -protected: - virtual void _onClear() override; - -public: - /** - * @internal - */ - void addInt(int value); - /** - * @internal - */ - void addFloat(float value); - /** - * @internal - */ - void addString(std::string value); - /** - * - Get the custom int number. - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 获取自定义整数。 - * @version DragonBones 5.0 - * @language zh_CN - */ - int getInt(unsigned index) const; - /** - * - Get the custom float number. - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 获取自定义浮点数。 - * @version DragonBones 5.0 - * @language zh_CN - */ - float getFloat(unsigned index) const; - /** - * - Get the custom string. - * @version DragonBones 5.0 - * @language en_US - */ - /** - * - 获取自定义字符串。 - * @version DragonBones 5.0 - * @language zh_CN - */ - std::string getString(unsigned index) const; - -public: // For WebAssembly. - const std::vector& getInts() const { return ints; } - const std::vector& getFloats() const { return floats; } - const std::vector& getStrings() const { return strings; } -}; -/** - * @internal - */ -class ActionData : public BaseObject -{ - BIND_CLASS_TYPE_B(ActionData); - -public: - ActionType type; - std::string name; - const BoneData* bone; - const SlotData* slot; - UserData* data; - - ActionData() : - data(nullptr) - { - _onClear(); - } - virtual ~ActionData() - { - _onClear(); - } - -protected: - virtual void _onClear() override; - -public: // For WebAssembly. - int getType() const { return (int)type; } - void setType(int value) { type = (ActionType)value; } - - const BoneData* getBone() const { return bone; } - void setBone(const BoneData* value) { bone = value; } - - const SlotData* getSlot() const { return slot; } - void setSlot(const SlotData* value) { slot = value; } - - const UserData* getData() const { return data; } - void setData(UserData* value) { data = value; } -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_USER_DATA_H diff --git a/native/cocos/editor-support/dragonbones/parser/BinaryDataParser.cpp b/native/cocos/editor-support/dragonbones/parser/BinaryDataParser.cpp deleted file mode 100644 index 515c43b1ed..0000000000 --- a/native/cocos/editor-support/dragonbones/parser/BinaryDataParser.cpp +++ /dev/null @@ -1,237 +0,0 @@ -#include "BinaryDataParser.h" - -DRAGONBONES_NAMESPACE_BEGIN - -TimelineData* BinaryDataParser::_parseBinaryTimeline(TimelineType type, unsigned offset, TimelineData* timelineData) -{ - const auto timeline = timelineData != nullptr ? timelineData : BaseObject::borrowObject(); - timeline->type = type; - timeline->offset = offset; - - _timeline = timeline; - - const auto keyFrameCount = (unsigned)_timelineArray[timeline->offset + (unsigned)BinaryOffset::TimelineKeyFrameCount]; - if (keyFrameCount == 1) - { - timeline->frameIndicesOffset = -1; - } - else - { - unsigned frameIndicesOffset = 0; - const auto totalFrameCount = _animation->frameCount + 1; // One more frame than animation. - auto& frameIndices = _data->frameIndices; - - frameIndicesOffset = frameIndices.size(); - timeline->frameIndicesOffset = frameIndicesOffset; - frameIndices.resize(frameIndicesOffset + totalFrameCount); - - for ( - std::size_t i = 0, iK = 0, frameStart = 0, frameCount = 0; - i < totalFrameCount; - ++i - ) - { - if (frameStart + frameCount <= i && iK < keyFrameCount) - { - frameStart = _frameArray[_animation->frameOffset + _timelineArray[timeline->offset + (unsigned)BinaryOffset::TimelineFrameOffset + iK]]; - if (iK == keyFrameCount - 1) - { - frameCount = _animation->frameCount - frameStart; - } - else - { - frameCount = _frameArray[_animation->frameOffset + _timelineArray[timeline->offset + (unsigned)BinaryOffset::TimelineFrameOffset + iK + 1]] - frameStart; - } - - iK++; - } - - frameIndices[frameIndicesOffset + i] = iK - 1; - } - } - - _timeline = nullptr; - - return timeline; -} - -void BinaryDataParser::_parseVertices(const rapidjson::Value& rawData, VerticesData& vertices) -{ - vertices.offset = rawData[OFFSET].GetUint(); - - const auto weightOffset = _intArray[vertices.offset + (unsigned)BinaryOffset::MeshWeightOffset]; - if (weightOffset >= 0) - { - const auto weight = BaseObject::borrowObject(); - const auto vertexCount = _intArray[vertices.offset + (unsigned)BinaryOffset::MeshVertexCount]; - const auto boneCount = (unsigned)_intArray[weightOffset + (unsigned)BinaryOffset::WeigthBoneCount]; - weight->offset = weightOffset; - - for (std::size_t i = 0; i < boneCount; ++i) - { - const auto boneIndex = _intArray[weightOffset + (unsigned)BinaryOffset::WeigthBoneIndices + i]; - weight->addBone(_rawBones[boneIndex]); - } - - auto boneIndicesOffset = weightOffset + (unsigned)BinaryOffset::WeigthBoneIndices + boneCount; - unsigned weightCount = 0; - for (std::size_t i = 0, l = vertexCount; i < l; ++i) - { - const auto vertexBoneCount = (unsigned)_intArray[boneIndicesOffset++]; - weightCount += vertexBoneCount; - boneIndicesOffset += vertexBoneCount; - } - - weight->count = weightCount; - vertices.weight = weight; - } -} - -void BinaryDataParser::_parseMesh(const rapidjson::Value& rawData, MeshDisplayData& mesh) -{ - _parseVertices(rawData, mesh.vertices); -} - -AnimationData* BinaryDataParser::_parseAnimation(const rapidjson::Value& rawData) -{ - const auto animation = BaseObject::borrowObject(); - animation->frameCount = std::max(_getNumber(rawData, DURATION, 1), 1); - animation->playTimes = _getNumber(rawData, PLAY_TIMES, 1); - animation->duration = (float)(animation->frameCount) / _armature->frameRate; // float - animation->fadeInTime = _getNumber(rawData, FADE_IN_TIME, 0.0f); - animation->scale = _getNumber(rawData, SCALE, 1.0f); - animation->name = _getString(rawData, NAME, DEFAULT_NAME); - if (animation->name.empty()) - { - animation->name = DEFAULT_NAME; - } - - // Offsets. - const auto& offsets = rawData[OFFSET]; - animation->frameIntOffset = offsets[0].GetUint(); - animation->frameFloatOffset = offsets[1].GetUint(); - animation->frameOffset = offsets[2].GetUint(); - - _animation = animation; - - if (rawData.HasMember(ACTION)) - { - animation->actionTimeline = _parseBinaryTimeline(TimelineType::Action, rawData[ACTION].GetUint()); - } - - if (rawData.HasMember(Z_ORDER)) - { - animation->zOrderTimeline = _parseBinaryTimeline(TimelineType::ZOrder, rawData[Z_ORDER].GetUint()); - } - - if (rawData.HasMember(BONE)) - { - const auto& rawTimeliness = rawData[BONE]; - for (auto iterator = rawTimeliness.MemberBegin(); iterator != rawTimeliness.MemberEnd(); ++iterator) - { - const auto bone = _armature->getBone(iterator->name.GetString()); - if (bone == nullptr) - { - continue; - } - - const auto& rawTimelines = *&(iterator->value); - for (std::size_t i = 0, l = rawTimelines.Size(); i < l; i += 2) - { - const auto timelineType = (TimelineType)rawTimelines[i].GetInt(); - const auto timelineOffset = rawTimelines[i + 1].GetUint(); - const auto timeline = _parseBinaryTimeline(timelineType, timelineOffset); - _animation->addBoneTimeline(bone, timeline); - } - } - } - - if (rawData.HasMember(SLOT)) - { - const auto& rawTimeliness = rawData[SLOT]; - for (auto iterator = rawTimeliness.MemberBegin(); iterator != rawTimeliness.MemberEnd(); ++iterator) - { - const auto slot = _armature->getSlot(iterator->name.GetString()); - if (slot == nullptr) - { - continue; - } - - const auto& rawTimelines = *&(iterator->value); - for (std::size_t i = 0, l = rawTimelines.Size(); i < l; i += 2) - { - const auto timelineType = (TimelineType)rawTimelines[i].GetInt(); - const auto timelineOffset = rawTimelines[i + 1].GetUint(); - const auto timeline = _parseBinaryTimeline(timelineType, timelineOffset); - _animation->addSlotTimeline(slot, timeline); - } - } - } - - if (rawData.HasMember(CONSTRAINT)) - { - const auto& rawTimeliness = rawData[CONSTRAINT]; - for (auto iterator = rawTimeliness.MemberBegin(); iterator != rawTimeliness.MemberEnd(); ++iterator) - { - const auto constraint = _armature->getConstraint(iterator->name.GetString()); - if (constraint == nullptr) - { - continue; - } - - const auto& rawTimelines = *&(iterator->value); - for (std::size_t i = 0, l = rawTimelines.Size(); i < l; i += 2) - { - const auto timelineType = (TimelineType)rawTimelines[i].GetInt(); - const auto timelineOffset = rawTimelines[i + 1].GetUint(); - const auto timeline = _parseBinaryTimeline(timelineType, timelineOffset); - _animation->addConstraintTimeline(constraint, timeline); - } - } - } - - _animation = nullptr; - - return animation; -} - -void BinaryDataParser::_parseArray(const rapidjson::Value& rawData) -{ - const auto& offsets = rawData[OFFSET]; - - _data->binary = _binary; - _data->intArray = _intArray = (int16_t*)(_binary + _binaryOffset + offsets[0].GetUint()); - _data->floatArray = _floatArray = (float*)(_binary + _binaryOffset + offsets[2].GetUint()); - _data->frameIntArray = _frameIntArray = (int16_t*)(_binary + _binaryOffset + offsets[4].GetUint()); - _data->frameFloatArray = _frameFloatArray = (float*)(_binary + _binaryOffset + offsets[6].GetUint()); - _data->frameArray = _frameArray = (int16_t*)(_binary + _binaryOffset + offsets[8].GetUint()); - _data->timelineArray = _timelineArray = (uint16_t*)(_binary + _binaryOffset + offsets[10].GetUint()); -} - -DragonBonesData* BinaryDataParser::parseDragonBonesData(const char* rawData, float scale) -{ - DRAGONBONES_ASSERT(rawData != nullptr, ""); - - if ( - rawData[0] != 'D' || - rawData[1] != 'B' || - rawData[2] != 'D' || - rawData[3] != 'T' - ) - { - DRAGONBONES_ASSERT(false, "Nonsupport data."); - return nullptr; - } - - const auto headerLength = (std::size_t)(((uint32_t*)(rawData + 8))[0]); - const auto headerBytes = rawData + 8 + 4; - rapidjson::Document document; - document.Parse(headerBytes, headerLength); - - _binaryOffset = 8 + 4 + headerLength; - _binary = rawData; - - return JSONDataParser::_parseDragonBonesData(document, scale); -} - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones/parser/BinaryDataParser.h b/native/cocos/editor-support/dragonbones/parser/BinaryDataParser.h deleted file mode 100644 index 896196e887..0000000000 --- a/native/cocos/editor-support/dragonbones/parser/BinaryDataParser.h +++ /dev/null @@ -1,72 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_BINARY_DATA_PARSER_H -#define DRAGONBONES_BINARY_DATA_PARSER_H - -#include "JSONDataParser.h" - -DRAGONBONES_NAMESPACE_BEGIN - -/** - * @internal - */ -class BinaryDataParser : public JSONDataParser -{ - DRAGONBONES_DISALLOW_COPY_AND_ASSIGN(BinaryDataParser) - -private: - unsigned _binaryOffset; - const char* _binary; - const int16_t* _intArray; - const float* _floatArray; - const int16_t* _frameIntArray; - const float* _frameFloatArray; - const int16_t* _frameArray; - const uint16_t* _timelineArray; - - TimelineData* _parseBinaryTimeline(TimelineType type, unsigned offset, TimelineData* timelineData = nullptr); - void _parseVertices(const rapidjson::Value& rawData, VerticesData& vertices); - -protected: - virtual void _parseMesh(const rapidjson::Value& rawData, MeshDisplayData& mesh) override; - virtual AnimationData* _parseAnimation(const rapidjson::Value& rawData) override; - virtual void _parseArray(const rapidjson::Value& rawData) override; - -public: - BinaryDataParser() : - _binaryOffset(0), - _binary(nullptr), - _intArray(nullptr), - _floatArray(nullptr), - _frameIntArray(nullptr), - _frameFloatArray(nullptr), - _frameArray(nullptr), - _timelineArray(nullptr) - {} - virtual ~BinaryDataParser() {} - - virtual DragonBonesData* parseDragonBonesData(const char* rawData, float scale = 1.0f) override; -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_BINARY_DATA_PARSER_H diff --git a/native/cocos/editor-support/dragonbones/parser/DataParser.cpp b/native/cocos/editor-support/dragonbones/parser/DataParser.cpp deleted file mode 100644 index a5632ffbed..0000000000 --- a/native/cocos/editor-support/dragonbones/parser/DataParser.cpp +++ /dev/null @@ -1,319 +0,0 @@ -#include "DataParser.h" - -DRAGONBONES_NAMESPACE_BEGIN - -const char* DataParser::DATA_VERSION_2_3 = "2.3"; -const char* DataParser::DATA_VERSION_3_0 = "3.0"; -const char* DataParser::DATA_VERSION_4_0 = "4.0"; -const char* DataParser::DATA_VERSION_4_5 = "4.5"; -const char* DataParser::DATA_VERSION_5_0 = "5.0"; -const char* DataParser::DATA_VERSION_5_5 = "5.5"; -const char* DataParser::DATA_VERSION = DataParser::DATA_VERSION_5_5; - -const std::vector DataParser::DATA_VERSIONS -{ - DataParser::DATA_VERSION_4_0, - DataParser::DATA_VERSION_4_5, - DataParser::DATA_VERSION_5_0, - DataParser::DATA_VERSION_5_5 -}; - -const char* DataParser::TEXTURE_ATLAS = "TextureAtlas"; -const char* DataParser::SUB_TEXTURE = "SubTexture"; -const char* DataParser::FORMAT = "format"; -const char* DataParser::IMAGE_PATH = "imagePath"; -const char* DataParser::WIDTH = "width"; -const char* DataParser::HEIGHT = "height"; -const char* DataParser::ROTATED = "rotated"; -const char* DataParser::FRAME_X = "frameX"; -const char* DataParser::FRAME_Y = "frameY"; -const char* DataParser::FRAME_WIDTH = "frameWidth"; -const char* DataParser::FRAME_HEIGHT = "frameHeight"; - -const char* DataParser::DRADON_BONES = "dragonBones"; -const char* DataParser::USER_DATA = "userData"; -const char* DataParser::ARMATURE = "armature"; -const char* DataParser::BONE = "bone"; -const char* DataParser::SLOT = "slot"; -const char* DataParser::CONSTRAINT = "constraint"; -const char* DataParser::IK = "ik"; -const char* DataParser::SKIN = "skin"; -const char* DataParser::DISPLAY = "display"; -const char* DataParser::ANIMATION = "animation"; -const char* DataParser::Z_ORDER = "zOrder"; -const char* DataParser::FFD = "ffd"; -const char* DataParser::FRAME = "frame"; -const char* DataParser::TRANSLATE_FRAME = "translateFrame"; -const char* DataParser::ROTATE_FRAME = "rotateFrame"; -const char* DataParser::SCALE_FRAME = "scaleFrame"; -const char* DataParser::DISPLAY_FRAME = "displayFrame"; -const char* DataParser::COLOR_FRAME = "colorFrame"; -const char* DataParser::DEFAULT_ACTIONS = "defaultActions"; -const char* DataParser::ACTIONS = "actions"; -const char* DataParser::EVENTS = "events"; -const char* DataParser::INTS = "ints"; -const char* DataParser::FLOATS = "floats"; -const char* DataParser::STRINGS = "strings"; -const char* DataParser::CANVAS = "canvas"; - -const char* DataParser::TRANSFORM = "transform"; -const char* DataParser::PIVOT = "pivot"; -const char* DataParser::AABB = "aabb"; -const char* DataParser::COLOR = "color"; - -const char* DataParser::VERSION = "version"; -const char* DataParser::COMPATIBLE_VERSION = "compatibleVersion"; -const char* DataParser::FRAME_RATE = "frameRate"; -const char* DataParser::TYPE = "type"; -const char* DataParser::SUB_TYPE = "subType"; -const char* DataParser::NAME = "name"; -const char* DataParser::PARENT = "parent"; -const char* DataParser::TARGET = "target"; -const char* DataParser::STAGE = "stage"; -const char* DataParser::SHARE = "share"; -const char* DataParser::PATH = "path"; -const char* DataParser::LENGTH = "length"; -const char* DataParser::DISPLAY_INDEX = "displayIndex"; -const char* DataParser::BLEND_MODE = "blendMode"; -const char* DataParser::INHERIT_TRANSLATION = "inheritTranslation"; -const char* DataParser::INHERIT_ROTATION = "inheritRotation"; -const char* DataParser::INHERIT_SCALE = "inheritScale"; -const char* DataParser::INHERIT_REFLECTION = "inheritReflection"; -const char* DataParser::INHERIT_ANIMATION = "inheritAnimation"; -const char* DataParser::INHERIT_DEFORM = "inheritDeform"; -const char* DataParser::BEND_POSITIVE = "bendPositive"; -const char* DataParser::CHAIN = "chain"; -const char* DataParser::WEIGHT = "weight"; - -const char* DataParser::FADE_IN_TIME = "fadeInTime"; -const char* DataParser::PLAY_TIMES = "playTimes"; -const char* DataParser::SCALE = "scale"; -const char* DataParser::OFFSET = "offset"; -const char* DataParser::POSITION = "position"; -const char* DataParser::DURATION = "duration"; -const char* DataParser::TWEEN_EASING = "tweenEasing"; -const char* DataParser::TWEEN_ROTATE = "tweenRotate"; -const char* DataParser::TWEEN_SCALE = "tweenScale"; -const char* DataParser::CLOCK_WISE = "clockwise"; -const char* DataParser::CURVE = "curve"; -const char* DataParser::EVENT = "event"; -const char* DataParser::SOUND = "sound"; -const char* DataParser::ACTION = "action"; - -const char* DataParser::X = "x"; -const char* DataParser::Y = "y"; -const char* DataParser::SKEW_X = "skX"; -const char* DataParser::SKEW_Y = "skY"; -const char* DataParser::SCALE_X = "scX"; -const char* DataParser::SCALE_Y = "scY"; -const char* DataParser::VALUE = "value"; -const char* DataParser::ROTATE = "rotate"; -const char* DataParser::SKEW = "skew"; - -const char* DataParser::ALPHA_OFFSET = "aO"; -const char* DataParser::RED_OFFSET = "rO"; -const char* DataParser::GREEN_OFFSET = "gO"; -const char* DataParser::BLUE_OFFSET = "bO"; -const char* DataParser::ALPHA_MULTIPLIER = "aM"; -const char* DataParser::RED_MULTIPLIER = "rM"; -const char* DataParser::GREEN_MULTIPLIER = "gM"; -const char* DataParser::BLUE_MULTIPLIER = "bM"; - -const char* DataParser::UVS = "uvs"; -const char* DataParser::VERTICES = "vertices"; -const char* DataParser::TRIANGLES = "triangles"; -const char* DataParser::WEIGHTS = "weights"; -const char* DataParser::SLOT_POSE = "slotPose"; -const char* DataParser::BONE_POSE = "bonePose"; - -const char* DataParser::GOTO_AND_PLAY = "gotoAndPlay"; - -const char* DataParser::DEFAULT_NAME = "default"; - -TextureFormat DataParser::_getTextureFormat(const std::string& value) -{ - auto lower = value; - std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower); - - if (lower == "rgba8888") - { - return TextureFormat::RGBA8888; - } - else if (lower == "bgra8888") - { - return TextureFormat::BGRA8888; - } - else if (lower == "rgba4444") - { - return TextureFormat::RGBA4444; - } - else if (lower == "rgb888") - { - return TextureFormat::RGB888; - } - else if (lower == "rgb565") - { - return TextureFormat::RGB565; - } - else if (lower == "rgba5551") - { - return TextureFormat::RGBA5551; - } - - return TextureFormat::DEFAULT; -} - -ArmatureType DataParser::_getArmatureType(const std::string& value) -{ - auto lower = value; - std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower); - - if (lower == "armature") - { - return ArmatureType::Armature; - } - else if (lower == "movieClip") - { - return ArmatureType::MovieClip; - } - else if (lower == "stage") - { - return ArmatureType::Stage; - } - - return ArmatureType::Armature; -} - -DisplayType DataParser::_getDisplayType(const std::string& value) -{ - auto lower = value; - std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower); - - if (lower == "image") - { - return DisplayType::Image; - } - else if (lower == "armature") - { - return DisplayType::Armature; - } - else if (lower == "mesh") - { - return DisplayType::Mesh; - } - else if (lower == "boundingbox") - { - return DisplayType::BoundingBox; - } - - return DisplayType::Image; -} - -BoundingBoxType DataParser::_getBoundingBoxType(const std::string & value) -{ - auto lower = value; - std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower); - - if (lower == "rectangle") - { - return BoundingBoxType::Rectangle; - } - else if (lower == "ellipse") - { - return BoundingBoxType::Ellipse; - } - else if (lower == "polygon") - { - return BoundingBoxType::Polygon; - } - - return BoundingBoxType::Rectangle; -} - -ActionType DataParser::_getActionType(const std::string& value) -{ - auto lower = value; - std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower); - - if (lower == "play") - { - return ActionType::Play; - } - else if (lower == "frame") - { - return ActionType::Frame; - } - else if (lower == "sound") - { - return ActionType::Sound; - } - - return ActionType::Play; -} - -BlendMode DataParser::_getBlendMode(const std::string& value) -{ - auto lower = value; - std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower); - - if (lower == "normal") - { - return BlendMode::Normal; - } - else if (lower == "add") - { - return BlendMode::Add; - } - else if (lower == "alpha") - { - return BlendMode::Alpha; - } - else if (lower == "darken") - { - return BlendMode::Darken; - } - else if (lower == "difference") - { - return BlendMode::Difference; - } - else if (lower == "erase") - { - return BlendMode::Erase; - } - else if (lower == "hardlight") - { - return BlendMode::HardLight; - } - else if (lower == "invert") - { - return BlendMode::Invert; - } - else if (lower == "layer") - { - return BlendMode::Layer; - } - else if (lower == "lighten") - { - return BlendMode::Lighten; - } - else if (lower == "multiply") - { - return BlendMode::Multiply; - } - else if (lower == "overlay") - { - return BlendMode::Overlay; - } - else if (lower == "screen") - { - return BlendMode::Screen; - } - else if (lower == "subtract") - { - return BlendMode::Subtract; - } - - return BlendMode::Normal; -} - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones/parser/DataParser.h b/native/cocos/editor-support/dragonbones/parser/DataParser.h deleted file mode 100644 index de97eeb1e3..0000000000 --- a/native/cocos/editor-support/dragonbones/parser/DataParser.h +++ /dev/null @@ -1,182 +0,0 @@ -/** - * The MIT License (MIT) - * - * Copyright (c) 2012-2018 DragonBones team and other contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ -#ifndef DRAGONBONES_DATA_PARSER_H -#define DRAGONBONES_DATA_PARSER_H - -#include "../core/DragonBones.h" -#include "../model/UserData.h" -#include "../model/DragonBonesData.h" -#include "../model/ArmatureData.h" -#include "../model/CanvasData.h" -#include "../model/ConstraintData.h" -#include "../model/SkinData.h" -#include "../model/DisplayData.h" -#include "../model/BoundingBoxData.h" -#include "../model/AnimationData.h" -#include "../model/TextureAtlasData.h" - -DRAGONBONES_NAMESPACE_BEGIN -/** - * @internal - */ -class DataParser -{ - ABSTRACT_CLASS(DataParser) - -protected: - static const char* DATA_VERSION_2_3; - static const char* DATA_VERSION_3_0; - static const char* DATA_VERSION_4_0; - static const char* DATA_VERSION_4_5; - static const char* DATA_VERSION_5_0; - static const char* DATA_VERSION_5_5; - static const char* DATA_VERSION; - - static const std::vector DATA_VERSIONS; - - static const char* TEXTURE_ATLAS; - static const char* SUB_TEXTURE; - static const char* FORMAT; - static const char* IMAGE_PATH; - static const char* WIDTH; - static const char* HEIGHT; - static const char* ROTATED; - static const char* FRAME_X; - static const char* FRAME_Y; - static const char* FRAME_WIDTH; - static const char* FRAME_HEIGHT; - - static const char* DRADON_BONES; - static const char* USER_DATA; - static const char* ARMATURE; - static const char* BONE; - static const char* SLOT; - static const char* CONSTRAINT; - static const char* IK; - static const char* SKIN; - static const char* DISPLAY; - static const char* ANIMATION; - static const char* Z_ORDER; - static const char* FFD; - static const char* FRAME; - static const char* TRANSLATE_FRAME; - static const char* ROTATE_FRAME; - static const char* SCALE_FRAME; - static const char* DISPLAY_FRAME; - static const char* COLOR_FRAME; - static const char* DEFAULT_ACTIONS; - static const char* ACTIONS; - static const char* EVENTS; - static const char* INTS; - static const char* FLOATS; - static const char* STRINGS; - static const char* CANVAS; - - static const char* PIVOT; - static const char* TRANSFORM; - static const char* AABB; - static const char* COLOR; - - static const char* VERSION; - static const char* COMPATIBLE_VERSION; - static const char* FRAME_RATE; - static const char* TYPE; - static const char* SUB_TYPE; - static const char* NAME; - static const char* PARENT; - static const char* TARGET; - static const char* STAGE; - static const char* SHARE; - static const char* PATH; - static const char* LENGTH; - static const char* DISPLAY_INDEX; - static const char* BLEND_MODE; - static const char* INHERIT_TRANSLATION; - static const char* INHERIT_ROTATION; - static const char* INHERIT_SCALE; - static const char* INHERIT_REFLECTION; - static const char* INHERIT_ANIMATION; - static const char* INHERIT_DEFORM; - static const char* BEND_POSITIVE; - static const char* CHAIN; - static const char* WEIGHT; - - static const char* FADE_IN_TIME; - static const char* PLAY_TIMES; - static const char* SCALE; - static const char* OFFSET; - static const char* POSITION; - static const char* DURATION; - static const char* TWEEN_EASING; - static const char* TWEEN_ROTATE; - static const char* TWEEN_SCALE; - static const char* CLOCK_WISE; - static const char* CURVE; - static const char* EVENT; - static const char* SOUND; - static const char* ACTION; - - static const char* X; - static const char* Y; - static const char* SKEW_X; - static const char* SKEW_Y; - static const char* SCALE_X; - static const char* SCALE_Y; - static const char* VALUE; - static const char* ROTATE; - static const char* SKEW; - - static const char* ALPHA_OFFSET; - static const char* RED_OFFSET; - static const char* GREEN_OFFSET; - static const char* BLUE_OFFSET; - static const char* ALPHA_MULTIPLIER; - static const char* RED_MULTIPLIER; - static const char* GREEN_MULTIPLIER; - static const char* BLUE_MULTIPLIER; - - static const char* UVS; - static const char* VERTICES; - static const char* TRIANGLES; - static const char* WEIGHTS; - static const char* SLOT_POSE; - static const char* BONE_POSE; - - static const char* GOTO_AND_PLAY; - - static const char* DEFAULT_NAME; - - static TextureFormat _getTextureFormat(const std::string& value); - static ArmatureType _getArmatureType(const std::string& value); - static DisplayType _getDisplayType(const std::string& value); - static BoundingBoxType _getBoundingBoxType(const std::string& value); - static ActionType _getActionType(const std::string& value); - static BlendMode _getBlendMode(const std::string& value); - -public: - virtual DragonBonesData* parseDragonBonesData(const char* rawData, float scale = 1.0f) = 0; - virtual bool parseTextureAtlasData(const char* rawData, TextureAtlasData& textureAtlasData, float scale = 1.0f) = 0; -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_DATA_PARSER_H diff --git a/native/cocos/editor-support/dragonbones/parser/JSONDataParser.cpp b/native/cocos/editor-support/dragonbones/parser/JSONDataParser.cpp deleted file mode 100644 index 81fc9b6454..0000000000 --- a/native/cocos/editor-support/dragonbones/parser/JSONDataParser.cpp +++ /dev/null @@ -1,2039 +0,0 @@ -#include "JSONDataParser.h" -#include "base/ccMacros.h" - -DRAGONBONES_NAMESPACE_BEGIN - -void JSONDataParser::_getCurvePoint( - float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, - float t, - Point& result -) -{ - const auto l_t = 1.0f - t; - const auto powA = l_t * l_t; - const auto powB = t * t; - const auto kA = l_t * powA; - const auto kB = 3.0f * t * powA; - const auto kC = 3.0f * l_t * powB; - const auto kD = t * powB; - - result.x = kA * x1 + kB * x2 + kC * x3 + kD * x4; - result.y = kA * y1 + kB * y2 + kC * y3 + kD * y4; -} - -void JSONDataParser::_samplingEasingCurve(const rapidjson::Value& curve, std::vector& samples) -{ - int curveCount = curve.Size(); - int stepIndex = -2; - for (std::size_t i = 0, l = samples.size(); i < l; ++i) - { - float t = (float)(i + 1) / (l + 1); // float - while ((stepIndex + 6 < curveCount ? curve[stepIndex + 6].GetDouble() : 1) < t) // stepIndex + 3 * 2 - { - stepIndex += 6; - } - - const auto isInCurve = stepIndex >= 0 && stepIndex + 6 < curveCount; - const auto x1 = isInCurve ? curve[stepIndex].GetDouble() : 0.0f; - const auto y1 = isInCurve ? curve[stepIndex + 1].GetDouble() : 0.0f; - const auto x2 = curve[stepIndex + 2].GetDouble(); - const auto y2 = curve[stepIndex + 3].GetDouble(); - const auto x3 = curve[stepIndex + 4].GetDouble(); - const auto y3 = curve[stepIndex + 5].GetDouble(); - const auto x4 = isInCurve ? curve[stepIndex + 6].GetDouble() : 1.0f; - const auto y4 = isInCurve ? curve[stepIndex + 7].GetDouble() : 1.0f; - - float lower = 0.0f; - float higher = 1.0f; - while (higher - lower > 0.0001f) - { - const auto percentage = (higher + lower) * 0.5f; - _getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, percentage, _helpPoint); - if (t - _helpPoint.x > 0.0f) - { - lower = percentage; - } - else { - higher = percentage; - } - } - - samples[i] = _helpPoint.y; - } -} - -void JSONDataParser::_parseActionDataInFrame(const rapidjson::Value& rawData, unsigned frameStart, BoneData* bone, SlotData* slot) -{ - if (rawData.HasMember(EVENT)) - { - _mergeActionFrame(rawData[EVENT], frameStart, ActionType::Frame, bone, slot); - } - - if (rawData.HasMember(SOUND)) - { - _mergeActionFrame(rawData[SOUND], frameStart, ActionType::Sound, bone, slot); - } - - if (rawData.HasMember(ACTION)) - { - _mergeActionFrame(rawData[ACTION], frameStart, ActionType::Play, bone, slot); - } - - if (rawData.HasMember(EVENTS)) - { - _mergeActionFrame(rawData[EVENTS], frameStart, ActionType::Frame, bone, slot); - } - - if (rawData.HasMember(ACTIONS)) - { - _mergeActionFrame(rawData[ACTIONS], frameStart, ActionType::Play, bone, slot); - } -} - -void JSONDataParser::_mergeActionFrame(const rapidjson::Value& rawData, unsigned frameStart, ActionType type, BoneData* bone, SlotData* slot) -{ - const auto actionOffset = _armature->actions.size(); - const auto& actions = _parseActionData(rawData, type, bone, slot); - ActionFrame* frame = nullptr; - - for (const auto action : actions) - { - _armature->addAction(action, false); - } - - if (_actionFrames.empty()) // First frame. - { - _actionFrames.resize(1); - _actionFrames[0].frameStart = 0; - } - - for (auto& eachFrame : _actionFrames) // Get same frame. - { - if (eachFrame.frameStart == frameStart) - { - frame = &eachFrame; - break; - } - } - - if (frame == nullptr) // Create and cache frame. - { - const auto frameCount = _actionFrames.size(); - _actionFrames.resize(frameCount + 1); - frame = &_actionFrames[frameCount]; - frame->frameStart = frameStart; - } - - for (std::size_t i = 0; i < actions.size(); ++i) // Cache action offsets. - { - frame->actions.push_back(actionOffset + i); - } -} - -unsigned JSONDataParser::_parseCacheActionFrame(ActionFrame& frame) -{ - const auto frameOffset = _frameArray.size(); - const auto actionCount = frame.actions.size(); - _frameArray.resize(_frameArray.size() + 1 + 1 + actionCount); - _frameArray[frameOffset + (unsigned)BinaryOffset::FramePosition] = frame.frameStart; - _frameArray[frameOffset + (unsigned)BinaryOffset::FramePosition + 1] = actionCount; // Action count. - - for (std::size_t i = 0; i < actionCount; ++i) // Action offsets. - { - _frameArray[frameOffset + (unsigned)BinaryOffset::FramePosition + 2 + i] = frame.actions[i]; - } - - return frameOffset; -} - -ArmatureData* JSONDataParser::_parseArmature(const rapidjson::Value& rawData, float scale) -{ - const auto armature = BaseObject::borrowObject(); - armature->name = _getString(rawData, NAME, ""); - armature->frameRate = _getNumber(rawData, FRAME_RATE, _data->frameRate); - armature->scale = scale; - - if (rawData.HasMember(TYPE) && rawData[TYPE].IsString()) - { - armature->type = _getArmatureType(rawData[TYPE].GetString()); - } - else - { - armature->type = (ArmatureType)_getNumber(rawData, TYPE, (int)ArmatureType::Armature); - } - - if (armature->frameRate == 0) // Data error. - { - armature->frameRate = 24; - } - - _armature = armature; - - if (rawData.HasMember(CANVAS)) - { - const auto& rawCanvas = rawData[CANVAS]; - const auto canvas = BaseObject::borrowObject(); - canvas->hasBackground = rawCanvas.HasMember(COLOR); - canvas->color = _getNumber(rawCanvas, COLOR, 0); - canvas->aabb.x = _getNumber(rawCanvas, X, 0.0f) * armature->scale; - canvas->aabb.y = _getNumber(rawCanvas, Y, 0.0f) * armature->scale; - canvas->aabb.width = _getNumber(rawCanvas, WIDTH, 0.0f) * armature->scale; - canvas->aabb.height = _getNumber(rawCanvas, HEIGHT, 0.0f) * armature->scale; - // - armature->canvas = canvas; - } - - if (rawData.HasMember(AABB)) - { - const auto& rawAABB = rawData[AABB]; - armature->aabb.x = _getNumber(rawAABB, X, 0.0f) * armature->scale; - armature->aabb.y = _getNumber(rawAABB, Y, 0.0f) * armature->scale; - armature->aabb.width = _getNumber(rawAABB, WIDTH, 0.0f) * armature->scale; - armature->aabb.height = _getNumber(rawAABB, HEIGHT, 0.0f) * armature->scale; - } - - if (rawData.HasMember(BONE)) - { - const auto& rawBones = rawData[BONE]; - for (std::size_t i = 0, l = rawBones.Size(); i < l; ++i) - { - const auto& rawBone = rawBones[i]; - const auto& parentName = _getString(rawBone, PARENT, ""); - const auto bone = _parseBone(rawBone); - - if (!parentName.empty()) // Get bone parent. - { - const auto parent = armature->getBone(parentName); - if (parent != nullptr) - { - bone->parent = parent; - } - else // Cache. - { - auto& cacheBones = _cacheBones[parentName]; - cacheBones.push_back(bone); - } - } - - auto iterator = _cacheBones.find(bone->name); - if (iterator != _cacheBones.end()) - { - for (const auto child : _cacheBones[bone->name]) - { - child->parent = bone; - } - - _cacheBones.erase(iterator); - } - - armature->addBone(bone); - _rawBones.push_back(bone); // Cache raw bones sort. - } - } - - if (rawData.HasMember(IK)) - { - const auto& rawIKS = rawData[IK]; - for (std::size_t i = 0, l = rawIKS.Size(); i < l; ++i) - { - const auto constraint = _parseIKConstraint(rawIKS[i]); - if (constraint) - { - armature->addConstraint(constraint); - } - } - } - - armature->sortBones(); - - if (rawData.HasMember(SLOT)) - { - int zOrder = 0; - const auto& rawSlots = rawData[SLOT]; - for (std::size_t i = 0, l = rawSlots.Size(); i < l; ++i) - { - armature->addSlot(_parseSlot(rawSlots[i], zOrder++)); - } - } - - if (rawData.HasMember(SKIN)) - { - const auto& rawSkins = rawData[SKIN]; - for (std::size_t i = 0, l = rawSkins.Size(); i < l; ++i) - { - armature->addSkin(_parseSkin(rawSkins[i])); - } - } - - for (std::size_t i = 0, l = _cacheRawMeshes.size(); i < l; ++i) // Link mesh. - { - const auto rawMeshData = _cacheRawMeshes[i]; - const auto& shareName = _getString(*rawMeshData, SHARE, ""); - if (shareName.empty()) { - continue; - } - - auto skinName = _getString(*rawMeshData, SKIN, DEFAULT_NAME); - if (skinName.empty()) // - { - skinName = DEFAULT_NAME; - } - - const auto shareMesh = armature->getMesh(skinName, "", shareName); // TODO slot; - if (shareMesh == nullptr) { - continue; // Error. - } - - const auto mesh = _cacheMeshes[i]; - mesh->vertices.shareFrom(shareMesh->vertices); - } - - if (rawData.HasMember(ANIMATION)) - { - const auto& rawAnimations = rawData[ANIMATION]; - for (std::size_t i = 0, l = rawAnimations.Size(); i < l; ++i) - { - armature->addAnimation(_parseAnimation(rawAnimations[i])); - } - } - - if (rawData.HasMember(DEFAULT_ACTIONS)) - { - const auto& actions = _parseActionData(rawData[DEFAULT_ACTIONS], ActionType::Play, nullptr, nullptr); - for (const auto action : actions) - { - armature->addAction(action, true); - - if (action->type == ActionType::Play) // Set default animation from default action. - { - const auto animation = armature->getAnimation(action->name); - if (animation != nullptr) - { - armature->defaultAnimation = animation; - } - } - } - } - - if (rawData.HasMember(ACTIONS)) - { - const auto& actions = _parseActionData(rawData[ACTIONS], ActionType::Play, nullptr, nullptr); - - for (const auto action : actions) - { - armature->addAction(action, false); - } - } - - // Clear helper. - _rawBones.clear(); - _cacheRawMeshes.clear(); - _cacheMeshes.clear(); - _armature = nullptr; - - _weightSlotPose.clear(); - _weightBonePoses.clear(); - _cacheBones.clear(); - _slotChildActions.clear(); - - return armature; -} - -BoneData* JSONDataParser::_parseBone(const rapidjson::Value& rawData) -{ - const auto bone = BaseObject::borrowObject(); - bone->inheritTranslation = _getBoolean(rawData, INHERIT_TRANSLATION, true); - bone->inheritRotation = _getBoolean(rawData, INHERIT_ROTATION, true); - bone->inheritScale = _getBoolean(rawData, INHERIT_SCALE, true); - bone->inheritReflection = _getBoolean(rawData, INHERIT_REFLECTION, true); - bone->length = _getNumber(rawData, LENGTH, 0.0f) * _armature->scale; - bone->name = _getString(rawData, NAME, ""); - - if (rawData.HasMember(TRANSFORM)) - { - _parseTransform(rawData[TRANSFORM], bone->transform, _armature->scale); - } - - return bone; -} - -ConstraintData* JSONDataParser::_parseIKConstraint(const rapidjson::Value& rawData) -{ - const auto bone = _armature->getBone(_getString(rawData, BONE, "")); - if (bone == nullptr) - { - return nullptr; - } - - const auto target = _armature->getBone(_getString(rawData, TARGET, "")); - if (target == nullptr) - { - return nullptr; - } - - const auto constraint = BaseObject::borrowObject(); - constraint->scaleEnabled = _getBoolean(rawData, SCALE, false); - constraint->bendPositive = _getBoolean(rawData, BEND_POSITIVE, true); - constraint->weight = _getNumber(rawData, WEIGHT, 1.0f); - constraint->name = _getString(rawData, NAME, ""); - constraint->bone = bone; - constraint->target = target; - - const auto chain = _getNumber(rawData, CHAIN, (unsigned)0); - if (chain > 0 && bone->parent != nullptr) - { - constraint->root = bone->parent; - constraint->bone = bone; - } - else - { - constraint->root = bone; - constraint->bone = nullptr; - } - - return constraint; -} - -SlotData* JSONDataParser::_parseSlot(const rapidjson::Value& rawData, int zOrder) -{ - const auto slot = BaseObject::borrowObject(); - slot->displayIndex = _getNumber(rawData, DISPLAY_INDEX, (int)0); - slot->zOrder = zOrder; - slot->name = _getString(rawData, NAME, ""); - slot->parent = _armature->getBone(_getString(rawData, PARENT, "")); - - if (rawData.HasMember(BLEND_MODE) && rawData[BLEND_MODE].IsString()) - { - slot->blendMode = _getBlendMode(rawData[BLEND_MODE].GetString()); - } - else - { - slot->blendMode = (BlendMode)_getNumber(rawData, BLEND_MODE, (int)BlendMode::Normal); - } - - if (rawData.HasMember(COLOR)) - { - slot->color = SlotData::createColor(); - _parseColorTransform(rawData[COLOR], *slot->color); - } - else - { - slot->color = &SlotData::DEFAULT_COLOR; - } - - if (rawData.HasMember(ACTIONS)) - { - _slotChildActions[slot->name] = _parseActionData(rawData[ACTIONS], ActionType::Play, nullptr, nullptr); - } - - return slot; -} - -SkinData * JSONDataParser::_parseSkin(const rapidjson::Value& rawData) -{ - const auto skin = BaseObject::borrowObject(); - skin->name = _getString(rawData, NAME, DEFAULT_NAME); - if (skin->name.empty()) - { - skin->name = DEFAULT_NAME; - } - - if (rawData.HasMember(SLOT)) - { - const auto& rawSlots = rawData[SLOT]; - _skin = skin; - - for (std::size_t i = 0, l = rawSlots.Size(); i < l; ++i) - { - const auto& rawSlot = rawSlots[i]; - const auto& slotName = _getString(rawSlot, NAME, ""); - const auto slot = _armature->getSlot(slotName); - if (slot != nullptr) - { - _slot = slot; - - if (rawSlot.HasMember(DISPLAY)) - { - const auto& rawDisplays = rawSlot[DISPLAY]; - for (std::size_t j = 0, lJ = rawDisplays.Size(); j < lJ; ++j) - { - const auto& rawDisplay = rawDisplays[j]; - if (!rawDisplay.IsNull()) - { - skin->addDisplay(slotName, _parseDisplay(rawDisplay)); - } - else - { - skin->addDisplay(slotName, nullptr); - } - } - } - - _slot = nullptr; - } - } - - _skin = nullptr; - } - - return skin; -} - -DisplayData* JSONDataParser::_parseDisplay(const rapidjson::Value& rawData) -{ - const auto& name = _getString(rawData, NAME, ""); - const auto& path = _getString(rawData, PATH, ""); - auto type = DisplayType::Image; - DisplayData* display = nullptr; - - if (rawData.HasMember(TYPE) && rawData[TYPE].IsString()) - { - type = _getDisplayType(rawData[TYPE].GetString()); - } - else - { - type = (DisplayType)_getNumber(rawData, TYPE, (int)DisplayType::Image); - } - - switch (type) - { - case dragonBones::DisplayType::Image: - { - const auto imageDisplay = BaseObject::borrowObject(); - imageDisplay->name = name; - imageDisplay->path = !path.empty() ? path : name; - _parsePivot(rawData, *imageDisplay); - - display = imageDisplay; - break; - } - - case dragonBones::DisplayType::Armature: - { - const auto armatureDisplay = BaseObject::borrowObject(); - armatureDisplay->name = name; - armatureDisplay->path = !path.empty() ? path : name; - armatureDisplay->inheritAnimation = true; - - if (rawData.HasMember(ACTIONS)) - { - const auto& actions = _parseActionData(rawData[ACTIONS], ActionType::Play, nullptr, nullptr); - - for (const auto action : actions) - { - armatureDisplay->addAction(action); - } - } - else if (_slotChildActions.find(_slot->name) != _slotChildActions.cend()) - { - const auto displays = _skin->getDisplays(_slot->name); - if (displays == nullptr ? _slot->displayIndex == 0 : (std::size_t)_slot->displayIndex == displays->size()) - { - for (const auto action : _slotChildActions[_slot->name]) - { - armatureDisplay->addAction(action); - } - - _slotChildActions.erase(_slotChildActions.find(_slot->name)); - } - } - - display = armatureDisplay; - break; - } - - case dragonBones::DisplayType::Mesh: - { - const auto meshDisplay = BaseObject::borrowObject(); - meshDisplay->vertices.inheritDeform = _getBoolean(rawData, INHERIT_DEFORM, true); - meshDisplay->name = name; - meshDisplay->path = !path.empty() ? path : name; - meshDisplay->vertices.data = _data; - - if (rawData.HasMember(SHARE)) - { - _cacheRawMeshes.push_back(&rawData); - _cacheMeshes.push_back(meshDisplay); - } - else - { - _parseMesh(rawData, *meshDisplay); - } - - display = meshDisplay; - break; - } - - case dragonBones::DisplayType::BoundingBox: - { - const auto boundingBox = _parseBoundingBox(rawData); - if (boundingBox != nullptr) - { - const auto boundingBoxDisplay = BaseObject::borrowObject(); - boundingBoxDisplay->name = name; - boundingBoxDisplay->path = !path.empty() ? path : name; - boundingBoxDisplay->boundingBox = boundingBox; - - display = boundingBoxDisplay; - } - break; - } - } - - if (display != nullptr && rawData.HasMember(TRANSFORM)) - { - _parseTransform(rawData[TRANSFORM], display->transform, _armature->scale); - } - - return display; -} - -void JSONDataParser::_parsePivot(const rapidjson::Value& rawData, ImageDisplayData& display) -{ - if (rawData.HasMember(PIVOT)) - { - const auto& rawPivot = rawData[PIVOT]; - display.pivot.x = _getNumber(rawPivot, X, 0.0f); - display.pivot.y = _getNumber(rawPivot, Y, 0.0f); - } - else - { - display.pivot.x = 0.5f; - display.pivot.y = 0.5f; - } -} - -void JSONDataParser::_parseMesh(const rapidjson::Value& rawData, MeshDisplayData& mesh) -{ - const auto& rawVertices = rawData[VERTICES]; - const auto& rawUVs = rawData[UVS]; - const auto& rawTriangles = rawData[TRIANGLES]; - const auto vertexCount = rawVertices.Size() / 2; - const auto triangleCount = rawTriangles.Size() / 3; - const auto vertexOffset = _floatArray.size(); - const auto uvOffset = vertexOffset + vertexCount * 2; - const auto meshOffset = _intArray.size(); - const auto meshName = _skin->name + "_" + _slot->name + "_" + mesh.name; // Cache pose data. - - mesh.vertices.offset = meshOffset; - _intArray.resize(_intArray.size() + 1 + 1 + 1 + 1 + triangleCount * 3); - _intArray[meshOffset + (unsigned)BinaryOffset::MeshVertexCount] = vertexCount; - _intArray[meshOffset + (unsigned)BinaryOffset::MeshTriangleCount] = triangleCount; - _intArray[meshOffset + (unsigned)BinaryOffset::MeshFloatOffset] = vertexOffset; - for (std::size_t i = 0, l = triangleCount * 3; i < l; ++i) - { - _intArray[meshOffset + (unsigned)BinaryOffset::MeshVertexIndices + i] = rawTriangles[i].GetUint(); - } - - _floatArray.resize(_floatArray.size() + vertexCount * 2 + vertexCount * 2); - for (std::size_t i = 0, l = vertexCount * 2; i < l; ++i) - { - _floatArray[vertexOffset + i] = rawVertices[i].GetDouble(); - _floatArray[uvOffset + i] = rawUVs[i].GetDouble(); - } - - if (rawData.HasMember(WEIGHTS)) - { - const auto& rawWeights = rawData[WEIGHTS]; - const auto& rawSlotPose = rawData[SLOT_POSE]; - const auto& rawBonePoses = rawData[BONE_POSE]; - const auto& sortedBones = _armature->sortedBones; - std::vector weightBoneIndices; - const unsigned weightBoneCount = rawBonePoses.Size() / 7; - const auto floatOffset = _floatArray.size(); - const auto weightCount = (rawWeights.Size() - vertexCount) / 2; // uint - const auto weightOffset = _intArray.size(); - const auto weight = BaseObject::borrowObject(); - - weight->count = weightCount; - weight->offset = weightOffset; - weightBoneIndices.resize(weightBoneCount); - _intArray.resize(_intArray.size() + 1 + 1 + weightBoneCount + vertexCount + weightCount); - _intArray[weightOffset + (unsigned)BinaryOffset::WeigthFloatOffset] = floatOffset; - - for (std::size_t i = 0; i < weightBoneCount; ++i) - { - const auto rawBoneIndex = rawBonePoses[i * 7].GetUint(); - const auto bone = _rawBones[rawBoneIndex]; - weight->addBone(bone); - weightBoneIndices[i] = rawBoneIndex; - _intArray[weightOffset + (unsigned)BinaryOffset::WeigthBoneIndices + i] = indexOf(sortedBones, bone); - } - - _floatArray.resize(_floatArray.size() + weightCount * 3); - - _helpMatrixA.a = rawSlotPose[0].GetDouble(); - _helpMatrixA.b = rawSlotPose[1].GetDouble(); - _helpMatrixA.c = rawSlotPose[2].GetDouble(); - _helpMatrixA.d = rawSlotPose[3].GetDouble(); - _helpMatrixA.tx = rawSlotPose[4].GetDouble(); - _helpMatrixA.ty = rawSlotPose[5].GetDouble(); - - for ( - std::size_t i = 0, iW = 0, iB = weightOffset + (unsigned)BinaryOffset::WeigthBoneIndices + weightBoneCount, iV = floatOffset; - i < vertexCount; - ++i - ) - { - const auto iD = i * 2; - const auto vertexBoneCount = rawWeights[iW++].GetUint(); - _intArray[iB++] = vertexBoneCount; - - auto x = _floatArray[vertexOffset + iD]; - auto y = _floatArray[vertexOffset + iD + 1]; - _helpMatrixA.transformPoint(x, y, _helpPoint); - - x = _helpPoint.x; - y = _helpPoint.y; - - for (std::size_t j = 0; j < vertexBoneCount; ++j) - { - const auto rawBoneIndex = rawWeights[iW++].GetUint(); - const auto boneIndex = indexOf(weightBoneIndices, rawBoneIndex); - const auto matrixOffset = boneIndex * 7 + 1; - - _helpMatrixB.a = rawBonePoses[matrixOffset + 0].GetDouble(); - _helpMatrixB.b = rawBonePoses[matrixOffset + 1].GetDouble(); - _helpMatrixB.c = rawBonePoses[matrixOffset + 2].GetDouble(); - _helpMatrixB.d = rawBonePoses[matrixOffset + 3].GetDouble(); - _helpMatrixB.tx = rawBonePoses[matrixOffset + 4].GetDouble(); - _helpMatrixB.ty = rawBonePoses[matrixOffset + 5].GetDouble(); - _helpMatrixB.invert(); - _helpMatrixB.transformPoint(x, y, _helpPoint); - - _intArray[iB++] = boneIndex; - _floatArray[iV++] = rawWeights[iW++].GetDouble(); - _floatArray[iV++] = _helpPoint.x; - _floatArray[iV++] = _helpPoint.y; - } - } - - mesh.vertices.weight = weight; - _weightSlotPose[meshName] = &rawSlotPose; - _weightBonePoses[meshName] = &rawBonePoses; - } -} - -BoundingBoxData* JSONDataParser::_parseBoundingBox(const rapidjson::Value& rawData) -{ - BoundingBoxData* boundingBox = nullptr; - BoundingBoxType type = BoundingBoxType::Rectangle; - if (rawData.HasMember(SUB_TYPE) && rawData[SUB_TYPE].IsString()) - { - type = _getBoundingBoxType(rawData[SUB_TYPE].GetString()); - } - else - { - type = (BoundingBoxType)_getNumber(rawData, SUB_TYPE, (int)type); - } - - switch (type) - { - case BoundingBoxType::Rectangle: - boundingBox = BaseObject::borrowObject(); - break; - - case BoundingBoxType::Ellipse: - boundingBox = BaseObject::borrowObject(); - break; - - case BoundingBoxType::Polygon: - boundingBox = _parsePolygonBoundingBox(rawData); - break; - } - - if (boundingBox != nullptr) - { - boundingBox->color = _getNumber(rawData, COLOR, 0x000000); - if (boundingBox->type == BoundingBoxType::Rectangle || boundingBox->type == BoundingBoxType::Ellipse) - { - boundingBox->width = _getNumber(rawData, WIDTH, 0.0f); - boundingBox->height = _getNumber(rawData, HEIGHT, 0.0f); - } - } - - return boundingBox; -} - -PolygonBoundingBoxData* JSONDataParser::_parsePolygonBoundingBox(const rapidjson::Value& rawData) -{ - const auto polygonBoundingBox = BaseObject::borrowObject(); - - if (rawData.HasMember(VERTICES)) - { - const auto& rawVertices = rawData[VERTICES]; - auto& vertices = polygonBoundingBox->vertices; - - polygonBoundingBox->vertices.resize(rawVertices.Size()); - - for (std::size_t i = 0, l = rawVertices.Size(); i < l; i += 2) - { - const auto x = rawVertices[i].GetDouble(); - const auto y = rawVertices[i + 1].GetDouble(); - vertices[i] = x; - vertices[i + 1] = y; - - // AABB. - if (i == 0) - { - polygonBoundingBox->x = x; - polygonBoundingBox->y = y; - polygonBoundingBox->width = x; - polygonBoundingBox->height = y; - } - else - { - if (x < polygonBoundingBox->x) - { - polygonBoundingBox->x = x; - } - else if (x > polygonBoundingBox->width) - { - polygonBoundingBox->width = x; - } - - if (y < polygonBoundingBox->y) - { - polygonBoundingBox->y = y; - } - else if (y > polygonBoundingBox->height) - { - polygonBoundingBox->height = y; - } - } - } - - polygonBoundingBox->width -= polygonBoundingBox->x; - polygonBoundingBox->height -= polygonBoundingBox->y; - } - else - { - DRAGONBONES_ASSERT(false, "Data error.\n Please reexport DragonBones Data to fixed the bug."); - } - - return polygonBoundingBox; -} - -AnimationData* JSONDataParser::_parseAnimation(const rapidjson::Value& rawData) -{ - const auto animation = BaseObject::borrowObject(); - animation->frameCount = std::max(_getNumber(rawData, DURATION, (unsigned)1), (unsigned)1); - animation->playTimes = _getNumber(rawData, PLAY_TIMES, (unsigned)1); - animation->duration = (float)animation->frameCount / _armature->frameRate; // float - animation->fadeInTime = _getNumber(rawData, FADE_IN_TIME, 0.0f); - animation->scale = _getNumber(rawData, SCALE, 1.0f); - animation->name = _getString(rawData, NAME, DEFAULT_NAME); - - if (animation->name.empty()) - { - animation->name = DEFAULT_NAME; - } - - animation->frameIntOffset = _frameIntArray.size(); - animation->frameFloatOffset = _frameFloatArray.size(); - animation->frameOffset = _frameArray.size(); - - _animation = animation; - - if (rawData.HasMember(FRAME)) - { - const auto& rawFrames = rawData[FRAME]; - const auto keyFrameCount = rawFrames.Size(); - if (keyFrameCount > 0) - { - for (std::size_t i = 0, frameStart = 0; i < keyFrameCount; ++i) - { - const auto& rawFrame = rawFrames[i]; - _parseActionDataInFrame(rawFrame, frameStart, nullptr, nullptr); - frameStart += _getNumber(rawFrame, DURATION, (unsigned)1); - } - } - } - - if (rawData.HasMember(Z_ORDER)) - { - _animation->zOrderTimeline = _parseTimeline( - rawData[Z_ORDER], FRAME, TimelineType::ZOrder, - false, false, 0, - std::bind(&JSONDataParser::_parseZOrderFrame, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3) - ); - } - - if (rawData.HasMember(BONE)) - { - const auto& rawTimelines = rawData[BONE]; - for (std::size_t i = 0, l = rawTimelines.Size(); i < l; ++i) - { - _parseBoneTimeline(rawTimelines[i]); - } - } - - if (rawData.HasMember(SLOT)) - { - const auto& rawTimelines = rawData[SLOT]; - for (std::size_t i = 0, l = rawTimelines.Size(); i < l; ++i) - { - _parseSlotTimeline(rawTimelines[i]); - } - } - - if (rawData.HasMember(FFD)) - { - const auto& rawTimelines = rawData[FFD]; - for (std::size_t i = 0, l = rawTimelines.Size(); i < l; ++i) - { - const auto& rawTimeline = rawTimelines[i]; - auto skinName = _getString(rawTimeline, SKIN, DEFAULT_NAME); - const auto& slotName = _getString(rawTimeline, SLOT, ""); - const auto& displayName = _getString(rawTimeline, NAME, ""); - - if (skinName.empty()) // - { - skinName = DEFAULT_NAME; - } - - _slot = _armature->getSlot(slotName); - _mesh = _armature->getMesh(skinName, slotName, displayName); - if (_slot == nullptr || _mesh == nullptr) - { - continue; - } - - const auto timeline = _parseTimeline( - rawTimeline, FRAME, TimelineType::SlotDeform, - false, true, 0, - std::bind(&JSONDataParser::_parseSlotFFDFrame, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3) - ); - if (timeline != nullptr) - { - _animation->addSlotTimeline(_slot, timeline); - } - - _slot = nullptr; - _mesh = nullptr; - } - } - - if (rawData.HasMember(IK)) - { - const auto& rawTimelines = rawData[IK]; - for (std::size_t i = 0, l = rawTimelines.Size(); i < l; ++i) - { - const auto& rawTimeline = rawTimelines[i]; - const auto& constraintName = _getString(rawTimeline, NAME, ""); - const auto constraint = _armature->getConstraint(constraintName); - if (constraint == nullptr) - { - continue; - } - - const auto timeline = _parseTimeline( - rawTimeline, FRAME, TimelineType::IKConstraint, - true, false, 2, - std::bind(&JSONDataParser::_parseIKConstraintFrame, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3) - ); - - if (timeline != nullptr) - { - _animation->addConstraintTimeline(constraint, timeline); - } - } - } - - if (_actionFrames.size() > 0) - { - std::sort(_actionFrames.begin(), _actionFrames.end()); - - const auto timeline = _animation->actionTimeline = BaseObject::borrowObject(); - const auto keyFrameCount = _actionFrames.size(); - timeline->type = TimelineType::Action; - timeline->offset = _timelineArray.size(); - _timelineArray.resize(_timelineArray.size() + 1 + 1 + 1 + 1 + 1 + keyFrameCount); - _timelineArray[timeline->offset + (unsigned)BinaryOffset::TimelineScale] = 100; - _timelineArray[timeline->offset + (unsigned)BinaryOffset::TimelineOffset] = 0; - _timelineArray[timeline->offset + (unsigned)BinaryOffset::TimelineKeyFrameCount] = keyFrameCount; - _timelineArray[timeline->offset + (unsigned)BinaryOffset::TimelineFrameValueCount] = 0; - _timelineArray[timeline->offset + (unsigned)BinaryOffset::TimelineFrameValueOffset] = 0; - - _timeline = timeline; - - if (keyFrameCount == 1) - { - timeline->frameIndicesOffset = -1; - _timelineArray[timeline->offset + (unsigned)BinaryOffset::TimelineFrameOffset + 0] = _parseCacheActionFrame(_actionFrames[0]) - _animation->frameOffset; - } - else { - const auto totalFrameCount = _animation->frameCount + 1; // One more frame than animation. - auto& frameIndices = _data->frameIndices; - timeline->frameIndicesOffset = frameIndices.size(); - frameIndices.resize(frameIndices.size() + totalFrameCount); - - for ( - std::size_t i = 0, iK = 0, frameStart = 0, frameCount = 0; - i < totalFrameCount; - ++i - ) - { - if (frameStart + frameCount <= i && iK < keyFrameCount) - { - auto& frame = _actionFrames[iK]; - frameStart = frame.frameStart; - if (iK == keyFrameCount - 1) - { - frameCount = _animation->frameCount - frameStart; - } - else { - frameCount = _actionFrames[iK + 1].frameStart - frameStart; - } - - _timelineArray[timeline->offset + (unsigned)BinaryOffset::TimelineFrameOffset + iK] = _parseActionFrame(frame, frameStart, frameCount) - _animation->frameOffset; - iK++; - } - - frameIndices[timeline->frameIndicesOffset + i] = iK - 1; - } - } - - _timeline = nullptr; - _actionFrames.clear(); - } - - _animation = nullptr; - - return animation; -} - -TimelineData* JSONDataParser::_parseTimeline( - const rapidjson::Value& rawData, const char* framesKey, TimelineType type, - bool addIntOffset, bool addFloatOffset, unsigned frameValueCount, - const std::function& frameParser -) -{ - if (!rawData.HasMember(framesKey)) - { - return nullptr; - } - - const auto& rawFrames = rawData[framesKey]; - const auto keyFrameCount = rawFrames.Size(); - if (keyFrameCount == 0) - { - return nullptr; - } - - const auto timeline = BaseObject::borrowObject(); - timeline->type = type; - timeline->offset = _timelineArray.size(); - _timelineArray.resize(_timelineArray.size() + 1 + 1 + 1 + 1 + 1 + keyFrameCount); - _timelineArray[timeline->offset + (unsigned)BinaryOffset::TimelineScale] = _getNumber(rawData, SCALE, 1.0f) * 100.f; - _timelineArray[timeline->offset + (unsigned)BinaryOffset::TimelineOffset] = _getNumber(rawData, OFFSET, 0.0f) * 100.f; - _timelineArray[timeline->offset + (unsigned)BinaryOffset::TimelineKeyFrameCount] = keyFrameCount; - _timelineArray[timeline->offset + (unsigned)BinaryOffset::TimelineFrameValueCount] = frameValueCount; - if (addIntOffset) - { - _timelineArray[timeline->offset + (unsigned)BinaryOffset::TimelineFrameValueOffset] = _frameIntArray.size() - _animation->frameIntOffset; - } - else if (addFloatOffset) - { - _timelineArray[timeline->offset + (unsigned)BinaryOffset::TimelineFrameValueOffset] = _frameFloatArray.size() - _animation->frameFloatOffset; - } - else - { - _timelineArray[timeline->offset + (unsigned)BinaryOffset::TimelineFrameValueOffset] = 0; - } - - _timeline = timeline; - - if (keyFrameCount == 1) // Only one frame. - { - timeline->frameIndicesOffset = -1; - _timelineArray[timeline->offset + (unsigned)BinaryOffset::TimelineFrameOffset + 0] = frameParser(rawFrames[0], 0, 0) - _animation->frameOffset; - } - else { - unsigned frameIndicesOffset = 0; - auto& frameIndices = _data->frameIndices; - const auto totalFrameCount = _animation->frameCount + 1; // One more frame than animation. - frameIndicesOffset = frameIndices.size(); - frameIndices.resize(frameIndicesOffset + totalFrameCount); - timeline->frameIndicesOffset = frameIndicesOffset; - - for ( - std::size_t i = 0, iK = 0, frameStart = 0, frameCount = 0; - i < totalFrameCount; - ++i - ) - { - if (frameStart + frameCount <= i && iK < keyFrameCount) - { - const auto& rawFrame = rawFrames[iK]; - frameStart = i; - frameCount = _getNumber(rawFrame, DURATION, (unsigned)1); - if (iK == keyFrameCount - 1) - { - frameCount = _animation->frameCount - frameStart; - } - - _timelineArray[timeline->offset + (unsigned)BinaryOffset::TimelineFrameOffset + iK] = frameParser(rawFrame, frameStart, frameCount) - _animation->frameOffset; - iK++; - } - - frameIndices[frameIndicesOffset + i] = iK - 1; - } - } - - _timeline = nullptr; - - return timeline; -} - -void JSONDataParser::_parseBoneTimeline(const rapidjson::Value& rawData) -{ - const auto bone = _armature->getBone(_getString(rawData, NAME, "")); - if (bone == nullptr) - { - return; - } - - _bone = bone; - _slot = _armature->getSlot(_bone->name); - - if (rawData.HasMember(TRANSLATE_FRAME)) - { - const auto timeline = _parseTimeline( - rawData, TRANSLATE_FRAME, TimelineType::BoneTranslate, - false, true, 2, - std::bind(&JSONDataParser::_parseBoneTranslateFrame, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3) - ); - if (timeline != nullptr) - { - _animation->addBoneTimeline(bone, timeline); - } - } - - if (rawData.HasMember(ROTATE_FRAME)) - { - const auto timeline = _parseTimeline( - rawData, ROTATE_FRAME, TimelineType::BoneRotate, - false, true, 2, - std::bind(&JSONDataParser::_parseBoneRotateFrame, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3) - ); - if (timeline != nullptr) - { - _animation->addBoneTimeline(bone, timeline); - } - } - - if (rawData.HasMember(SCALE_FRAME)) - { - const auto timeline = _parseTimeline( - rawData, SCALE_FRAME, TimelineType::BoneScale, - false, true, 2, - std::bind(&JSONDataParser::_parseBoneScaleFrame, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3) - ); - if (timeline != nullptr) - { - _animation->addBoneTimeline(bone, timeline); - } - } - - if (rawData.HasMember(FRAME)) - { - const auto timeline = _parseTimeline( - rawData, FRAME, TimelineType::BoneAll, - false, true, 6, - std::bind(&JSONDataParser::_parseBoneAllFrame, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3) - ); - if (timeline != nullptr) - { - _animation->addBoneTimeline(bone, timeline); - } - } - - _bone = nullptr; - _slot = nullptr; -} - -void JSONDataParser::_parseSlotTimeline(const rapidjson::Value& rawData) -{ - const auto slot = _armature->getSlot(_getString(rawData, NAME, "")); - if (slot == nullptr) - { - return; - } - - TimelineData* displayTimeline = nullptr; - TimelineData* colorTimeline = nullptr; - _slot = slot; - - if (rawData.HasMember(DISPLAY_FRAME)) - { - displayTimeline = _parseTimeline( - rawData, DISPLAY_FRAME, TimelineType::SlotDisplay, - false, false, 0, - std::bind(&JSONDataParser::_parseSlotDisplayFrame, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3) - ); - } - else - { - displayTimeline = _parseTimeline( - rawData, FRAME, TimelineType::SlotDisplay, - false, false, 0, - std::bind(&JSONDataParser::_parseSlotDisplayFrame, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3) - ); - } - - if (rawData.HasMember(COLOR_FRAME)) - { - colorTimeline = _parseTimeline( - rawData, COLOR_FRAME, TimelineType::SlotColor, - true, false, 1, - std::bind(&JSONDataParser::_parseSlotColorFrame, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3) - ); - } - else - { - colorTimeline = _parseTimeline( - rawData, FRAME, TimelineType::SlotColor, - true, false, 1, - std::bind(&JSONDataParser::_parseSlotColorFrame, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3) - ); - } - - if (displayTimeline != nullptr) - { - _animation->addSlotTimeline(slot, displayTimeline); - } - - if (colorTimeline != nullptr) - { - _animation->addSlotTimeline(slot, colorTimeline); - } - - _slot = nullptr; -} - -unsigned JSONDataParser::_parseFrame(const rapidjson::Value& rawData, unsigned frameStart, unsigned frameCount) -{ - const auto frameOffset = _frameArray.size(); - _frameArray.resize(_frameArray.size() + 1); - _frameArray[frameOffset + (unsigned)BinaryOffset::FramePosition] = frameStart; - - return frameOffset; -} - -unsigned JSONDataParser::_parseTweenFrame(const rapidjson::Value& rawData, unsigned frameStart, unsigned frameCount) -{ - const auto frameOffset = _parseFrame(rawData, frameStart, frameCount); - - if (frameCount > 0) - { - if (rawData.HasMember(CURVE)) - { - const auto sampleCount = frameCount + 1; - _helpArray.resize(sampleCount); - _samplingEasingCurve(rawData[CURVE], _helpArray); - _frameArray.resize(_frameArray.size() + 1 + 1 + _helpArray.size()); - _frameArray[frameOffset + (unsigned)BinaryOffset::FrameTweenType] = (int)TweenType::Curve; - _frameArray[frameOffset + (unsigned)BinaryOffset::FrameTweenEasingOrCurveSampleCount] = sampleCount; - for (std::size_t i = 0; i < sampleCount; ++i) - { - _frameArray[frameOffset + (unsigned)BinaryOffset::FrameCurveSamples + i] = _helpArray[i] * 10000.0f; - } - } - else - { - const auto noTween = -2.0f; - auto tweenEasing = noTween; - if (rawData.HasMember(TWEEN_EASING)) - { - tweenEasing = _getNumber(rawData, TWEEN_EASING, noTween); - } - - if (tweenEasing == noTween) - { - _frameArray.resize(_frameArray.size() + 1); - _frameArray[frameOffset + (unsigned)BinaryOffset::FrameTweenType] = (int16_t)TweenType::None; - } - else if (tweenEasing == 0.0f) - { - _frameArray.resize(_frameArray.size() + 1); - _frameArray[frameOffset + (unsigned)BinaryOffset::FrameTweenType] = (int16_t)TweenType::Line; - } - else if (tweenEasing < 0.0f) - { - _frameArray.resize(_frameArray.size() + 1 + 1); - _frameArray[frameOffset + (unsigned)BinaryOffset::FrameTweenType] = (int16_t)TweenType::QuadIn; - _frameArray[frameOffset + (unsigned)BinaryOffset::FrameTweenEasingOrCurveSampleCount] = -tweenEasing * 100.0f; - } - else if (tweenEasing <= 1.0f) - { - _frameArray.resize(_frameArray.size() + 1 + 1); - _frameArray[frameOffset + (unsigned)BinaryOffset::FrameTweenType] = (int16_t)TweenType::QuadOut; - _frameArray[frameOffset + (unsigned)BinaryOffset::FrameTweenEasingOrCurveSampleCount] = tweenEasing * 100.0f; - } - else - { - _frameArray.resize(_frameArray.size() + 1 + 1); - _frameArray[frameOffset + (unsigned)BinaryOffset::FrameTweenType] = (int16_t)TweenType::QuadInOut; - _frameArray[frameOffset + (unsigned)BinaryOffset::FrameTweenEasingOrCurveSampleCount] = tweenEasing * 100.0f - 100.0f; - } - } - } - else - { - _frameArray.resize(_frameArray.size() + 1); - _frameArray[frameOffset + (unsigned)BinaryOffset::FrameTweenType] = (int16_t)TweenType::None; - } - - return frameOffset; -} - -unsigned JSONDataParser::_parseActionFrame(const ActionFrame& frame, unsigned frameStart, unsigned frameCount) -{ - const auto frameOffset = _frameArray.size(); - const auto actionCount = frame.actions.size(); - _frameArray.resize(_frameArray.size() + 1 + 1 + actionCount); - _frameArray[frameOffset + (unsigned)BinaryOffset::FramePosition] = frameStart; - _frameArray[frameOffset + (unsigned)BinaryOffset::FramePosition + 1] = actionCount; // Action count. - - for (std::size_t i = 0; i < actionCount; ++i) // Action offsets. - { - _frameArray[frameOffset + (unsigned)BinaryOffset::FramePosition + 2 + i] = frame.actions[i]; - } - - return frameOffset; -} - -unsigned JSONDataParser::_parseZOrderFrame(const rapidjson::Value& rawData, unsigned frameStart, unsigned frameCount) -{ - const auto frameOffset = _parseFrame(rawData, frameStart, frameCount); - - if (rawData.HasMember(Z_ORDER)) - { - const auto& rawZOrder = rawData[Z_ORDER]; - if (!rawZOrder.Empty()) - { - const auto slotCount = _armature->sortedSlots.size(); - std::vector unchanged; - std::vector zOrders; - unchanged.resize(slotCount - rawZOrder.Size() / 2); - zOrders.resize(slotCount); - - for (std::size_t i = 0; i < unchanged.size(); ++i) - { - unchanged[i] = 0; - } - - for (std::size_t i = 0; i < slotCount; ++i) - { - zOrders[i] = -1; - } - - unsigned originalIndex = 0; - unsigned unchangedIndex = 0; - for (std::size_t i = 0, l = rawZOrder.Size(); i < l; i += 2) - { - const auto slotIndex = rawZOrder[i].GetInt(); - const auto zOrderOffset = rawZOrder[i + 1].GetInt(); - while (originalIndex != (unsigned)slotIndex) - { - unchanged[unchangedIndex++] = originalIndex++; - } - - unsigned index = originalIndex + zOrderOffset; - CCASSERT(index >= 0 && index < zOrders.size(), "DragonBones::JSONDataParser index is invalid"); - zOrders[index] = originalIndex++; - } - - while (originalIndex < slotCount) - { - unchanged[unchangedIndex++] = originalIndex++; - } - - _frameArray.resize(_frameArray.size() + 1 + slotCount); - _frameArray[frameOffset + 1] = slotCount; - - int i = slotCount; - while (i--) - { - if (zOrders[i] == -1) - { - _frameArray[frameOffset + 2 + i] = unchanged[--unchangedIndex]; - } - else { - _frameArray[frameOffset + 2 + i] = zOrders[i]; - } - } - - return frameOffset; - } - } - - _frameArray.resize(_frameArray.size() + 1); - _frameArray[frameOffset + 1] = 0; - - return frameOffset; -} - -unsigned JSONDataParser::_parseBoneAllFrame(const rapidjson::Value& rawData, unsigned frameStart, unsigned frameCount) -{ - _helpTransform.identity(); - if (rawData.HasMember(TRANSFORM)) - { - _parseTransform(rawData[TRANSFORM], _helpTransform, 1.0f); - } - - // Modify rotation. - auto rotation = _helpTransform.rotation; - if (frameStart != 0) - { - if (_prevClockwise == 0) - { - rotation = _prevRotation + Transform::normalizeRadian(rotation - _prevRotation); - } - else - { - if (_prevClockwise > 0 ? rotation >= _prevRotation : rotation <= _prevRotation) - { - _prevClockwise = _prevClockwise > 0 ? _prevClockwise - 1 : _prevClockwise + 1; - } - - rotation = _prevRotation + rotation - _prevRotation + Transform::PI_D * _prevClockwise; - } - } - - _prevClockwise = _getNumber(rawData, TWEEN_ROTATE, 0.0f); - _prevRotation = rotation; - // - const auto frameOffset = _parseTweenFrame(rawData, frameStart, frameCount); - auto frameFloatOffset = _frameFloatArray.size(); - _frameFloatArray.resize(_frameFloatArray.size() + 6); - _frameFloatArray[frameFloatOffset++] = _helpTransform.x; - _frameFloatArray[frameFloatOffset++] = _helpTransform.y; - _frameFloatArray[frameFloatOffset++] = rotation; - _frameFloatArray[frameFloatOffset++] = _helpTransform.skew; - _frameFloatArray[frameFloatOffset++] = _helpTransform.scaleX; - _frameFloatArray[frameFloatOffset++] = _helpTransform.scaleY; - _parseActionDataInFrame(rawData, frameStart, _bone, _slot); - - return frameOffset; -} - -unsigned JSONDataParser::_parseBoneTranslateFrame(const rapidjson::Value& rawData, unsigned frameStart, unsigned frameCount) -{ - const auto frameOffset = _parseTweenFrame(rawData, frameStart, frameCount); - auto frameFloatOffset = _frameFloatArray.size(); - _frameFloatArray.resize(_frameFloatArray.size() + 2); - _frameFloatArray[frameFloatOffset++] = _getNumber(rawData, X, 0.0f); - _frameFloatArray[frameFloatOffset++] = _getNumber(rawData, Y, 0.0f); - - return frameOffset; -} - -unsigned JSONDataParser::_parseBoneRotateFrame(const rapidjson::Value& rawData, unsigned frameStart, unsigned frameCount) -{ - // Modify rotation. - auto rotation = _getNumber(rawData, ROTATE, 0.0f) * Transform::DEG_RAD; - if (frameStart != 0) - { - if (_prevClockwise == 0) - { - rotation = _prevRotation + Transform::normalizeRadian(rotation - _prevRotation); - } - else - { - if (_prevClockwise > 0 ? rotation >= _prevRotation : rotation <= _prevRotation) - { - _prevClockwise = _prevClockwise > 0 ? _prevClockwise - 1 : _prevClockwise + 1; - } - - rotation = _prevRotation + rotation - _prevRotation + Transform::PI_D * _prevClockwise; - } - } - - _prevClockwise = _getNumber(rawData, CLOCK_WISE, 0.0f); - _prevRotation = rotation; - // - const auto frameOffset = _parseTweenFrame(rawData, frameStart, frameCount); - auto frameFloatOffset = _frameFloatArray.size(); - _frameFloatArray.resize(_frameFloatArray.size() + 2); - _frameFloatArray[frameFloatOffset++] = rotation; - _frameFloatArray[frameFloatOffset++] = _getNumber(rawData, SKEW, 0.0f) * Transform::DEG_RAD; - - return frameOffset; -} - -unsigned JSONDataParser::_parseBoneScaleFrame(const rapidjson::Value& rawData, unsigned frameStart, unsigned frameCount) -{ - const auto frameOffset = _parseTweenFrame(rawData, frameStart, frameCount); - - auto frameFloatOffset = _frameFloatArray.size(); - _frameFloatArray.resize(_frameFloatArray.size() + 2); - _frameFloatArray[frameFloatOffset++] = _getNumber(rawData, X, 1.0f); - _frameFloatArray[frameFloatOffset++] = _getNumber(rawData, Y, 1.0f); - - return frameOffset; -} - -unsigned JSONDataParser::_parseSlotDisplayFrame(const rapidjson::Value& rawData, unsigned frameStart, unsigned frameCount) -{ - const auto frameOffset = _parseFrame(rawData, frameStart, frameCount); - - _frameArray.resize(_frameArray.size() + 1); - - if (rawData.HasMember(VALUE)) - { - _frameArray[frameOffset + 1] = _getNumber(rawData, VALUE, 0); - } - else - { - _frameArray[frameOffset + 1] = _getNumber(rawData, DISPLAY_INDEX, 0); - } - - _parseActionDataInFrame(rawData, frameStart, _slot->parent, _slot); - - return frameOffset; -} - -unsigned JSONDataParser::_parseSlotColorFrame(const rapidjson::Value& rawData, unsigned frameStart, unsigned frameCount) -{ - const auto frameOffset = _parseTweenFrame(rawData, frameStart, frameCount); - auto colorOffset = -1; - - if (rawData.HasMember(VALUE) || rawData.HasMember(COLOR)) - { - const auto& rawColor = rawData.HasMember(VALUE) ? rawData[VALUE] : rawData[COLOR]; - if ( - rawColor.HasMember(ALPHA_MULTIPLIER) || - rawColor.HasMember(RED_MULTIPLIER) || - rawColor.HasMember(GREEN_MULTIPLIER) || - rawColor.HasMember(BLUE_MULTIPLIER) || - rawColor.HasMember(ALPHA_OFFSET) || - rawColor.HasMember(RED_OFFSET) || - rawColor.HasMember(GREEN_OFFSET) || - rawColor.HasMember(BLUE_OFFSET) - ) - { - _parseColorTransform(rawColor, _helpColorTransform); - colorOffset = _intArray.size(); - _intArray.resize(_intArray.size() + 8); - _intArray[colorOffset++] = _helpColorTransform.alphaMultiplier * 100; - _intArray[colorOffset++] = _helpColorTransform.redMultiplier * 100; - _intArray[colorOffset++] = _helpColorTransform.greenMultiplier * 100; - _intArray[colorOffset++] = _helpColorTransform.blueMultiplier * 100; - _intArray[colorOffset++] = _helpColorTransform.alphaOffset; - _intArray[colorOffset++] = _helpColorTransform.redOffset; - _intArray[colorOffset++] = _helpColorTransform.greenOffset; - _intArray[colorOffset++] = _helpColorTransform.blueOffset; - colorOffset -= 8; - } - } - - if (colorOffset < 0) - { - if (_defaultColorOffset < 0) - { - _defaultColorOffset = colorOffset = _intArray.size(); - _intArray.resize(_intArray.size() + 8); - _intArray[colorOffset++] = 100; - _intArray[colorOffset++] = 100; - _intArray[colorOffset++] = 100; - _intArray[colorOffset++] = 100; - _intArray[colorOffset++] = 0; - _intArray[colorOffset++] = 0; - _intArray[colorOffset++] = 0; - _intArray[colorOffset++] = 0; - } - - colorOffset = _defaultColorOffset; - } - - const auto frameIntOffset = _frameIntArray.size(); - _frameIntArray.resize(_frameIntArray.size() + 1); - _frameIntArray[frameIntOffset] = colorOffset; - - return frameOffset; -} - -unsigned JSONDataParser::_parseSlotFFDFrame(const rapidjson::Value& rawData, unsigned frameStart, unsigned frameCount) -{ - const auto frameFloatOffset = _frameFloatArray.size(); - const auto frameOffset = _parseTweenFrame(rawData, frameStart, frameCount); - const auto offset = _getNumber(rawData, OFFSET, (unsigned)0); - const auto vertexCount = (unsigned)_intArray[_mesh->vertices.offset + (unsigned)BinaryOffset::MeshVertexCount]; - const auto meshName = _mesh->parent->name + "_" + _slot->name + "_" + _mesh->name; - const auto weight = _mesh->vertices.weight; - - auto x = 0.0f; - auto y = 0.0f; - unsigned iB = 0; - unsigned iV = 0; - if (weight != nullptr) - { - const auto& rawSlotPose = *(_weightSlotPose[meshName]); - - _helpMatrixA.a = rawSlotPose[0].GetDouble(); - _helpMatrixA.b = rawSlotPose[1].GetDouble(); - _helpMatrixA.c = rawSlotPose[2].GetDouble(); - _helpMatrixA.d = rawSlotPose[3].GetDouble(); - _helpMatrixA.tx = rawSlotPose[4].GetDouble(); - _helpMatrixA.ty = rawSlotPose[5].GetDouble(); - - _frameFloatArray.resize(_frameFloatArray.size() + weight->count * 2); - iB = weight->offset + (unsigned)BinaryOffset::WeigthBoneIndices + weight->bones.size(); - } - else - { - _frameFloatArray.resize(_frameFloatArray.size() + vertexCount * 2); - } - - for ( - std::size_t i = 0; - i < vertexCount * 2; - i += 2 - ) - { - if (!rawData.HasMember(VERTICES)) // Fill 0. - { - x = 0.0f; - y = 0.0f; - } - else - { - if (i < offset || i - offset >= rawData[VERTICES].Size()) { - x = 0.0f; - } - else - { - x = rawData[VERTICES][i - offset].GetDouble(); - } - - if (i + 1 < offset || i + 1 - offset >= rawData[VERTICES].Size()) { - y = 0.0f; - } - else - { - y = rawData[VERTICES][i + 1 - offset].GetDouble(); - } - } - - if (weight != nullptr) // If mesh is skinned, transform point by bone bind pose. - { - const auto& rawBonePoses = *(_weightBonePoses[meshName]); - const unsigned vertexBoneCount = _intArray[iB++]; - - _helpMatrixA.transformPoint(x, y, _helpPoint, true); - x = _helpPoint.x; - y = _helpPoint.y; - - for (std::size_t j = 0; j < vertexBoneCount; ++j) - { - const auto boneIndex = _intArray[iB++]; - const auto matrixOffset = boneIndex * 7 + 1; - - _helpMatrixB.a = rawBonePoses[matrixOffset + 0].GetDouble(); - _helpMatrixB.b = rawBonePoses[matrixOffset + 1].GetDouble(); - _helpMatrixB.c = rawBonePoses[matrixOffset + 2].GetDouble(); - _helpMatrixB.d = rawBonePoses[matrixOffset + 3].GetDouble(); - _helpMatrixB.tx = rawBonePoses[matrixOffset + 4].GetDouble(); - _helpMatrixB.ty = rawBonePoses[matrixOffset + 5].GetDouble(); - _helpMatrixB.invert(); - _helpMatrixB.transformPoint(x, y, _helpPoint, true); - - _frameFloatArray[frameFloatOffset + iV++] = _helpPoint.x; - _frameFloatArray[frameFloatOffset + iV++] = _helpPoint.y; - } - } - else - { - _frameFloatArray[frameFloatOffset + i] = x; - _frameFloatArray[frameFloatOffset + i + 1] = y; - } - } - - if (frameStart == 0) - { - const auto frameIntOffset = _frameIntArray.size(); - _frameIntArray.resize(_frameIntArray.size() + 1 + 1 + 1 + 1 + 1); - _frameIntArray[frameIntOffset + (unsigned)BinaryOffset::DeformVertexOffset] = _mesh->vertices.offset; - _frameIntArray[frameIntOffset + (unsigned)BinaryOffset::DeformCount] = _frameFloatArray.size() - frameFloatOffset; - _frameIntArray[frameIntOffset + (unsigned)BinaryOffset::DeformValueCount] = _frameFloatArray.size() - frameFloatOffset; - _frameIntArray[frameIntOffset + (unsigned)BinaryOffset::DeformValueOffset] = 0; - _frameIntArray[frameIntOffset + (unsigned)BinaryOffset::DeformFloatOffset] = frameFloatOffset; - _timelineArray[_timeline->offset + (unsigned)BinaryOffset::TimelineFrameValueCount] = frameIntOffset - _animation->frameIntOffset; - } - - return frameOffset; -} - -unsigned JSONDataParser::_parseIKConstraintFrame(const rapidjson::Value& rawData, unsigned frameStart, unsigned frameCount) -{ - const auto frameOffset = _parseTweenFrame(rawData, frameStart, frameCount); - - auto frameIntOffset = _frameIntArray.size(); - _frameIntArray.resize(_frameIntArray.size() + 2); - _frameIntArray[frameIntOffset++] = _getBoolean(rawData, BEND_POSITIVE, true) ? 1 : 0; - _frameIntArray[frameIntOffset++] = round(_getNumber(rawData, WEIGHT, 1.0f) * 100.0f); - - return frameOffset; -} - -const std::vector& JSONDataParser::_parseActionData(const rapidjson::Value& rawData, ActionType type, BoneData* bone, SlotData* slot) -{ - static std::vector actions; - actions.clear(); - - if (rawData.IsString()) - { - const auto action = BaseObject::borrowObject(); - action->type = type; - action->name = rawData.GetString(); - action->bone = bone; - action->slot = slot; - actions.push_back(action); - } - else if (rawData.IsArray()) - { - for (std::size_t iA = 0, lA = rawData.Size(); iA < lA; ++iA) - { - const auto& rawAction = rawData[iA]; - const auto action = BaseObject::borrowObject(); - - if (rawAction.HasMember(GOTO_AND_PLAY)) - { - action->type = ActionType::Play; - action->name = _getString(rawAction, GOTO_AND_PLAY, ""); - } - else - { - if (rawAction.HasMember(TYPE) && rawAction[TYPE].IsString()) - { - action->type = _getActionType(rawAction[TYPE].GetString()); - } - else - { - action->type = (ActionType)_getNumber(rawAction, TYPE, (int)type); - } - - action->name = _getString(rawAction, NAME, ""); - } - - if (rawAction.HasMember(BONE)) - { - const auto& boneName = _getString(rawAction, BONE, ""); - action->bone = _armature->getBone(boneName); - } - else { - action->bone = bone; - } - - if (rawAction.HasMember(SLOT)) - { - const auto& slotName = _getString(rawAction, SLOT, ""); - action->slot = _armature->getSlot(slotName); - } - else - { - action->slot = slot; - } - - if (rawAction.HasMember(INTS)) - { - if (action->data == nullptr) - { - action->data = BaseObject::borrowObject(); - } - - const auto& rawInts = rawAction[INTS]; - for (std::size_t i = 0, l = rawInts.Size(); i < l; ++i) - { - action->data->addInt(rawInts[i].GetInt()); - } - } - - if (rawAction.HasMember(FLOATS)) - { - if (action->data == nullptr) - { - action->data = BaseObject::borrowObject(); - } - - const auto& rawFloats = rawAction[FLOATS]; - for (std::size_t i = 0, l = rawFloats.Size(); i < l; ++i) - { - action->data->addFloat(rawFloats[i].GetDouble()); - } - } - - if (rawAction.HasMember(STRINGS)) - { - if (action->data == nullptr) - { - action->data = BaseObject::borrowObject(); - } - - const auto& rawStrings = rawAction[STRINGS]; - for (std::size_t i = 0, l = rawStrings.Size(); i < l; ++i) - { - action->data->addString(rawStrings[i].GetString()); - } - } - - actions.push_back(action); - } - } - - return actions; -} - -void JSONDataParser::_parseTransform(const rapidjson::Value& rawData, Transform& transform, float scale) -{ - transform.x = _getNumber(rawData, X, 0.0f) * scale; - transform.y = _getNumber(rawData, Y, 0.0f) * scale; - - if (rawData.HasMember(ROTATE) || rawData.HasMember(SKEW)) - { - transform.rotation = Transform::normalizeRadian(_getNumber(rawData, ROTATE, 0.0f) * Transform::DEG_RAD); - transform.skew = Transform::normalizeRadian(_getNumber(rawData, SKEW, 0.0f) * Transform::DEG_RAD); - } - else if (rawData.HasMember(SKEW_X) || rawData.HasMember(SKEW_Y)) - { - transform.rotation = Transform::normalizeRadian(_getNumber(rawData, SKEW_Y, 0.0f) * Transform::DEG_RAD); - transform.skew = Transform::normalizeRadian(_getNumber(rawData, SKEW_X, 0.0f) * Transform::DEG_RAD) - transform.rotation; - } - - transform.scaleX = _getNumber(rawData, SCALE_X, 1.0f); - transform.scaleY = _getNumber(rawData, SCALE_Y, 1.0f); -} - -void JSONDataParser::_parseColorTransform(const rapidjson::Value& rawData, ColorTransform& color) -{ - color.alphaMultiplier = _getNumber(rawData, ALPHA_MULTIPLIER, (int)100) * 0.01f; - color.redMultiplier = _getNumber(rawData, RED_MULTIPLIER, (int)100) * 0.01f; - color.greenMultiplier = _getNumber(rawData, GREEN_MULTIPLIER, (int)100) * 0.01f; - color.blueMultiplier = _getNumber(rawData, BLUE_MULTIPLIER, (int)100) * 0.01f; - color.alphaOffset = _getNumber(rawData, ALPHA_OFFSET, (int)0); - color.redOffset = _getNumber(rawData, RED_OFFSET, (int)0); - color.greenOffset = _getNumber(rawData, GREEN_OFFSET, (int)0); - color.blueOffset = _getNumber(rawData, BLUE_OFFSET, (int)0); -} - -void JSONDataParser::_parseArray(const rapidjson::Value& rawData) -{ - _intArray.clear(); - _floatArray.clear(); - _frameIntArray.clear(); - _frameFloatArray.clear(); - _frameArray.clear(); - _timelineArray.clear(); -} - -DragonBonesData* JSONDataParser::_parseDragonBonesData(const rapidjson::Value& rawData, float scale) -{ - const auto& version = _getString(rawData, VERSION, ""); - const auto& compatibleVersion = _getString(rawData, COMPATIBLE_VERSION, ""); - - if ( - indexOf(DATA_VERSIONS, version) >= 0 || - indexOf(DATA_VERSIONS, compatibleVersion) >= 0 - ) - { - const auto data = BaseObject::borrowObject(); - data->version = version; - data->name = _getString(rawData, NAME, ""); - data->frameRate = _getNumber(rawData, FRAME_RATE, 24); - - if (data->frameRate == 0) // Data error. - { - data->frameRate = 24; - } - - if (rawData.HasMember(ARMATURE)) - { - _data = data; - _parseArray(rawData); - - const auto& rawArmatures = rawData[ARMATURE]; - for (std::size_t i = 0, l = rawArmatures.Size(); i < l; ++i) - { - data->addArmature(_parseArmature(rawArmatures[i], scale)); - } - - if (data->binary == nullptr) - { - // Align. - if (fmod(_intArray.size(), 2) != 0) - { - _intArray.push_back(0); - } - - if (fmod(_frameIntArray.size(), 2) != 0) - { - _frameIntArray.push_back(0); - } - - if (fmod(_frameArray.size(), 2) != 0) - { - _frameArray.push_back(0); - } - - if (fmod(_timelineArray.size(), 2) != 0) - { - _timelineArray.push_back(0); - } - - const auto l1 = _intArray.size() * 2; - const auto l2 = _floatArray.size() * 4; - const auto l3 = _frameIntArray.size() * 2; - const auto l4 = _frameFloatArray.size() * 4; - const auto l5 = _frameArray.size() * 2; - const auto l6 = _timelineArray.size() * 2; - - auto binary = new char[l1 + l2 + l3 + l4 + l5 + l6]; - auto intArray = (int16_t*)binary; - auto floatArray = (float*)(binary + l1); - auto frameIntArray = (int16_t*)(binary + l1 + l2); - auto frameFloatArray = (float*)(binary + l1 + l2 + l3); - auto frameArray = (int16_t*)(binary + l1 + l2 + l3 + l4); - auto timelineArray = (uint16_t*)(binary + l1 + l2 + l3 + l4 + l5); - - for (std::size_t i = 0, l = _intArray.size(); i < l; ++i) - { - intArray[i] = _intArray[i]; - } - - for (std::size_t i = 0, l = _floatArray.size(); i < l; ++i) - { - floatArray[i] = _floatArray[i]; - } - - for (std::size_t i = 0, l = _frameIntArray.size(); i < l; ++i) - { - frameIntArray[i] = _frameIntArray[i]; - } - - for (std::size_t i = 0, l = _frameFloatArray.size(); i < l; ++i) - { - frameFloatArray[i] = _frameFloatArray[i]; - } - - for (std::size_t i = 0, l = _frameArray.size(); i < l; ++i) - { - frameArray[i] = _frameArray[i]; - } - - for (std::size_t i = 0, l = _timelineArray.size(); i < l; ++i) - { - timelineArray[i] = _timelineArray[i]; - } - - data->binary = binary; - data->intArray = intArray; - data->floatArray = floatArray; - data->frameIntArray = frameIntArray; - data->frameFloatArray = frameFloatArray; - data->frameArray = frameArray; - data->timelineArray = timelineArray; - } - - _defaultColorOffset = -1; - _data = nullptr; - } - - if (rawData.HasMember(TEXTURE_ATLAS)) - { - _rawTextureAtlases = (rapidjson::Value*)&(rawData[TEXTURE_ATLAS]); - } - - return data; - } - else - { - DRAGONBONES_ASSERT( - false, - "Nonsupport data version: " + version + "\n" + - "Please convert DragonBones data to support version.\n" + - "Read more: https://github.com/DragonBones/Tools/" - ); - } - - return nullptr; -} - -void JSONDataParser::_parseTextureAtlasData(const rapidjson::Value& rawData, TextureAtlasData& textureAtlasData, float scale) -{ - textureAtlasData.format = _getTextureFormat(_getString(rawData, FORMAT, "")); - textureAtlasData.width = _getNumber(rawData, WIDTH, (unsigned)0); - textureAtlasData.height = _getNumber(rawData, HEIGHT, (unsigned)0); - textureAtlasData.scale = scale == 1.0f ? 1.0f / _getNumber(rawData, SCALE, 1.0f) : scale; - textureAtlasData.name = _getString(rawData, NAME, ""); - textureAtlasData.imagePath = _getString(rawData, IMAGE_PATH, ""); - - if (rawData.HasMember(SUB_TEXTURE)) - { - const auto& rawTextures = rawData[SUB_TEXTURE]; - for (std::size_t i = 0, l = rawTextures.Size(); i < l; ++i) - { - const auto& rawTexture = rawTextures[i]; - const auto textureData = textureAtlasData.createTexture(); - textureData->rotated = _getBoolean(rawTexture, ROTATED, false); - textureData->name = _getString(rawTexture, NAME, ""); - textureData->region.x = _getNumber(rawTexture, X, 0.0f); - textureData->region.y = _getNumber(rawTexture, Y, 0.0f); - textureData->region.width = _getNumber(rawTexture, WIDTH, 0.0f); - textureData->region.height = _getNumber(rawTexture, HEIGHT, 0.0f); - - const auto frameWidth = _getNumber(rawTexture, FRAME_WIDTH, -1.0f); - const auto frameHeight = _getNumber(rawTexture, FRAME_HEIGHT, -1.0f); - if (frameWidth > 0.0f && frameHeight > 0.0f) - { - textureData->frame = TextureData::createRectangle(); - textureData->frame->x = _getNumber(rawTexture, FRAME_X, 0.0f); - textureData->frame->y = _getNumber(rawTexture, FRAME_Y, 0.0f); - textureData->frame->width = frameWidth; - textureData->frame->height = frameHeight; - } - - textureAtlasData.addTexture(textureData); - } - } -} - -DragonBonesData* JSONDataParser::parseDragonBonesData(const char* rawData, float scale) -{ - DRAGONBONES_ASSERT(rawData != nullptr, ""); - - rapidjson::Document document; - document.Parse(rawData); - - return _parseDragonBonesData(document, scale); -} - -bool JSONDataParser::parseTextureAtlasData(const char* rawData, TextureAtlasData& textureAtlasData, float scale) -{ - if (rawData == nullptr) - { - if (_rawTextureAtlases == nullptr || _rawTextureAtlases->Empty()) - { - return false; - } - - const auto& rawTextureAtlas = (*_rawTextureAtlases)[_rawTextureAtlasIndex++]; - _parseTextureAtlasData(rawTextureAtlas, textureAtlasData, scale); - if (_rawTextureAtlasIndex >= _rawTextureAtlases->Size()) - { - _rawTextureAtlasIndex = 0; - _rawTextureAtlases = nullptr; - } - - return true; - } - - rapidjson::Document document; - document.Parse(rawData); - _parseTextureAtlasData(document, textureAtlasData, scale); - - return true; -} - -DRAGONBONES_NAMESPACE_END diff --git a/native/cocos/editor-support/dragonbones/parser/JSONDataParser.h b/native/cocos/editor-support/dragonbones/parser/JSONDataParser.h deleted file mode 100644 index 0e1f12a46f..0000000000 --- a/native/cocos/editor-support/dragonbones/parser/JSONDataParser.h +++ /dev/null @@ -1,270 +0,0 @@ -#ifndef DRAGONBONES_JSON_DATA_PARSER_H -#define DRAGONBONES_JSON_DATA_PARSER_H - -#include "DataParser.h" -#include "json/document.h" - -DRAGONBONES_NAMESPACE_BEGIN - -class ActionFrame -{ -public: - unsigned frameStart; - std::vector actions; - - bool operator < (const ActionFrame& b) const - { - return frameStart < b.frameStart; - } -}; - -class JSONDataParser : public DataParser -{ - DRAGONBONES_DISALLOW_COPY_AND_ASSIGN(JSONDataParser) - -protected: - inline static bool _getBoolean(const rapidjson::Value& rawData, const char* key, bool defaultValue) - { - if (rawData.HasMember(key)) - { - const auto& value = rawData[key]; - if (value.IsBool()) - { - return value.GetBool(); - } - else if (value.IsString()) - { - const std::string stringValue = value.GetString(); - if ( - stringValue == "0" || - stringValue == "NaN" || - stringValue == "" || - stringValue == "false" || - stringValue == "null" || - stringValue == "undefined" - ) - { - return false; - } - - return true; - } - else if (value.IsNumber()) - { - return value.GetInt() != 0; - } - } - - return defaultValue; - } - - inline static unsigned _getNumber(const rapidjson::Value& rawData, const char* key, unsigned defaultValue) - { - if (rawData.HasMember(key)) - { - return rawData[key].GetUint(); - } - - return defaultValue; - } - - inline static int _getNumber(const rapidjson::Value& rawData, const char* key, int defaultValue) - { - if (rawData.HasMember(key)) - { - return rawData[key].GetInt(); - } - - return defaultValue; - } - - inline static float _getNumber(const rapidjson::Value& rawData, const char* key, float defaultValue) - { - if (rawData.HasMember(key) && rawData[key].IsNumber()) - { - return rawData[key].GetDouble(); // cocos can not support GetFloat(); - } - - return defaultValue; - } - - inline static std::string _getString(const rapidjson::Value& rawData, const char* key, const std::string& defaultValue) - { - if (rawData.HasMember(key)) - { - if (rawData[key].IsString()) - { - return rawData[key].GetString(); - } - - return dragonBones::to_string(rawData[key].GetDouble()); - } - - return defaultValue; - } - - inline static int _getParameter(const rapidjson::Value& rawData, std::size_t index, int defaultValue) - { - if (rawData.Size() > index) - { - return rawData[(int) index].GetInt(); - } - - return defaultValue; - } - - inline static float _getParameter(const rapidjson::Value& rawData, std::size_t index, float defaultValue) - { - if (rawData.Size() > index) - { - return rawData[(int) index].GetDouble(); - } - - return defaultValue; - } - - inline static std::string _getParameter(const rapidjson::Value& rawData, std::size_t index, const std::string& defaultValue) - { - if (rawData.Size() > index) - { - return rawData[(int) index].GetString(); - } - - return defaultValue; - } - -protected: - unsigned _rawTextureAtlasIndex; - std::vector _rawBones; - DragonBonesData* _data; - ArmatureData* _armature; - BoneData* _bone; - SlotData* _slot; - SkinData* _skin; - MeshDisplayData* _mesh; - AnimationData* _animation; - TimelineData* _timeline; - rapidjson::Value* _rawTextureAtlases; - -private: - int _defaultColorOffset; - int _prevClockwise; - float _prevRotation; - Matrix _helpMatrixA; - Matrix _helpMatrixB; - Transform _helpTransform; - ColorTransform _helpColorTransform; - Point _helpPoint; - std::vector _helpArray; - std::vector _intArray; - std::vector _floatArray; - std::vector _frameIntArray; - std::vector _frameFloatArray; - std::vector _frameArray; - std::vector _timelineArray; - std::vector _cacheRawMeshes; - std::vector _cacheMeshes; - std::vector _actionFrames; - std::map _weightSlotPose; - std::map _weightBonePoses; - std::map> _cacheBones; - std::map> _slotChildActions; - -public: - JSONDataParser() : - _rawTextureAtlasIndex(0), - _rawBones(), - _data(nullptr), - _armature(nullptr), - _bone(nullptr), - _slot(nullptr), - _skin(nullptr), - _mesh(nullptr), - _animation(nullptr), - _timeline(nullptr), - _rawTextureAtlases(nullptr), - - _defaultColorOffset(-1), - _prevClockwise(0), - _prevRotation(0.0f), - _helpMatrixA(), - _helpMatrixB(), - _helpTransform(), - _helpColorTransform(), - _helpPoint(), - _helpArray(), - _intArray(), - _floatArray(), - _frameIntArray(), - _frameFloatArray(), - _frameArray(), - _timelineArray(), - _cacheMeshes(), - _cacheRawMeshes(), - _actionFrames(), - _weightSlotPose(), - _weightBonePoses(), - _cacheBones(), - _slotChildActions() - { - } - virtual ~JSONDataParser() - { - } - -private: - void _getCurvePoint( - float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, - float t, - Point& result - ); - void _samplingEasingCurve(const rapidjson::Value& curve, std::vector& samples); - void _parseActionDataInFrame(const rapidjson::Value& rawData, unsigned frameStart, BoneData* bone, SlotData* slot); - void _mergeActionFrame(const rapidjson::Value& rawData, unsigned frameStart, ActionType type, BoneData* bone, SlotData* slot); - unsigned _parseCacheActionFrame(ActionFrame& frame); - -protected: - virtual ArmatureData* _parseArmature(const rapidjson::Value& rawData, float scale); - virtual BoneData* _parseBone(const rapidjson::Value& rawData); - virtual ConstraintData* _parseIKConstraint(const rapidjson::Value& rawData); - virtual SlotData* _parseSlot(const rapidjson::Value& rawData, int zOrder); - virtual SkinData* _parseSkin(const rapidjson::Value& rawData); - virtual DisplayData* _parseDisplay(const rapidjson::Value& rawData); - virtual void _parsePivot(const rapidjson::Value& rawData, ImageDisplayData& display); - virtual void _parseMesh(const rapidjson::Value& rawData, MeshDisplayData& mesh); - virtual BoundingBoxData* _parseBoundingBox(const rapidjson::Value& rawData); - virtual PolygonBoundingBoxData* _parsePolygonBoundingBox(const rapidjson::Value& rawData); - virtual AnimationData* _parseAnimation(const rapidjson::Value& rawData); - virtual TimelineData* _parseTimeline( - const rapidjson::Value& rawData, const char* framesKey, TimelineType type, - bool addIntOffset, bool addFloatOffset, unsigned frameValueCount, - const std::function& frameParser - ); - virtual void _parseBoneTimeline(const rapidjson::Value& rawData); - virtual void _parseSlotTimeline(const rapidjson::Value& rawData); - virtual unsigned _parseFrame(const rapidjson::Value& rawData, unsigned frameStart, unsigned frameCount); - virtual unsigned _parseTweenFrame(const rapidjson::Value& rawData, unsigned frameStart, unsigned frameCount); - virtual unsigned _parseActionFrame(const ActionFrame& rawData, unsigned frameStart, unsigned frameCount); - virtual unsigned _parseZOrderFrame(const rapidjson::Value& rawData, unsigned frameStart, unsigned frameCount); - virtual unsigned _parseBoneAllFrame(const rapidjson::Value& rawData, unsigned frameStart, unsigned frameCount); - virtual unsigned _parseBoneTranslateFrame(const rapidjson::Value& rawData, unsigned frameStart, unsigned frameCount); - virtual unsigned _parseBoneRotateFrame(const rapidjson::Value& rawData, unsigned frameStart, unsigned frameCount); - virtual unsigned _parseBoneScaleFrame(const rapidjson::Value& rawData, unsigned frameStart, unsigned frameCount); - virtual unsigned _parseSlotDisplayFrame(const rapidjson::Value& rawData, unsigned frameStart, unsigned frameCount); - virtual unsigned _parseSlotColorFrame(const rapidjson::Value& rawData, unsigned frameStart, unsigned frameCount); - virtual unsigned _parseSlotFFDFrame(const rapidjson::Value& rawData, unsigned frameStart, unsigned frameCount); - virtual unsigned _parseIKConstraintFrame(const rapidjson::Value& rawData, unsigned frameStart, unsigned frameCount); - virtual const std::vector& _parseActionData(const rapidjson::Value& rawData, ActionType type, BoneData* bone, SlotData* slot); - virtual void _parseTransform(const rapidjson::Value& rawData, Transform& transform, float scale); - virtual void _parseColorTransform(const rapidjson::Value& rawData, ColorTransform& color); - virtual void _parseArray(const rapidjson::Value& rawData); - virtual DragonBonesData* _parseDragonBonesData(const rapidjson::Value& rawData, float scale = 1.0f); - virtual void _parseTextureAtlasData(const rapidjson::Value& rawData, TextureAtlasData& textureAtlasData, float scale = 1.0f); - -public: - virtual DragonBonesData* parseDragonBonesData(const char* rawData, float scale = 1.0f) override; - virtual bool parseTextureAtlasData(const char* rawData, TextureAtlasData& textureAtlasData, float scale = 1.0f) override; -}; - -DRAGONBONES_NAMESPACE_END -#endif // DRAGONBONES_JSON_DATA_PARSER_H diff --git a/native/cocos/editor-support/middleware-adapter.cpp b/native/cocos/editor-support/middleware-adapter.cpp deleted file mode 100644 index a1390401d6..0000000000 --- a/native/cocos/editor-support/middleware-adapter.cpp +++ /dev/null @@ -1,166 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ -#include "middleware-adapter.h" -#include "base/ccMacros.h" -#include "renderer/gfx/Texture.h" - -using namespace cocos2d; -using namespace cocos2d::renderer; - -MIDDLEWARE_BEGIN - -Texture2D::Texture2D() -{ - -} - -Texture2D::~Texture2D() -{ - CC_SAFE_RELEASE(_texture); - _texParamCallback = nullptr; -} - -int Texture2D::getPixelsWide() const -{ - return _pixelsWide; -} - -int Texture2D::getPixelsHigh() const -{ - return _pixelsHigh; -} - -void Texture2D::setPixelsWide(int wide) -{ - this->_pixelsWide = wide; -} - -void Texture2D::setPixelsHigh(int high) -{ - this->_pixelsHigh = high; -} - -int Texture2D::getRealTextureIndex() const -{ - return this->_realTextureIndex; -} - -void Texture2D::setRealTextureIndex(int textureIndex) -{ - this->_realTextureIndex = textureIndex; -} - -void Texture2D::setTexParamCallback(const texParamCallback& callback) -{ - this->_texParamCallback = callback; -} - -void Texture2D::setTexParameters(const TexParams& texParams) -{ - if (_texParamCallback) - { - _texParamCallback(this->_realTextureIndex,texParams.minFilter,texParams.magFilter,texParams.wrapS,texParams.wrapT); - } -} - -void Texture2D::setNativeTexture(Texture* texture) -{ - if (_texture == texture) return; - CC_SAFE_RELEASE(_texture); - _texture = texture; - CC_SAFE_RETAIN(_texture); -} - -Texture* Texture2D::getNativeTexture() const -{ - return _texture; -} - -SpriteFrame* SpriteFrame::createWithTexture(Texture2D *texture, const cocos2d::Rect& rect) -{ - SpriteFrame *spriteFrame = new (std::nothrow) SpriteFrame(); - spriteFrame->initWithTexture(texture, rect); - spriteFrame->autorelease(); - - return spriteFrame; -} - -SpriteFrame* SpriteFrame::createWithTexture(Texture2D* texture, const cocos2d::Rect& rect, bool rotated, const cocos2d::Vec2& offset, const cocos2d::Size& originalSize) -{ - SpriteFrame *spriteFrame = new (std::nothrow) SpriteFrame(); - spriteFrame->initWithTexture(texture, rect, rotated, offset, originalSize); - spriteFrame->autorelease(); - - return spriteFrame; -} - -bool SpriteFrame::initWithTexture(Texture2D* texture, const cocos2d::Rect& rect) -{ - return initWithTexture(texture, rect, false, cocos2d::Vec2::ZERO, rect.size); -} - -bool SpriteFrame::initWithTexture(Texture2D* texture, const cocos2d::Rect& rect, bool rotated, const cocos2d::Vec2& offset, const cocos2d::Size& originalSize) -{ - _texture = texture; - - if (texture) - { - texture->retain(); - } - - _rectInPixels = rect; - _offsetInPixels = offset; - _originalSizeInPixels = originalSize; - _rotated = rotated; - _anchorPoint = cocos2d::Vec2(NAN, NAN); - - return true; -} - -SpriteFrame::SpriteFrame() -{ - -} - -SpriteFrame::~SpriteFrame() -{ - CC_SAFE_RELEASE(_texture); -} - -void SpriteFrame::setTexture(Texture2D * texture) -{ - if( _texture != texture ) - { - CC_SAFE_RELEASE(_texture); - CC_SAFE_RETAIN(texture); - _texture = texture; - } -} - -Texture2D* SpriteFrame::getTexture() -{ - return _texture; -} - -MIDDLEWARE_END diff --git a/native/cocos/editor-support/middleware-adapter.h b/native/cocos/editor-support/middleware-adapter.h deleted file mode 100644 index 4be794b745..0000000000 --- a/native/cocos/editor-support/middleware-adapter.h +++ /dev/null @@ -1,219 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ -#pragma once - -#include "math/Vec2.h" -#include "base/ccTypes.h" -#include -#include "MiddlewareMacro.h" -#include "renderer/renderer/Effect.h" - -MIDDLEWARE_BEGIN -/** - * Texture format with u v. - */ -struct Tex2F -{ - GLfloat u; - GLfloat v; -}; - -/** - * Vertex Format with x y u v color. - */ -struct V2F_T2F_C4B -{ - // vertices (2F) - cocos2d::Vec2 vertex; // 8 bytes - - // tex coords (2F) - Tex2F texCoord; // 8 bytes - - // colors (4B) - cocos2d::Color4B color; // 4 bytes -}; - -/** - * Vertex Format with x y u v color1 color2. - */ -struct V2F_T2F_C4B_C4B -{ - // vertices (2F) - cocos2d::Vec2 vertex; // 8 bytes - - // tex coords (2F) - Tex2F texCoord; // 8 bytes - - // colors (4B) - cocos2d::Color4B color; // 4 bytes - - // colors (4B) - cocos2d::Color4B color2; // 4 bytes -}; - -struct Triangles -{ - /**Vertex data pointer.*/ - V2F_T2F_C4B* verts = nullptr; - /**Index data pointer.*/ - unsigned short* indices = nullptr; - /**The number of vertices.*/ - int vertCount = 0; - /**The number of indices.*/ - int indexCount = 0; -}; - -struct TwoColorTriangles -{ - /**Vertex data pointer.*/ - V2F_T2F_C4B_C4B* verts = nullptr; - /**Index data pointer.*/ - unsigned short* indices = nullptr; - /**The number of vertices.*/ - int vertCount = 0; - /**The number of indices.*/ - int indexCount = 0; -}; - -/////////////////////////////////////////////////////////////////////// -// adapt to editor texture,this is a texture delegate,not real texture -/////////////////////////////////////////////////////////////////////// -class Texture2D : public cocos2d::Ref -{ -public: - Texture2D(); - virtual ~Texture2D(); - /** - Extension to set the Min / Mag filter - */ - typedef struct _TexParams - { - GLuint minFilter; - GLuint magFilter; - GLuint wrapS; - GLuint wrapT; - }TexParams; - - /** - * set texture param callback - */ - typedef std::function texParamCallback; - - /** Sets the min filter, mag filter, wrap s and wrap t texture parameters. - If the texture size is NPOT (non power of 2), then in can only use GL_CLAMP_TO_EDGE in GL_TEXTURE_WRAP_{S,T}. - - @warning Calling this method could allocate additional texture memory. - - @since v0.8 - * @code - * When this function bound into js or lua,the input parameter will be changed - * In js: var setBlendFunc(var arg1, var arg2, var arg3, var arg4) - * In lua: local setBlendFunc(local arg1, local arg2, local arg3, local arg4) - * @endcode - */ - void setTexParameters(const TexParams& texParams); - - /** Gets the width of the texture in pixels. */ - int getPixelsWide() const; - - /** Gets the height of the texture in pixels. */ - int getPixelsHigh() const; - - /** Gets real texture index */ - int getRealTextureIndex() const; - - /** Sets the width of the texture in pixels. */ - void setPixelsWide(int wide); - - /** Sets the height of the texture in pixels. */ - void setPixelsHigh(int high); - - /** Sets real texture index.*/ - void setRealTextureIndex(int textureIndex); - - /** Sets texture param callback*/ - void setTexParamCallback(const texParamCallback& callback); - - /** Sets texture native ptr*/ - void setNativeTexture(cocos2d::renderer::Texture* texture); - - /** Gets texture native ptr*/ - cocos2d::renderer::Texture* getNativeTexture() const; -private: - - /** width in pixels */ - int _pixelsWide = 0; - - /** height in pixels */ - int _pixelsHigh = 0; - - /** js texture */ - int _realTextureIndex = 0; - - texParamCallback _texParamCallback = nullptr; - - cocos2d::renderer::Texture* _texture = nullptr; -}; - -/////////////////////////////////////////////////////////////////////// -// adapt to editor sprite frame -/////////////////////////////////////////////////////////////////////// -class SpriteFrame : public cocos2d::Ref -{ -public: - static SpriteFrame* createWithTexture(Texture2D* pobTexture, const cocos2d::Rect& rect); - static SpriteFrame* createWithTexture(Texture2D* pobTexture, const cocos2d::Rect& rect, bool rotated, const cocos2d::Vec2& offset, const cocos2d::Size& originalSize); - - SpriteFrame(); - virtual ~SpriteFrame(); - - /** Initializes a SpriteFrame with a texture, rect in points. - It is assumed that the frame was not trimmed. - */ - bool initWithTexture(Texture2D* pobTexture, const cocos2d::Rect& rect); - - /** Initializes a SpriteFrame with a texture, rect, rotated, offset and originalSize in pixels. - The originalSize is the size in points of the frame before being trimmed. - */ - bool initWithTexture(Texture2D* pobTexture, const cocos2d::Rect& rect, bool rotated, const cocos2d::Vec2& offset, const cocos2d::Size& originalSize); - - /** Get texture of the frame. - * - * @return The texture of the sprite frame. - */ - Texture2D* getTexture(); - /** Set texture of the frame, the texture is retained. - * - * @param pobTexture The texture of the sprite frame. - */ - void setTexture(Texture2D* pobTexture); -protected: - cocos2d::Vec2 _anchorPoint; - cocos2d::Rect _rectInPixels; - bool _rotated = false; - cocos2d::Vec2 _offsetInPixels; - cocos2d::Size _originalSizeInPixels; - Texture2D* _texture = nullptr; -}; -MIDDLEWARE_END diff --git a/native/cocos/editor-support/particle/ParticleSimulator.cpp b/native/cocos/editor-support/particle/ParticleSimulator.cpp deleted file mode 100644 index d1e2912190..0000000000 --- a/native/cocos/editor-support/particle/ParticleSimulator.cpp +++ /dev/null @@ -1,462 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ -#include "ParticleSimulator.h" -#include "base/ccRandom.h" -#include -#include "base/ccMacros.h" -#include "math/Mat4.h" -#include "MiddlewareManager.h" -#include "middleware-adapter.h" -#include "renderer/scene/assembler/CustomAssembler.hpp" -#include "math/Vec2.h" - -USING_NS_MW; - -NS_CC_BEGIN - -// global particle pool -static ParticlePool _pool; - -void Particle::reset() -{ - pos = cocos2d::Vec3::ZERO; - startPos = cocos2d::Vec3::ZERO; - color = cocos2d::Color4B::BLACK; - deltaColor = cocos2d::Color4B::BLACK; - size = 0; - deltaSize = 0; - rotation = 0; - deltaRotation = 0; - timeToLive = 0; - drawPos = cocos2d::Vec3::ZERO; - - // Mode A - dir = cocos2d::Vec3::ZERO; - radialAccel = 0; - tangentialAccel = 0; - - // Mode B - angle = 0; - degreesPerSecond = 0; - radius = 0; - deltaRadius = 0; -} - -ParticlePool::ParticlePool() -{ - -} - -ParticlePool::~ParticlePool() -{ - for (auto particle : _pool) - { - delete particle; - } - _pool.clear(); -} - -ParticleSimulator::ParticleSimulator() -{ - -} - -ParticleSimulator::~ParticleSimulator() -{ - onDisable(); - - CC_SAFE_RELEASE(_effect); - CC_SAFE_RELEASE(_nodeProxy); - - for (auto particle : _particles) - { - delete particle; - } - _particles.clear(); -} - -void ParticleSimulator::stop() -{ - _active = false; - _elapsed = duration; - _emitCounter = 0; -} - -void ParticleSimulator::reset() -{ - _active = true; - _elapsed = 0; - _emitCounter = 0; - _finished = false; - for (auto particle : _particles) - { - _pool.put(particle); - } - _particles.clear(); -} - -void ParticleSimulator::emitParticle(cocos2d::Vec3 &pos) -{ - auto& particle = *_pool.get(); - _particles.push_back(&particle); - - // Init particle - // timeToLive - // no negative life. prevent division by 0 - particle.timeToLive = life + lifeVar * random(-1.0f, 1.0f); - // avoid divide zero - float timeToLive = particle.timeToLive = std::max(0.001f, particle.timeToLive); - - // position - particle.pos.x = _sourcePos.x + _posVar.x * random(-1.0f, 1.0f); - particle.pos.y = _sourcePos.y + _posVar.y * random(-1.0f, 1.0f); - - // Color - GLubyte sr, sg, sb, sa; - particle.color.r = sr = clampf(_startColor.r + _startColorVar.r * random(-1.0f, 1.0f), 0, 255); - particle.color.g = sg = clampf(_startColor.g + _startColorVar.g * random(-1.0f, 1.0f), 0, 255); - particle.color.b = sb = clampf(_startColor.b + _startColorVar.b * random(-1.0f, 1.0f), 0, 255); - particle.color.a = sa = clampf(_startColor.a + _startColorVar.a * random(-1.0f, 1.0f), 0, 255); - particle.deltaColor.r = (clampf(_endColor.r + _endColorVar.r * random(-1.0f, 1.0f), 0, 255) - sr) / timeToLive; - particle.deltaColor.g = (clampf(_endColor.g + _endColorVar.g * random(-1.0f, 1.0f), 0, 255) - sg) / timeToLive; - particle.deltaColor.b = (clampf(_endColor.b + _endColorVar.b * random(-1.0f, 1.0f), 0, 255) - sb) / timeToLive; - particle.deltaColor.a = (clampf(_endColor.a + _endColorVar.a * random(-1.0f, 1.0f), 0, 255) - sa) / timeToLive; - - // size - float startS = startSize + startSizeVar * random(-1.0f, 1.0f); - startS = std::max(0.0f, startS); // No negative value - particle.size = startS; - if (endSize == START_SIZE_EQUAL_TO_END_SIZE) - { - particle.deltaSize = 0; - } - else - { - float endS = endSize + endSizeVar * random(-1.0f, 1.0f); - endS = std::max(0.0f, endS); // No negative values - particle.deltaSize = (endS - startS) / timeToLive; - } - - // rotation - float startA = startSpin + startSpinVar * random(-1.0f, 1.0f); - float endA = endSpin + endSpinVar * random(-1.0f, 1.0f); - particle.rotation = startA; - particle.deltaRotation = (endA - startA) / timeToLive; - - // position - particle.startPos.x = pos.x; - particle.startPos.y = pos.y; - - // direction - float a = CC_DEGREES_TO_RADIANS(angle + angleVar * random(-1.0f, 1.0f)); - // Mode Gravity: A - if (emitterMode == EmitterMode::GRAVITY) - { - float s = speed + speedVar * random(-1.0f, 1.0f); - // direction - particle.dir.x = cos(a); - particle.dir.y = sin(a); - particle.dir.scale(s); - // radial accel - particle.radialAccel = radialAccel + radialAccelVar * random(-1.0f, 1.0f); - // tangential accel - particle.tangentialAccel = tangentialAccel + tangentialAccelVar * random(-1.0f, 1.0f); - // rotation is dir - if (rotationIsDir) - { - particle.rotation = -CC_RADIANS_TO_DEGREES(atan2(particle.dir.y, particle.dir.x)); - } - } - // Mode Radius: B - else - { - // Set the default diameter of the particle from the source position - float tempStartRadius = startRadius + startRadiusVar * random(-1.0f, 1.0f); - float tempEndRadius = endRadius + endRadiusVar * random(-1.0f, 1.0f); - particle.radius = tempStartRadius; - particle.deltaRadius = (endRadius == START_RADIUS_EQUAL_TO_END_RADIUS) ? 0 : (tempEndRadius - tempStartRadius) / timeToLive; - particle.angle = a; - particle.degreesPerSecond = CC_DEGREES_TO_RADIANS(rotatePerS + rotatePerSVar * random(-1.0f, 1.0f)); - } -} - -void ParticleSimulator::onEnable() -{ - MiddlewareManager::getInstance()->addTimer(this); -} - -void ParticleSimulator::onDisable() -{ - MiddlewareManager::getInstance()->removeTimer(this); -} - -void ParticleSimulator::render(float dt) -{ - if (_finished || _nodeProxy == nullptr || _effect == nullptr) - { - return; - } - - // uv size must equal 8,because per particle has 4 vertex. - if (_uv.size() != 8) - { - return; - } - - renderer::CustomAssembler* assembler = (renderer::CustomAssembler*)_nodeProxy->getAssembler(); - if (assembler == nullptr) - { - return; - } - assembler->reset(); - assembler->updateEffect(0, _effect); - - // avoid other place call update. - auto mgr = MiddlewareManager::getInstance(); - if (!mgr->isRendering) return; - - middleware::MeshBuffer* mb = mgr->getMeshBuffer(VF_XYUVC); - middleware::IOBuffer& vb = mb->getVB(); - middleware::IOBuffer& ib = mb->getIB(); - - // Calculate pos - auto worldMatrix = _nodeProxy->getWorldMatrix(); - - cocos2d::Vec3 pos; - cocos2d::Vec3 tpa; - cocos2d::Vec3 tpb; - cocos2d::Vec3 tpc; - - if (positionType == PositionType::FREE) - { - worldMatrix.transformPoint(&pos); - } - else if (positionType == PositionType::RELATIVE) - { - _nodeProxy->getPosition(&pos); - } - - // Get world to node trans only once - worldMatrix.inverse(); - - // Emission - if (_active && emissionRate) - { - float rate = 1.0 / emissionRate; - //issue #1201, prevent bursts of particles, due to too high emitCounter - if (_particles.size() < totalParticles) - _emitCounter += dt; - - while ((_particles.size() < totalParticles) && (_emitCounter > rate)) - { - emitParticle(pos); - _emitCounter -= rate; - } - - _elapsed += dt; - if (duration != -1 && duration < _elapsed) - { - _stopCallback(); - } - } - - // Used to reduce memory allocation / creation within the loop - std::size_t particleIdx = 0; - std::size_t particleSize = _particles.size(); - vb.checkSpace(particleSize * 4 * sizeof (middleware::V2F_T2F_C4B)); - ib.checkSpace(particleSize * 6 * sizeof (unsigned short)); - std::size_t vbOffset = vb.getCurPos() / sizeof (middleware::V2F_T2F_C4B); - uint32_t indexStart = (uint32_t)ib.getCurPos()/sizeof(unsigned short); - uint32_t indexCount = 0; - - while (particleIdx < particleSize) - { - // Reset temporary vectors - tpa.x = tpa.y = tpb.x = tpb.y = tpc.x = tpc.y = 0; - - auto& particle = *_particles[particleIdx]; - - // life - particle.timeToLive -= dt; - if (particle.timeToLive > 0) - { - // Mode A: gravity, direction, tangential accel & radial accel - if (emitterMode == EmitterMode::GRAVITY) - { - auto& tmp = tpc; - auto& radial = tpa; - auto& tangential = tpb; - - // radial acceleration - if (particle.pos.x || particle.pos.y) - { - radial.set(particle.pos); - radial.normalize(); - } - tangential.set(radial); - radial.scale(particle.radialAccel); - - // tangential acceleration - auto newy = tangential.x; - tangential.x = -tangential.y; - tangential.y = newy; - - tangential.scale(particle.tangentialAccel); - - tmp.set(radial); - tmp.add(tangential); - tmp.add(_gravity.x, _gravity.y, _gravity.z); - tmp.scale(dt); - particle.dir.add(tmp); - - tmp.set(particle.dir); - tmp.scale(dt); - particle.pos.add(tmp); - } - // Mode B: radius movement - else - { - // Update the angle and radius of the particle. - particle.angle += particle.degreesPerSecond * dt; - particle.radius += particle.deltaRadius * dt; - - particle.pos.x = -cos(particle.angle) * particle.radius; - particle.pos.y = -sin(particle.angle) * particle.radius; - } - - // color - particle.color.r += particle.deltaColor.r * dt; - particle.color.g += particle.deltaColor.g * dt; - particle.color.b += particle.deltaColor.b * dt; - particle.color.a += particle.deltaColor.a * dt; - - // size - particle.size += particle.deltaSize * dt; - if (particle.size < 0) - { - particle.size = 0; - } - - // angle - particle.rotation += particle.deltaRotation * dt; - - // update values in quad buffer - auto& newPos = tpa; - if (positionType == PositionType::FREE || positionType == PositionType::RELATIVE) - { - auto& diff = tpb; - auto& startPos = tpc; - // current Position convert To Node Space - worldMatrix.transformPoint(pos, &diff); - // start Position convert To Node Space - worldMatrix.transformPoint(particle.startPos, &startPos); - diff.add(-startPos.x, -startPos.y, -startPos.z); - newPos.set(particle.pos); - newPos.add(-diff.x, -diff.y, -diff.z); - } - else - { - newPos.set(particle.pos); - } - - auto x = newPos.x, y = newPos.y; - auto size_2 = particle.size * 0.5; - auto x1 = -size_2, y1 = -size_2; - auto x2 = size_2, y2 = size_2; - - auto rad = -CC_DEGREES_TO_RADIANS(particle.rotation); - auto cr = cos(rad), sr = sin(rad); - uint32_t tempColor = ((particle.color.a << 24) & 0xff000000) + - ((particle.color.b << 16) & 0x00ff0000) + - ((particle.color.g << 8) & 0x0000ff00) + - ((particle.color.r) & 0x000000ff); - // bl - vb.writeFloat32(x1 * cr - y1 * sr + x); - vb.writeFloat32(x1 * sr + y1 * cr + y); - vb.writeFloat32(_uv[0]); - vb.writeFloat32(_uv[1]); - vb.writeUint32(tempColor); - - // br - vb.writeFloat32(x2 * cr - y1 * sr + x); - vb.writeFloat32(x2 * sr + y1 * cr + y); - vb.writeFloat32(_uv[2]); - vb.writeFloat32(_uv[3]); - vb.writeUint32(tempColor); - - // tl - vb.writeFloat32(x1 * cr - y2 * sr + x); - vb.writeFloat32(x1 * sr + y2 * cr + y); - vb.writeFloat32(_uv[4]); - vb.writeFloat32(_uv[5]); - vb.writeUint32(tempColor); - - // tr - vb.writeFloat32(x2 * cr - y2 * sr + x); - vb.writeFloat32(x2 * sr + y2 * cr + y); - vb.writeFloat32(_uv[6]); - vb.writeFloat32(_uv[7]); - vb.writeUint32(tempColor); - - ib.writeUint16(vbOffset); - ib.writeUint16(vbOffset + 1); - ib.writeUint16(vbOffset + 2); - ib.writeUint16(vbOffset + 1); - ib.writeUint16(vbOffset + 3); - ib.writeUint16(vbOffset + 2); - - vbOffset += 4; - indexCount += 6; - - // update particle counter - ++particleIdx; - } - else - { - // life < 0 - auto deadParticle = _particles[particleIdx]; - if (particleIdx != particleSize - 1) - { - _particles[particleIdx] = _particles[particleSize - 1]; - } - _pool.put(deadParticle); - particleSize--; - _particles.resize(particleSize); - } - } - - assembler->updateIABuffer(0, mb->getGLVB(), mb->getGLIB()); - assembler->updateIARange(0, indexStart, indexCount); - - if (_particles.size() == 0 && !_active) - { - _finished = true; - if (_finishedCallback) - { - _finishedCallback(); - } - } -} - -NS_CC_END diff --git a/native/cocos/editor-support/particle/ParticleSimulator.h b/native/cocos/editor-support/particle/ParticleSimulator.h deleted file mode 100644 index c917bd6043..0000000000 --- a/native/cocos/editor-support/particle/ParticleSimulator.h +++ /dev/null @@ -1,281 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ -#pragma once -#include "MiddlewareMacro.h" -#include "math/Vec3.h" -#include "base/ccTypes.h" -#include -#include "IOBuffer.h" -#include "renderer/scene/NodeProxy.hpp" -#include "renderer/renderer/Effect.h" -#include "MiddlewareManager.h" -#include "scripting/js-bindings/jswrapper/SeApi.h" - -NS_CC_BEGIN - -struct Particle { -public: - cocos2d::Vec3 pos; - cocos2d::Vec3 startPos; - cocos2d::Color4B color = cocos2d::Color4B::BLACK; - cocos2d::Color4B deltaColor = cocos2d::Color4B::BLACK; - float size = 0.0f; - float deltaSize = 0.0f; - float rotation = 0.0f; - float deltaRotation = 0.0f; - float timeToLive = 0.0f; - cocos2d::Vec3 drawPos; - - // Mode A - cocos2d::Vec3 dir; - float radialAccel = 0.0f; - float tangentialAccel = 0.0f; - - // Mode B - float angle = 0.0f; - float degreesPerSecond = 0.0f; - float radius = 0.0f; - float deltaRadius = 0.0f; - - bool inPool = false; - void reset(); -}; - -class ParticlePool { -public: - ParticlePool(); - ~ParticlePool(); - - void put(Particle* particle) - { - CCASSERT(!particle->inPool, "Particle is in pool already"); - _pool.push_back(particle); - particle->inPool = true; - particle->reset(); - } - - Particle* get() - { - Particle* obj = nullptr; - if (_pool.size() > 0) - { - obj = _pool.back(); - _pool.pop_back(); - obj->inPool = false; - } else { - obj = new Particle(); - } - return obj; - } - -private: - std::vector _pool; -}; - -enum PositionType -{ - FREE = 0, - RELATIVE = 1, - GROUPED = 2 -}; - -enum EmitterMode -{ - GRAVITY = 0, - RADIUS = 1 -}; - -class ParticleSimulator : public cocos2d::middleware::IMiddleware, public cocos2d::Ref { - - //* @enum - enum { - /** The Particle emitter lives forever. */ - DURATION_INFINITY = -1, - - /** The starting size of the particle is equal to the ending size. */ - START_SIZE_EQUAL_TO_END_SIZE = -1, - - /** The starting radius of the particle is equal to the ending radius. */ - START_RADIUS_EQUAL_TO_END_RADIUS = -1, - }; - -public: - ParticleSimulator(); - ~ParticleSimulator(); - void stop(); - void reset(); - void emitParticle(cocos2d::Vec3& pos); - void update(float dt) override {} - void render(float dt) override; - void onEnable(); - void onDisable(); - - typedef std::function finishedCallback; - void setFinishedCallback(finishedCallback callback) - { - _finishedCallback = callback; - } - - typedef std::function stopCallback; - void setStopCallback(stopCallback callback) - { - _stopCallback = callback; - } - - void bindNodeProxy(cocos2d::renderer::NodeProxy* node) - { - CC_SAFE_RELEASE(_nodeProxy); - _nodeProxy = node; - CC_SAFE_RETAIN(_nodeProxy); - } - - void setEffect(cocos2d::renderer::Effect* effect) - { - CC_SAFE_RELEASE(_effect); - _effect = effect; - CC_SAFE_RETAIN(_effect); - } - - void updateUVs(const std::vector& uv) - { - _uv = uv; - } - - std::size_t getParticleCount() - { - return _particles.size(); - } - - bool active() - { - return _active; - } - - void setGravity(float x, float y, float z) - { - _gravity.x = x; - _gravity.y = y; - _gravity.z = z; - } - - void setSourcePos(float x, float y, float z) - { - _sourcePos.x = x; - _sourcePos.y = y; - _sourcePos.z = z; - } - - void setPosVar(float x, float y, float z) - { - _posVar.x = x; - _posVar.y = y; - _posVar.z = z; - } - - void setStartColor(GLubyte r, GLubyte g, GLubyte b, GLubyte a) - { - _startColor.r = r; - _startColor.g = g; - _startColor.b = b; - _startColor.a = a; - } - - void setStartColorVar(GLubyte r, GLubyte g, GLubyte b, GLubyte a) - { - _startColorVar.r = r; - _startColorVar.g = g; - _startColorVar.b = b; - _startColorVar.a = a; - } - - void setEndColor(GLubyte r, GLubyte g, GLubyte b, GLubyte a) - { - _endColor.r = r; - _endColor.g = g; - _endColor.b = b; - _endColor.a = a; - } - - void setEndColorVar(GLubyte r, GLubyte g, GLubyte b, GLubyte a) - { - _endColorVar.r = r; - _endColorVar.g = g; - _endColorVar.b = b; - _endColorVar.a = a; - } - -private: - std::vector _particles; - bool _active = false; - bool _finished = false; - float _elapsed = 0; - float _emitCounter = 0; - std::size_t _uvFilled = 0; - finishedCallback _finishedCallback = nullptr; - stopCallback _stopCallback = nullptr; - cocos2d::renderer::NodeProxy* _nodeProxy = nullptr; - cocos2d::renderer::Effect* _effect = nullptr; - std::vector _uv; - - cocos2d::Vec3 _gravity; - cocos2d::Vec3 _sourcePos; - cocos2d::Vec3 _posVar; - cocos2d::Color4B _startColor = cocos2d::Color4B::BLACK; - cocos2d::Color4B _startColorVar = cocos2d::Color4B::WHITE; - cocos2d::Color4B _endColor = cocos2d::Color4B::BLACK; - cocos2d::Color4B _endColorVar = cocos2d::Color4B::WHITE; -public: - int positionType = PositionType::FREE; - float emissionRate = 0.0f; - std::size_t totalParticles = 0; - float duration = -1.0f; - int emitterMode = EmitterMode::GRAVITY; - float life = 0.0f; - float lifeVar = 0.0f; - float startSize = 0.0f; - float startSizeVar = 0.0f; - float endSize = 0.0f; - float endSizeVar = 0.0f; - float startSpin = 0.0f; - float startSpinVar = 0.0f; - float endSpin = 0.0f; - float endSpinVar = 0.0f; - float angle = 0.0f; - float angleVar = 0.0f; - float speed = 0.0f; - float speedVar = 0.0f; - float radialAccel = 0.0f; - float radialAccelVar = 0.0f; - float tangentialAccel = 0.0f; - float tangentialAccelVar = 0.0f; - bool rotationIsDir = false; - float startRadius = 0.0f; - float startRadiusVar = 0.0f; - float endRadius = 0.0f; - float endRadiusVar = 0.0f; - float rotatePerS = 0.0f; - float rotatePerSVar = 0.0f; -}; - -NS_CC_END diff --git a/native/cocos/editor-support/spine-creator-support/AttachmentVertices.cpp b/native/cocos/editor-support/spine-creator-support/AttachmentVertices.cpp deleted file mode 100644 index e6fd952587..0000000000 --- a/native/cocos/editor-support/spine-creator-support/AttachmentVertices.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated May 1, 2019. Replaces all prior versions. - * - * Copyright (c) 2013-2019, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS - * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#include "spine-creator-support/AttachmentVertices.h" - -USING_NS_CC; - -namespace spine { - - AttachmentVertices::AttachmentVertices (middleware::Texture2D* texture, int verticesCount, unsigned short* triangles, int trianglesCount) { - _texture = texture; - - _triangles = new middleware::Triangles(); - _triangles->verts = new middleware::V2F_T2F_C4B[verticesCount]; - _triangles->vertCount = verticesCount; - _triangles->indices = triangles; - _triangles->indexCount = trianglesCount; - } - - AttachmentVertices::~AttachmentVertices () { - delete [] _triangles->verts; - delete _triangles; - } - -} diff --git a/native/cocos/editor-support/spine-creator-support/AttachmentVertices.h b/native/cocos/editor-support/spine-creator-support/AttachmentVertices.h deleted file mode 100644 index d50a72ed7d..0000000000 --- a/native/cocos/editor-support/spine-creator-support/AttachmentVertices.h +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated May 1, 2019. Replaces all prior versions. - * - * Copyright (c) 2013-2019, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS - * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#pragma once - -#include "middleware-adapter.h" -#include "base/ccMacros.h" - -namespace spine{ - /** - * Store attachment vertex and indice list - */ - class AttachmentVertices { - public: - AttachmentVertices (cocos2d::middleware::Texture2D* texture, int verticesCount, unsigned short* triangles, int trianglesCount); - virtual ~AttachmentVertices (); - - cocos2d::middleware::Texture2D* _texture = nullptr; - cocos2d::middleware::Triangles* _triangles = nullptr; - }; -} diff --git a/native/cocos/editor-support/spine-creator-support/SkeletonAnimation.cpp b/native/cocos/editor-support/spine-creator-support/SkeletonAnimation.cpp deleted file mode 100644 index 73cb5e0d3a..0000000000 --- a/native/cocos/editor-support/spine-creator-support/SkeletonAnimation.cpp +++ /dev/null @@ -1,342 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated May 1, 2019. Replaces all prior versions. - * - * Copyright (c) 2013-2019, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS - * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#include "spine-creator-support/SkeletonAnimation.h" -#include "spine-creator-support/spine-cocos2dx.h" -#include "spine/extension.h" -#include - -USING_NS_CC; -using std::min; -using std::max; -using std::vector; - -namespace spine { - -typedef struct _TrackEntryListeners { - StartListener startListener; - InterruptListener interruptListener; - EndListener endListener; - DisposeListener disposeListener; - CompleteListener completeListener; - EventListener eventListener; -} _TrackEntryListeners; - -void animationCallback (AnimationState* state, EventType type, TrackEntry* entry, Event* event) { - ((SkeletonAnimation*)state->getRendererObject())->onAnimationStateEvent(entry, type, event); -} - -void trackEntryCallback (AnimationState* state, EventType type, TrackEntry* entry, Event* event) { - ((SkeletonAnimation*)state->getRendererObject())->onTrackEntryEvent(entry, type, event); - if (type == EventType_Dispose) - if (entry->getRendererObject()) delete (spine::_TrackEntryListeners*)entry->getRendererObject(); -} - -static _TrackEntryListeners* getListeners (TrackEntry* entry) { - if (!entry->getRendererObject()) { - entry->setRendererObject(new spine::_TrackEntryListeners()); - entry->setListener(trackEntryCallback); - } - return (_TrackEntryListeners*)entry->getRendererObject(); -} - -float SkeletonAnimation::GlobalTimeScale = 1.0f; -void SkeletonAnimation::setGlobalTimeScale(float timeScale) { - GlobalTimeScale = timeScale; -} - -SkeletonAnimation* SkeletonAnimation::create() { - SkeletonAnimation* skeleton = new SkeletonAnimation(); - skeleton->autorelease(); - return skeleton; -} - -SkeletonAnimation* SkeletonAnimation::createWithData (SkeletonData* skeletonData, bool ownsSkeletonData) { - SkeletonAnimation* node = new SkeletonAnimation(); - node->initWithData(skeletonData, ownsSkeletonData); - node->autorelease(); - return node; -} - -SkeletonAnimation* SkeletonAnimation::createWithJsonFile (const std::string& skeletonJsonFile, Atlas* atlas, float scale) { - SkeletonAnimation* node = new SkeletonAnimation(); - node->initWithJsonFile(skeletonJsonFile, atlas, scale); - node->autorelease(); - return node; -} - -SkeletonAnimation* SkeletonAnimation::createWithJsonFile (const std::string& skeletonJsonFile, const std::string& atlasFile, float scale) { - SkeletonAnimation* node = new SkeletonAnimation(); - node->initWithJsonFile(skeletonJsonFile, atlasFile, scale); - node->autorelease(); - return node; -} - -SkeletonAnimation* SkeletonAnimation::createWithBinaryFile (const std::string& skeletonBinaryFile, Atlas* atlas, float scale) { - SkeletonAnimation* node = new SkeletonAnimation(); - node->initWithBinaryFile(skeletonBinaryFile, atlas, scale); - node->autorelease(); - return node; -} - -SkeletonAnimation* SkeletonAnimation::createWithBinaryFile (const std::string& skeletonBinaryFile, const std::string& atlasFile, float scale) { - SkeletonAnimation* node = new SkeletonAnimation(); - node->initWithBinaryFile(skeletonBinaryFile, atlasFile, scale); - node->autorelease(); - return node; -} - -void SkeletonAnimation::initialize () { - super::initialize(); - - _ownsAnimationStateData = true; - _state = new (__FILE__, __LINE__) AnimationState(new (__FILE__, __LINE__) AnimationStateData(_skeleton->getData())); - _state->setRendererObject(this); - _state->setListener(animationCallback); -} - -SkeletonAnimation::SkeletonAnimation () -: SkeletonRenderer() { -} - -SkeletonAnimation::~SkeletonAnimation () { - _startListener = nullptr; - _interruptListener = nullptr; - _endListener = nullptr; - _disposeListener = nullptr; - _completeListener = nullptr; - _eventListener = nullptr; - - if (_state) { - clearTracks(); - if (_ownsAnimationStateData) delete _state->getData(); - delete _state; - } -} - -void SkeletonAnimation::update (float deltaTime) { - if (!_skeleton) return; - if (!_paused) { - deltaTime *= _timeScale * GlobalTimeScale; - if (_ownsSkeleton) _skeleton->update(deltaTime); - _state->update(deltaTime); - _state->apply(*_skeleton); - _skeleton->updateWorldTransform(); - } -} - -void SkeletonAnimation::setAnimationStateData (AnimationStateData* stateData) { - CCASSERT(stateData, "stateData cannot be null."); - - if (_state) { - if (_ownsAnimationStateData) delete _state->getData(); - delete _state; - } - - _ownsAnimationStateData = false; - _state = new (__FILE__, __LINE__) AnimationState(stateData); - _state->setRendererObject(this); - _state->setListener(animationCallback); -} - -void SkeletonAnimation::setMix (const std::string& fromAnimation, const std::string& toAnimation, float duration) { - if (_state) { - _state->getData()->setMix(fromAnimation.c_str(), toAnimation.c_str(), duration); - } -} - -TrackEntry* SkeletonAnimation::setAnimation (int trackIndex, const std::string& name, bool loop) { - if (!_skeleton) return 0; - Animation* animation = _skeleton->getData()->findAnimation(name.c_str()); - if (!animation) { - log("Spine: Animation not found: %s", name.c_str()); - return 0; - } - auto trackEntry = _state->setAnimation(trackIndex, animation, loop); - _state->apply(*_skeleton); - return trackEntry; -} - -TrackEntry* SkeletonAnimation::addAnimation (int trackIndex, const std::string& name, bool loop, float delay) { - if (!_skeleton) return 0; - Animation* animation = _skeleton->getData()->findAnimation(name.c_str()); - if (!animation) { - log("Spine: Animation not found: %s", name.c_str()); - return 0; - } - return _state->addAnimation(trackIndex, animation, loop, delay); -} - -TrackEntry* SkeletonAnimation::setEmptyAnimation (int trackIndex, float mixDuration) { - if (_state) { - return _state->setEmptyAnimation(trackIndex, mixDuration); - } - return nullptr; -} - -void SkeletonAnimation::setEmptyAnimations (float mixDuration) { - if (_state) { - _state->setEmptyAnimations(mixDuration); - } -} - -TrackEntry* SkeletonAnimation::addEmptyAnimation (int trackIndex, float mixDuration, float delay) { - if (_state) { - return _state->addEmptyAnimation(trackIndex, mixDuration, delay); - } - return nullptr; -} - -Animation* SkeletonAnimation::findAnimation(const std::string& name) const { - if (_skeleton) { - return _skeleton->getData()->findAnimation(name.c_str()); - } - return nullptr; -} - -TrackEntry* SkeletonAnimation::getCurrent (int trackIndex) { - if (_state) { - return _state->getCurrent(trackIndex); - } - return nullptr; -} - -void SkeletonAnimation::clearTracks () { - if (_state) { - _state->clearTracks(); - } -} - -void SkeletonAnimation::clearTrack (int trackIndex) { - if (_state) { - _state->clearTrack(trackIndex); - } -} - -void SkeletonAnimation::onAnimationStateEvent (TrackEntry* entry, EventType type, Event* event) { - switch (type) { - case EventType_Start: - if (_startListener) _startListener(entry); - break; - case EventType_Interrupt: - if (_interruptListener) _interruptListener(entry); - break; - case EventType_End: - if (_endListener) _endListener(entry); - break; - case EventType_Dispose: - if (_disposeListener) _disposeListener(entry); - break; - case EventType_Complete: - if (_completeListener) _completeListener(entry); - break; - case EventType_Event: - if (_eventListener) _eventListener(entry, event); - break; - } -} - -void SkeletonAnimation::onTrackEntryEvent (TrackEntry* entry, EventType type, Event* event) { - if (!entry->getRendererObject()) return; - _TrackEntryListeners* listeners = (_TrackEntryListeners*)entry->getRendererObject(); - switch (type) { - case EventType_Start: - if (listeners->startListener) listeners->startListener(entry); - break; - case EventType_Interrupt: - if (listeners->interruptListener) listeners->interruptListener(entry); - break; - case EventType_End: - if (listeners->endListener) listeners->endListener(entry); - break; - case EventType_Dispose: - if (listeners->disposeListener) listeners->disposeListener(entry); - break; - case EventType_Complete: - if (listeners->completeListener) listeners->completeListener(entry); - break; - case EventType_Event: - if (listeners->eventListener) listeners->eventListener(entry, event); - break; - } -} - -void SkeletonAnimation::setStartListener (const StartListener& listener) { - _startListener = listener; -} - -void SkeletonAnimation::setInterruptListener (const InterruptListener& listener) { - _interruptListener = listener; -} - -void SkeletonAnimation::setEndListener (const EndListener& listener) { - _endListener = listener; -} - -void SkeletonAnimation::setDisposeListener (const DisposeListener& listener) { - _disposeListener = listener; -} - -void SkeletonAnimation::setCompleteListener (const CompleteListener& listener) { - _completeListener = listener; -} - -void SkeletonAnimation::setEventListener (const EventListener& listener) { - _eventListener = listener; -} - -void SkeletonAnimation::setTrackStartListener (TrackEntry* entry, const StartListener& listener) { - getListeners(entry)->startListener = listener; -} - -void SkeletonAnimation::setTrackInterruptListener (TrackEntry* entry, const InterruptListener& listener) { - getListeners(entry)->interruptListener = listener; -} - -void SkeletonAnimation::setTrackEndListener (TrackEntry* entry, const EndListener& listener) { - getListeners(entry)->endListener = listener; -} - -void SkeletonAnimation::setTrackDisposeListener (TrackEntry* entry, const DisposeListener& listener) { - getListeners(entry)->disposeListener = listener; -} - -void SkeletonAnimation::setTrackCompleteListener (TrackEntry* entry, const CompleteListener& listener) { - getListeners(entry)->completeListener = listener; -} - -void SkeletonAnimation::setTrackEventListener (TrackEntry* entry, const EventListener& listener) { - getListeners(entry)->eventListener = listener; -} - -AnimationState* SkeletonAnimation::getState() const { - return _state; -} - -} diff --git a/native/cocos/editor-support/spine-creator-support/SkeletonAnimation.h b/native/cocos/editor-support/spine-creator-support/SkeletonAnimation.h deleted file mode 100644 index c4f17c21e7..0000000000 --- a/native/cocos/editor-support/spine-creator-support/SkeletonAnimation.h +++ /dev/null @@ -1,118 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated May 1, 2019. Replaces all prior versions. - * - * Copyright (c) 2013-2019, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS - * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#pragma once -#include "spine/spine.h" -#include "spine-creator-support/SkeletonRenderer.h" - -namespace spine { - -typedef std::function StartListener; -typedef std::function InterruptListener; -typedef std::function EndListener; -typedef std::function DisposeListener; -typedef std::function CompleteListener; -typedef std::function EventListener; - -/** Draws an animated skeleton, providing an AnimationState for applying one or more animations and queuing animations to be - * played later. */ -class SkeletonAnimation: public SkeletonRenderer { -public: - static SkeletonAnimation* create(); - static SkeletonAnimation* createWithData (SkeletonData* skeletonData, bool ownsSkeletonData = false); - static SkeletonAnimation* createWithJsonFile (const std::string& skeletonJsonFile, Atlas* atlas, float scale = 1); - static SkeletonAnimation* createWithJsonFile (const std::string& skeletonJsonFile, const std::string& atlasFile, float scale = 1); - static SkeletonAnimation* createWithBinaryFile (const std::string& skeletonBinaryFile, Atlas* atlas, float scale = 1); - static SkeletonAnimation* createWithBinaryFile (const std::string& skeletonBinaryFile, const std::string& atlasFile, float scale = 1); - static void setGlobalTimeScale(float timeScale); - - // Use createWithJsonFile instead - CC_DEPRECATED_ATTRIBUTE static SkeletonAnimation* createWithFile (const std::string& skeletonJsonFile, Atlas* atlas, float scale = 1) { - return SkeletonAnimation::createWithJsonFile(skeletonJsonFile, atlas, scale); - } - // Use createWithJsonFile instead - CC_DEPRECATED_ATTRIBUTE static SkeletonAnimation* createWithFile (const std::string& skeletonJsonFile, const std::string& atlasFile, float scale = 1) { - return SkeletonAnimation::createWithJsonFile(skeletonJsonFile, atlasFile, scale); - } - - virtual void update (float deltaTime) override; - - void setAnimationStateData (AnimationStateData* stateData); - void setMix (const std::string& fromAnimation, const std::string& toAnimation, float duration); - - TrackEntry* setAnimation (int trackIndex, const std::string& name, bool loop); - TrackEntry* addAnimation (int trackIndex, const std::string& name, bool loop, float delay = 0); - TrackEntry* setEmptyAnimation (int trackIndex, float mixDuration); - void setEmptyAnimations (float mixDuration); - TrackEntry* addEmptyAnimation (int trackIndex, float mixDuration, float delay = 0); - Animation* findAnimation(const std::string& name) const; - TrackEntry* getCurrent (int trackIndex = 0); - void clearTracks (); - void clearTrack (int trackIndex = 0); - - void setStartListener (const StartListener& listener); - void setInterruptListener (const InterruptListener& listener); - void setEndListener (const EndListener& listener); - void setDisposeListener (const DisposeListener& listener); - void setCompleteListener (const CompleteListener& listener); - void setEventListener (const EventListener& listener); - - void setTrackStartListener (TrackEntry* entry, const StartListener& listener); - void setTrackInterruptListener (TrackEntry* entry, const InterruptListener& listener); - void setTrackEndListener (TrackEntry* entry, const EndListener& listener); - void setTrackDisposeListener (TrackEntry* entry, const DisposeListener& listener); - void setTrackCompleteListener (TrackEntry* entry, const CompleteListener& listener); - void setTrackEventListener (TrackEntry* entry, const EventListener& listener); - - virtual void onAnimationStateEvent (TrackEntry* entry, EventType type, Event* event); - virtual void onTrackEntryEvent (TrackEntry* entry, EventType type, Event* event); - - AnimationState* getState() const; - -CC_CONSTRUCTOR_ACCESS: - SkeletonAnimation (); - virtual ~SkeletonAnimation (); - virtual void initialize () override; - -public: - static float GlobalTimeScale; -protected: - AnimationState* _state = nullptr; - bool _ownsAnimationStateData = false; - StartListener _startListener = nullptr; - InterruptListener _interruptListener = nullptr; - EndListener _endListener = nullptr; - DisposeListener _disposeListener = nullptr; - CompleteListener _completeListener = nullptr; - EventListener _eventListener = nullptr; -private: - typedef SkeletonRenderer super; -}; - -} diff --git a/native/cocos/editor-support/spine-creator-support/SkeletonCache.cpp b/native/cocos/editor-support/spine-creator-support/SkeletonCache.cpp deleted file mode 100644 index 0a0f9b3404..0000000000 --- a/native/cocos/editor-support/spine-creator-support/SkeletonCache.cpp +++ /dev/null @@ -1,532 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated May 1, 2019. Replaces all prior versions. - * - * Copyright (c) 2013-2019, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS - * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#include "SkeletonCache.h" -#include "spine-creator-support/AttachmentVertices.h" -#include "renderer/gfx/Texture.h" - -USING_NS_CC; -USING_NS_MW; -using namespace cocos2d::renderer; - -namespace spine { - - float SkeletonCache::FrameTime = 1.0f / 60.0f; - float SkeletonCache::MaxCacheTime = 120.0f; - - SkeletonCache::SegmentData::SegmentData () { - - } - - SkeletonCache::SegmentData::~SegmentData () { - CC_SAFE_RELEASE_NULL(_texture); - } - - void SkeletonCache::SegmentData::setTexture (cocos2d::middleware::Texture2D* value) { - CC_SAFE_RETAIN(value); - CC_SAFE_RELEASE(_texture); - _texture = value; - } - - cocos2d::middleware::Texture2D* SkeletonCache::SegmentData::getTexture () const { - return _texture; - } - - SkeletonCache::FrameData::FrameData () { - - } - - SkeletonCache::FrameData::~FrameData () { - for (std::size_t i = 0, c = _colors.size(); i < c; i++) { - delete _colors[i]; - } - _colors.clear(); - - for (std::size_t i = 0, c = _segments.size(); i < c; i++) { - delete _segments[i]; - } - _segments.clear(); - } - - SkeletonCache::ColorData* SkeletonCache::FrameData::buildColorData (std::size_t index) { - if (index > _colors.size()) return nullptr; - if (index == _colors.size()) { - ColorData* colorData = new ColorData; - _colors.push_back(colorData); - } - return _colors[index]; - } - - std::size_t SkeletonCache::FrameData::getColorCount () const { - return _colors.size(); - } - - SkeletonCache::SegmentData* SkeletonCache::FrameData::buildSegmentData (std::size_t index) { - if (index > _segments.size()) return nullptr; - if (index == _segments.size()) { - SegmentData* segmentData = new SegmentData; - _segments.push_back(segmentData); - } - return _segments[index]; - } - - std::size_t SkeletonCache::FrameData::getSegmentCount () const { - return _segments.size(); - } - - SkeletonCache::AnimationData::AnimationData () { - - } - - SkeletonCache::AnimationData::~AnimationData () { - reset(); - } - - void SkeletonCache::AnimationData::reset () { - for (std::size_t i = 0, c = _frames.size(); i < c; i++) { - delete _frames[i]; - } - _frames.clear(); - _isComplete = false; - _totalTime = 0.0f; - } - - bool SkeletonCache::AnimationData::needUpdate (int toFrameIdx) const { - return !_isComplete && _totalTime <= MaxCacheTime && (toFrameIdx == -1 || _frames.size() < toFrameIdx + 1); - } - - SkeletonCache::FrameData* SkeletonCache::AnimationData::buildFrameData (std::size_t frameIdx) { - if (frameIdx > _frames.size()) { - return nullptr; - } - if (frameIdx == _frames.size()) { - auto frameData = new FrameData(); - _frames.push_back(frameData); - } - return _frames[frameIdx]; - } - - SkeletonCache::FrameData* SkeletonCache::AnimationData::getFrameData (std::size_t frameIdx) const { - if (frameIdx >= _frames.size()) { - return nullptr; - } - return _frames[frameIdx]; - } - - std::size_t SkeletonCache::AnimationData::getFrameCount () const { - return _frames.size(); - } - - SkeletonCache::SkeletonCache () { - - } - - SkeletonCache::~SkeletonCache () { - for (auto it = _animationCaches.begin(); it != _animationCaches.end(); it++) { - delete it->second; - } - _animationCaches.clear(); - } - - SkeletonCache::AnimationData* SkeletonCache::buildAnimationData (const std::string& animationName) { - AnimationData* aniData = nullptr; - auto it = _animationCaches.find(animationName); - if (it == _animationCaches.end()) { - auto animation = findAnimation(animationName); - if (animation == nullptr) return nullptr; - - aniData = new AnimationData(); - aniData->_animationName = animationName; - _animationCaches[animationName] = aniData; - } else { - aniData = it->second; - } - return aniData; - } - - SkeletonCache::AnimationData* SkeletonCache::getAnimationData (const std::string& animationName) { - auto it = _animationCaches.find(animationName); - if (it == _animationCaches.end()) { - return nullptr; - } else { - return it->second; - } - } - - void SkeletonCache::update (float deltaTime) { - if (!_skeleton) return; - if (_ownsSkeleton) _skeleton->update(deltaTime); - _state->update(deltaTime); - _state->apply(*_skeleton); - _skeleton->updateWorldTransform(); - } - - void SkeletonCache::updateToFrame (const std::string& animationName, int toFrameIdx/*= -1*/) { - auto it = _animationCaches.find(animationName); - if (it == _animationCaches.end()) { - return; - } - - AnimationData* animationData = it->second; - if (!animationData || !animationData->needUpdate(toFrameIdx)) { - return; - } - - if (_curAnimationName != animationName) { - updateToFrame(_curAnimationName); - _curAnimationName = animationName; - } - - // init animation - if (animationData->getFrameCount() == 0) { - setAnimation(0, animationName, false); - } - - do { - update(FrameTime); - renderAnimationFrame(animationData); - animationData->_totalTime += FrameTime; - } while (animationData->needUpdate(toFrameIdx)); - } - - void SkeletonCache::renderAnimationFrame (AnimationData* animationData) { - std::size_t frameIndex = animationData->getFrameCount(); - FrameData* frameData = animationData->buildFrameData(frameIndex); - - if (!_skeleton) return; - - // If opacity is 0,then return. - if (_skeleton->getColor().a == 0) { - return; - } - - Color4F preColor(-1.0f, -1.0f, -1.0f, -1.0f); - Color4F preDarkColor(-1.0f, -1.0f, -1.0f, -1.0f); - // range [0.0, 1.0] - Color4F color; - Color4F darkColor; - - AttachmentVertices* attachmentVertices = nullptr; - middleware::IOBuffer& vb = frameData->vb; - middleware::IOBuffer& ib = frameData->ib; - - // vertex size int bytes with two color - int vbs2 = sizeof(V2F_T2F_C4B_C4B); - // verex size in floats with two color - int vs2 = vbs2 / sizeof(float); - - int vbSize = 0; - int ibSize = 0; - - int preBlendMode = -1; - GLuint preTextureIndex = -1; - GLuint curTextureIndex = -1; - - int preISegWritePos = -1; - int curISegLen = 0; - int curVSegLen = 0; - - int materialLen = 0; - Slot* slot = nullptr; - - middleware::Texture2D* texture = nullptr; - - auto flush = [&]() { - // fill pre segment count field - if (preISegWritePos != -1) { - SegmentData* preSegmentData = frameData->buildSegmentData(materialLen - 1); - preSegmentData->indexCount = curISegLen; - preSegmentData->vertexFloatCount = curVSegLen; - } - - SegmentData* segmentData = frameData->buildSegmentData(materialLen); - segmentData->setTexture(texture); - segmentData->blendMode = slot->getData().getBlendMode(); - - // save new segment count pos field - preISegWritePos = (int)ib.getCurPos() / sizeof(unsigned short); - // reset pre blend mode to current - preBlendMode = (int)slot->getData().getBlendMode(); - // reset pre texture index to current - preTextureIndex = curTextureIndex; - // reset index segmentation count - curISegLen = 0; - // reset vertex segmentation count - curVSegLen = 0; - // material length increased - materialLen++; - }; - - auto& drawOrder = _skeleton->getDrawOrder(); - for (size_t i = 0, n = drawOrder.size(); i < n; ++i) { - slot = drawOrder[i]; - - if (!slot->getAttachment()) { - _clipper->clipEnd(*slot); - continue; - } - - // Early exit if slot is invisible - if (slot->getColor().a == 0) { - _clipper->clipEnd(*slot); - continue; - } - - TwoColorTriangles trianglesTwoColor; - - if (slot->getAttachment()->getRTTI().isExactly(RegionAttachment::rtti)) { - RegionAttachment* attachment = (RegionAttachment*)slot->getAttachment(); - attachmentVertices = (AttachmentVertices*)attachment->getRendererObject(); - - // Early exit if attachment is invisible - if (attachment->getColor().a == 0) { - _clipper->clipEnd(*slot); - continue; - } - - trianglesTwoColor.vertCount = attachmentVertices->_triangles->vertCount; - vbSize = trianglesTwoColor.vertCount * sizeof(V2F_T2F_C4B_C4B); - vb.checkSpace(vbSize, true); - trianglesTwoColor.verts = (V2F_T2F_C4B_C4B*)vb.getCurBuffer(); - for (int ii = 0; ii < trianglesTwoColor.vertCount; ii++) { - trianglesTwoColor.verts[ii].texCoord = attachmentVertices->_triangles->verts[ii].texCoord; - } - attachment->computeWorldVertices(slot->getBone(), (float*)trianglesTwoColor.verts, 0, vs2); - - trianglesTwoColor.indexCount = attachmentVertices->_triangles->indexCount; - ibSize = trianglesTwoColor.indexCount * sizeof(unsigned short); - ib.checkSpace(ibSize, true); - trianglesTwoColor.indices = (unsigned short*)ib.getCurBuffer(); - memcpy(trianglesTwoColor.indices, attachmentVertices->_triangles->indices, ibSize); - - color.r = attachment->getColor().r; - color.g = attachment->getColor().g; - color.b = attachment->getColor().b; - color.a = attachment->getColor().a; - - } else if (slot->getAttachment()->getRTTI().isExactly(MeshAttachment::rtti)) { - MeshAttachment* attachment = (MeshAttachment*)slot->getAttachment(); - attachmentVertices = (AttachmentVertices*)attachment->getRendererObject(); - - // Early exit if attachment is invisible - if (attachment->getColor().a == 0) { - _clipper->clipEnd(*slot); - continue; - } - - trianglesTwoColor.vertCount = attachmentVertices->_triangles->vertCount; - vbSize = trianglesTwoColor.vertCount * sizeof(V2F_T2F_C4B_C4B); - vb.checkSpace(vbSize, true); - trianglesTwoColor.verts = (V2F_T2F_C4B_C4B*)vb.getCurBuffer(); - for (int ii = 0; ii < trianglesTwoColor.vertCount; ii++) { - trianglesTwoColor.verts[ii].texCoord = attachmentVertices->_triangles->verts[ii].texCoord; - } - attachment->computeWorldVertices(*slot, 0, attachment->getWorldVerticesLength(), (float*)trianglesTwoColor.verts, 0, vs2); - - trianglesTwoColor.indexCount = attachmentVertices->_triangles->indexCount; - ibSize = trianglesTwoColor.indexCount * sizeof(unsigned short); - ib.checkSpace(ibSize, true); - trianglesTwoColor.indices = (unsigned short*)ib.getCurBuffer(); - memcpy(trianglesTwoColor.indices, attachmentVertices->_triangles->indices, ibSize); - - color.r = attachment->getColor().r; - color.g = attachment->getColor().g; - color.b = attachment->getColor().b; - color.a = attachment->getColor().a; - - } else if (slot->getAttachment()->getRTTI().isExactly(ClippingAttachment::rtti)) { - ClippingAttachment* clip = (ClippingAttachment*)slot->getAttachment(); - _clipper->clipStart(*slot, clip); - continue; - } else { - _clipper->clipEnd(*slot); - continue; - } - - color.a = _skeleton->getColor().a * slot->getColor().a * color.a * 255; - // skip rendering if the color of this attachment is 0 - if (color.a == 0) { - _clipper->clipEnd(*slot); - continue; - } - - float red = _skeleton->getColor().r * color.r * 255; - float green = _skeleton->getColor().g * color.g * 255; - float blue = _skeleton->getColor().b * color.b * 255; - - color.r = red * slot->getColor().r; - color.g = green * slot->getColor().g; - color.b = blue * slot->getColor().b; - - if (slot->hasDarkColor()) { - darkColor.r = red * slot->getDarkColor().r; - darkColor.g = green * slot->getDarkColor().g; - darkColor.b = blue * slot->getDarkColor().b; - } else { - darkColor.r = 0; - darkColor.g = 0; - darkColor.b = 0; - } - darkColor.a = 0; - - if (preColor != color || preDarkColor != darkColor) { - preColor = color; - preDarkColor = darkColor; - auto colorCount = frameData->getColorCount(); - if (colorCount > 0) { - ColorData* preColorData = frameData->buildColorData(colorCount - 1); - preColorData->vertexFloatOffset = (int) vb.getCurPos() / sizeof(float); - } - ColorData* colorData = frameData->buildColorData(colorCount); - colorData->finalColor = color; - colorData->darkColor = darkColor; - } - - // Two color tint logic - if (_clipper->isClipping()) { - _clipper->clipTriangles((float*)&trianglesTwoColor.verts[0].vertex, trianglesTwoColor.indices, trianglesTwoColor.indexCount, (float*)&trianglesTwoColor.verts[0].texCoord, vs2); - - if (_clipper->getClippedTriangles().size() == 0) { - _clipper->clipEnd(*slot); - continue; - } - - trianglesTwoColor.vertCount = (int)_clipper->getClippedVertices().size() >> 1; - vbSize = trianglesTwoColor.vertCount * sizeof(V2F_T2F_C4B_C4B); - vb.checkSpace(vbSize, true); - trianglesTwoColor.verts = (V2F_T2F_C4B_C4B*)vb.getCurBuffer(); - - trianglesTwoColor.indexCount = (int)_clipper->getClippedTriangles().size(); - ibSize = trianglesTwoColor.indexCount * sizeof(unsigned short); - trianglesTwoColor.indices = (unsigned short*)ib.getCurBuffer(); - memcpy(trianglesTwoColor.indices, _clipper->getClippedTriangles().buffer(), sizeof(unsigned short) * _clipper->getClippedTriangles().size()); - - float* verts = _clipper->getClippedVertices().buffer(); - float* uvs = _clipper->getClippedUVs().buffer(); - - for (int v = 0, vn = trianglesTwoColor.vertCount, vv = 0; v < vn; ++v, vv += 2) { - V2F_T2F_C4B_C4B* vertex = trianglesTwoColor.verts + v; - vertex->vertex.x = verts[vv]; - vertex->vertex.y = verts[vv + 1]; - vertex->texCoord.u = uvs[vv]; - vertex->texCoord.v = uvs[vv + 1]; - vertex->color.r = (GLubyte)color.r; - vertex->color.g = (GLubyte)color.g; - vertex->color.b = (GLubyte)color.b; - vertex->color.a = (GLubyte)color.a; - vertex->color2.r = (GLubyte)darkColor.r; - vertex->color2.g = (GLubyte)darkColor.g; - vertex->color2.b = (GLubyte)darkColor.b; - vertex->color2.a = (GLubyte)darkColor.a; - } - } else { - for (int v = 0, vn = trianglesTwoColor.vertCount; v < vn; ++v) { - V2F_T2F_C4B_C4B* vertex = trianglesTwoColor.verts + v; - vertex->color.r = (GLubyte)color.r; - vertex->color.g = (GLubyte)color.g; - vertex->color.b = (GLubyte)color.b; - vertex->color.a = (GLubyte)color.a; - vertex->color2.r = (GLubyte)darkColor.r; - vertex->color2.g = (GLubyte)darkColor.g; - vertex->color2.b = (GLubyte)darkColor.b; - vertex->color2.a = (GLubyte)darkColor.a; - } - } - - texture = attachmentVertices->_texture; - curTextureIndex = attachmentVertices->_texture->getNativeTexture()->getHandle(); - // If texture or blendMode change,will change material. - if (preTextureIndex != curTextureIndex || preBlendMode != slot->getData().getBlendMode()) { - flush(); - } - - if (vbSize > 0 && ibSize > 0) { - auto vertexOffset = curVSegLen / vs2; - - if (vertexOffset > 0) { - unsigned short* ibBuffer = (unsigned short*)ib.getCurBuffer(); - for (int ii = 0, nn = ibSize / sizeof(unsigned short); ii < nn; ii++) { - ibBuffer[ii] += vertexOffset; - } - } - vb.move(vbSize); - ib.move(ibSize); - - // Record this turn index segmentation count,it will store in material buffer in the end. - curISegLen += ibSize / sizeof(unsigned short); - curVSegLen += vbSize / sizeof(float); - } - - _clipper->clipEnd(*slot); - } // End slot traverse - - _clipper->clipEnd(); - - if (preISegWritePos != -1) { - SegmentData* preSegmentData = frameData->buildSegmentData(materialLen - 1); - preSegmentData->indexCount = curISegLen; - preSegmentData->vertexFloatCount = curVSegLen; - } - - auto colorCount = frameData->getColorCount(); - if (colorCount > 0) { - ColorData* preColorData = frameData->buildColorData(colorCount - 1); - preColorData->vertexFloatOffset = (int) vb.getCurPos() / sizeof(float); - } - } - - void SkeletonCache::onAnimationStateEvent (TrackEntry* entry, EventType type, Event* event) { - SkeletonAnimation::onAnimationStateEvent(entry, type, event); - if (type == EventType_Complete && entry) { - Animation* ani = entry->getAnimation(); - if (!ani) return; - std::string aniName = ani->getName().buffer(); - if (aniName == _curAnimationName) { - AnimationData* aniData = getAnimationData(_curAnimationName); - if (!aniData) return; - aniData->_isComplete = true; - } - } - } - - void SkeletonCache::resetAllAnimationData() { - for (auto it = _animationCaches.begin(); it != _animationCaches.end(); it++) { - it->second->reset(); - } - } - - void SkeletonCache::resetAnimationData(const std::string& animationName) { - for (auto it = _animationCaches.begin(); it != _animationCaches.end(); it++) { - if (it->second->_animationName == animationName) { - it->second->reset(); - break; - } - } - } -} diff --git a/native/cocos/editor-support/spine-creator-support/SkeletonCache.h b/native/cocos/editor-support/spine-creator-support/SkeletonCache.h deleted file mode 100644 index 9e8f87bbd8..0000000000 --- a/native/cocos/editor-support/spine-creator-support/SkeletonCache.h +++ /dev/null @@ -1,136 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated May 1, 2019. Replaces all prior versions. - * - * Copyright (c) 2013-2019, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS - * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#pragma once - -#include "SkeletonAnimation.h" -#include "IOBuffer.h" -#include "middleware-adapter.h" -#include - -namespace spine { - class SkeletonCache: public SkeletonAnimation { - public: - struct SegmentData { - friend class SkeletonCache; - - SegmentData (); - ~SegmentData (); - - void setTexture (cocos2d::middleware::Texture2D* value); - cocos2d::middleware::Texture2D* getTexture () const; - public: - int indexCount = 0; - int vertexFloatCount = 0; - int blendMode = 0; - private: - cocos2d::middleware::Texture2D* _texture = nullptr; - }; - - struct ColorData { - cocos2d::Color4F finalColor; - cocos2d::Color4F darkColor; - int vertexFloatOffset = 0; - }; - - struct FrameData { - friend class SkeletonCache; - - FrameData (); - ~FrameData (); - - const std::vector& getColors () const { - return _colors; - } - std::size_t getColorCount () const; - - const std::vector& getSegments () const { - return _segments; - } - std::size_t getSegmentCount () const; - private: - // if segment data is empty, it will build new one. - SegmentData* buildSegmentData (std::size_t index); - // if color data is empty, it will build new one. - ColorData* buildColorData (std::size_t index); - - std::vector _colors; - std::vector _segments; - public: - cocos2d::middleware::IOBuffer ib; - cocos2d::middleware::IOBuffer vb; - }; - - struct AnimationData { - friend class SkeletonCache; - - AnimationData (); - ~AnimationData (); - void reset (); - - FrameData* getFrameData (std::size_t frameIdx) const; - std::size_t getFrameCount () const; - - bool isComplete () const { return _isComplete; } - bool needUpdate (int toFrameIdx) const; - private: - // if frame is empty, it will build new one. - FrameData* buildFrameData (std::size_t frameIdx); - private: - std::string _animationName = ""; - bool _isComplete = false; - float _totalTime = 0.0f; - std::vector _frames; - }; - - SkeletonCache (); - virtual ~SkeletonCache (); - - virtual void beginSchedule() override {} - virtual void stopSchedule() override {} - virtual void update (float deltaTime) override; - virtual void render (float deltaTime) override {} - virtual void onAnimationStateEvent (TrackEntry* entry, EventType type, Event* event) override; - - void updateToFrame (const std::string& animationName, int toFrameIdx = -1); - // if animation data is empty, it will build new one. - AnimationData* buildAnimationData (const std::string& animationName); - AnimationData* getAnimationData (const std::string& animationName); - void resetAllAnimationData(); - void resetAnimationData(const std::string& animationName); - private: - void renderAnimationFrame (AnimationData* animationData); - public: - static float FrameTime; - static float MaxCacheTime; - private: - std::string _curAnimationName = ""; - std::map _animationCaches; - }; -} diff --git a/native/cocos/editor-support/spine-creator-support/SkeletonCacheAnimation.cpp b/native/cocos/editor-support/spine-creator-support/SkeletonCacheAnimation.cpp deleted file mode 100644 index 75c4ee23c6..0000000000 --- a/native/cocos/editor-support/spine-creator-support/SkeletonCacheAnimation.cpp +++ /dev/null @@ -1,477 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated May 1, 2019. Replaces all prior versions. - * - * Copyright (c) 2013-2019, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS - * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#include "SkeletonCacheAnimation.h" -#include "MiddlewareMacro.h" -#include "SkeletonCacheMgr.h" -#include "renderer/renderer/Pass.h" -#include "renderer/renderer/Technique.h" -#include "renderer/scene/assembler/CustomAssembler.hpp" -#include "renderer/gfx/Texture.h" - -USING_NS_CC; -USING_NS_MW; -using namespace cocos2d::renderer; -static const std::string techStage = "opaque"; -static const std::string textureKey = "texture"; - -namespace spine { - - SkeletonCacheAnimation::SkeletonCacheAnimation (const std::string& uuid, bool isShare) { - if (isShare) { - _skeletonCache = SkeletonCacheMgr::getInstance()->buildSkeletonCache(uuid); - _skeletonCache->retain(); - } else { - _skeletonCache = new SkeletonCache(); - _skeletonCache->initWithUUID(uuid); - _skeletonCache->retain(); - _skeletonCache->autorelease(); - } - beginSchedule(); - } - - SkeletonCacheAnimation::~SkeletonCacheAnimation () { - if (_skeletonCache) { - _skeletonCache->release(); - _skeletonCache = nullptr; - } - while (!_animationQueue.empty()) { - auto ani = _animationQueue.front(); - _animationQueue.pop(); - delete ani; - } - CC_SAFE_RELEASE(_nodeProxy); - CC_SAFE_RELEASE(_effect); - stopSchedule(); - } - - void SkeletonCacheAnimation::update(float dt) { - if (_paused) return; - - auto gTimeScale = SkeletonAnimation::GlobalTimeScale; - dt *= _timeScale * gTimeScale; - - if (_isAniComplete) { - if (_animationQueue.empty() && !_headAnimation) { - if (_animationData && !_animationData->isComplete()) { - _skeletonCache->updateToFrame(_animationName); - } - return; - } - if (!_headAnimation) { - _headAnimation = _animationQueue.front(); - _animationQueue.pop(); - } - if (!_headAnimation) { - return; - } - _accTime += dt; - if (_accTime > _headAnimation->delay) { - std::string name = _headAnimation->animationName; - bool loop = _headAnimation->loop; - delete _headAnimation; - _headAnimation = nullptr; - setAnimation(name, loop); - return; - } - } - - if (!_animationData) return; - - if (_accTime <= 0.00001 && _playCount == 0) { - if (_startListener) { - _startListener(_animationName); - } - } - - _accTime += dt; - int frameIdx = floor(_accTime / SkeletonCache::FrameTime); - if (!_animationData->isComplete()) { - _skeletonCache->updateToFrame(_animationName, frameIdx); - } - - int finalFrameIndex = (int)_animationData->getFrameCount() - 1; - if (_animationData->isComplete() && frameIdx >= finalFrameIndex) { - _playCount++; - _accTime = 0.0f; - if (_playTimes > 0 && _playCount >= _playTimes) { - frameIdx = finalFrameIndex; - _playCount = 0; - _isAniComplete = true; - } else { - frameIdx = 0; - } - if (_endListener) { - _endListener(_animationName); - } - if (_completeListener) { - _completeListener(_animationName); - } - } - _curFrameIndex = frameIdx; - } - - void SkeletonCacheAnimation::render(float dt) { - - if (_nodeProxy == nullptr) { - return; - } - - CustomAssembler* assembler = (CustomAssembler*)_nodeProxy->getAssembler(); - if (assembler == nullptr) { - return; - } - assembler->reset(); - assembler->setUseModel(!_batch); - - if (!_animationData) return; - SkeletonCache::FrameData* frameData = _animationData->getFrameData(_curFrameIndex); - if (!frameData) return; - - auto& segments = frameData->getSegments(); - auto& colors = frameData->getColors(); - if (segments.size() == 0 || colors.size() == 0) return; - - auto mgr = MiddlewareManager::getInstance(); - if (!mgr->isRendering) return; - - _nodeColor.a = _nodeProxy->getRealOpacity() / (float)255; - - middleware::MeshBuffer* mb = mgr->getMeshBuffer(VF_XYUVCC); - middleware::IOBuffer& vb = mb->getVB(); - middleware::IOBuffer& ib = mb->getIB(); - const auto& srcVB = frameData->vb; - const auto& srcIB = frameData->ib; - - const cocos2d::Mat4& nodeWorldMat = _nodeProxy->getWorldMatrix(); - - int colorOffset = 0; - SkeletonCache::ColorData* nowColor = colors[colorOffset++]; - auto maxVFOffset = nowColor->vertexFloatOffset; - - Color4B finalColor; - Color4B darkColor; - float tempR = 0.0f, tempG = 0.0f, tempB = 0.0f, tempA = 0.0f; - float multiplier = 1.0f; - int srcVertexBytesOffset = 0; - int vertexBytes = 0; - int srcIndexBytesOffset = 0; - int indexBytes = 0; - GLuint textureHandle = 0; - double effectHash = 0; - int blendMode = 0; - int dstVertexOffset = 0; - float* dstVertexBuffer = nullptr; - unsigned int* dstColorBuffer = nullptr; - unsigned short* dstIndexBuffer = nullptr; - bool needColor = false; - BlendFactor curBlendSrc = BlendFactor::ONE; - BlendFactor curBlendDst = BlendFactor::ZERO; - - if (abs(_nodeColor.r - 1.0f) > 0.0001f || - abs(_nodeColor.g - 1.0f) > 0.0001f || - abs(_nodeColor.b - 1.0f) > 0.0001f || - abs(_nodeColor.a - 1.0f) > 0.0001f || - _premultipliedAlpha) { - needColor = true; - } - - auto handleColor = [&](SkeletonCache::ColorData* colorData){ - tempA = colorData->finalColor.a * _nodeColor.a; - multiplier = _premultipliedAlpha ? tempA / 255 : 1; - tempR = _nodeColor.r * multiplier; - tempG = _nodeColor.g * multiplier; - tempB = _nodeColor.b * multiplier; - - finalColor.a = (GLubyte)tempA; - finalColor.r = (GLubyte)(colorData->finalColor.r * tempR); - finalColor.g = (GLubyte)(colorData->finalColor.g * tempG); - finalColor.b = (GLubyte)(colorData->finalColor.b * tempB); - - darkColor.r = (GLubyte)(colorData->darkColor.r * tempR); - darkColor.g = (GLubyte)(colorData->darkColor.g * tempG); - darkColor.b = (GLubyte)(colorData->darkColor.b * tempB); - darkColor.a = _premultipliedAlpha ? 255 : 0; - }; - - handleColor(nowColor); - - for (std::size_t segIndex = 0, segLen = segments.size(); segIndex < segLen; segIndex++) { - auto segment = segments[segIndex]; - vertexBytes = segment->vertexFloatCount * sizeof(float); - - // fill vertex buffer - vb.checkSpace(vertexBytes, true); - dstVertexOffset = (int)vb.getCurPos() / sizeof(V2F_T2F_C4B_C4B); - dstVertexBuffer = (float*)vb.getCurBuffer(); - dstColorBuffer = (unsigned int*)vb.getCurBuffer(); - vb.writeBytes((char*)srcVB.getBuffer() + srcVertexBytesOffset, vertexBytes); - - // batch handle - if (_batch) { - cocos2d::Vec3* point = nullptr; - float tempZ = 0.0f; - for (auto posIndex = 0; posIndex < segment->vertexFloatCount; posIndex += 6) - { - point = (cocos2d::Vec3*)(dstVertexBuffer + posIndex); - tempZ = point->z; - point->z = 0; - nodeWorldMat.transformPoint(point); - point->z = tempZ; - } - } - - // handle vertex color - if (needColor) { - int frameFloatOffset = srcVertexBytesOffset / sizeof(float); - for (auto colorIndex = 0; colorIndex < segment->vertexFloatCount; colorIndex += 6, frameFloatOffset += 6) - { - if (frameFloatOffset >= maxVFOffset) { - nowColor = colors[colorOffset++]; - handleColor(nowColor); - maxVFOffset = nowColor->vertexFloatOffset; - } - memcpy(dstColorBuffer + colorIndex + 4, &finalColor, sizeof(finalColor)); - memcpy(dstColorBuffer + colorIndex + 5, &darkColor, sizeof(darkColor)); - } - } - - // move src vertex buffer offset - srcVertexBytesOffset += vertexBytes; - - // fill index buffer - indexBytes = segment->indexCount * sizeof(unsigned short); - ib.checkSpace(indexBytes, true); - assembler->updateIARange(segIndex, (int)ib.getCurPos() / sizeof(unsigned short), segment->indexCount); - dstIndexBuffer = (unsigned short*)ib.getCurBuffer(); - ib.writeBytes((char*)srcIB.getBuffer() + srcIndexBytesOffset, indexBytes); - for (auto indexPos = 0; indexPos < segment->indexCount; indexPos ++) { - dstIndexBuffer[indexPos] += dstVertexOffset; - } - srcIndexBytesOffset += indexBytes; - - // set assembler glvb and glib - assembler->updateIABuffer(segIndex, mb->getGLVB(), mb->getGLIB()); - - // handle material - textureHandle = segment->getTexture()->getNativeTexture()->getHandle(); - blendMode = segment->blendMode; - effectHash = textureHandle + (blendMode << 16) + (1/*_useTint*/ << 24) + ((int)_batch << 25); - Effect* renderEffect = assembler->getEffect(segIndex); - Technique::Parameter* param = nullptr; - Pass* pass = nullptr; - - if (renderEffect) { - double renderHash = renderEffect->getHash(); - if (abs(renderHash - effectHash) >= 0.01) { - param = (Technique::Parameter*)&(renderEffect->getProperty(textureKey)); - Technique* tech = renderEffect->getTechnique(techStage); - cocos2d::Vector& passes = (cocos2d::Vector&)tech->getPasses(); - pass = *(passes.begin()); - } - } - else { - if (_effect == nullptr) { - cocos2d::log("SkeletonCacheAnimation:update get effect failed"); - assembler->reset(); - return; - } - auto effect = new cocos2d::renderer::Effect(); - effect->autorelease(); - effect->copy(_effect); - - Technique* tech = effect->getTechnique(techStage); - cocos2d::Vector& passes = (cocos2d::Vector&)tech->getPasses(); - pass = *(passes.begin()); - - assembler->updateEffect(segIndex, effect); - renderEffect = effect; - param = (Technique::Parameter*)&(renderEffect->getProperty(textureKey)); - } - - if (param) { - param->setTexture(segment->getTexture()->getNativeTexture()); - } - - switch (blendMode) { - case BlendMode_Additive: - curBlendSrc = _premultipliedAlpha ? BlendFactor::ONE : BlendFactor::SRC_ALPHA; - curBlendDst = BlendFactor::ONE; - break; - case BlendMode_Multiply: - curBlendSrc = BlendFactor::DST_COLOR; - curBlendDst = BlendFactor::ONE_MINUS_SRC_ALPHA; - break; - case BlendMode_Screen: - curBlendSrc = BlendFactor::ONE; - curBlendDst = BlendFactor::ONE_MINUS_SRC_COLOR; - break; - default: - curBlendSrc = _premultipliedAlpha ? BlendFactor::ONE : BlendFactor::SRC_ALPHA; - curBlendDst = BlendFactor::ONE_MINUS_SRC_ALPHA; - } - - if (pass) { - pass->setBlend(BlendOp::ADD, curBlendSrc, curBlendDst, - BlendOp::ADD, curBlendSrc, curBlendDst); - } - - renderEffect->updateHash(effectHash); - } - } - - Skeleton* SkeletonCacheAnimation::getSkeleton() const { - return _skeletonCache->getSkeleton(); - } - - void SkeletonCacheAnimation::setTimeScale (float scale) { - _timeScale = scale; - } - - float SkeletonCacheAnimation::getTimeScale () const { - return _timeScale; - } - - void SkeletonCacheAnimation::paused (bool value) { - _paused = value; - } - - Bone* SkeletonCacheAnimation::findBone (const std::string& boneName) const { - return _skeletonCache->findBone(boneName); - } - - Slot* SkeletonCacheAnimation::findSlot (const std::string& slotName) const { - return _skeletonCache->findSlot(slotName); - } - - void SkeletonCacheAnimation::setSkin (const std::string& skinName) { - _skeletonCache->setSkin(skinName); - _skeletonCache->setToSetupPose(); - _skeletonCache->resetAllAnimationData(); - } - - void SkeletonCacheAnimation::setSkin (const char* skinName) { - _skeletonCache->setSkin(skinName); - _skeletonCache->setToSetupPose(); - _skeletonCache->resetAllAnimationData(); - } - - Attachment* SkeletonCacheAnimation::getAttachment (const std::string& slotName, const std::string& attachmentName) const { - return _skeletonCache->getAttachment(slotName, attachmentName); - } - - bool SkeletonCacheAnimation::setAttachment (const std::string& slotName, const std::string& attachmentName) { - auto ret = _skeletonCache->setAttachment(slotName, attachmentName); - _skeletonCache->resetAllAnimationData(); - return ret; - } - - bool SkeletonCacheAnimation::setAttachment (const std::string& slotName, const char* attachmentName) { - auto ret = _skeletonCache->setAttachment(slotName, attachmentName); - _skeletonCache->resetAllAnimationData(); - return ret; - } - - void SkeletonCacheAnimation::setColor (cocos2d::Color4B& color) { - _nodeColor.r = color.r / 255.0f; - _nodeColor.g = color.g / 255.0f; - _nodeColor.b = color.b / 255.0f; - _nodeColor.a = color.a / 255.0f; - } - - void SkeletonCacheAnimation::setBatchEnabled (bool enabled) { - _batch = enabled; - } - - void SkeletonCacheAnimation::setOpacityModifyRGB (bool value) { - _premultipliedAlpha = value; - } - - bool SkeletonCacheAnimation::isOpacityModifyRGB () const { - return _premultipliedAlpha; - } - - void SkeletonCacheAnimation::beginSchedule() { - MiddlewareManager::getInstance()->addTimer(this); - } - - void SkeletonCacheAnimation::stopSchedule() { - MiddlewareManager::getInstance()->removeTimer(this); - } - - void SkeletonCacheAnimation::onEnable() { - beginSchedule(); - } - - void SkeletonCacheAnimation::onDisable() { - stopSchedule(); - } - - void SkeletonCacheAnimation::setAnimation (const std::string& name, bool loop) { - _playTimes = loop ? 0 : 1; - _animationName = name; - _animationData = _skeletonCache->buildAnimationData(_animationName); - _isAniComplete = false; - _accTime = 0.0f; - _playCount = 0; - _curFrameIndex = 0; - } - - void SkeletonCacheAnimation::addAnimation (const std::string& name, bool loop, float delay) { - auto aniInfo = new AniQueueData(); - aniInfo->animationName = name; - aniInfo->loop = loop; - aniInfo->delay = delay; - _animationQueue.push(aniInfo); - } - - Animation* SkeletonCacheAnimation::findAnimation(const std::string& name) const { - return _skeletonCache->findAnimation(name); - } - - void SkeletonCacheAnimation::setStartListener (const CacheFrameEvent& listener) { - _startListener = listener; - } - - void SkeletonCacheAnimation::setEndListener (const CacheFrameEvent& listener) { - _endListener = listener; - } - - void SkeletonCacheAnimation::setCompleteListener (const CacheFrameEvent& listener) { - _completeListener = listener; - } - - void SkeletonCacheAnimation::updateAnimationCache (const std::string& animationName) { - _skeletonCache->resetAnimationData(animationName); - } - - void SkeletonCacheAnimation::updateAllAnimationCache () { - _skeletonCache->resetAllAnimationData(); - } -} diff --git a/native/cocos/editor-support/spine-creator-support/SkeletonCacheAnimation.h b/native/cocos/editor-support/spine-creator-support/SkeletonCacheAnimation.h deleted file mode 100644 index 2a9809293b..0000000000 --- a/native/cocos/editor-support/spine-creator-support/SkeletonCacheAnimation.h +++ /dev/null @@ -1,132 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated May 1, 2019. Replaces all prior versions. - * - * Copyright (c) 2013-2019, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS - * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#pragma once -#include "spine/spine.h" -#include "base/CCRef.h" -#include "MiddlewareManager.h" -#include "renderer/scene/NodeProxy.hpp" -#include "SkeletonCache.h" -#include - -namespace spine { - class SkeletonCacheAnimation : public cocos2d::middleware::IMiddleware, public cocos2d::Ref { - public: - SkeletonCacheAnimation (const std::string& uuid, bool isShare); - virtual ~SkeletonCacheAnimation (); - - virtual void update(float dt) override; - virtual void render(float dt) override; - - Skeleton* getSkeleton() const; - - void setTimeScale (float scale); - float getTimeScale () const; - - void paused (bool value); - - Bone* findBone (const std::string& boneName) const; - Slot* findSlot (const std::string& slotName) const; - - void setSkin (const std::string& skinName); - void setSkin (const char* skinName); - - Attachment* getAttachment (const std::string& slotName, const std::string& attachmentName) const; - bool setAttachment (const std::string& slotName, const std::string& attachmentName); - bool setAttachment (const std::string& slotName, const char* attachmentName); - - void bindNodeProxy(cocos2d::renderer::NodeProxy* node) { - if (node == _nodeProxy) return; - CC_SAFE_RELEASE(_nodeProxy); - _nodeProxy = node; - CC_SAFE_RETAIN(_nodeProxy); - } - - void setEffect(cocos2d::renderer::Effect* effect) { - if (effect == _effect) return; - CC_SAFE_RELEASE(_effect); - _effect = effect; - CC_SAFE_RETAIN(_effect); - } - - void setColor (cocos2d::Color4B& color); - void setBatchEnabled (bool enabled); - - void setOpacityModifyRGB (bool value); - bool isOpacityModifyRGB () const; - - void beginSchedule(); - void stopSchedule(); - void onEnable(); - void onDisable(); - - void setAnimation (const std::string& name, bool loop); - void addAnimation (const std::string& name, bool loop, float delay = 0); - Animation* findAnimation(const std::string& name) const; - - typedef std::function CacheFrameEvent; - void setStartListener (const CacheFrameEvent& listener); - void setEndListener (const CacheFrameEvent& listener); - void setCompleteListener (const CacheFrameEvent& listener); - void updateAnimationCache (const std::string& animationName); - void updateAllAnimationCache (); - private: - float _timeScale = 1; - bool _paused = false; - - bool _batch = false; - cocos2d::Color4F _nodeColor = cocos2d::Color4F::WHITE; - bool _premultipliedAlpha = false; - - cocos2d::renderer::NodeProxy* _nodeProxy = nullptr; - cocos2d::renderer::Effect* _effect = nullptr; - - CacheFrameEvent _startListener = nullptr; - CacheFrameEvent _endListener = nullptr; - CacheFrameEvent _completeListener = nullptr; - - SkeletonCache* _skeletonCache = nullptr; - SkeletonCache::AnimationData* _animationData = nullptr; - int _curFrameIndex = -1; - - float _accTime = 0.0f; - int _playCount = 0; - int _playTimes = 0; - bool _isAniComplete = true; - std::string _animationName = ""; - - struct AniQueueData { - std::string animationName = ""; - bool loop = false; - float delay = 0.0f; - }; - std::queue _animationQueue; - AniQueueData* _headAnimation = nullptr; - }; -} diff --git a/native/cocos/editor-support/spine-creator-support/SkeletonCacheMgr.cpp b/native/cocos/editor-support/spine-creator-support/SkeletonCacheMgr.cpp deleted file mode 100644 index 08f93625d2..0000000000 --- a/native/cocos/editor-support/spine-creator-support/SkeletonCacheMgr.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated May 1, 2019. Replaces all prior versions. - * - * Copyright (c) 2013-2019, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS - * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#include "SkeletonCacheMgr.h" - -namespace spine { - SkeletonCacheMgr* SkeletonCacheMgr::_instance = nullptr; - SkeletonCache* SkeletonCacheMgr::buildSkeletonCache(const std::string& uuid) { - SkeletonCache* animation = _caches.at(uuid); - if (!animation) { - animation = new SkeletonCache(); - animation->initWithUUID(uuid); - _caches.insert(uuid, animation); - animation->autorelease(); - } - return animation; - } - - void SkeletonCacheMgr::removeSkeletonCache (const std::string& uuid) { - auto it = _caches.find(uuid); - if (it != _caches.end()) { - _caches.erase(it); - } - } -} diff --git a/native/cocos/editor-support/spine-creator-support/SkeletonCacheMgr.h b/native/cocos/editor-support/spine-creator-support/SkeletonCacheMgr.h deleted file mode 100644 index 576eee9459..0000000000 --- a/native/cocos/editor-support/spine-creator-support/SkeletonCacheMgr.h +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated May 1, 2019. Replaces all prior versions. - * - * Copyright (c) 2013-2019, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS - * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#pragma once -#include "SkeletonCache.h" -#include "base/CCMap.h" - -namespace spine { - -class SkeletonCacheMgr { -public: - static SkeletonCacheMgr* getInstance () { - if (_instance == nullptr) { - _instance = new SkeletonCacheMgr(); - } - return _instance; - } - - static void destroyInstance () { - if (_instance) { - delete _instance; - _instance = nullptr; - } - } - - void removeSkeletonCache (const std::string& uuid); - SkeletonCache* buildSkeletonCache (const std::string& uuid); -private: - static SkeletonCacheMgr* _instance; - cocos2d::Map _caches; -}; - -} diff --git a/native/cocos/editor-support/spine-creator-support/SkeletonDataMgr.cpp b/native/cocos/editor-support/spine-creator-support/SkeletonDataMgr.cpp deleted file mode 100644 index 93774b1f4e..0000000000 --- a/native/cocos/editor-support/spine-creator-support/SkeletonDataMgr.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated May 1, 2019. Replaces all prior versions. - * - * Copyright (c) 2013-2019, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS - * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#include "SkeletonDataMgr.h" -#include -#include - -using namespace spine; - -class SkeletonDataInfo; -static std::map _dataMap; - -class SkeletonDataInfo : public cocos2d::Ref { -public: - SkeletonDataInfo (const std::string& uuid) { - _uuid = uuid; - } - - ~SkeletonDataInfo () { - if (data) { - delete data; - data = nullptr; - } - - if (atlas) { - delete atlas; - atlas = nullptr; - } - - if (attachmentLoader) { - delete attachmentLoader; - attachmentLoader = nullptr; - } - } - - SkeletonData* data = nullptr; - Atlas* atlas = nullptr; - AttachmentLoader* attachmentLoader = nullptr; - std::vector texturesIndex; - std::string _uuid; -}; - -SkeletonDataMgr* SkeletonDataMgr::_instance = nullptr; - -bool SkeletonDataMgr::hasSkeletonData (const std::string& uuid) { - auto it = _dataMap.find(uuid); - return it != _dataMap.end(); -} - -void SkeletonDataMgr::setSkeletonData (const std::string& uuid, SkeletonData* data, Atlas* atlas, AttachmentLoader* attachmentLoader, const std::vector& texturesIndex) { - auto it = _dataMap.find(uuid); - if (it != _dataMap.end()) { - releaseByUUID(uuid); - } - SkeletonDataInfo* info = new SkeletonDataInfo(uuid); - info->data = data; - info->atlas = atlas; - info->attachmentLoader = attachmentLoader; - info->texturesIndex = texturesIndex; - _dataMap[uuid] = info; -} - -SkeletonData* SkeletonDataMgr::retainByUUID (const std::string& uuid) { - auto dataIt = _dataMap.find(uuid); - if (dataIt == _dataMap.end()) { - return nullptr; - } - dataIt->second->retain(); - return dataIt->second->data; -} - -void SkeletonDataMgr::releaseByUUID (const std::string& uuid) { - auto dataIt = _dataMap.find(uuid); - if (dataIt == _dataMap.end()) { - return; - } - SkeletonDataInfo* info = dataIt->second; - // If info reference count is 1, then info will be destroy. - if (info->getReferenceCount() == 1) { - _dataMap.erase(dataIt); - if (_destroyCallback) { - auto& texturesIndex = info->texturesIndex; - for (auto it = texturesIndex.begin(); it != texturesIndex.end(); it++) { - _destroyCallback(*it); - } - } - } - info->release(); -} diff --git a/native/cocos/editor-support/spine-creator-support/SkeletonDataMgr.h b/native/cocos/editor-support/spine-creator-support/SkeletonDataMgr.h deleted file mode 100644 index 0df3d6c8a7..0000000000 --- a/native/cocos/editor-support/spine-creator-support/SkeletonDataMgr.h +++ /dev/null @@ -1,78 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated May 1, 2019. Replaces all prior versions. - * - * Copyright (c) 2013-2019, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS - * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#pragma once - -#include -#include -#include "spine/SkeletonData.h" -#include "base/CCRef.h" -#include "spine/spine.h" -#include -#include - -namespace spine { - -/** - * Cache skeleton data. - */ -class SkeletonDataMgr { -public: - static SkeletonDataMgr* getInstance () { - if (_instance == nullptr) { - _instance = new SkeletonDataMgr(); - } - return _instance; - } - - static void destroyInstance () { - if (_instance) { - delete _instance; - _instance = nullptr; - } - } - - SkeletonDataMgr () {} - virtual ~SkeletonDataMgr () {} - bool hasSkeletonData (const std::string& uuid); - void setSkeletonData (const std::string& uuid, SkeletonData* data, Atlas* atlas, AttachmentLoader* attachmentLoader, const std::vector& texturesIndex); - SkeletonData* retainByUUID (const std::string& uuid); - void releaseByUUID (const std::string& uuid); - - typedef std::function destroyCallback; - void setDestroyCallback(destroyCallback callback) - { - _destroyCallback = callback; - } -private: - static SkeletonDataMgr* _instance; - destroyCallback _destroyCallback = nullptr; -}; - -} diff --git a/native/cocos/editor-support/spine-creator-support/SkeletonRenderer.cpp b/native/cocos/editor-support/spine-creator-support/SkeletonRenderer.cpp deleted file mode 100644 index afe1e340b8..0000000000 --- a/native/cocos/editor-support/spine-creator-support/SkeletonRenderer.cpp +++ /dev/null @@ -1,1065 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated May 1, 2019. Replaces all prior versions. - * - * Copyright (c) 2013-2019, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS - * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#include "spine-creator-support/SkeletonRenderer.h" -#include "spine-creator-support/AttachmentVertices.h" -#include "spine-creator-support/spine-cocos2dx.h" -#include -#include "base/CCScheduler.h" -#include "MiddlewareMacro.h" -#include "renderer/renderer/Pass.h" -#include "renderer/renderer/Technique.h" -#include "renderer/scene/assembler/CustomAssembler.hpp" -#include "SkeletonDataMgr.h" -#include "renderer/gfx/Texture.h" - -USING_NS_CC; -USING_NS_MW; - -using std::min; -using std::max; -using namespace spine; -using namespace cocos2d; -using namespace cocos2d::renderer; - -static const std::string techStage = "opaque"; -static const std::string textureKey = "texture"; - -static Cocos2dTextureLoader textureLoader; - -enum DebugType { - None = 0, - Slots, - Mesh, - Bones -}; - -SkeletonRenderer* SkeletonRenderer::create () { - SkeletonRenderer* skeleton = new SkeletonRenderer(); - skeleton->autorelease(); - return skeleton; -} - -SkeletonRenderer* SkeletonRenderer::createWithSkeleton(Skeleton* skeleton, bool ownsSkeleton, bool ownsSkeletonData) { - SkeletonRenderer* node = new SkeletonRenderer(skeleton, ownsSkeleton, ownsSkeletonData); - node->autorelease(); - return node; -} - -SkeletonRenderer* SkeletonRenderer::createWithData (SkeletonData* skeletonData, bool ownsSkeletonData) { - SkeletonRenderer* node = new SkeletonRenderer(skeletonData, ownsSkeletonData); - node->autorelease(); - return node; -} - -SkeletonRenderer* SkeletonRenderer::createWithFile (const std::string& skeletonDataFile, Atlas* atlas, float scale) { - SkeletonRenderer* node = new SkeletonRenderer(skeletonDataFile, atlas, scale); - node->autorelease(); - return node; -} - -SkeletonRenderer* SkeletonRenderer::createWithFile (const std::string& skeletonDataFile, const std::string& atlasFile, float scale) { - SkeletonRenderer* node = new SkeletonRenderer(skeletonDataFile, atlasFile, scale); - node->autorelease(); - return node; -} - -void SkeletonRenderer::initialize () { - if (_clipper == nullptr) { - _clipper = new (__FILE__, __LINE__) SkeletonClipping(); - } - - _skeleton->setToSetupPose(); - _skeleton->updateWorldTransform(); - beginSchedule(); -} - -void SkeletonRenderer::beginSchedule() { - MiddlewareManager::getInstance()->addTimer(this); -} - -void SkeletonRenderer::onEnable() { - beginSchedule(); -} - -void SkeletonRenderer::onDisable() { - stopSchedule(); -} - -void SkeletonRenderer::stopSchedule() { - MiddlewareManager::getInstance()->removeTimer(this); - if (_debugBuffer) { - _debugBuffer->reset(); - _debugBuffer->clear(); - } -} - -void SkeletonRenderer::setSkeletonData (SkeletonData *skeletonData, bool ownsSkeletonData) { - _skeleton = new (__FILE__, __LINE__) Skeleton(skeletonData); - _ownsSkeletonData = ownsSkeletonData; -} - -SkeletonRenderer::SkeletonRenderer () { -} - -SkeletonRenderer::SkeletonRenderer(Skeleton* skeleton, bool ownsSkeleton, bool ownsSkeletonData, bool ownsAtlas) { - initWithSkeleton(skeleton, ownsSkeleton, ownsSkeletonData, ownsAtlas); -} - -SkeletonRenderer::SkeletonRenderer (SkeletonData *skeletonData, bool ownsSkeletonData) { - initWithData(skeletonData, ownsSkeletonData); -} - -SkeletonRenderer::SkeletonRenderer (const std::string& skeletonDataFile, Atlas* atlas, float scale) { - initWithJsonFile(skeletonDataFile, atlas, scale); -} - -SkeletonRenderer::SkeletonRenderer (const std::string& skeletonDataFile, const std::string& atlasFile, float scale) { - initWithJsonFile(skeletonDataFile, atlasFile, scale); -} - -SkeletonRenderer::~SkeletonRenderer () { - CC_SAFE_RELEASE(_effectDelegate); - if (_ownsSkeletonData) delete _skeleton->getData(); - if (_ownsSkeleton) delete _skeleton; - if (_ownsAtlas && _atlas) delete _atlas; - if (_attachmentLoader) delete _attachmentLoader; - if (_uuid != "") SkeletonDataMgr::getInstance()->releaseByUUID(_uuid); - if (_clipper) delete _clipper; - - if (_debugBuffer) { - delete _debugBuffer; - _debugBuffer = nullptr; - } - - CC_SAFE_RELEASE(_nodeProxy); - CC_SAFE_RELEASE(_effect); - stopSchedule(); -} - -void SkeletonRenderer::initWithUUID(const std::string& uuid) { - _ownsSkeleton = true; - _uuid = uuid; - SkeletonData* skeletonData = SkeletonDataMgr::getInstance()->retainByUUID(uuid); - CCASSERT(skeletonData, "Skeleton data is is null"); - - setSkeletonData(skeletonData, false); - initialize(); -} - -void SkeletonRenderer::initWithSkeleton(Skeleton* skeleton, bool ownsSkeleton, bool ownsSkeletonData, bool ownsAtlas) { - _skeleton = skeleton; - _ownsSkeleton = ownsSkeleton; - _ownsSkeletonData = ownsSkeletonData; - _ownsAtlas = ownsAtlas; - - initialize(); -} - -void SkeletonRenderer::initWithData (SkeletonData* skeletonData, bool ownsSkeletonData) { - _ownsSkeleton = true; - setSkeletonData(skeletonData, ownsSkeletonData); - initialize(); -} - -void SkeletonRenderer::initWithJsonFile (const std::string& skeletonDataFile, Atlas* atlas, float scale) { - _atlas = atlas; - _attachmentLoader = new (__FILE__, __LINE__) Cocos2dAtlasAttachmentLoader(_atlas); - - SkeletonJson* json = new (__FILE__, __LINE__) SkeletonJson(_attachmentLoader); - json->setScale(scale); - SkeletonData* skeletonData = json->readSkeletonDataFile(skeletonDataFile.c_str()); - CCASSERT(skeletonData, !json->getError().isEmpty() ? json->getError().buffer() : "Error reading skeleton data."); - delete json; - - _ownsSkeleton = true; - setSkeletonData(skeletonData, true); - - initialize(); -} - -void SkeletonRenderer::initWithJsonFile (const std::string& skeletonDataFile, const std::string& atlasFile, float scale) { - _atlas = new (__FILE__, __LINE__) Atlas(atlasFile.c_str(), &textureLoader); - CCASSERT(_atlas, "Error reading atlas file."); - - _attachmentLoader = new (__FILE__, __LINE__) Cocos2dAtlasAttachmentLoader(_atlas); - - SkeletonJson* json = new (__FILE__, __LINE__) SkeletonJson(_attachmentLoader); - json->setScale(scale); - SkeletonData* skeletonData = json->readSkeletonDataFile(skeletonDataFile.c_str()); - CCASSERT(skeletonData, !json->getError().isEmpty() ? json->getError().buffer() : "Error reading skeleton data."); - delete json; - - _ownsSkeleton = true; - _ownsAtlas = true; - setSkeletonData(skeletonData, true); - - initialize(); -} - -void SkeletonRenderer::initWithBinaryFile (const std::string& skeletonDataFile, Atlas* atlas, float scale) { - _atlas = atlas; - _attachmentLoader = new (__FILE__, __LINE__) Cocos2dAtlasAttachmentLoader(_atlas); - - SkeletonBinary* binary = new (__FILE__, __LINE__) SkeletonBinary(_attachmentLoader); - binary->setScale(scale); - SkeletonData* skeletonData = binary->readSkeletonDataFile(skeletonDataFile.c_str()); - CCASSERT(skeletonData, !binary->getError().isEmpty() ? binary->getError().buffer() : "Error reading skeleton data."); - delete binary; - _ownsSkeleton = true; - setSkeletonData(skeletonData, true); - - initialize(); -} - -void SkeletonRenderer::initWithBinaryFile (const std::string& skeletonDataFile, const std::string& atlasFile, float scale) { - _atlas = new (__FILE__, __LINE__) Atlas(atlasFile.c_str(), &textureLoader); - CCASSERT(_atlas, "Error reading atlas file."); - - _attachmentLoader = new (__FILE__, __LINE__) Cocos2dAtlasAttachmentLoader(_atlas); - - SkeletonBinary* binary = new (__FILE__, __LINE__) SkeletonBinary(_attachmentLoader); - binary->setScale(scale); - SkeletonData* skeletonData = binary->readSkeletonDataFile(skeletonDataFile.c_str()); - CCASSERT(skeletonData, !binary->getError().isEmpty() ? binary->getError().buffer() : "Error reading skeleton data."); - delete binary; - _ownsSkeleton = true; - _ownsAtlas = true; - setSkeletonData(skeletonData, true); - - initialize(); -} - -void SkeletonRenderer::render (float deltaTime) { - - if (_nodeProxy == nullptr) { - return; - } - - CustomAssembler* assembler = (CustomAssembler*)_nodeProxy->getAssembler(); - if (assembler == nullptr) { - return; - } - assembler->reset(); - assembler->setUseModel(!_batch); - - if (!_skeleton) return; - // avoid other place call update. - auto mgr = MiddlewareManager::getInstance(); - if (!mgr->isRendering) return; - - _nodeColor.a = _nodeProxy->getRealOpacity() / (float)255; - - // If opacity is 0,then return. - if (_skeleton->getColor().a == 0) { - return; - } - - // color range is [0.0, 1.0] - Color4F color; - Color4F darkColor; - AttachmentVertices* attachmentVertices = nullptr; - bool inRange = _startSlotIndex != -1 || _endSlotIndex != -1 ? false : true; - auto vertexFormat = _useTint? VF_XYUVCC : VF_XYUVC; - middleware::MeshBuffer* mb = mgr->getMeshBuffer(vertexFormat); - middleware::IOBuffer& vb = mb->getVB(); - middleware::IOBuffer& ib = mb->getIB(); - - // vertex size int bytes with one color - int vbs1 = sizeof(V2F_T2F_C4B); - // vertex size in floats with one color - int vs1 = vbs1 / sizeof(float); - // vertex size int bytes with two color - int vbs2 = sizeof(V2F_T2F_C4B_C4B); - // verex size in floats with two color - int vs2 = vbs2 / sizeof(float); - const cocos2d::Mat4& nodeWorldMat = _nodeProxy->getWorldMatrix(); - - int vbSize = 0; - int ibSize = 0; - - BlendFactor curBlendSrc = BlendFactor::ONE; - BlendFactor curBlendDst = BlendFactor::ZERO; - int curBlendMode = -1; - int preBlendMode = -1; - GLuint preTextureIndex = -1; - GLuint curTextureIndex = -1; - - int preISegWritePos = -1; - int curISegLen = 0; - - int materialLen = 0; - Slot* slot = nullptr; - int isFull = 0; - - middleware::Texture2D* texture = nullptr; - - if (_debugSlots || _debugBones || _debugMesh) { - // If enable debug draw,then init debug buffer. - if (_debugBuffer == nullptr) { - _debugBuffer = new IOTypedArray(se::Object::TypedArrayType::FLOAT32, MAX_DEBUG_BUFFER_SIZE); - } - _debugBuffer->reset(); - } - - auto flush = [&]() { - // fill pre segment count field - if (preISegWritePos != -1) { - assembler->updateIARange(materialLen - 1, preISegWritePos, curISegLen); - } - - // prepare to fill new segment field - curBlendMode = slot->getData().getBlendMode(); - switch (curBlendMode) { - case BlendMode_Additive: - curBlendSrc = _premultipliedAlpha ? BlendFactor::ONE : BlendFactor::SRC_ALPHA; - curBlendDst = BlendFactor::ONE; - break; - case BlendMode_Multiply: - curBlendSrc = BlendFactor::DST_COLOR; - curBlendDst = BlendFactor::ONE_MINUS_SRC_ALPHA; - break; - case BlendMode_Screen: - curBlendSrc = BlendFactor::ONE; - curBlendDst = BlendFactor::ONE_MINUS_SRC_COLOR; - break; - default: - curBlendSrc = _premultipliedAlpha ? BlendFactor::ONE : BlendFactor::SRC_ALPHA; - curBlendDst = BlendFactor::ONE_MINUS_SRC_ALPHA; - } - - double curHash = curTextureIndex + (curBlendMode << 16) + ((int)_useTint << 24) + ((int)_batch << 25); - Effect* renderEffect = assembler->getEffect(materialLen); - Technique::Parameter* param = nullptr; - Pass* pass = nullptr; - - if (renderEffect) { - double renderHash = renderEffect->getHash(); - if (abs(renderHash - curHash) >= 0.01) { - param = (Technique::Parameter*)&(renderEffect->getProperty(textureKey)); - Technique* tech = renderEffect->getTechnique(techStage); - cocos2d::Vector& passes = (cocos2d::Vector&)tech->getPasses(); - pass = *(passes.begin()); - } - } - else { - if (_effect == nullptr) { - cocos2d::log("SkeletonRenderer:update get effect failed"); - assembler->reset(); - return; - } - auto effect = new cocos2d::renderer::Effect(); - effect->autorelease(); - effect->copy(_effect); - - Technique* tech = effect->getTechnique(techStage); - cocos2d::Vector& passes = (cocos2d::Vector&)tech->getPasses(); - pass = *(passes.begin()); - - assembler->updateEffect(materialLen, effect); - renderEffect = effect; - param = (Technique::Parameter*)&(renderEffect->getProperty(textureKey)); - } - - if (param) { - param->setTexture(texture->getNativeTexture()); - } - - if (pass) { - pass->setBlend(BlendOp::ADD, curBlendSrc, curBlendDst, - BlendOp::ADD, curBlendSrc, curBlendDst); - } - - renderEffect->updateHash(curHash); - - // save new segment count pos field - preISegWritePos = (int)ib.getCurPos() / sizeof(unsigned short); - // save new segment vb and ib - assembler->updateIABuffer(materialLen, mb->getGLVB(), mb->getGLIB()); - // reset pre blend mode to current - preBlendMode = (int)slot->getData().getBlendMode(); - // reset pre texture index to current - preTextureIndex = curTextureIndex; - // reset index segmentation count - curISegLen = 0; - // material length increased - materialLen++; - }; - - VertexEffect* effect = nullptr; - if (_effectDelegate) { - effect = _effectDelegate->getVertexEffect(); - } - - if (effect) { - effect->begin(*_skeleton); - } - - auto& drawOrder = _skeleton->getDrawOrder(); - for (size_t i = 0, n = drawOrder.size(); i < n; ++i) { - isFull = 0; - slot = drawOrder[i]; - if (_startSlotIndex >= 0 && _startSlotIndex == slot->getData().getIndex()) { - inRange = true; - } - - if (!inRange) { - _clipper->clipEnd(*slot); - continue; - } - - if (_endSlotIndex >= 0 && _endSlotIndex == slot->getData().getIndex()) { - inRange = false; - } - - if (!slot->getAttachment()) { - _clipper->clipEnd(*slot); - continue; - } - - // Early exit if slot is invisible - if (slot->getColor().a == 0) { - _clipper->clipEnd(*slot); - continue; - } - - Triangles triangles; - TwoColorTriangles trianglesTwoColor; - - if (slot->getAttachment()->getRTTI().isExactly(RegionAttachment::rtti)) { - RegionAttachment* attachment = (RegionAttachment*)slot->getAttachment(); - attachmentVertices = (AttachmentVertices*)attachment->getRendererObject(); - - // Early exit if attachment is invisible - if (attachment->getColor().a == 0) { - _clipper->clipEnd(*slot); - continue; - } - - if (!_useTint) { - triangles.vertCount = attachmentVertices->_triangles->vertCount; - vbSize = triangles.vertCount * sizeof(V2F_T2F_C4B); - isFull |= vb.checkSpace(vbSize, true); - triangles.verts = (V2F_T2F_C4B*)vb.getCurBuffer(); - memcpy(triangles.verts, attachmentVertices->_triangles->verts, vbSize); - attachment->computeWorldVertices(slot->getBone(), (float*)triangles.verts, 0, vs1); - - triangles.indexCount = attachmentVertices->_triangles->indexCount; - ibSize = triangles.indexCount * sizeof(unsigned short); - ib.checkSpace(ibSize, true); - triangles.indices = (unsigned short*)ib.getCurBuffer(); - memcpy(triangles.indices, attachmentVertices->_triangles->indices, ibSize); - } else { - trianglesTwoColor.vertCount = attachmentVertices->_triangles->vertCount; - vbSize = trianglesTwoColor.vertCount * sizeof(V2F_T2F_C4B_C4B); - isFull |= vb.checkSpace(vbSize, true); - trianglesTwoColor.verts = (V2F_T2F_C4B_C4B*)vb.getCurBuffer(); - for (int ii = 0; ii < trianglesTwoColor.vertCount; ii++) { - trianglesTwoColor.verts[ii].texCoord = attachmentVertices->_triangles->verts[ii].texCoord; - } - attachment->computeWorldVertices(slot->getBone(), (float*)trianglesTwoColor.verts, 0, vs2); - - trianglesTwoColor.indexCount = attachmentVertices->_triangles->indexCount; - ibSize = trianglesTwoColor.indexCount * sizeof(unsigned short); - ib.checkSpace(ibSize, true); - trianglesTwoColor.indices = (unsigned short*)ib.getCurBuffer(); - memcpy(trianglesTwoColor.indices, attachmentVertices->_triangles->indices, ibSize); - } - - color.r = attachment->getColor().r; - color.g = attachment->getColor().g; - color.b = attachment->getColor().b; - color.a = attachment->getColor().a; - - if(_debugSlots) { - _debugBuffer->writeFloat32(DebugType::Slots); - _debugBuffer->writeFloat32(8); - float* vertices = _useTint ? (float*)trianglesTwoColor.verts : (float*)triangles.verts; - int stride = _useTint ? vs2 : vs1; - // Quadrangle has 4 vertex. - for (int ii = 0; ii < 4; ii ++) { - _debugBuffer->writeFloat32(vertices[0]); - _debugBuffer->writeFloat32(vertices[1]); - vertices += stride; - } - } - } else if (slot->getAttachment()->getRTTI().isExactly(MeshAttachment::rtti)) { - MeshAttachment* attachment = (MeshAttachment*)slot->getAttachment(); - attachmentVertices = (AttachmentVertices*)attachment->getRendererObject(); - - // Early exit if attachment is invisible - if (attachment->getColor().a == 0) { - _clipper->clipEnd(*slot); - continue; - } - - if (!_useTint) { - triangles.vertCount = attachmentVertices->_triangles->vertCount; - vbSize = triangles.vertCount * sizeof(V2F_T2F_C4B); - isFull |= vb.checkSpace(vbSize, true); - triangles.verts = (V2F_T2F_C4B*)vb.getCurBuffer(); - memcpy(triangles.verts, attachmentVertices->_triangles->verts, vbSize); - attachment->computeWorldVertices(*slot, 0, attachment->getWorldVerticesLength(), (float*)triangles.verts, 0, vs1); - - triangles.indexCount = attachmentVertices->_triangles->indexCount; - ibSize = triangles.indexCount * sizeof(unsigned short); - ib.checkSpace(ibSize, true); - triangles.indices = (unsigned short*)ib.getCurBuffer(); - memcpy(triangles.indices, attachmentVertices->_triangles->indices, ibSize); - } else { - trianglesTwoColor.vertCount = attachmentVertices->_triangles->vertCount; - vbSize = trianglesTwoColor.vertCount * sizeof(V2F_T2F_C4B_C4B); - isFull |= vb.checkSpace(vbSize, true); - trianglesTwoColor.verts = (V2F_T2F_C4B_C4B*)vb.getCurBuffer(); - for (int ii = 0; ii < trianglesTwoColor.vertCount; ii++) { - trianglesTwoColor.verts[ii].texCoord = attachmentVertices->_triangles->verts[ii].texCoord; - } - attachment->computeWorldVertices(*slot, 0, attachment->getWorldVerticesLength(), (float*)trianglesTwoColor.verts, 0, vs2); - - trianglesTwoColor.indexCount = attachmentVertices->_triangles->indexCount; - ibSize = trianglesTwoColor.indexCount * sizeof(unsigned short); - ib.checkSpace(ibSize, true); - trianglesTwoColor.indices = (unsigned short*)ib.getCurBuffer(); - memcpy(trianglesTwoColor.indices, attachmentVertices->_triangles->indices, ibSize); - } - - color.r = attachment->getColor().r; - color.g = attachment->getColor().g; - color.b = attachment->getColor().b; - color.a = attachment->getColor().a; - - if(_debugMesh) { - int indexCount = _useTint ? trianglesTwoColor.indexCount : triangles.indexCount; - unsigned short* indices = _useTint ? (unsigned short*)trianglesTwoColor.indices : (unsigned short*)triangles.indices; - float* vertices = _useTint ? (float*)trianglesTwoColor.verts : (float*)triangles.verts; - - int stride = _useTint ? vs2 : vs1; - _debugBuffer->writeFloat32(DebugType::Mesh); - _debugBuffer->writeFloat32(indexCount * 2); - for (int ii = 0; ii < indexCount; ii += 3) { - int v1 = indices[ii] * stride; - int v2 = indices[ii + 1] * stride; - int v3 = indices[ii + 2] * stride; - _debugBuffer->writeFloat32(vertices[v1]); - _debugBuffer->writeFloat32(vertices[v1 + 1]); - _debugBuffer->writeFloat32(vertices[v2]); - _debugBuffer->writeFloat32(vertices[v2 + 1]); - _debugBuffer->writeFloat32(vertices[v3]); - _debugBuffer->writeFloat32(vertices[v3 + 1]); - } - } - - } else if (slot->getAttachment()->getRTTI().isExactly(ClippingAttachment::rtti)) { - ClippingAttachment* clip = (ClippingAttachment*)slot->getAttachment(); - _clipper->clipStart(*slot, clip); - continue; - } else { - _clipper->clipEnd(*slot); - continue; - } - - color.a = _skeleton->getColor().a * slot->getColor().a * color.a * _nodeColor.a * 255; - // skip rendering if the color of this attachment is 0 - if (color.a == 0) { - _clipper->clipEnd(*slot); - continue; - } - - float multiplier = _premultipliedAlpha ? color.a : 255; - float red = _nodeColor.r * _skeleton->getColor().r * color.r * multiplier; - float green = _nodeColor.g * _skeleton->getColor().g * color.g * multiplier; - float blue = _nodeColor.b * _skeleton->getColor().b * color.b * multiplier; - - color.r = red * slot->getColor().r; - color.g = green * slot->getColor().g; - color.b = blue * slot->getColor().b; - - if (slot->hasDarkColor()) { - darkColor.r = red * slot->getDarkColor().r; - darkColor.g = green * slot->getDarkColor().g; - darkColor.b = blue * slot->getDarkColor().b; - } else { - darkColor.r = 0; - darkColor.g = 0; - darkColor.b = 0; - } - darkColor.a = _premultipliedAlpha ? 255 : 0; - - // One color tint logic - if (!_useTint) { - // Cliping logic - if (_clipper->isClipping()) { - _clipper->clipTriangles((float*)&triangles.verts[0].vertex, triangles.indices, triangles.indexCount, (float*)&triangles.verts[0].texCoord, vs1); - - if (_clipper->getClippedTriangles().size() == 0) { - _clipper->clipEnd(*slot); - continue; - } - - triangles.vertCount = (int)_clipper->getClippedVertices().size() >> 1; - vbSize = triangles.vertCount * sizeof(V2F_T2F_C4B); - isFull |= vb.checkSpace(vbSize, true); - triangles.verts = (V2F_T2F_C4B*)vb.getCurBuffer(); - - triangles.indexCount = (int)_clipper->getClippedTriangles().size(); - ibSize = triangles.indexCount * sizeof(unsigned short); - ib.checkSpace(ibSize, true); - triangles.indices = (unsigned short*)ib.getCurBuffer(); - memcpy(triangles.indices, _clipper->getClippedTriangles().buffer(), sizeof(unsigned short) * _clipper->getClippedTriangles().size()); - - float* verts = _clipper->getClippedVertices().buffer(); - float* uvs = _clipper->getClippedUVs().buffer(); - if (effect) { - Color light; - Color dark; - light.r = color.r / 255.0f; - light.g = color.g / 255.0f; - light.b = color.b / 255.0f; - light.a = color.a / 255.0f; - dark.r = dark.g = dark.b = dark.a = 0; - for (int v = 0, vn = triangles.vertCount, vv = 0; v < vn; ++v, vv+=2) { - V2F_T2F_C4B* vertex = triangles.verts + v; - Color lightCopy = light; - Color darkCopy = dark; - vertex->vertex.x = verts[vv]; - vertex->vertex.y = verts[vv + 1]; - vertex->texCoord.u = uvs[vv]; - vertex->texCoord.v = uvs[vv + 1]; - effect->transform(vertex->vertex.x, vertex->vertex.y, vertex->texCoord.u, vertex->texCoord.v, lightCopy, darkCopy); - vertex->color.r = (GLubyte)(lightCopy.r * 255); - vertex->color.g = (GLubyte)(lightCopy.g * 255); - vertex->color.b = (GLubyte)(lightCopy.b * 255); - vertex->color.a = (GLubyte)(lightCopy.a * 255); - } - } else { - for (int v = 0, vn = triangles.vertCount, vv = 0; v < vn; ++v, vv+=2) { - V2F_T2F_C4B* vertex = triangles.verts + v; - vertex->vertex.x = verts[vv]; - vertex->vertex.y = verts[vv + 1]; - vertex->texCoord.u = uvs[vv]; - vertex->texCoord.v = uvs[vv + 1]; - vertex->color.r = (GLubyte)color.r; - vertex->color.g = (GLubyte)color.g; - vertex->color.b = (GLubyte)color.b; - vertex->color.a = (GLubyte)color.a; - } - } - // No cliping logic - } else { - if (effect) { - Color light; - Color dark; - light.r = color.r / 255.0f; - light.g = color.g / 255.0f; - light.b = color.b / 255.0f; - light.a = color.a / 255.0f; - dark.r = dark.g = dark.b = dark.a = 0; - for (int v = 0, vn = triangles.vertCount; v < vn; ++v) { - V2F_T2F_C4B* vertex = triangles.verts + v; - Color lightCopy = light; - Color darkCopy = dark; - effect->transform(vertex->vertex.x, vertex->vertex.y, vertex->texCoord.u, vertex->texCoord.v, lightCopy, darkCopy); - vertex->color.r = (GLubyte)(lightCopy.r * 255); - vertex->color.g = (GLubyte)(lightCopy.g * 255); - vertex->color.b = (GLubyte)(lightCopy.b * 255); - vertex->color.a = (GLubyte)(lightCopy.a * 255); - } - } else { - for (int v = 0, vn = triangles.vertCount; v < vn; ++v) { - V2F_T2F_C4B* vertex = triangles.verts + v; - vertex->color.r = (GLubyte)color.r; - vertex->color.g = (GLubyte)color.g; - vertex->color.b = (GLubyte)color.b; - vertex->color.a = (GLubyte)color.a; - } - } - } - } - // Two color tint logic - else { - if (_clipper->isClipping()) { - _clipper->clipTriangles((float*)&trianglesTwoColor.verts[0].vertex, trianglesTwoColor.indices, trianglesTwoColor.indexCount, (float*)&trianglesTwoColor.verts[0].texCoord, vs2); - - if (_clipper->getClippedTriangles().size() == 0) { - _clipper->clipEnd(*slot); - continue; - } - - trianglesTwoColor.vertCount = (int)_clipper->getClippedVertices().size() >> 1; - vbSize = trianglesTwoColor.vertCount * sizeof(V2F_T2F_C4B_C4B); - isFull |= vb.checkSpace(vbSize, true); - trianglesTwoColor.verts = (V2F_T2F_C4B_C4B*)vb.getCurBuffer(); - - trianglesTwoColor.indexCount = (int)_clipper->getClippedTriangles().size(); - ibSize = trianglesTwoColor.indexCount * sizeof(unsigned short); - trianglesTwoColor.indices = (unsigned short*)ib.getCurBuffer(); - memcpy(trianglesTwoColor.indices, _clipper->getClippedTriangles().buffer(), sizeof(unsigned short) * _clipper->getClippedTriangles().size()); - - float* verts = _clipper->getClippedVertices().buffer(); - float* uvs = _clipper->getClippedUVs().buffer(); - - if (effect) { - Color light; - Color dark; - light.r = color.r / 255.0f; - light.g = color.g / 255.0f; - light.b = color.b / 255.0f; - light.a = color.a / 255.0f; - dark.r = darkColor.r / 255.0f; - dark.g = darkColor.g / 255.0f; - dark.b = darkColor.b / 255.0f; - dark.a = darkColor.a / 255.0f; - for (int v = 0, vn = trianglesTwoColor.vertCount, vv = 0; v < vn; ++v, vv += 2) { - V2F_T2F_C4B_C4B* vertex = trianglesTwoColor.verts + v; - Color lightCopy = light; - Color darkCopy = dark; - vertex->vertex.x = verts[vv]; - vertex->vertex.y = verts[vv + 1]; - vertex->texCoord.u = uvs[vv]; - vertex->texCoord.v = uvs[vv + 1]; - effect->transform(vertex->vertex.x, vertex->vertex.y, vertex->texCoord.u, vertex->texCoord.v, lightCopy, darkCopy); - vertex->color.r = (GLubyte)(lightCopy.r * 255); - vertex->color.g = (GLubyte)(lightCopy.g * 255); - vertex->color.b = (GLubyte)(lightCopy.b * 255); - vertex->color.a = (GLubyte)(lightCopy.a * 255); - vertex->color2.r = (GLubyte)(darkCopy.r * 255); - vertex->color2.g = (GLubyte)(darkCopy.g * 255); - vertex->color2.b = (GLubyte)(darkCopy.b * 255); - vertex->color2.a = (GLubyte)darkColor.a; - } - } else { - for (int v = 0, vn = trianglesTwoColor.vertCount, vv = 0; v < vn; ++v, vv += 2) { - V2F_T2F_C4B_C4B* vertex = trianglesTwoColor.verts + v; - vertex->vertex.x = verts[vv]; - vertex->vertex.y = verts[vv + 1]; - vertex->texCoord.u = uvs[vv]; - vertex->texCoord.v = uvs[vv + 1]; - vertex->color.r = (GLubyte)color.r; - vertex->color.g = (GLubyte)color.g; - vertex->color.b = (GLubyte)color.b; - vertex->color.a = (GLubyte)color.a; - vertex->color2.r = (GLubyte)darkColor.r; - vertex->color2.g = (GLubyte)darkColor.g; - vertex->color2.b = (GLubyte)darkColor.b; - vertex->color2.a = (GLubyte)darkColor.a; - } - } - } else { - if (effect) { - Color light; - Color dark; - light.r = color.r / 255.0f; - light.g = color.g / 255.0f; - light.b = color.b / 255.0f; - light.a = color.a / 255.0f; - dark.r = darkColor.r / 255.0f; - dark.g = darkColor.g / 255.0f; - dark.b = darkColor.b / 255.0f; - dark.a = darkColor.a / 255.0f; - - for (int v = 0, vn = trianglesTwoColor.vertCount; v < vn; ++v) { - V2F_T2F_C4B_C4B* vertex = trianglesTwoColor.verts + v; - Color lightCopy = light; - Color darkCopy = dark; - effect->transform(vertex->vertex.x, vertex->vertex.y, vertex->texCoord.u, vertex->texCoord.v, lightCopy, darkCopy); - vertex->color.r = (GLubyte)(lightCopy.r * 255); - vertex->color.g = (GLubyte)(lightCopy.g * 255); - vertex->color.b = (GLubyte)(lightCopy.b * 255); - vertex->color.a = (GLubyte)(lightCopy.a * 255); - vertex->color2.r = (GLubyte)(darkCopy.r * 255); - vertex->color2.g = (GLubyte)(darkCopy.g * 255); - vertex->color2.b = (GLubyte)(darkCopy.b * 255); - vertex->color2.a = (GLubyte)darkColor.a; - } - } else { - for (int v = 0, vn = trianglesTwoColor.vertCount; v < vn; ++v) { - V2F_T2F_C4B_C4B* vertex = trianglesTwoColor.verts + v; - vertex->color.r = (GLubyte)color.r; - vertex->color.g = (GLubyte)color.g; - vertex->color.b = (GLubyte)color.b; - vertex->color.a = (GLubyte)color.a; - vertex->color2.r = (GLubyte)darkColor.r; - vertex->color2.g = (GLubyte)darkColor.g; - vertex->color2.b = (GLubyte)darkColor.b; - vertex->color2.a = (GLubyte)darkColor.a; - } - } - } - } - - texture = attachmentVertices->_texture; - curTextureIndex = attachmentVertices->_texture->getNativeTexture()->getHandle(); - // If texture or blendMode change,will change material. - if (preTextureIndex != curTextureIndex || preBlendMode != slot->getData().getBlendMode() || isFull) { - flush(); - } - - if (vbSize > 0 && ibSize > 0) { - auto vbs = vbs1; - auto vertexOffset = vb.getCurPos() / vbs1; - if (_useTint) { - vbs = vbs2; - vertexOffset = vb.getCurPos() / vbs2; - } - - if (_batch) { - uint8_t* vbBuffer = vb.getCurBuffer(); - cocos2d::Vec3* point = nullptr; - float tempZ = 0.0f; - for (int ii = 0, nn = vbSize; ii < nn; ii += vbs) - { - point = (cocos2d::Vec3*)(vbBuffer + ii); - tempZ = point->z; - point->z = 0; - nodeWorldMat.transformPoint(point); - point->z = tempZ; - } - } - - if (vertexOffset > 0) { - unsigned short* ibBuffer = (unsigned short*)ib.getCurBuffer(); - for (int ii = 0, nn = ibSize / sizeof(unsigned short); ii < nn; ii++) - { - ibBuffer[ii] += vertexOffset; - } - } - vb.move(vbSize); - ib.move(ibSize); - - // Record this turn index segmentation count,it will store in material buffer in the end. - curISegLen += ibSize / sizeof(unsigned short); - } - - _clipper->clipEnd(*slot); - } // End slot traverse - - _clipper->clipEnd(); - - if (effect) effect->end(); - - if (preISegWritePos != -1) { - assembler->updateIARange(materialLen - 1, preISegWritePos, curISegLen); - } - - if (_debugBones) { - auto& bones = _skeleton->getBones(); - size_t bonesCount = bones.size(); - _debugBuffer->writeFloat32(DebugType::Bones); - _debugBuffer->writeFloat32(bonesCount * 4); - for (size_t i = 0, n = bonesCount; i < n; i++) { - Bone *bone = bones[i]; - float x = bone->getData().getLength() * bone->getA() + bone->getWorldX(); - float y = bone->getData().getLength() * bone->getC() + bone->getWorldY(); - _debugBuffer->writeFloat32(bone->getWorldX()); - _debugBuffer->writeFloat32(bone->getWorldY()); - _debugBuffer->writeFloat32(x); - _debugBuffer->writeFloat32(y); - } - } - - // debug end - if (_debugBuffer) { - if (_debugBuffer->isOutRange()) { - _debugBuffer->reset(); - cocos2d::log("Spine debug data is too large, debug buffer has no space to put in it!!!!!!!!!!"); - cocos2d::log("You can adjust MAX_DEBUG_BUFFER_SIZE macro"); - } - _debugBuffer->writeFloat32(DebugType::None); - } -} - -cocos2d::Rect SkeletonRenderer::getBoundingBox () const { - static IOBuffer buffer(1024); - float* worldVertices = nullptr; - float minX = FLT_MAX, minY = FLT_MAX, maxX = -FLT_MAX, maxY = -FLT_MAX; - for (int i = 0; i < _skeleton->getSlots().size(); ++i) { - Slot* slot = _skeleton->getSlots()[i]; - if (!slot->getAttachment()) continue; - int verticesCount; - if (slot->getAttachment()->getRTTI().isExactly(RegionAttachment::rtti)) { - RegionAttachment* attachment = (RegionAttachment*)slot->getAttachment(); - buffer.checkSpace(8 * sizeof(float)); - worldVertices = (float*)buffer.getCurBuffer(); - attachment->computeWorldVertices(slot->getBone(), worldVertices, 0, 2); - verticesCount = 8; - } else if (slot->getAttachment()->getRTTI().isExactly(MeshAttachment::rtti)) { - MeshAttachment* mesh = (MeshAttachment*)slot->getAttachment(); - buffer.checkSpace(mesh->getWorldVerticesLength() * sizeof(float)); - worldVertices = (float*)buffer.getCurBuffer(); - mesh->computeWorldVertices(*slot, 0, mesh->getWorldVerticesLength(), worldVertices, 0, 2); - verticesCount = (int)mesh->getWorldVerticesLength(); - } else - continue; - for (int ii = 0; ii < verticesCount; ii += 2) { - float x = worldVertices[ii], y = worldVertices[ii + 1]; - minX = min(minX, x); - minY = min(minY, y); - maxX = max(maxX, x); - maxY = max(maxY, y); - } - } - if (minX == FLT_MAX) minX = minY = maxX = maxY = 0; - return cocos2d::Rect(minX, minY, maxX - minX, maxY - minY); -} - -void SkeletonRenderer::updateWorldTransform () { - if (_skeleton) { - _skeleton->updateWorldTransform(); - } -} - -void SkeletonRenderer::setToSetupPose () { - if (_skeleton) { - _skeleton->setToSetupPose(); - } -} - -void SkeletonRenderer::setBonesToSetupPose () { - if (_skeleton) { - _skeleton->setBonesToSetupPose(); - } -} - -void SkeletonRenderer::setSlotsToSetupPose () { - if (_skeleton) { - _skeleton->setSlotsToSetupPose(); - } -} - -Bone* SkeletonRenderer::findBone (const std::string& boneName) const { - if (_skeleton) { - return _skeleton->findBone(boneName.c_str()); - } - return nullptr; -} - -Slot* SkeletonRenderer::findSlot (const std::string& slotName) const { - if (_skeleton) { - return _skeleton->findSlot(slotName.c_str()); - } - return nullptr; -} - -void SkeletonRenderer::setSkin (const std::string& skinName) { - if (_skeleton) { - _skeleton->setSkin(skinName.empty() ? 0 : skinName.c_str()); - } -} - -void SkeletonRenderer::setSkin (const char* skinName) { - if (_skeleton) { - _skeleton->setSkin(skinName); - } -} - -Attachment* SkeletonRenderer::getAttachment (const std::string& slotName, const std::string& attachmentName) const { - if (_skeleton) { - return _skeleton->getAttachment(slotName.c_str(), attachmentName.c_str()); - } - return nullptr; -} - -bool SkeletonRenderer::setAttachment (const std::string& slotName, const std::string& attachmentName) { - if (_skeleton) { - return _skeleton->getAttachment(slotName.c_str(), attachmentName.empty() ? 0 : attachmentName.c_str()) ? true : false; - } - return false; -} - -bool SkeletonRenderer::setAttachment (const std::string& slotName, const char* attachmentName) { - if (_skeleton) { - return _skeleton->getAttachment(slotName.c_str(), attachmentName) ? true : false; - } - return false; -} - -void SkeletonRenderer::setUseTint(bool enabled) { - _useTint = enabled; -} - -void SkeletonRenderer::setVertexEffectDelegate(VertexEffectDelegate *effectDelegate) { - if (_effectDelegate == effectDelegate) { - return; - } - CC_SAFE_RELEASE(_effectDelegate); - _effectDelegate = effectDelegate; - CC_SAFE_RETAIN(_effectDelegate); -} - -void SkeletonRenderer::setSlotsRange(int startSlotIndex, int endSlotIndex) { - this->_startSlotIndex = startSlotIndex; - this->_endSlotIndex = endSlotIndex; -} - -Skeleton* SkeletonRenderer::getSkeleton () const { - return _skeleton; -} - -void SkeletonRenderer::setTimeScale (float scale) { - _timeScale = scale; -} - -float SkeletonRenderer::getTimeScale () const { - return _timeScale; -} - -void SkeletonRenderer::paused(bool value) { - _paused = value; -} - -void SkeletonRenderer::setColor (cocos2d::Color4B& color) { - _nodeColor.r = color.r / 255.0f; - _nodeColor.g = color.g / 255.0f; - _nodeColor.b = color.b / 255.0f; - _nodeColor.a = color.a / 255.0f; -} - -void SkeletonRenderer::setBatchEnabled (bool enabled) { - _batch = enabled; -} - -void SkeletonRenderer::setDebugBonesEnabled (bool enabled) { - _debugBones = enabled; -} - -void SkeletonRenderer::setDebugSlotsEnabled (bool enabled) { - _debugSlots = enabled; -} - -void SkeletonRenderer::setDebugMeshEnabled (bool enabled) { - _debugMesh = enabled; -} - -void SkeletonRenderer::setOpacityModifyRGB (bool value) { - _premultipliedAlpha = value; -} - -bool SkeletonRenderer::isOpacityModifyRGB () const { - return _premultipliedAlpha; -} diff --git a/native/cocos/editor-support/spine-creator-support/SkeletonRenderer.h b/native/cocos/editor-support/spine-creator-support/SkeletonRenderer.h deleted file mode 100644 index 2adbeaedcc..0000000000 --- a/native/cocos/editor-support/spine-creator-support/SkeletonRenderer.h +++ /dev/null @@ -1,191 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated May 1, 2019. Replaces all prior versions. - * - * Copyright (c) 2013-2019, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS - * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#pragma once - -#include "spine/spine.h" -#include "base/CCRef.h" -#include "base/ccTypes.h" -#include -#include "scripting/js-bindings/jswrapper/Object.hpp" -#include "IOTypedArray.h" -#include "MiddlewareManager.h" -#include "spine-creator-support/VertexEffectDelegate.h" -#include "renderer/scene/NodeProxy.hpp" -#include "base/CCMap.h" -#include "middleware-adapter.h" -#include "base/ccMacros.h" - -namespace spine { - - class AttachmentVertices; - - /** Draws a skeleton. - */ - class SkeletonRenderer: public cocos2d::middleware::IMiddleware, public cocos2d::Ref { - public: - static SkeletonRenderer* create (); - static SkeletonRenderer* createWithSkeleton(Skeleton* skeleton, bool ownsSkeleton = false, bool ownsSkeletonData = false); - static SkeletonRenderer* createWithData (SkeletonData* skeletonData, bool ownsSkeletonData = false); - static SkeletonRenderer* createWithFile (const std::string& skeletonDataFile, Atlas* atlas, float scale = 1); - static SkeletonRenderer* createWithFile (const std::string& skeletonDataFile, const std::string& atlasFile, float scale = 1); - - virtual void update (float deltaTime) override {} - virtual void render (float deltaTime) override; - virtual cocos2d::Rect getBoundingBox () const; - - Skeleton* getSkeleton() const; - - void setTimeScale (float scale); - float getTimeScale () const; - - void updateWorldTransform (); - - void setToSetupPose (); - void setBonesToSetupPose (); - void setSlotsToSetupPose (); - void paused (bool value); - - /* Returns 0 if the bone was not found. */ - Bone* findBone (const std::string& boneName) const; - /* Returns 0 if the slot was not found. */ - Slot* findSlot (const std::string& slotName) const; - - /* Sets the skin used to look up attachments not found in the SkeletonData defaultSkin. Attachments from the new skin are - * attached if the corresponding attachment from the old skin was attached. - * @param skin May be empty string ("") for no skin.*/ - void setSkin (const std::string& skinName); - /** @param skin May be 0 for no skin.*/ - void setSkin (const char* skinName); - - /* Returns 0 if the slot or attachment was not found. */ - Attachment* getAttachment (const std::string& slotName, const std::string& attachmentName) const; - /* Returns false if the slot or attachment was not found. - * @param attachmentName May be empty string ("") for no attachment. */ - bool setAttachment (const std::string& slotName, const std::string& attachmentName); - /* @param attachmentName May be 0 for no attachment. */ - bool setAttachment (const std::string& slotName, const char* attachmentName); - - /* Enables/disables two color tinting for this instance. May break batching */ - void setUseTint(bool enabled); - - /* Sets the vertex effect to be used, set to 0 to disable vertex effects */ - void setVertexEffectDelegate(VertexEffectDelegate* effectDelegate); - /* Sets the range of slots that should be rendered. Use -1, -1 to clear the range */ - void setSlotsRange(int startSlotIndex, int endSlotIndex); - - /** - * @return debug data,it's a Float32Array, - * format |debug bones length|[beginX|beginY|toX|toY|...loop...] - */ - se_object_ptr getDebugData() const { - if (_debugBuffer) { - return _debugBuffer->getTypeArray(); - } - return nullptr; - } - - void bindNodeProxy(cocos2d::renderer::NodeProxy* node) { - if (node == _nodeProxy) return; - CC_SAFE_RELEASE(_nodeProxy); - _nodeProxy = node; - CC_SAFE_RETAIN(_nodeProxy); - } - - void setEffect(cocos2d::renderer::Effect* effect) { - if (effect == _effect) return; - CC_SAFE_RELEASE(_effect); - _effect = effect; - CC_SAFE_RETAIN(_effect); - } - - void setColor (cocos2d::Color4B& color); - void setBatchEnabled (bool enabled); - void setDebugBonesEnabled (bool enabled); - void setDebugSlotsEnabled (bool enabled); - void setDebugMeshEnabled (bool enabled); - - void setOpacityModifyRGB (bool value); - bool isOpacityModifyRGB () const; - - virtual void beginSchedule(); - virtual void stopSchedule(); - void onEnable(); - void onDisable(); - - CC_CONSTRUCTOR_ACCESS: - SkeletonRenderer (); - SkeletonRenderer(Skeleton* skeleton, bool ownsSkeleton = false, bool ownsSkeletonData = false, bool ownsAtlas = false); - SkeletonRenderer (SkeletonData* skeletonData, bool ownsSkeletonData = false); - SkeletonRenderer (const std::string& skeletonDataFile, Atlas* atlas, float scale = 1); - SkeletonRenderer (const std::string& skeletonDataFile, const std::string& atlasFile, float scale = 1); - - virtual ~SkeletonRenderer (); - - void initWithUUID(const std::string& uuid); - void initWithSkeleton(Skeleton* skeleton, bool ownsSkeleton = false, bool ownsSkeletonData = false, bool ownsAtlas = false); - void initWithData (SkeletonData* skeletonData, bool ownsSkeletonData = false); - void initWithJsonFile (const std::string& skeletonDataFile, Atlas* atlas, float scale = 1); - void initWithJsonFile (const std::string& skeletonDataFile, const std::string& atlasFile, float scale = 1); - void initWithBinaryFile (const std::string& skeletonDataFile, Atlas* atlas, float scale = 1); - void initWithBinaryFile (const std::string& skeletonDataFile, const std::string& atlasFile, float scale = 1); - - virtual void initialize (); - protected: - void setSkeletonData (SkeletonData* skeletonData, bool ownsSkeletonData); - - bool _ownsSkeletonData = false; - bool _ownsSkeleton = false; - bool _ownsAtlas = false; - Atlas* _atlas = nullptr; - AttachmentLoader* _attachmentLoader = nullptr; - Skeleton* _skeleton = nullptr; - VertexEffectDelegate* _effectDelegate = nullptr; - float _timeScale = 1; - bool _paused = false; - - bool _batch = false; - bool _debugMesh = false; - bool _debugSlots = false; - bool _debugBones = false; - cocos2d::Color4F _nodeColor = cocos2d::Color4F::WHITE; - bool _premultipliedAlpha = false; - SkeletonClipping* _clipper = nullptr; - bool _useTint = false; - std::string _uuid = ""; - - int _startSlotIndex = -1; - int _endSlotIndex = -1; - - cocos2d::middleware::IOTypedArray* _debugBuffer = nullptr; - cocos2d::renderer::NodeProxy* _nodeProxy = nullptr; - cocos2d::renderer::Effect* _effect = nullptr; - }; - -} diff --git a/native/cocos/editor-support/spine-creator-support/VertexEffectDelegate.cpp b/native/cocos/editor-support/spine-creator-support/VertexEffectDelegate.cpp deleted file mode 100644 index 5bbfdf9478..0000000000 --- a/native/cocos/editor-support/spine-creator-support/VertexEffectDelegate.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated May 1, 2019. Replaces all prior versions. - * - * Copyright (c) 2013-2019, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS - * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#include "VertexEffectDelegate.h" -namespace spine { - - VertexEffectDelegate::VertexEffectDelegate () { - - } - - VertexEffectDelegate::~VertexEffectDelegate () { - clear(); - } - - void VertexEffectDelegate::clear() { - if (_interpolation) { - delete _interpolation; - _interpolation = nullptr; - } - if (_vertexEffect) { - delete _vertexEffect; - _vertexEffect = nullptr; - } - _effectType = "none"; - } - - JitterVertexEffect* VertexEffectDelegate::initJitter (float jitterX, float jitterY) { - clear(); - _vertexEffect = new JitterVertexEffect(jitterX, jitterY); - _effectType = "jitter"; - return (JitterVertexEffect*)_vertexEffect; - } - - SwirlVertexEffect* VertexEffectDelegate::initSwirlWithPow(float radius, int power) { - clear(); - _interpolation = new PowInterpolation(power); - _vertexEffect = new SwirlVertexEffect(radius, *_interpolation); - _effectType = "swirl"; - return (SwirlVertexEffect*)_vertexEffect; - } - - SwirlVertexEffect* VertexEffectDelegate::initSwirlWithPowOut(float radius, int power) { - clear(); - _interpolation = new PowOutInterpolation(power); - _vertexEffect = new SwirlVertexEffect(radius, *_interpolation); - _effectType = "swirl"; - return (SwirlVertexEffect*)_vertexEffect; - } - - JitterVertexEffect* VertexEffectDelegate::getJitterVertexEffect () { - JitterVertexEffect* jitter = dynamic_cast(_vertexEffect); - return jitter; - } - - SwirlVertexEffect* VertexEffectDelegate::getSwirlVertexEffect () { - SwirlVertexEffect* swirl = dynamic_cast(_vertexEffect); - return swirl; - } -} diff --git a/native/cocos/editor-support/spine-creator-support/VertexEffectDelegate.h b/native/cocos/editor-support/spine-creator-support/VertexEffectDelegate.h deleted file mode 100644 index 2eab2cd29d..0000000000 --- a/native/cocos/editor-support/spine-creator-support/VertexEffectDelegate.h +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated May 1, 2019. Replaces all prior versions. - * - * Copyright (c) 2013-2019, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS - * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#pragma once - -#include "spine/spine.h" -#include "base/CCRef.h" -#include "base/ccTypes.h" -#include - -namespace spine { - class VertexEffectDelegate: public cocos2d::Ref { - public: - VertexEffectDelegate (); - ~VertexEffectDelegate (); - JitterVertexEffect* initJitter (float jitterX, float jitterY); - SwirlVertexEffect* initSwirlWithPow(float radius, int power); - SwirlVertexEffect* initSwirlWithPowOut(float radius, int power); - VertexEffect* getVertexEffect () { - return _vertexEffect; - } - JitterVertexEffect* getJitterVertexEffect (); - SwirlVertexEffect* getSwirlVertexEffect (); - const std::string& getEffectType() const { - return _effectType; - } - void clear(); - private: - VertexEffect* _vertexEffect = nullptr; - Interpolation* _interpolation = nullptr; - std::string _effectType = "none"; - }; -} diff --git a/native/cocos/editor-support/spine-creator-support/spine-cocos2dx.cpp b/native/cocos/editor-support/spine-creator-support/spine-cocos2dx.cpp deleted file mode 100644 index b9857e3775..0000000000 --- a/native/cocos/editor-support/spine-creator-support/spine-cocos2dx.cpp +++ /dev/null @@ -1,167 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated May 1, 2019. Replaces all prior versions. - * - * Copyright (c) 2013-2019, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS - * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#include "spine-creator-support/spine-cocos2dx.h" -#include "spine-creator-support/AttachmentVertices.h" -#include "middleware-adapter.h" -#include "base/CCData.h" -#include "platform/CCFileUtils.h" - -namespace spine { - static CustomTextureLoader _customTextureLoader = nullptr; - void spAtlasPage_setCustomTextureLoader (CustomTextureLoader texLoader) { - _customTextureLoader = texLoader; - } - - static SpineObjectDisposeCallback _spineObjectDisposeCallback = 0; - void setSpineObjectDisposeCallback(SpineObjectDisposeCallback callback) { - _spineObjectDisposeCallback = callback; - } -} - -USING_NS_CC; -USING_NS_MW; -using namespace spine; - -static void deleteAttachmentVertices (void* vertices) { - delete (AttachmentVertices *) vertices; -} - -static unsigned short quadTriangles[6] = {0, 1, 2, 2, 3, 0}; - -static void setAttachmentVertices(RegionAttachment* attachment) { - AtlasRegion* region = (AtlasRegion*)attachment->getRendererObject(); - AttachmentVertices* attachmentVertices = new AttachmentVertices((Texture2D*)region->page->getRendererObject(), 4, quadTriangles, 6); - V2F_T2F_C4B* vertices = attachmentVertices->_triangles->verts; - for (int i = 0, ii = 0; i < 4; ++i, ii += 2) { - vertices[i].texCoord.u = attachment->getUVs()[ii]; - vertices[i].texCoord.v = attachment->getUVs()[ii + 1]; - } - attachment->setRendererObject(attachmentVertices, deleteAttachmentVertices); -} - -static void setAttachmentVertices(MeshAttachment* attachment) { - AtlasRegion* region = (AtlasRegion*)attachment->getRendererObject(); - AttachmentVertices* attachmentVertices = new AttachmentVertices((Texture2D*)region->page->getRendererObject(), - attachment->getWorldVerticesLength() >> 1, attachment->getTriangles().buffer(), attachment->getTriangles().size()); - V2F_T2F_C4B* vertices = attachmentVertices->_triangles->verts; - for (size_t i = 0, ii = 0, nn = attachment->getWorldVerticesLength(); ii < nn; ++i, ii += 2) { - vertices[i].texCoord.u = attachment->getUVs()[ii]; - vertices[i].texCoord.v = attachment->getUVs()[ii + 1]; - } - attachment->setRendererObject(attachmentVertices, deleteAttachmentVertices); -} - -Cocos2dAtlasAttachmentLoader::Cocos2dAtlasAttachmentLoader(Atlas* atlas): AtlasAttachmentLoader(atlas) { -} - -Cocos2dAtlasAttachmentLoader::~Cocos2dAtlasAttachmentLoader() { } - -void Cocos2dAtlasAttachmentLoader::configureAttachment(Attachment* attachment) { - if (attachment->getRTTI().isExactly(RegionAttachment::rtti)) { - setAttachmentVertices((RegionAttachment*)attachment); - } else if (attachment->getRTTI().isExactly(MeshAttachment::rtti)) { - setAttachmentVertices((MeshAttachment*)attachment); - } -} - -GLuint wrap (TextureWrap wrap) { - return wrap == TextureWrap_ClampToEdge ? GL_CLAMP_TO_EDGE : GL_REPEAT; -} - -GLuint filter (TextureFilter filter) { - switch (filter) { - case TextureFilter_Unknown: - break; - case TextureFilter_Nearest: - return GL_NEAREST; - case TextureFilter_Linear: - return GL_LINEAR; - case TextureFilter_MipMap: - return GL_LINEAR_MIPMAP_LINEAR; - case TextureFilter_MipMapNearestNearest: - return GL_NEAREST_MIPMAP_NEAREST; - case TextureFilter_MipMapLinearNearest: - return GL_LINEAR_MIPMAP_NEAREST; - case TextureFilter_MipMapNearestLinear: - return GL_NEAREST_MIPMAP_LINEAR; - case TextureFilter_MipMapLinearLinear: - return GL_LINEAR_MIPMAP_LINEAR; - } - return GL_LINEAR; -} - -Cocos2dTextureLoader::Cocos2dTextureLoader() : TextureLoader() { } -Cocos2dTextureLoader::~Cocos2dTextureLoader() { } - -void Cocos2dTextureLoader::load(AtlasPage& page, const spine::String& path) { - Texture2D* texture = nullptr; - if (spine::_customTextureLoader) - { - texture = spine::_customTextureLoader(path.buffer()); - } - CCASSERT(texture != nullptr, "Invalid image"); - texture->retain(); - - Texture2D::TexParams textureParams = {filter(page.minFilter), filter(page.magFilter), wrap(page.uWrap), wrap(page.vWrap)}; - texture->setTexParameters(textureParams); - - page.setRendererObject(texture); - page.width = texture->getPixelsWide(); - page.height = texture->getPixelsHigh(); -} - -void Cocos2dTextureLoader::unload(void* texture) { - ((Texture2D*)texture)->release(); -} - - -Cocos2dExtension::Cocos2dExtension() : DefaultSpineExtension() { } - -Cocos2dExtension::~Cocos2dExtension() { } - -char *Cocos2dExtension::_readFile(const spine::String &path, int *length) { - *length = 0; - Data data = FileUtils::getInstance()->getDataFromFile(FileUtils::getInstance()->fullPathForFilename(path.buffer())); - if (data.isNull()) return 0; - - char *ret = (char*)malloc(sizeof(unsigned char) * data.getSize()); - memcpy(ret, (char*)data.getBytes(), data.getSize()); - *length = (int)data.getSize(); - return ret; -} - -SpineExtension *spine::getDefaultExtension () { - return new Cocos2dExtension(); -} - -void Cocos2dExtension::_free(void *mem, const char *file, int line) { - _spineObjectDisposeCallback(mem); - DefaultSpineExtension::_free(mem, file, line); -} diff --git a/native/cocos/editor-support/spine-creator-support/spine-cocos2dx.h b/native/cocos/editor-support/spine-creator-support/spine-cocos2dx.h deleted file mode 100644 index 56ca3314b2..0000000000 --- a/native/cocos/editor-support/spine-creator-support/spine-cocos2dx.h +++ /dev/null @@ -1,76 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated May 1, 2019. Replaces all prior versions. - * - * Copyright (c) 2013-2019, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software - * or otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS - * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#pragma once - -#include "spine/spine.h" -#include "spine-creator-support/SkeletonRenderer.h" -#include "spine-creator-support/SkeletonAnimation.h" -#include "spine-creator-support/SkeletonDataMgr.h" -#include "spine-creator-support/SkeletonCacheMgr.h" -#include "spine-creator-support/SkeletonCacheAnimation.h" -#include "middleware-adapter.h" - -namespace spine { - typedef cocos2d::middleware::Texture2D* (*CustomTextureLoader)(const char* path); - // set custom texture loader for _spAtlasPage_createTexture - void spAtlasPage_setCustomTextureLoader(CustomTextureLoader texLoader); - - class Cocos2dAtlasAttachmentLoader: public AtlasAttachmentLoader { - public: - Cocos2dAtlasAttachmentLoader(Atlas* atlas); - virtual ~Cocos2dAtlasAttachmentLoader(); - virtual void configureAttachment(Attachment* attachment); - }; - - class Cocos2dTextureLoader: public TextureLoader { - public: - Cocos2dTextureLoader(); - - virtual ~Cocos2dTextureLoader(); - - virtual void load(AtlasPage& page, const String& path); - - virtual void unload(void* texture); - }; - - class Cocos2dExtension: public DefaultSpineExtension { - public: - Cocos2dExtension(); - - virtual ~Cocos2dExtension(); - - virtual void _free(void *mem, const char *file, int line); - protected: - virtual char *_readFile(const String &path, int *length); - }; - - typedef void (*SpineObjectDisposeCallback)(void*); - void setSpineObjectDisposeCallback(SpineObjectDisposeCallback callback); -} diff --git a/native/cocos/editor-support/spine/Animation.cpp b/native/cocos/editor-support/spine/Animation.cpp deleted file mode 100644 index 8ab7ef84c7..0000000000 --- a/native/cocos/editor-support/spine/Animation.cpp +++ /dev/null @@ -1,141 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include -#include -#include -#include - -#include - -using namespace spine; - -Animation::Animation(const String &name, Vector &timelines, float duration) : - _timelines(timelines), - _duration(duration), - _name(name) { - assert(_name.length() > 0); -} - -Animation::~Animation() { - ContainerUtil::cleanUpVectorOfPointers(_timelines); -} - -void Animation::apply(Skeleton &skeleton, float lastTime, float time, bool loop, Vector *pEvents, float alpha, - MixBlend blend, MixDirection direction) { - if (loop && _duration != 0) { - time = MathUtil::fmod(time, _duration); - if (lastTime > 0) { - lastTime = MathUtil::fmod(lastTime, _duration); - } - } - - for (size_t i = 0, n = _timelines.size(); i < n; ++i) { - _timelines[i]->apply(skeleton, lastTime, time, pEvents, alpha, blend, direction); - } -} - -const String &Animation::getName() { - return _name; -} - -Vector &Animation::getTimelines() { - return _timelines; -} - -float Animation::getDuration() { - return _duration; -} - -void Animation::setDuration(float inValue) { - _duration = inValue; -} - -int Animation::binarySearch(Vector &values, float target, int step) { - int low = 0; - int size = (int)values.size(); - int high = size / step - 2; - if (high == 0) { - return step; - } - - int current = (int) (static_cast(high) >> 1); - while (true) { - if (values[(current + 1) * step] <= target) { - low = current + 1; - } else { - high = current; - } - - if (low == high) { - return (low + 1) * step; - } - - current = (int) (static_cast(low + high) >> 1); - } -} - -int Animation::binarySearch(Vector &values, float target) { - int low = 0; - int size = (int)values.size(); - int high = size - 2; - if (high == 0) { - return 1; - } - - int current = (int) (static_cast(high) >> 1); - while (true) { - if (values[(current + 1)] <= target) { - low = current + 1; - } else { - high = current; - } - - if (low == high) { - return (low + 1); - } - - current = (int) (static_cast(low + high) >> 1); - } -} - -int Animation::linearSearch(Vector &values, float target, int step) { - for (int i = 0, last = (int)values.size() - step; i <= last; i += step) { - if (values[i] > target) { - return i; - } - } - - return -1; -} diff --git a/native/cocos/editor-support/spine/Animation.h b/native/cocos/editor-support/spine/Animation.h deleted file mode 100644 index 4cb9fdc986..0000000000 --- a/native/cocos/editor-support/spine/Animation.h +++ /dev/null @@ -1,119 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_Animation_h -#define Spine_Animation_h - -#include -#include -#include -#include -#include - -namespace spine { -class Timeline; - -class Skeleton; - -class Event; - -class SP_API Animation : public SpineObject { - friend class AnimationState; - - friend class TrackEntry; - - friend class AnimationStateData; - - friend class AttachmentTimeline; - - friend class ColorTimeline; - - friend class DeformTimeline; - - friend class DrawOrderTimeline; - - friend class EventTimeline; - - friend class IkConstraintTimeline; - - friend class PathConstraintMixTimeline; - - friend class PathConstraintPositionTimeline; - - friend class PathConstraintSpacingTimeline; - - friend class RotateTimeline; - - friend class ScaleTimeline; - - friend class ShearTimeline; - - friend class TransformConstraintTimeline; - - friend class TranslateTimeline; - - friend class TwoColorTimeline; - -public: - Animation(const String &name, Vector &timelines, float duration); - - ~Animation(); - - /// Applies all the animation's timelines to the specified skeleton. - /// See also Timeline::apply(Skeleton&, float, float, Vector, float, MixPose, MixDirection) - void apply(Skeleton &skeleton, float lastTime, float time, bool loop, Vector *pEvents, float alpha, - MixBlend blend, MixDirection direction); - - const String &getName(); - - Vector &getTimelines(); - - float getDuration(); - - void setDuration(float inValue); - - - -private: - Vector _timelines; - float _duration; - String _name; - - /// @param target After the first and before the last entry. - static int binarySearch(Vector &values, float target, int step); - - /// @param target After the first and before the last entry. - static int binarySearch(Vector &values, float target); - - static int linearSearch(Vector &values, float target, int step); -}; -} - -#endif /* Spine_Animation_h */ diff --git a/native/cocos/editor-support/spine/AnimationState.cpp b/native/cocos/editor-support/spine/AnimationState.cpp deleted file mode 100644 index 67456c2581..0000000000 --- a/native/cocos/editor-support/spine/AnimationState.cpp +++ /dev/null @@ -1,1031 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace spine; - -void dummyOnAnimationEventFunc(AnimationState *state, spine::EventType type, TrackEntry *entry, Event *event = NULL) { - SP_UNUSED(state); - SP_UNUSED(type); - SP_UNUSED(entry); - SP_UNUSED(event); -} - -TrackEntry::TrackEntry() : _animation(NULL), _next(NULL), _mixingFrom(NULL), _mixingTo(0), _trackIndex(0), _loop(false), _holdPrevious(false), - _eventThreshold(0), _attachmentThreshold(0), _drawOrderThreshold(0), _animationStart(0), - _animationEnd(0), _animationLast(0), _nextAnimationLast(0), _delay(0), _trackTime(0), - _trackLast(0), _nextTrackLast(0), _trackEnd(0), _timeScale(1.0f), _alpha(0), _mixTime(0), - _mixDuration(0), _interruptAlpha(0), _totalAlpha(0), _mixBlend(MixBlend_Replace), - _listener(dummyOnAnimationEventFunc) { -} - -TrackEntry::~TrackEntry() { } - -int TrackEntry::getTrackIndex() { return _trackIndex; } - -Animation *TrackEntry::getAnimation() { return _animation; } - -bool TrackEntry::getLoop() { return _loop; } - -void TrackEntry::setLoop(bool inValue) { _loop = inValue; } - -bool TrackEntry::getHoldPrevious() { return _holdPrevious; } - -void TrackEntry::setHoldPrevious(bool inValue) { _holdPrevious = inValue; } - -float TrackEntry::getDelay() { return _delay; } - -void TrackEntry::setDelay(float inValue) { _delay = inValue; } - -float TrackEntry::getTrackTime() { return _trackTime; } - -void TrackEntry::setTrackTime(float inValue) { _trackTime = inValue; } - -float TrackEntry::getTrackEnd() { return _trackEnd; } - -void TrackEntry::setTrackEnd(float inValue) { _trackEnd = inValue; } - -float TrackEntry::getAnimationStart() { return _animationStart; } - -void TrackEntry::setAnimationStart(float inValue) { _animationStart = inValue; } - -float TrackEntry::getAnimationEnd() { return _animationEnd; } - -void TrackEntry::setAnimationEnd(float inValue) { _animationEnd = inValue; } - -float TrackEntry::getAnimationLast() { return _animationLast; } - -void TrackEntry::setAnimationLast(float inValue) { - _animationLast = inValue; - _nextAnimationLast = inValue; -} - -float TrackEntry::getAnimationTime() { - if (_loop) { - float duration = _animationEnd - _animationStart; - if (duration == 0) { - return _animationStart; - } - - return MathUtil::fmod(_trackTime, duration) + _animationStart; - } - - return MathUtil::min(_trackTime + _animationStart, _animationEnd); -} - -float TrackEntry::getTimeScale() { return _timeScale; } - -void TrackEntry::setTimeScale(float inValue) { _timeScale = inValue; } - -float TrackEntry::getAlpha() { return _alpha; } - -void TrackEntry::setAlpha(float inValue) { _alpha = inValue; } - -float TrackEntry::getEventThreshold() { return _eventThreshold; } - -void TrackEntry::setEventThreshold(float inValue) { _eventThreshold = inValue; } - -float TrackEntry::getAttachmentThreshold() { return _attachmentThreshold; } - -void TrackEntry::setAttachmentThreshold(float inValue) { _attachmentThreshold = inValue; } - -float TrackEntry::getDrawOrderThreshold() { return _drawOrderThreshold; } - -void TrackEntry::setDrawOrderThreshold(float inValue) { _drawOrderThreshold = inValue; } - -TrackEntry *TrackEntry::getNext() { return _next; } - -bool TrackEntry::isComplete() { - return _trackTime >= _animationEnd - _animationStart; -} - -float TrackEntry::getMixTime() { return _mixTime; } - -void TrackEntry::setMixTime(float inValue) { _mixTime = inValue; } - -float TrackEntry::getMixDuration() { return _mixDuration; } - -void TrackEntry::setMixDuration(float inValue) { _mixDuration = inValue; } - -TrackEntry *TrackEntry::getMixingFrom() { return _mixingFrom; } - -TrackEntry *TrackEntry::getMixingTo() { return _mixingTo; } - -void TrackEntry::setMixBlend(MixBlend blend) { _mixBlend = blend; } - -MixBlend TrackEntry::getMixBlend() { return _mixBlend; } - -void TrackEntry::resetRotationDirections() { - _timelinesRotation.clear(); -} - -void TrackEntry::setListener(AnimationStateListener inValue) { - _listener = inValue; -} - -void TrackEntry::reset() { - _animation = NULL; - _next = NULL; - _mixingFrom = NULL; - _mixingTo = NULL; - - setRendererObject(NULL); - - _timelineMode.clear(); - _timelineHoldMix.clear(); - _timelinesRotation.clear(); - - _listener = dummyOnAnimationEventFunc; -} - -EventQueueEntry::EventQueueEntry(EventType eventType, TrackEntry *trackEntry, Event *event) : - _type(eventType), - _entry(trackEntry), - _event(event) { -} - -EventQueue *EventQueue::newEventQueue(AnimationState &state, Pool &trackEntryPool) { - return new(__FILE__, __LINE__) EventQueue(state, trackEntryPool); -} - -EventQueueEntry EventQueue::newEventQueueEntry(EventType eventType, TrackEntry *entry, Event *event) { - return EventQueueEntry(eventType, entry, event); -} - -EventQueue::EventQueue(AnimationState &state, Pool &trackEntryPool) : _state(state), - _trackEntryPool(trackEntryPool), - _drainDisabled(false) { -} - -EventQueue::~EventQueue() { -} - -void EventQueue::start(TrackEntry *entry) { - _eventQueueEntries.add(newEventQueueEntry(EventType_Start, entry)); - _state._animationsChanged = true; -} - -void EventQueue::interrupt(TrackEntry *entry) { - _eventQueueEntries.add(newEventQueueEntry(EventType_Interrupt, entry)); -} - -void EventQueue::end(TrackEntry *entry) { - _eventQueueEntries.add(newEventQueueEntry(EventType_End, entry)); - _state._animationsChanged = true; -} - -void EventQueue::dispose(TrackEntry *entry) { - _eventQueueEntries.add(newEventQueueEntry(EventType_Dispose, entry)); -} - -void EventQueue::complete(TrackEntry *entry) { - _eventQueueEntries.add(newEventQueueEntry(EventType_Complete, entry)); -} - -void EventQueue::event(TrackEntry *entry, Event *event) { - _eventQueueEntries.add(newEventQueueEntry(EventType_Event, entry, event)); -} - -/// Raises all events in the queue and drains the queue. -void EventQueue::drain() { - if (_drainDisabled) { - return; - } - - _drainDisabled = true; - - AnimationState &state = _state; - - // Don't cache _eventQueueEntries.size() so callbacks can queue their own events (eg, call setAnimation in AnimationState_Complete). - for (size_t i = 0; i < _eventQueueEntries.size(); ++i) { - EventQueueEntry *queueEntry = &_eventQueueEntries[i]; - TrackEntry *trackEntry = queueEntry->_entry; - - switch (queueEntry->_type) { - case EventType_Start: - case EventType_Interrupt: - case EventType_Complete: - trackEntry->_listener(&state, queueEntry->_type, trackEntry, NULL); - state._listener(&state, queueEntry->_type, trackEntry, NULL); - break; - case EventType_End: - trackEntry->_listener(&state, queueEntry->_type, trackEntry, NULL); - state._listener(&state, queueEntry->_type, trackEntry, NULL); - /* Yes, we want to fall through here */ - case EventType_Dispose: - trackEntry->_listener(&state, EventType_Dispose, trackEntry, NULL); - state._listener(&state, EventType_Dispose, trackEntry, NULL); - trackEntry->reset(); - _trackEntryPool.free(trackEntry); - break; - case EventType_Event: - trackEntry->_listener(&state, queueEntry->_type, trackEntry, queueEntry->_event); - state._listener(&state, queueEntry->_type, trackEntry, queueEntry->_event); - break; - } - } - _eventQueueEntries.clear(); - - _drainDisabled = false; -} - -const int Subsequent = 0; -const int First = 1; -const int Hold = 2; -const int HoldMix = 3; - -AnimationState::AnimationState(AnimationStateData *data) : - _data(data), - _queue(EventQueue::newEventQueue(*this, _trackEntryPool)), - _animationsChanged(false), - _listener(dummyOnAnimationEventFunc), - _timeScale(1) { -} - -AnimationState::~AnimationState() { - for (size_t i = 0; i < _tracks.size(); i++) { - TrackEntry* entry = _tracks[i]; - if (entry) { - TrackEntry* from = entry->_mixingFrom; - while (from) { - TrackEntry* curr = from; - from = curr->_mixingFrom; - delete curr; - } - TrackEntry* next = entry->_next; - while (next) { - TrackEntry* curr = next; - next = curr->_next; - delete curr; - } - delete entry; - } - } - delete _queue; -} - -void AnimationState::update(float delta) { - delta *= _timeScale; - for (size_t i = 0, n = _tracks.size(); i < n; ++i) { - TrackEntry *currentP = _tracks[i]; - if (currentP == NULL) { - continue; - } - - TrackEntry ¤t = *currentP; - - current._animationLast = current._nextAnimationLast; - current._trackLast = current._nextTrackLast; - - float currentDelta = delta * current._timeScale; - - if (current._delay > 0) { - current._delay -= currentDelta; - if (current._delay > 0) { - continue; - } - currentDelta = -current._delay; - current._delay = 0; - } - - TrackEntry *next = current._next; - if (next != NULL) { - // When the next entry's delay is passed, change to the next entry, preserving leftover time. - float nextTime = current._trackLast - next->_delay; - if (nextTime >= 0) { - next->_delay = 0; - next->_trackTime = current._timeScale == 0 ? 0 : (nextTime / current._timeScale + delta) * next->_timeScale; - current._trackTime += currentDelta; - setCurrent(i, next, true); - while (next->_mixingFrom != NULL) { - next->_mixTime += delta; - next = next->_mixingFrom; - } - continue; - } - } else if (current._trackLast >= current._trackEnd && current._mixingFrom == NULL) { - // clear the track when there is no next entry, the track end time is reached, and there is no mixingFrom. - _tracks[i] = NULL; - - _queue->end(currentP); - disposeNext(currentP); - continue; - } - - if (current._mixingFrom != NULL && updateMixingFrom(currentP, delta)) { - // End mixing from entries once all have completed. - TrackEntry *from = current._mixingFrom; - current._mixingFrom = NULL; - if (from != NULL) from->_mixingTo = NULL; - while (from != NULL) { - _queue->end(from); - from = from->_mixingFrom; - } - } - - current._trackTime += currentDelta; - } - - _queue->drain(); -} - -bool AnimationState::apply(Skeleton &skeleton) { - if (_animationsChanged) { - animationsChanged(); - } - - bool applied = false; - for (size_t i = 0, n = _tracks.size(); i < n; ++i) { - TrackEntry *currentP = _tracks[i]; - if (currentP == NULL || currentP->_delay > 0) { - continue; - } - - TrackEntry ¤t = *currentP; - - applied = true; - MixBlend blend = i == 0 ? MixBlend_First : current._mixBlend; - - // apply mixing from entries first. - float mix = current._alpha; - if (current._mixingFrom != NULL) { - mix *= applyMixingFrom(currentP, skeleton, blend); - } else if (current._trackTime >= current._trackEnd && current._next == NULL) { - mix = 0; // Set to setup pose the last time the entry will be applied. - } - - // apply current entry. - float animationLast = current._animationLast, animationTime = current.getAnimationTime(); - size_t timelineCount = current._animation->_timelines.size(); - Vector &timelines = current._animation->_timelines; - if ((i == 0 && mix == 1) || blend == MixBlend_Add) { - for (size_t ii = 0; ii < timelineCount; ++ii) { - timelines[ii]->apply(skeleton, animationLast, animationTime, &_events, mix, blend, - MixDirection_In); - } - } else { - Vector &timelineMode = current._timelineMode; - - bool firstFrame = current._timelinesRotation.size() == 0; - if (firstFrame) { - current._timelinesRotation.setSize(timelines.size() << 1, 0); - } - Vector &timelinesRotation = current._timelinesRotation; - - for (size_t ii = 0; ii < timelineCount; ++ii) { - Timeline *timeline = timelines[ii]; - assert(timeline); - - MixBlend timelineBlend = timelineMode[ii] == Subsequent ? blend : MixBlend_Setup; - - RotateTimeline *rotateTimeline = NULL; - if (timeline->getRTTI().isExactly(RotateTimeline::rtti)) { - rotateTimeline = static_cast(timeline); - } - - if (rotateTimeline != NULL) { - applyRotateTimeline(rotateTimeline, skeleton, animationTime, mix, timelineBlend, timelinesRotation, ii << 1, - firstFrame); - } else { - timeline->apply(skeleton, animationLast, animationTime, &_events, mix, timelineBlend, MixDirection_In); - } - } - } - - queueEvents(currentP, animationTime); - _events.clear(); - current._nextAnimationLast = animationTime; - current._nextTrackLast = current._trackTime; - } - - _queue->drain(); - return applied; -} - -void AnimationState::clearTracks() { - bool oldDrainDisabled = _queue->_drainDisabled; - _queue->_drainDisabled = true; - for (size_t i = 0, n = _tracks.size(); i < n; ++i) { - clearTrack(i); - } - _tracks.clear(); - _queue->_drainDisabled = oldDrainDisabled; - _queue->drain(); -} - -void AnimationState::clearTrack(size_t trackIndex) { - if (trackIndex >= _tracks.size()) { - return; - } - - TrackEntry *current = _tracks[trackIndex]; - if (current == NULL) { - return; - } - - _queue->end(current); - - disposeNext(current); - - TrackEntry *entry = current; - while (true) { - TrackEntry *from = entry->_mixingFrom; - if (from == NULL) { - break; - } - - _queue->end(from); - entry->_mixingFrom = NULL; - entry->_mixingTo = NULL; - entry = from; - } - - _tracks[current->_trackIndex] = NULL; - - _queue->drain(); -} - -TrackEntry *AnimationState::setAnimation(size_t trackIndex, const String &animationName, bool loop) { - Animation *animation = _data->_skeletonData->findAnimation(animationName); - assert(animation != NULL); - - return setAnimation(trackIndex, animation, loop); -} - -TrackEntry *AnimationState::setAnimation(size_t trackIndex, Animation *animation, bool loop) { - assert(animation != NULL); - - bool interrupt = true; - TrackEntry *current = expandToIndex(trackIndex); - if (current != NULL) { - if (current->_nextTrackLast == -1) { - // Don't mix from an entry that was never applied. - _tracks[trackIndex] = current->_mixingFrom; - _queue->interrupt(current); - _queue->end(current); - disposeNext(current); - current = current->_mixingFrom; - interrupt = false; - } else { - disposeNext(current); - } - } - - TrackEntry *entry = newTrackEntry(trackIndex, animation, loop, current); - setCurrent(trackIndex, entry, interrupt); - _queue->drain(); - - return entry; -} - -TrackEntry *AnimationState::addAnimation(size_t trackIndex, const String &animationName, bool loop, float delay) { - Animation *animation = _data->_skeletonData->findAnimation(animationName); - assert(animation != NULL); - - return addAnimation(trackIndex, animation, loop, delay); -} - -TrackEntry *AnimationState::addAnimation(size_t trackIndex, Animation *animation, bool loop, float delay) { - assert(animation != NULL); - - TrackEntry *last = expandToIndex(trackIndex); - if (last != NULL) { - while (last->_next != NULL) { - last = last->_next; - } - } - - TrackEntry *entry = newTrackEntry(trackIndex, animation, loop, last); - - if (last == NULL) { - setCurrent(trackIndex, entry, true); - _queue->drain(); - } else { - last->_next = entry; - if (delay <= 0) { - float duration = last->_animationEnd - last->_animationStart; - if (duration != 0) { - if (last->_loop) { - delay += duration * (1 + (int) (last->_trackTime / duration)); - } else { - delay += MathUtil::max(duration, last->_trackTime); - } - delay -= _data->getMix(last->_animation, animation); - } else { - delay = last->_trackTime; - } - } - } - - entry->_delay = delay; - return entry; -} - -TrackEntry *AnimationState::setEmptyAnimation(size_t trackIndex, float mixDuration) { - TrackEntry *entry = setAnimation(trackIndex, AnimationState::getEmptyAnimation(), false); - entry->_mixDuration = mixDuration; - entry->_trackEnd = mixDuration; - return entry; -} - -TrackEntry *AnimationState::addEmptyAnimation(size_t trackIndex, float mixDuration, float delay) { - if (delay <= 0) { - delay -= mixDuration; - } - - TrackEntry *entry = addAnimation(trackIndex, AnimationState::getEmptyAnimation(), false, delay); - entry->_mixDuration = mixDuration; - entry->_trackEnd = mixDuration; - return entry; -} - -void AnimationState::setEmptyAnimations(float mixDuration) { - bool oldDrainDisabled = _queue->_drainDisabled; - _queue->_drainDisabled = true; - for (size_t i = 0, n = _tracks.size(); i < n; ++i) { - TrackEntry *current = _tracks[i]; - if (current != NULL) { - setEmptyAnimation(i, mixDuration); - } - } - _queue->_drainDisabled = oldDrainDisabled; - _queue->drain(); -} - -TrackEntry *AnimationState::getCurrent(size_t trackIndex) { - return trackIndex >= _tracks.size() ? NULL : _tracks[trackIndex]; -} - -AnimationStateData *AnimationState::getData() { - return _data; -} - -Vector &AnimationState::getTracks() { - return _tracks; -} - -float AnimationState::getTimeScale() { - return _timeScale; -} - -void AnimationState::setTimeScale(float inValue) { - _timeScale = inValue; -} - -void AnimationState::setListener(AnimationStateListener inValue) { - _listener = inValue; -} - -void AnimationState::disableQueue() { - _queue->_drainDisabled = true; -} -void AnimationState::enableQueue() { - _queue->_drainDisabled = false; -} - -Animation *AnimationState::getEmptyAnimation() { - static Vector timelines; - static Animation ret(String(""), timelines, 0); - return &ret; -} - -void AnimationState::applyRotateTimeline(RotateTimeline *rotateTimeline, Skeleton &skeleton, float time, float alpha, - MixBlend blend, Vector &timelinesRotation, size_t i, bool firstFrame) { - if (firstFrame) { - timelinesRotation[i] = 0; - } - - if (alpha == 1) { - rotateTimeline->apply(skeleton, 0, time, NULL, 1, blend, MixDirection_In); - return; - } - - Bone *bone = skeleton._bones[rotateTimeline->_boneIndex]; - Vector& frames = rotateTimeline->_frames; - float r1, r2; - if (time < frames[0]) { - switch (blend) { - case MixBlend_Setup: - bone->_rotation = bone->_data._rotation; - default: - return; - case MixBlend_First: - r1 = bone->_rotation; - r2 = bone->_data._rotation; - } - } else { - r1 = blend == MixBlend_Setup ? bone->_data._rotation : bone->_rotation; - if (time >= frames[frames.size() - RotateTimeline::ENTRIES]) { - // Time is after last frame. - r2 = bone->_data._rotation + frames[frames.size() + RotateTimeline::PREV_ROTATION]; - } else { - // Interpolate between the previous frame and the current frame. - int frame = Animation::binarySearch(frames, time, RotateTimeline::ENTRIES); - float prevRotation = frames[frame + RotateTimeline::PREV_ROTATION]; - float frameTime = frames[frame]; - float percent = rotateTimeline->getCurvePercent((frame >> 1) - 1, 1 - (time - frameTime) / (frames[frame + - RotateTimeline::PREV_TIME] - - frameTime)); - - r2 = frames[frame + RotateTimeline::ROTATION] - prevRotation; - r2 -= (16384 - (int) (16384.499999999996 - r2 / 360)) * 360; - r2 = prevRotation + r2 * percent + bone->_data._rotation; - r2 -= (16384 - (int) (16384.499999999996 - r2 / 360)) * 360; - } - } - - // Mix between rotations using the direction of the shortest route on the first frame while detecting crosses. - float total, diff = r2 - r1; - diff -= (16384 - (int) (16384.499999999996 - diff / 360)) * 360; - if (diff == 0) { - total = timelinesRotation[i]; - } else { - float lastTotal, lastDiff; - if (firstFrame) { - lastTotal = 0; - lastDiff = diff; - } else { - lastTotal = timelinesRotation[i]; // Angle and direction of mix, including loops. - lastDiff = timelinesRotation[i + 1]; // Difference between bones. - } - - bool current = diff > 0, dir = lastTotal >= 0; - // Detect cross at 0 (not 180). - if (MathUtil::sign(lastDiff) != MathUtil::sign(diff) && MathUtil::abs(lastDiff) <= 90) { - // A cross after a 360 rotation is a loop. - if (MathUtil::abs(lastTotal) > 180) { - lastTotal += 360 * MathUtil::sign(lastTotal); - } - dir = current; - } - - total = diff + lastTotal - MathUtil::fmod(lastTotal, 360); // Store loops as part of lastTotal. - if (dir != current) { - total += 360 * MathUtil::sign(lastTotal); - } - timelinesRotation[i] = total; - } - timelinesRotation[i + 1] = diff; - r1 += total * alpha; - bone->_rotation = r1 - (16384 - (int) (16384.499999999996 - r1 / 360)) * 360; -} - -bool AnimationState::updateMixingFrom(TrackEntry *to, float delta) { - TrackEntry *from = to->_mixingFrom; - if (from == NULL) { - return true; - } - - bool finished = updateMixingFrom(from, delta); - - from->_animationLast = from->_nextAnimationLast; - from->_trackLast = from->_nextTrackLast; - - // Require mixTime > 0 to ensure the mixing from entry was applied at least once. - if (to->_mixTime > 0 && to->_mixTime >= to->_mixDuration) { - // Require totalAlpha == 0 to ensure mixing is complete, unless mixDuration == 0 (the transition is a single frame). - if (from->_totalAlpha == 0 || to->_mixDuration == 0) { - to->_mixingFrom = from->_mixingFrom; - if (from->_mixingFrom != NULL) from->_mixingFrom->_mixingTo = to; - to->_interruptAlpha = from->_interruptAlpha; - _queue->end(from); - } - return finished; - } - - from->_trackTime += delta * from->_timeScale; - to->_mixTime += delta; - - return false; -} - -float AnimationState::applyMixingFrom(TrackEntry *to, Skeleton &skeleton, MixBlend blend) { - TrackEntry *from = to->_mixingFrom; - if (from->_mixingFrom != NULL) { - applyMixingFrom(from, skeleton, blend); - } - - float mix; - if (to->_mixDuration == 0) { - // Single frame mix to undo mixingFrom changes. - mix = 1; - if (blend == MixBlend_First) blend = MixBlend_Setup; - } else { - mix = to->_mixTime / to->_mixDuration; - if (mix > 1) { - mix = 1; - } - if (blend != MixBlend_First) blend = from->_mixBlend; - } - - Vector *eventBuffer = mix < from->_eventThreshold ? &_events : NULL; - bool attachments = mix < from->_attachmentThreshold, drawOrder = mix < from->_drawOrderThreshold; - float animationLast = from->_animationLast, animationTime = from->getAnimationTime(); - Vector &timelines = from->_animation->_timelines; - size_t timelineCount = timelines.size(); - float alphaHold = from->_alpha * to->_interruptAlpha, alphaMix = alphaHold * (1 - mix); - - if (blend == MixBlend_Add) { - for (size_t i = 0; i < timelineCount; i++) - timelines[i]->apply(skeleton, animationLast, animationTime, eventBuffer, alphaMix, blend, MixDirection_Out); - } else { - Vector &timelineMode = from->_timelineMode; - Vector &timelineHoldMix = from->_timelineHoldMix; - - bool firstFrame = from->_timelinesRotation.size() == 0; - if (firstFrame) { - from->_timelinesRotation.setSize(timelines.size() << 1, 0); - } - - Vector &timelinesRotation = from->_timelinesRotation; - - from->_totalAlpha = 0; - for (size_t i = 0; i < timelineCount; i++) { - Timeline *timeline = timelines[i]; - MixDirection direction = MixDirection_Out; - MixBlend timelineBlend; - float alpha; - switch (timelineMode[i]) { - case Subsequent: - if (!attachments && (timeline->getRTTI().isExactly(AttachmentTimeline::rtti))) continue; - if (!drawOrder && (timeline->getRTTI().isExactly(DrawOrderTimeline::rtti))) continue; - timelineBlend = blend; - alpha = alphaMix; - break; - case First: - timelineBlend = MixBlend_Setup; - alpha = alphaMix; - break; - case Hold: - timelineBlend = MixBlend_Setup; - alpha = alphaHold; - break; - default: - timelineBlend = MixBlend_Setup; - TrackEntry *holdMix = timelineHoldMix[i]; - alpha = alphaHold * MathUtil::max(0.0f, 1.0f - holdMix->_mixTime / holdMix->_mixDuration); - break; - } - from->_totalAlpha += alpha; - if ((timeline->getRTTI().isExactly(RotateTimeline::rtti))) { - applyRotateTimeline((RotateTimeline*)timeline, skeleton, animationTime, alpha, timelineBlend, timelinesRotation, i << 1, - firstFrame); - } else { - if (timelineBlend == MixBlend_Setup) { - if (timeline->getRTTI().isExactly(AttachmentTimeline::rtti)) { - if (attachments) direction = MixDirection_In; - } else if (timeline->getRTTI().isExactly(DrawOrderTimeline::rtti)) { - if (drawOrder) direction = MixDirection_In; - } - } - timeline->apply(skeleton, animationLast, animationTime, eventBuffer, alpha, timelineBlend, - direction); - } - } - } - - if (to->_mixDuration > 0) { - queueEvents(from, animationTime); - } - - _events.clear(); - from->_nextAnimationLast = animationTime; - from->_nextTrackLast = from->_trackTime; - - return mix; -} - -void AnimationState::queueEvents(TrackEntry *entry, float animationTime) { - float animationStart = entry->_animationStart, animationEnd = entry->_animationEnd; - float duration = animationEnd - animationStart; - float trackLastWrapped = MathUtil::fmod(entry->_trackLast, duration); - - // Queue events before complete. - size_t i = 0, n = _events.size(); - for (; i < n; ++i) { - Event *e = _events[i]; - if (e->_time < trackLastWrapped) { - break; - } - if (e->_time > animationEnd) { - // Discard events outside animation start/end. - continue; - } - _queue->event(entry, e); - } - - // Queue complete if completed a loop iteration or the animation. - bool complete = false; - if (entry->_loop) - complete = duration == 0 || (trackLastWrapped > MathUtil::fmod(entry->_trackTime, duration)); - else - complete = animationTime >= animationEnd && entry->_animationLast < animationEnd; - if (complete) _queue->complete(entry); - - // Queue events after complete. - for (; i < n; ++i) { - Event *e = _events[i]; - if (e->_time < animationStart) { - // Discard events outside animation start/end. - continue; - } - _queue->event(entry, _events[i]); - } -} - -void AnimationState::setCurrent(size_t index, TrackEntry *current, bool interrupt) { - TrackEntry *from = expandToIndex(index); - _tracks[index] = current; - - if (from != NULL) { - if (interrupt) { - _queue->interrupt(from); - } - - current->_mixingFrom = from; - from->_mixingTo = current; - current->_mixTime = 0; - - // Store interrupted mix percentage. - if (from->_mixingFrom != NULL && from->_mixDuration > 0) { - current->_interruptAlpha *= MathUtil::min(1.0f, from->_mixTime / from->_mixDuration); - } - - from->_timelinesRotation.clear(); // Reset rotation for mixing out, in case entry was mixed in. - } - - _queue->start(current); // triggers animationsChanged -} - -TrackEntry *AnimationState::expandToIndex(size_t index) { - if (index < _tracks.size()) { - return _tracks[index]; - } - - while (index >= _tracks.size()) { - _tracks.add(NULL); - } - - return NULL; -} - -TrackEntry *AnimationState::newTrackEntry(size_t trackIndex, Animation *animation, bool loop, TrackEntry *last) { - TrackEntry *entryP = _trackEntryPool.obtain(); // Pooling - TrackEntry &entry = *entryP; - - entry._trackIndex = trackIndex; - entry._animation = animation; - entry._loop = loop; - entry._holdPrevious = 0; - - entry._eventThreshold = 0; - entry._attachmentThreshold = 0; - entry._drawOrderThreshold = 0; - - entry._animationStart = 0; - entry._animationEnd = animation->getDuration(); - entry._animationLast = -1; - entry._nextAnimationLast = -1; - - entry._delay = 0; - entry._trackTime = 0; - entry._trackLast = -1; - entry._nextTrackLast = -1; // nextTrackLast == -1 signifies a TrackEntry that wasn't applied yet. - entry._trackEnd = std::numeric_limits::max(); // loop ? float.MaxValue : animation.Duration; - entry._timeScale = 1; - - entry._alpha = 1; - entry._interruptAlpha = 1; - entry._mixTime = 0; - entry._mixDuration = (last == NULL) ? 0 : _data->getMix(last->_animation, animation); - - return entryP; -} - -void AnimationState::disposeNext(TrackEntry *entry) { - TrackEntry *next = entry->_next; - while (next != NULL) { - _queue->dispose(next); - next = next->_next; - } - entry->_next = NULL; -} - -void AnimationState::animationsChanged() { - _animationsChanged = false; - - _propertyIDs.clear(); - - for (size_t i = 0, n = _tracks.size(); i < n; ++i) { - TrackEntry *entry = _tracks[i]; - - if (!entry) continue; - - while (entry->_mixingFrom != NULL) - entry = entry->_mixingFrom; - - do { - if (entry->_mixingTo == NULL || entry->_mixBlend != MixBlend_Add) setTimelineModes(entry); - entry = entry->_mixingTo; - } while (entry != NULL); - } -} - -void AnimationState::setTimelineModes(TrackEntry *entry) { - TrackEntry* to = entry->_mixingTo; - Vector &timelines = entry->_animation->_timelines; - size_t timelinesCount = timelines.size(); - Vector &timelineMode = entry->_timelineMode; - timelineMode.setSize(timelinesCount, 0); - Vector &timelineHoldMix = entry->_timelineHoldMix; - timelineHoldMix.setSize(timelinesCount, 0); - - if (to != NULL && to->_holdPrevious) { - for (size_t i = 0; i < timelinesCount; i++) { - int id = timelines[i]->getPropertyId(); - if (!_propertyIDs.contains(id)) _propertyIDs.add(id); - timelineMode[i] = Hold; - } - return; - } - - // outer: - size_t i = 0; - continue_outer: - for (; i < timelinesCount; ++i) { - int id = timelines[i]->getPropertyId(); - if (_propertyIDs.contains(id)) { - timelineMode[i] = Subsequent; - } else { - _propertyIDs.add(id); - - if (to == NULL || !hasTimeline(to, id)) { - timelineMode[i] = First; - } else { - for (TrackEntry *next = to->_mixingTo; next != NULL; next = next->_mixingTo) { - if (hasTimeline(next, id)) continue; - if (entry->_mixDuration > 0) { - timelineMode[i] = HoldMix; - timelineHoldMix[i] = entry; - i++; - goto continue_outer; // continue outer; - } - break; - } - timelineMode[i] = Hold; - } - } - } -} - -bool AnimationState::hasTimeline(TrackEntry* entry, int inId) { - Vector &timelines = entry->_animation->_timelines; - for (size_t i = 0, n = timelines.size(); i < n; ++i) { - if (timelines[i]->getPropertyId() == inId) { - return true; - } - } - return false; -} diff --git a/native/cocos/editor-support/spine/AnimationState.h b/native/cocos/editor-support/spine/AnimationState.h deleted file mode 100644 index 92d5778153..0000000000 --- a/native/cocos/editor-support/spine/AnimationState.h +++ /dev/null @@ -1,450 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_AnimationState_h -#define Spine_AnimationState_h - -#include -#include -#include -#include -#include -#include - -namespace spine { - enum EventType { - EventType_Start, - EventType_Interrupt, - EventType_End, - EventType_Complete, - EventType_Dispose, - EventType_Event - }; - - class AnimationState; - class TrackEntry; - - class Animation; - class Event; - class AnimationStateData; - class Skeleton; - class RotateTimeline; - - typedef void (*AnimationStateListener) (AnimationState* state, EventType type, TrackEntry* entry, Event* event); - - /// State for the playback of an animation - class SP_API TrackEntry : public SpineObject, public HasRendererObject { - friend class EventQueue; - friend class AnimationState; - - public: - TrackEntry(); - - virtual ~TrackEntry(); - - /// The index of the track where this entry is either current or queued. - int getTrackIndex(); - - /// The animation to apply for this track entry. - Animation* getAnimation(); - - /// - /// If true, the animation will repeat. If false, it will not, instead its last frame is applied if played beyond its duration. - bool getLoop(); - void setLoop(bool inValue); - - /// - /// If true, when mixing from the previous animation to this animation, the previous animation is applied as normal instead - /// of being mixed out. - /// - /// When mixing between animations that key the same property, if a lower track also keys that property then the value will - /// briefly dip toward the lower track value during the mix. This happens because the first animation mixes from 100% to 0% - /// while the second animation mixes from 0% to 100%. Setting holdPrevious to true applies the first animation - /// at 100% during the mix so the lower track value is overwritten. Such dipping does not occur on the lowest track which - /// keys the property, only when a higher track also keys the property. - /// - /// Snapping will occur if holdPrevious is true and this animation does not key all the same properties as the - /// previous animation. - bool getHoldPrevious(); - void setHoldPrevious(bool inValue); - - /// - /// Seconds to postpone playing the animation. When a track entry is the current track entry, delay postpones incrementing - /// the track time. When a track entry is queued, delay is the time from the start of the previous animation to when the - /// track entry will become the current track entry. - float getDelay(); - void setDelay(float inValue); - - /// - /// Current time in seconds this track entry has been the current track entry. The track time determines - /// TrackEntry.AnimationTime. The track time can be set to start the animation at a time other than 0, without affecting looping. - float getTrackTime(); - void setTrackTime(float inValue); - - /// - /// The track time in seconds when this animation will be removed from the track. Defaults to the animation duration for - /// non-looping animations and to int.MaxValue for looping animations. If the track end time is reached and no - /// other animations are queued for playback, and mixing from any previous animations is complete, properties keyed by the animation, - /// are set to the setup pose and the track is cleared. - /// - /// It may be desired to use AnimationState.addEmptyAnimation(int, float, float) to mix the properties back to the - /// setup pose over time, rather than have it happen instantly. - /// - float getTrackEnd(); - void setTrackEnd(float inValue); - - /// - /// Seconds when this animation starts, both initially and after looping. Defaults to 0. - /// - /// When changing the animation start time, it often makes sense to set TrackEntry.AnimationLast to the same value to - /// prevent timeline keys before the start time from triggering. - /// - float getAnimationStart(); - void setAnimationStart(float inValue); - - /// - /// Seconds for the last frame of this animation. Non-looping animations won't play past this time. Looping animations will - /// loop back to TrackEntry.AnimationStart at this time. Defaults to the animation duration. - float getAnimationEnd(); - void setAnimationEnd(float inValue); - - /// - /// The time in seconds this animation was last applied. Some timelines use this for one-time triggers. Eg, when this - /// animation is applied, event timelines will fire all events between the animation last time (exclusive) and animation time - /// (inclusive). Defaults to -1 to ensure triggers on frame 0 happen the first time this animation is applied. - float getAnimationLast(); - void setAnimationLast(float inValue); - - /// - /// Uses TrackEntry.TrackTime to compute the animation time between TrackEntry.AnimationStart. and - /// TrackEntry.AnimationEnd. When the track time is 0, the animation time is equal to the animation start time. - /// - float getAnimationTime(); - - /// - /// Multiplier for the delta time when the animation state is updated, causing time for this animation to play slower or - /// faster. Defaults to 1. - /// - float getTimeScale(); - void setTimeScale(float inValue); - - /// - /// Values less than 1 mix this animation with the last skeleton pose. Defaults to 1, which overwrites the last skeleton pose with - /// this animation. - /// - /// Typically track 0 is used to completely pose the skeleton, then alpha can be used on higher tracks. It doesn't make sense - /// to use alpha on track 0 if the skeleton pose is from the last frame render. - /// - float getAlpha(); - void setAlpha(float inValue); - - /// - /// When the mix percentage (mix time / mix duration) is less than the event threshold, event timelines for the animation - /// being mixed out will be applied. Defaults to 0, so event timelines are not applied for an animation being mixed out. - float getEventThreshold(); - void setEventThreshold(float inValue); - - /// - /// When the mix percentage (mix time / mix duration) is less than the attachment threshold, attachment timelines for the - /// animation being mixed out will be applied. Defaults to 0, so attachment timelines are not applied for an animation being - /// mixed out. - float getAttachmentThreshold(); - void setAttachmentThreshold(float inValue); - - /// - /// When the mix percentage (mix time / mix duration) is less than the draw order threshold, draw order timelines for the - /// animation being mixed out will be applied. Defaults to 0, so draw order timelines are not applied for an animation being - /// mixed out. - /// - float getDrawOrderThreshold(); - void setDrawOrderThreshold(float inValue); - - /// - /// The animation queued to start after this animation, or NULL. - TrackEntry* getNext(); - - /// - /// Returns true if at least one loop has been completed. - bool isComplete(); - - /// - /// Seconds from 0 to the mix duration when mixing from the previous animation to this animation. May be slightly more than - /// TrackEntry.MixDuration when the mix is complete. - float getMixTime(); - void setMixTime(float inValue); - - /// - /// Seconds for mixing from the previous animation to this animation. Defaults to the value provided by - /// AnimationStateData based on the animation before this animation (if any). - /// - /// The mix duration can be set manually rather than use the value from AnimationStateData.GetMix. - /// In that case, the mixDuration must be set before AnimationState.update(float) is next called. - /// - /// When using AnimationState::addAnimation(int, Animation, bool, float) with a delay - /// less than or equal to 0, note the Delay is set using the mix duration from the AnimationStateData - /// - /// - /// - float getMixDuration(); - void setMixDuration(float inValue); - - - MixBlend getMixBlend(); - void setMixBlend(MixBlend blend); - - /// - /// The track entry for the previous animation when mixing from the previous animation to this animation, or NULL if no - /// mixing is currently occuring. When mixing from multiple animations, MixingFrom makes up a double linked list with MixingTo. - TrackEntry* getMixingFrom(); - - /// - /// The track entry for the next animation when mixing from this animation, or NULL if no mixing is currently occuring. - /// When mixing from multiple animations, MixingTo makes up a double linked list with MixingFrom. - TrackEntry* getMixingTo(); - - /// - /// Resets the rotation directions for mixing this entry's rotate timelines. This can be useful to avoid bones rotating the - /// long way around when using alpha and starting animations on other tracks. - /// - /// Mixing involves finding a rotation between two others, which has two possible solutions: the short way or the long way around. - /// The two rotations likely change over time, so which direction is the short or long way also changes. - /// If the short way was always chosen, bones would flip to the other side when that direction became the long way. - /// TrackEntry chooses the short way the first time it is applied and remembers that direction. - void resetRotationDirections(); - - void setListener(AnimationStateListener listener); - - private: - Animation* _animation; - - TrackEntry* _next; - TrackEntry* _mixingFrom; - TrackEntry* _mixingTo; - int _trackIndex; - - bool _loop, _holdPrevious; - float _eventThreshold, _attachmentThreshold, _drawOrderThreshold; - float _animationStart, _animationEnd, _animationLast, _nextAnimationLast; - float _delay, _trackTime, _trackLast, _nextTrackLast, _trackEnd, _timeScale; - float _alpha, _mixTime, _mixDuration, _interruptAlpha, _totalAlpha; - MixBlend _mixBlend; - Vector _timelineMode; - Vector _timelineHoldMix; - Vector _timelinesRotation; - AnimationStateListener _listener; - - void reset(); - }; - - class SP_API EventQueueEntry : public SpineObject { - friend class EventQueue; - - public: - EventType _type; - TrackEntry* _entry; - Event* _event; - - EventQueueEntry(EventType eventType, TrackEntry* trackEntry, Event* event = NULL); - }; - - class SP_API EventQueue : public SpineObject { - friend class AnimationState; - - private: - Vector _eventQueueEntries; - AnimationState& _state; - Pool& _trackEntryPool; - bool _drainDisabled; - - static EventQueue* newEventQueue(AnimationState& state, Pool& trackEntryPool); - - static EventQueueEntry newEventQueueEntry(EventType eventType, TrackEntry* entry, Event* event = NULL); - - EventQueue(AnimationState& state, Pool& trackEntryPool); - - ~EventQueue(); - - void start(TrackEntry* entry); - - void interrupt(TrackEntry* entry); - - void end(TrackEntry* entry); - - void dispose(TrackEntry* entry); - - void complete(TrackEntry* entry); - - void event(TrackEntry* entry, Event* event); - - /// Raises all events in the queue and drains the queue. - void drain(); - }; - - class SP_API AnimationState : public SpineObject, public HasRendererObject { - friend class TrackEntry; - friend class EventQueue; - - public: - explicit AnimationState(AnimationStateData* data); - - ~AnimationState(); - - /// - /// Increments the track entry times, setting queued animations as current if needed - /// @param delta delta time - void update(float delta); - - /// - /// Poses the skeleton using the track entry animations. There are no side effects other than invoking listeners, so the - /// animation state can be applied to multiple skeletons to pose them identically. - bool apply(Skeleton& skeleton); - - /// - /// Removes all animations from all tracks, leaving skeletons in their previous pose. - /// It may be desired to use AnimationState.setEmptyAnimations(float) to mix the skeletons back to the setup pose, - /// rather than leaving them in their previous pose. - void clearTracks(); - - /// - /// Removes all animations from the tracks, leaving skeletons in their previous pose. - /// It may be desired to use AnimationState.setEmptyAnimations(float) to mix the skeletons back to the setup pose, - /// rather than leaving them in their previous pose. - void clearTrack(size_t trackIndex); - - /// Sets an animation by name. setAnimation(int, Animation, bool) - TrackEntry* setAnimation(size_t trackIndex, const String& animationName, bool loop); - - /// Sets the current animation for a track, discarding any queued animations. - /// @param loop If true, the animation will repeat. - /// If false, it will not, instead its last frame is applied if played beyond its duration. - /// In either case TrackEntry.TrackEnd determines when the track is cleared. - /// @return - /// A track entry to allow further customization of animation playback. References to the track entry must not be kept - /// after AnimationState.Dispose. - TrackEntry* setAnimation(size_t trackIndex, Animation* animation, bool loop); - - /// Queues an animation by name. - /// addAnimation(int, Animation, bool, float) - TrackEntry* addAnimation(size_t trackIndex, const String& animationName, bool loop, float delay); - - /// Adds an animation to be played delay seconds after the current or last queued animation - /// for a track. If the track is empty, it is equivalent to calling setAnimation. - /// @param delay - /// Seconds to begin this animation after the start of the previous animation. May be <= 0 to use the animation - /// duration of the previous track minus any mix duration plus the negative delay. - /// - /// @return A track entry to allow further customization of animation playback. References to the track entry must not be kept - /// after AnimationState.Dispose - TrackEntry* addAnimation(size_t trackIndex, Animation* animation, bool loop, float delay); - - /// - /// Sets an empty animation for a track, discarding any queued animations, and mixes to it over the specified mix duration. - TrackEntry* setEmptyAnimation(size_t trackIndex, float mixDuration); - - /// - /// Adds an empty animation to be played after the current or last queued animation for a track, and mixes to it over the - /// specified mix duration. - /// @return - /// A track entry to allow further customization of animation playback. References to the track entry must not be kept after AnimationState.Dispose. - /// - /// @param trackIndex Track number. - /// @param mixDuration Mix duration. - /// @param delay Seconds to begin this animation after the start of the previous animation. May be <= 0 to use the animation - /// duration of the previous track minus any mix duration plus the negative delay. - TrackEntry* addEmptyAnimation(size_t trackIndex, float mixDuration, float delay); - - /// - /// Sets an empty animation for every track, discarding any queued animations, and mixes to it over the specified mix duration. - void setEmptyAnimations(float mixDuration); - - /// @return The track entry for the animation currently playing on the track, or NULL if no animation is currently playing. - TrackEntry* getCurrent(size_t trackIndex); - - AnimationStateData* getData(); - - /// A list of tracks that have animations, which may contain NULLs. - Vector &getTracks(); - - float getTimeScale(); - void setTimeScale(float inValue); - - void setListener(AnimationStateListener listener); - - void disableQueue(); - void enableQueue(); - - private: - - AnimationStateData* _data; - - Pool _trackEntryPool; - Vector _tracks; - Vector _events; - EventQueue* _queue; - - Vector _propertyIDs; - bool _animationsChanged; - - AnimationStateListener _listener; - - float _timeScale; - - static Animation* getEmptyAnimation(); - - static void applyRotateTimeline(RotateTimeline* rotateTimeline, Skeleton& skeleton, float time, float alpha, MixBlend pose, Vector& timelinesRotation, size_t i, bool firstFrame); - - /// Returns true when all mixing from entries are complete. - bool updateMixingFrom(TrackEntry* to, float delta); - - float applyMixingFrom(TrackEntry* to, Skeleton& skeleton, MixBlend currentPose); - - void queueEvents(TrackEntry* entry, float animationTime); - - /// Sets the active TrackEntry for a given track number. - void setCurrent(size_t index, TrackEntry* current, bool interrupt); - - TrackEntry* expandToIndex(size_t index); - - /// Object-pooling version of new TrackEntry. Obtain an unused TrackEntry from the pool and clear/initialize its values. - /// @param last May be NULL. - TrackEntry* newTrackEntry(size_t trackIndex, Animation* animation, bool loop, TrackEntry* last); - - /// Dispose all track entries queued after the given TrackEntry. - void disposeNext(TrackEntry* entry); - - void animationsChanged(); - - void setTimelineModes(TrackEntry* entry); - - bool hasTimeline(TrackEntry* entry, int inId); - }; -} - -#endif /* Spine_AnimationState_h */ diff --git a/native/cocos/editor-support/spine/AnimationStateData.cpp b/native/cocos/editor-support/spine/AnimationStateData.cpp deleted file mode 100644 index e7d93ecf9d..0000000000 --- a/native/cocos/editor-support/spine/AnimationStateData.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include -#include -#include - -using namespace spine; - -AnimationStateData::AnimationStateData(SkeletonData *skeletonData) : _skeletonData(skeletonData), _defaultMix(0) { -} - -void AnimationStateData::setMix(const String &fromName, const String &toName, float duration) { - Animation *from = _skeletonData->findAnimation(fromName); - Animation *to = _skeletonData->findAnimation(toName); - - setMix(from, to, duration); -} - -void AnimationStateData::setMix(Animation *from, Animation *to, float duration) { - assert(from != NULL); - assert(to != NULL); - - AnimationPair key(from, to); - _animationToMixTime.put(key, duration); -} - -float AnimationStateData::getMix(Animation *from, Animation *to) { - assert(from != NULL); - assert(to != NULL); - - AnimationPair key(from, to); - - if (_animationToMixTime.containsKey(key)) return _animationToMixTime[key]; - return _defaultMix; -} - -SkeletonData *AnimationStateData::getSkeletonData() { - return _skeletonData; -} - -float AnimationStateData::getDefaultMix() { - return _defaultMix; -} - -void AnimationStateData::setDefaultMix(float inValue) { - _defaultMix = inValue; -} - -AnimationStateData::AnimationPair::AnimationPair(Animation *a1, Animation *a2) : _a1(a1), _a2(a2) { -} - -bool AnimationStateData::AnimationPair::operator==(const AnimationPair &other) const { - return _a1->_name == other._a1->_name && _a2->_name == other._a2->_name; -} diff --git a/native/cocos/editor-support/spine/AnimationStateData.h b/native/cocos/editor-support/spine/AnimationStateData.h deleted file mode 100644 index 94a008e112..0000000000 --- a/native/cocos/editor-support/spine/AnimationStateData.h +++ /dev/null @@ -1,88 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_AnimationStateData_h -#define Spine_AnimationStateData_h - -#include -#include -#include - -#include - -namespace spine { - class SkeletonData; - class Animation; - - /// Stores mix (crossfade) durations to be applied when AnimationState animations are changed. - class SP_API AnimationStateData : public SpineObject { - friend class AnimationState; - - public: - explicit AnimationStateData(SkeletonData* skeletonData); - - /// The SkeletonData to look up animations when they are specified by name. - SkeletonData* getSkeletonData(); - - /// The mix duration to use when no mix duration has been specifically defined between two animations. - float getDefaultMix(); - void setDefaultMix(float inValue); - - /// Sets a mix duration by animation names. - void setMix(const String& fromName, const String& toName, float duration); - - /// Sets a mix duration when changing from the specified animation to the other. - /// See TrackEntry.MixDuration. - void setMix(Animation* from, Animation* to, float duration); - - /// - /// The mix duration to use when changing from the specified animation to the other, - /// or the DefaultMix if no mix duration has been set. - /// - float getMix(Animation* from, Animation* to); - - private: - class AnimationPair : public SpineObject { - public: - Animation* _a1; - Animation* _a2; - - explicit AnimationPair(Animation* a1 = NULL, Animation* a2 = NULL); - - bool operator==(const AnimationPair &other) const; - }; - - SkeletonData* _skeletonData; - float _defaultMix; - HashMap _animationToMixTime; - }; -} - -#endif /* Spine_AnimationStateData_h */ diff --git a/native/cocos/editor-support/spine/Atlas.cpp b/native/cocos/editor-support/spine/Atlas.cpp deleted file mode 100644 index ea3b6f3484..0000000000 --- a/native/cocos/editor-support/spine/Atlas.cpp +++ /dev/null @@ -1,357 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include -#include -#include - -#include - -using namespace spine; - -Atlas::Atlas(const String &path, TextureLoader *textureLoader) : _textureLoader(textureLoader) { - int dirLength; - char *dir; - int length; - const char *data; - - /* Get directory from atlas path. */ - const char *lastForwardSlash = strrchr(path.buffer(), '/'); - const char *lastBackwardSlash = strrchr(path.buffer(), '\\'); - const char *lastSlash = lastForwardSlash > lastBackwardSlash ? lastForwardSlash : lastBackwardSlash; - if (lastSlash == path) lastSlash++; /* Never drop starting slash. */ - dirLength = (int) (lastSlash ? lastSlash - path.buffer() : 0); - dir = SpineExtension::calloc(dirLength + 1, __FILE__, __LINE__); - memcpy(dir, path.buffer(), dirLength); - dir[dirLength] = '\0'; - - data = SpineExtension::readFile(path, &length); - if (data) { - load(data, length, dir); - } - - SpineExtension::free(data, __FILE__, __LINE__); - SpineExtension::free(dir, __FILE__, __LINE__); -} - -Atlas::Atlas(const char *data, int length, const char *dir, TextureLoader *textureLoader) : _textureLoader( - textureLoader) { - load(data, length, dir); -} - -Atlas::~Atlas() { - if (_textureLoader) { - for (size_t i = 0, n = _pages.size(); i < n; ++i) { - _textureLoader->unload(_pages[i]->getRendererObject()); - } - } - ContainerUtil::cleanUpVectorOfPointers(_pages); - ContainerUtil::cleanUpVectorOfPointers(_regions); -} - -void Atlas::flipV() { - for (size_t i = 0, n = _regions.size(); i < n; ++i) { - AtlasRegion *regionP = _regions[i]; - AtlasRegion ®ion = *regionP; - region.v = 1 - region.v; - region.v2 = 1 - region.v2; - } -} - -AtlasRegion *Atlas::findRegion(const String &name) { - for (size_t i = 0, n = _regions.size(); i < n; ++i) { - if (_regions[i]->name == name) { - return _regions[i]; - } - } - - return NULL; -} - -Vector &Atlas::getPages() { - return _pages; -} - -void Atlas::load(const char *begin, int length, const char *dir) { - static const char *formatNames[] = {"", "Alpha", "Intensity", "LuminanceAlpha", "RGB565", "RGBA4444", "RGB888", - "RGBA8888"}; - static const char *textureFilterNames[] = {"", "Nearest", "Linear", "MipMap", "MipMapNearestNearest", - "MipMapLinearNearest", - "MipMapNearestLinear", "MipMapLinearLinear"}; - - int count; - const char *end = begin + length; - int dirLength = (int) strlen(dir); - int needsSlash = dirLength > 0 && dir[dirLength - 1] != '/' && dir[dirLength - 1] != '\\'; - - AtlasPage *page = NULL; - Str str; - Str tuple[4]; - - while (readLine(&begin, end, &str)) { - if (str.end - str.begin == 0) { - page = 0; - } else if (!page) { - char *name = mallocString(&str); - char *path = SpineExtension::calloc(dirLength + needsSlash + strlen(name) + 1, __FILE__, __LINE__); - memcpy(path, dir, dirLength); - if (needsSlash) { - path[dirLength] = '/'; - } - strcpy(path + dirLength + needsSlash, name); - - page = new(__FILE__, __LINE__) AtlasPage(String(name, true)); - - int tupleVal = readTuple(&begin, end, tuple); - assert(tupleVal == 2); - - /* size is only optional for an atlas packed with an old TexturePacker. */ - page->width = toInt(tuple); - page->height = toInt(tuple + 1); - readTuple(&begin, end, tuple); - - page->format = (Format) indexOf(formatNames, 8, tuple); - - readTuple(&begin, end, tuple); - page->minFilter = (TextureFilter) indexOf(textureFilterNames, 8, tuple); - page->magFilter = (TextureFilter) indexOf(textureFilterNames, 8, tuple + 1); - - readValue(&begin, end, &str); - - page->uWrap = TextureWrap_ClampToEdge; - page->vWrap = TextureWrap_ClampToEdge; - if (!equals(&str, "none")) { - if (str.end - str.begin == 1) { - if (*str.begin == 'x') { - page->uWrap = TextureWrap_Repeat; - } else if (*str.begin == 'y') { - page->vWrap = TextureWrap_Repeat; - } - } else if (equals(&str, "xy")) { - page->uWrap = TextureWrap_Repeat; - page->vWrap = TextureWrap_Repeat; - } - } - - if (_textureLoader) _textureLoader->load(*page, String(path)); - - SpineExtension::free(path, __FILE__, __LINE__); - - _pages.add(page); - } else { - AtlasRegion *region = new(__FILE__, __LINE__) AtlasRegion(); - - region->page = page; - region->name = String(mallocString(&str), true); - - readValue(&begin, end, &str); - region->rotate = equals(&str, "true") ? true : false; - - readTuple(&begin, end, tuple); - region->x = toInt(tuple); - region->y = toInt(tuple + 1); - - readTuple(&begin, end, tuple); - region->width = toInt(tuple); - region->height = toInt(tuple + 1); - - region->u = region->x / (float) page->width; - region->v = region->y / (float) page->height; - if (region->rotate) { - region->u2 = (region->x + region->height) / (float) page->width; - region->v2 = (region->y + region->width) / (float) page->height; - } else { - region->u2 = (region->x + region->width) / (float) page->width; - region->v2 = (region->y + region->height) / (float) page->height; - } - - count = readTuple(&begin, end, tuple); - assert(count); - - if (count == 4) { - /* split is optional */ - region->splits.setSize(4, 0); - region->splits[0] = toInt(tuple); - region->splits[1] = toInt(tuple + 1); - region->splits[2] = toInt(tuple + 2); - region->splits[3] = toInt(tuple + 3); - - count = readTuple(&begin, end, tuple); - assert(count); - - if (count == 4) { - /* pad is optional, but only present with splits */ - region->pads.setSize(4, 0); - region->pads[0] = toInt(tuple); - region->pads[1] = toInt(tuple + 1); - region->pads[2] = toInt(tuple + 2); - region->pads[3] = toInt(tuple + 3); - - readTuple(&begin, end, tuple); - } - } - - region->originalWidth = toInt(tuple); - region->originalHeight = toInt(tuple + 1); - - readTuple(&begin, end, tuple); - region->offsetX = (float)toInt(tuple); - region->offsetY = (float)toInt(tuple + 1); - - readValue(&begin, end, &str); - - region->index = toInt(&str); - - _regions.add(region); - } - } -} - -void Atlas::trim(Str *str) { - while (isspace((unsigned char) *str->begin) && str->begin < str->end) { - (str->begin)++; - } - - if (str->begin == str->end) { - return; - } - - str->end--; - - while (((unsigned char)*str->end == '\r') && str->end >= str->begin) { - str->end--; - } - - str->end++; -} - -int Atlas::readLine(const char **begin, const char *end, Str *str) { - if (*begin == end) { - return 0; - } - - str->begin = *begin; - - /* Find next delimiter. */ - while (*begin != end && **begin != '\n') { - (*begin)++; - } - - str->end = *begin; - trim(str); - - if (*begin != end) { - (*begin)++; - } - - return 1; -} - -int Atlas::beginPast(Str *str, char c) { - const char *begin = str->begin; - while (true) { - char lastSkippedChar = *begin; - if (begin == str->end) { - return 0; - } - begin++; - if (lastSkippedChar == c) { - break; - } - } - str->begin = begin; - return 1; -} - -int Atlas::readValue(const char **begin, const char *end, Str *str) { - readLine(begin, end, str); - if (!beginPast(str, ':')) { - return 0; - } - - trim(str); - return 1; -} - -int Atlas::readTuple(const char **begin, const char *end, Str tuple[]) { - int i; - Str str = {NULL, NULL}; - readLine(begin, end, &str); - if (!beginPast(&str, ':')) { - return 0; - } - - for (i = 0; i < 3; ++i) { - tuple[i].begin = str.begin; - if (!beginPast(&str, ',')) { - break; - } - - tuple[i].end = str.begin - 2; - trim(&tuple[i]); - } - - tuple[i].begin = str.begin; - tuple[i].end = str.end; - trim(&tuple[i]); - - return i + 1; -} - -char *Atlas::mallocString(Str *str) { - int length = (int) (str->end - str->begin); - char *string = SpineExtension::calloc(length + 1, __FILE__, __LINE__); - memcpy(string, str->begin, length); - string[length] = '\0'; - return string; -} - -int Atlas::indexOf(const char **array, int count, Str *str) { - int length = (int) (str->end - str->begin); - int i; - for (i = count - 1; i >= 0; i--) { - if (strncmp(array[i], str->begin, length) == 0) { - return i; - } - } - return 0; -} - -int Atlas::equals(Str *str, const char *other) { - return strncmp(other, str->begin, str->end - str->begin) == 0; -} - -int Atlas::toInt(Str *str) { - return (int) strtol(str->begin, (char **) &str->end, 10); -} diff --git a/native/cocos/editor-support/spine/Atlas.h b/native/cocos/editor-support/spine/Atlas.h deleted file mode 100644 index 6b49518c38..0000000000 --- a/native/cocos/editor-support/spine/Atlas.h +++ /dev/null @@ -1,159 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_Atlas_h -#define Spine_Atlas_h - -#include -#include -#include -#include -#include - -namespace spine { -enum Format { - Format_Alpha, - Format_Intensity, - Format_LuminanceAlpha, - Format_RGB565, - Format_RGBA4444, - Format_RGB888, - Format_RGBA8888 -}; - -enum TextureFilter { - TextureFilter_Unknown, - TextureFilter_Nearest, - TextureFilter_Linear, - TextureFilter_MipMap, - TextureFilter_MipMapNearestNearest, - TextureFilter_MipMapLinearNearest, - TextureFilter_MipMapNearestLinear, - TextureFilter_MipMapLinearLinear -}; - -enum TextureWrap { - TextureWrap_MirroredRepeat, - TextureWrap_ClampToEdge, - TextureWrap_Repeat -}; - -class SP_API AtlasPage : public SpineObject, public HasRendererObject { -public: - String name; - Format format; - TextureFilter minFilter; - TextureFilter magFilter; - TextureWrap uWrap; - TextureWrap vWrap; - int width, height; - - explicit AtlasPage(const String &inName) : name(inName), format(Format_RGBA8888), minFilter(TextureFilter_Nearest), - magFilter(TextureFilter_Nearest), uWrap(TextureWrap_ClampToEdge), - vWrap(TextureWrap_ClampToEdge) { - } - - virtual ~AtlasPage() { } -}; - -class SP_API AtlasRegion : public SpineObject { -public: - AtlasPage *page; - String name; - int x, y, width, height; - float u, v, u2, v2; - float offsetX, offsetY; - int originalWidth, originalHeight; - int index; - bool rotate; - Vector splits; - Vector pads; -}; - -class TextureLoader; - -class SP_API Atlas : public SpineObject { -public: - Atlas(const String &path, TextureLoader *textureLoader); - - Atlas(const char *data, int length, const char *dir, TextureLoader *textureLoader); - - ~Atlas(); - - void flipV(); - - /// Returns the first region found with the specified name. This method uses String comparison to find the region, so the result - /// should be cached rather than calling this method multiple times. - /// @return The region, or NULL. - AtlasRegion *findRegion(const String &name); - - Vector &getPages(); - -private: - Vector _pages; - Vector _regions; - TextureLoader *_textureLoader; - - void load(const char *begin, int length, const char *dir); - - class Str { - public: - const char *begin; - const char *end; - }; - - static void trim(Str *str); - - /// Tokenize string without modification. Returns 0 on failure - static int readLine(const char **begin, const char *end, Str *str); - - /// Moves str->begin past the first occurence of c. Returns 0 on failure - static int beginPast(Str *str, char c); - - /// Returns 0 on failure - static int readValue(const char **begin, const char *end, Str *str); - - /// Returns the number of tuple values read (1, 2, 4, or 0 for failure) - static int readTuple(const char **begin, const char *end, Str tuple[]); - - static char *mallocString(Str *str); - - static int indexOf(const char **array, int count, Str *str); - - static int equals(Str *str, const char *other); - - static int toInt(Str *str); - - static Atlas *abortAtlas(Atlas *atlas); -}; -} - -#endif /* Spine_Atlas_h */ - diff --git a/native/cocos/editor-support/spine/AtlasAttachmentLoader.cpp b/native/cocos/editor-support/spine/AtlasAttachmentLoader.cpp deleted file mode 100644 index ad6c3c5193..0000000000 --- a/native/cocos/editor-support/spine/AtlasAttachmentLoader.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -******************************************************S**********************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -namespace spine { -RTTI_IMPL(AtlasAttachmentLoader, AttachmentLoader) - -AtlasAttachmentLoader::AtlasAttachmentLoader(Atlas *atlas) : AttachmentLoader(), _atlas(atlas) { -} - -RegionAttachment *AtlasAttachmentLoader::newRegionAttachment(Skin &skin, const String &name, const String &path) { - SP_UNUSED(skin); - - AtlasRegion *regionP = findRegion(path); - if (!regionP) return NULL; - - AtlasRegion ®ion = *regionP; - - RegionAttachment *attachmentP = new(__FILE__, __LINE__) RegionAttachment(name); - - RegionAttachment &attachment = *attachmentP; - attachment.setRendererObject(regionP); - attachment.setUVs(region.u, region.v, region.u2, region.v2, region.rotate); - attachment._regionOffsetX = region.offsetX; - attachment._regionOffsetY = region.offsetY; - attachment._regionWidth = (float)region.width; - attachment._regionHeight = (float)region.height; - attachment._regionOriginalWidth = (float)region.originalWidth; - attachment._regionOriginalHeight = (float)region.originalHeight; - return attachmentP; -} - -MeshAttachment *AtlasAttachmentLoader::newMeshAttachment(Skin &skin, const String &name, const String &path) { - SP_UNUSED(skin); - - AtlasRegion *regionP = findRegion(path); - if (!regionP) return NULL; - - AtlasRegion ®ion = *regionP; - - MeshAttachment *attachmentP = new(__FILE__, __LINE__) MeshAttachment(name); - - MeshAttachment &attachment = *attachmentP; - attachment.setRendererObject(regionP); - attachment._regionU = region.u; - attachment._regionV = region.v; - attachment._regionU2 = region.u2; - attachment._regionV2 = region.v2; - attachment._regionRotate = region.rotate; - attachment._regionOffsetX = region.offsetX; - attachment._regionOffsetY = region.offsetY; - attachment._regionWidth = (float)region.width; - attachment._regionHeight = (float)region.height; - attachment._regionOriginalWidth = (float)region.originalWidth; - attachment._regionOriginalHeight = (float)region.originalHeight; - - return attachmentP; -} - -BoundingBoxAttachment *AtlasAttachmentLoader::newBoundingBoxAttachment(Skin &skin, const String &name) { - SP_UNUSED(skin); - return new(__FILE__, __LINE__) BoundingBoxAttachment(name); -} - -PathAttachment *AtlasAttachmentLoader::newPathAttachment(Skin &skin, const String &name) { - SP_UNUSED(skin); - return new(__FILE__, __LINE__) PathAttachment(name); -} - -PointAttachment *AtlasAttachmentLoader::newPointAttachment(Skin &skin, const String &name) { - SP_UNUSED(skin); - return new(__FILE__, __LINE__) PointAttachment(name); -} - -ClippingAttachment *AtlasAttachmentLoader::newClippingAttachment(Skin &skin, const String &name) { - SP_UNUSED(skin); - return new(__FILE__, __LINE__) ClippingAttachment(name); -} - -void AtlasAttachmentLoader::configureAttachment(Attachment* attachment) { - SP_UNUSED(attachment); -} - -AtlasRegion *AtlasAttachmentLoader::findRegion(const String &name) { - return _atlas->findRegion(name); -} - -} diff --git a/native/cocos/editor-support/spine/AtlasAttachmentLoader.h b/native/cocos/editor-support/spine/AtlasAttachmentLoader.h deleted file mode 100644 index bb1a5a5d08..0000000000 --- a/native/cocos/editor-support/spine/AtlasAttachmentLoader.h +++ /dev/null @@ -1,74 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_AtlasAttachmentLoader_h -#define Spine_AtlasAttachmentLoader_h - -#include -#include -#include - - -namespace spine { - class Atlas; - class AtlasRegion; - - /// - /// An AttachmentLoader that configures attachments using texture regions from an Atlas. - /// See http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data about Loading Skeleton Data in the Spine Runtimes Guide. - /// - class SP_API AtlasAttachmentLoader : public AttachmentLoader { - public: - RTTI_DECL - - explicit AtlasAttachmentLoader(Atlas* atlas); - - virtual RegionAttachment* newRegionAttachment(Skin& skin, const String& name, const String& path); - - virtual MeshAttachment* newMeshAttachment(Skin& skin, const String& name, const String& path); - - virtual BoundingBoxAttachment* newBoundingBoxAttachment(Skin& skin, const String& name); - - virtual PathAttachment* newPathAttachment(Skin& skin, const String& name); - - virtual PointAttachment* newPointAttachment(Skin& skin, const String& name); - - virtual ClippingAttachment* newClippingAttachment(Skin& skin, const String& name); - - virtual void configureAttachment(Attachment* attachment); - - AtlasRegion* findRegion(const String& name); - - private: - Atlas* _atlas; - }; -} - -#endif /* Spine_AtlasAttachmentLoader_h */ diff --git a/native/cocos/editor-support/spine/Attachment.cpp b/native/cocos/editor-support/spine/Attachment.cpp deleted file mode 100644 index e3bb6f26ce..0000000000 --- a/native/cocos/editor-support/spine/Attachment.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include - -using namespace spine; - -RTTI_IMPL_NOPARENT(Attachment) - -Attachment::Attachment(const String &name) : _name(name) { - assert(_name.length() > 0); -} - -Attachment::~Attachment() { -} - -const String &Attachment::getName() const { - return _name; -} diff --git a/native/cocos/editor-support/spine/Attachment.h b/native/cocos/editor-support/spine/Attachment.h deleted file mode 100644 index 0a0c000183..0000000000 --- a/native/cocos/editor-support/spine/Attachment.h +++ /dev/null @@ -1,54 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_Attachment_h -#define Spine_Attachment_h - -#include -#include -#include - -namespace spine { -class SP_API Attachment : public SpineObject { -RTTI_DECL - -public: - explicit Attachment(const String &name); - - virtual ~Attachment(); - - const String &getName() const; - -private: - const String _name; -}; -} - -#endif /* Spine_Attachment_h */ diff --git a/native/cocos/editor-support/spine/AttachmentLoader.cpp b/native/cocos/editor-support/spine/AttachmentLoader.cpp deleted file mode 100644 index 1e3011fd67..0000000000 --- a/native/cocos/editor-support/spine/AttachmentLoader.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include -#include -#include -#include -#include -#include - -using namespace spine; - -RTTI_IMPL_NOPARENT(AttachmentLoader) - -AttachmentLoader::AttachmentLoader() { -} - -AttachmentLoader::~AttachmentLoader() { -} diff --git a/native/cocos/editor-support/spine/AttachmentLoader.h b/native/cocos/editor-support/spine/AttachmentLoader.h deleted file mode 100644 index 730083d1ed..0000000000 --- a/native/cocos/editor-support/spine/AttachmentLoader.h +++ /dev/null @@ -1,76 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_AttachmentLoader_h -#define Spine_AttachmentLoader_h - -#include -#include -#include - -namespace spine { - class Skin; - class Attachment; - class RegionAttachment; - class MeshAttachment; - class BoundingBoxAttachment; - class PathAttachment; - class PointAttachment; - class ClippingAttachment; - - class SP_API AttachmentLoader : public SpineObject { - public: - RTTI_DECL - - AttachmentLoader(); - - virtual ~AttachmentLoader(); - - /// @return May be NULL to not load any attachment. - virtual RegionAttachment* newRegionAttachment(Skin& skin, const String& name, const String& path) = 0; - - /// @return May be NULL to not load any attachment. - virtual MeshAttachment* newMeshAttachment(Skin& skin, const String& name, const String& path) = 0; - - /// @return May be NULL to not load any attachment. - virtual BoundingBoxAttachment* newBoundingBoxAttachment(Skin& skin, const String& name) = 0; - - /// @return May be NULL to not load any attachment - virtual PathAttachment* newPathAttachment(Skin& skin, const String& name) = 0; - - virtual PointAttachment* newPointAttachment(Skin& skin, const String& name) = 0; - - virtual ClippingAttachment* newClippingAttachment(Skin& skin, const String& name) = 0; - - virtual void configureAttachment(Attachment* attachment) = 0; - }; -} - -#endif /* Spine_AttachmentLoader_h */ diff --git a/native/cocos/editor-support/spine/AttachmentTimeline.cpp b/native/cocos/editor-support/spine/AttachmentTimeline.cpp deleted file mode 100644 index 3d132dbc68..0000000000 --- a/native/cocos/editor-support/spine/AttachmentTimeline.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include - -#include -#include -#include -#include - -using namespace spine; - -RTTI_IMPL(AttachmentTimeline, Timeline) - -AttachmentTimeline::AttachmentTimeline(int frameCount) : Timeline(), _slotIndex(0) { - _frames.ensureCapacity(frameCount); - _attachmentNames.ensureCapacity(frameCount); - - _frames.setSize(frameCount, 0); - - for (int i = 0; i < frameCount; ++i) { - _attachmentNames.add(String()); - } -} - -void AttachmentTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, - MixBlend blend, MixDirection direction) { - SP_UNUSED(lastTime); - SP_UNUSED(pEvents); - SP_UNUSED(alpha); - - assert(_slotIndex < skeleton._slots.size()); - - String *attachmentName; - Slot *slotP = skeleton._slots[_slotIndex]; - Slot &slot = *slotP; - if (direction == MixDirection_Out && blend == MixBlend_Setup) { - attachmentName = &slot._data._attachmentName; - slot.setAttachment(attachmentName->length() == 0 ? NULL : skeleton.getAttachment(_slotIndex, *attachmentName)); - return; - } - - if (time < _frames[0]) { - // Time is before first frame. - if (blend == MixBlend_Setup || blend == MixBlend_First) { - attachmentName = &slot._data._attachmentName; - slot.setAttachment(attachmentName->length() == 0 ? NULL : skeleton.getAttachment(_slotIndex, *attachmentName)); - } - return; - } - - size_t frameIndex; - if (time >= _frames[_frames.size() - 1]) { - // Time is after last frame. - frameIndex = _frames.size() - 1; - } else { - frameIndex = Animation::binarySearch(_frames, time, 1) - 1; - } - - attachmentName = &_attachmentNames[frameIndex]; - slot.setAttachment(attachmentName->length() == 0 ? NULL : skeleton.getAttachment(_slotIndex, *attachmentName)); -} - -int AttachmentTimeline::getPropertyId() { - return ((int) TimelineType_Attachment << 24) + _slotIndex; -} - -void AttachmentTimeline::setFrame(int frameIndex, float time, const String &attachmentName) { - _frames[frameIndex] = time; - _attachmentNames[frameIndex] = attachmentName; -} - -size_t AttachmentTimeline::getSlotIndex() { - return _slotIndex; -} - -void AttachmentTimeline::setSlotIndex(size_t inValue) { - _slotIndex = inValue; -} - -const Vector &AttachmentTimeline::getFrames() { - return _frames; -} - -const Vector &AttachmentTimeline::getAttachmentNames() { - return _attachmentNames; -} - -size_t AttachmentTimeline::getFrameCount() { - return _frames.size(); -} diff --git a/native/cocos/editor-support/spine/AttachmentTimeline.h b/native/cocos/editor-support/spine/AttachmentTimeline.h deleted file mode 100644 index b281c043de..0000000000 --- a/native/cocos/editor-support/spine/AttachmentTimeline.h +++ /dev/null @@ -1,74 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_AttachmentTimeline_h -#define Spine_AttachmentTimeline_h - -#include -#include -#include -#include -#include -#include - -namespace spine { - - class Skeleton; - class Event; - - class SP_API AttachmentTimeline : public Timeline { - friend class SkeletonBinary; - friend class SkeletonJson; - - RTTI_DECL - - public: - explicit AttachmentTimeline(int frameCount); - - virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector* pEvents, float alpha, MixBlend blend, MixDirection direction); - - virtual int getPropertyId(); - - /// Sets the time and value of the specified keyframe. - void setFrame(int frameIndex, float time, const String& attachmentName); - - size_t getSlotIndex(); - void setSlotIndex(size_t inValue); - const Vector& getFrames(); - const Vector& getAttachmentNames(); - size_t getFrameCount(); - private: - size_t _slotIndex; - Vector _frames; - Vector _attachmentNames; - }; -} - -#endif /* Spine_AttachmentTimeline_h */ diff --git a/native/cocos/editor-support/spine/AttachmentType.h b/native/cocos/editor-support/spine/AttachmentType.h deleted file mode 100644 index c77f36b8c8..0000000000 --- a/native/cocos/editor-support/spine/AttachmentType.h +++ /dev/null @@ -1,46 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_AttachmentType_h -#define Spine_AttachmentType_h - -namespace spine { - enum AttachmentType { - AttachmentType_Region, - AttachmentType_Boundingbox, - AttachmentType_Mesh, - AttachmentType_Linkedmesh, - AttachmentType_Path, - AttachmentType_Point, - AttachmentType_Clipping - }; -} - -#endif /* Spine_AttachmentType_h */ diff --git a/native/cocos/editor-support/spine/BlendMode.h b/native/cocos/editor-support/spine/BlendMode.h deleted file mode 100644 index 729fdcf06d..0000000000 --- a/native/cocos/editor-support/spine/BlendMode.h +++ /dev/null @@ -1,43 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_BlendMode_h -#define Spine_BlendMode_h - -namespace spine { -enum BlendMode { - BlendMode_Normal = 0, - BlendMode_Additive, - BlendMode_Multiply, - BlendMode_Screen -}; -} - -#endif /* Spine_BlendMode_h */ diff --git a/native/cocos/editor-support/spine/Bone.cpp b/native/cocos/editor-support/spine/Bone.cpp deleted file mode 100644 index f235afea2c..0000000000 --- a/native/cocos/editor-support/spine/Bone.cpp +++ /dev/null @@ -1,541 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include - -using namespace spine; - -RTTI_IMPL(Bone, Updatable) - -bool Bone::yDown = false; - -void Bone::setYDown(bool inValue) { - yDown = inValue; -} - -bool Bone::isYDown() { - return yDown; -} - -Bone::Bone(BoneData &data, Skeleton &skeleton, Bone *parent) : Updatable(), - _data(data), - _skeleton(skeleton), - _parent(parent), - _x(0), - _y(0), - _rotation(0), - _scaleX(0), - _scaleY(0), - _shearX(0), - _shearY(0), - _ax(0), - _ay(0), - _arotation(0), - _ascaleX(0), - _ascaleY(0), - _ashearX(0), - _ashearY(0), - _appliedValid(false), - _a(1), - _b(0), - _worldX(0), - _c(0), - _d(1), - _worldY(0), - _sorted(false) { - setToSetupPose(); -} - -void Bone::update() { - updateWorldTransform(_x, _y, _rotation, _scaleX, _scaleY, _shearX, _shearY); -} - -void Bone::updateWorldTransform() { - updateWorldTransform(_x, _y, _rotation, _scaleX, _scaleY, _shearX, _shearY); -} - -void -Bone::updateWorldTransform(float x, float y, float rotation, float scaleX, float scaleY, float shearX, float shearY) { - float cosine, sine; - float pa, pb, pc, pd; - Bone *parent = _parent; - - _ax = x; - _ay = y; - _arotation = rotation; - _ascaleX = scaleX; - _ascaleY = scaleY; - _ashearX = shearX; - _ashearY = shearY; - _appliedValid = true; - - if (!parent) { /* Root bone. */ - float rotationY = rotation + 90 + shearY; - float sx = _skeleton.getScaleX(); - float sy = _skeleton.getScaleY(); - _a = MathUtil::cosDeg(rotation + shearX) * scaleX * sx; - _b = MathUtil::cosDeg(rotationY) * scaleY * sy; - _c = MathUtil::sinDeg(rotation + shearX) * scaleX * sx; - _d = MathUtil::sinDeg(rotationY) * scaleY * sy; - _worldX = x * sx + _skeleton.getX(); - _worldY = y * sy + _skeleton.getY(); - return; - } - - pa = parent->_a; - pb = parent->_b; - pc = parent->_c; - pd = parent->_d; - - _worldX = pa * x + pb * y + parent->_worldX; - _worldY = pc * x + pd * y + parent->_worldY; - - switch (_data.getTransformMode()) { - case TransformMode_Normal: { - float rotationY = rotation + 90 + shearY; - float la = MathUtil::cosDeg(rotation + shearX) * scaleX; - float lb = MathUtil::cosDeg(rotationY) * scaleY; - float lc = MathUtil::sinDeg(rotation + shearX) * scaleX; - float ld = MathUtil::sinDeg(rotationY) * scaleY; - _a = pa * la + pb * lc; - _b = pa * lb + pb * ld; - _c = pc * la + pd * lc; - _d = pc * lb + pd * ld; - return; - } - case TransformMode_OnlyTranslation: { - float rotationY = rotation + 90 + shearY; - _a = MathUtil::cosDeg(rotation + shearX) * scaleX; - _b = MathUtil::cosDeg(rotationY) * scaleY; - _c = MathUtil::sinDeg(rotation + shearX) * scaleX; - _d = MathUtil::sinDeg(rotationY) * scaleY; - break; - } - case TransformMode_NoRotationOrReflection: { - float s = pa * pa + pc * pc; - float prx, rx, ry, la, lb, lc, ld; - if (s > 0.0001f) { - s = MathUtil::abs(pa * pd - pb * pc) / s; - pb = pc * s; - pd = pa * s; - prx = MathUtil::atan2(pc, pa) * MathUtil::Rad_Deg; - } else { - pa = 0; - pc = 0; - prx = 90 - MathUtil::atan2(pd, pb) * MathUtil::Rad_Deg; - } - rx = rotation + shearX - prx; - ry = rotation + shearY - prx + 90; - la = MathUtil::cosDeg(rx) * scaleX; - lb = MathUtil::cosDeg(ry) * scaleY; - lc = MathUtil::sinDeg(rx) * scaleX; - ld = MathUtil::sinDeg(ry) * scaleY; - _a = pa * la - pb * lc; - _b = pa * lb - pb * ld; - _c = pc * la + pd * lc; - _d = pc * lb + pd * ld; - break; - } - case TransformMode_NoScale: - case TransformMode_NoScaleOrReflection: { - float za, zc, s; - float r, zb, zd, la, lb, lc, ld; - cosine = MathUtil::cosDeg(rotation); - sine = MathUtil::sinDeg(rotation); - za = (pa * cosine + pb * sine) / _skeleton.getScaleX(); - zc = (pc * cosine + pd * sine) / _skeleton.getScaleY(); - s = MathUtil::sqrt(za * za + zc * zc); - if (s > 0.00001f) s = 1 / s; - za *= s; - zc *= s; - s = MathUtil::sqrt(za * za + zc * zc); - if (_data.getTransformMode() == TransformMode_NoScale - && (pa * pd - pb * pc < 0) != (_skeleton.getScaleX() < 0 != _skeleton.getScaleY() < 0)) - s = -s; - r = MathUtil::Pi / 2 + MathUtil::atan2(zc, za); - zb = MathUtil::cos(r) * s; - zd = MathUtil::sin(r) * s; - la = MathUtil::cosDeg(shearX) * scaleX; - lb = MathUtil::cosDeg(90 + shearY) * scaleY; - lc = MathUtil::sinDeg(shearX) * scaleX; - ld = MathUtil::sinDeg(90 + shearY) * scaleY; - _a = za * la + zb * lc; - _b = za * lb + zb * ld; - _c = zc * la + zd * lc; - _d = zc * lb + zd * ld; - break; - } - } - _a *= _skeleton.getScaleX(); - _b *= _skeleton.getScaleX(); - _c *= _skeleton.getScaleY(); - _d *= _skeleton.getScaleY(); -} - -void Bone::setToSetupPose() { - BoneData &data = _data; - _x = data.getX(); - _y = data.getY(); - _rotation = data.getRotation(); - _scaleX = data.getScaleX(); - _scaleY = data.getScaleY(); - _shearX = data.getShearX(); - _shearY = data.getShearY(); -} - -void Bone::worldToLocal(float worldX, float worldY, float &outLocalX, float &outLocalY) { - float a = _a; - float b = _b; - float c = _c; - float d = _d; - - float invDet = 1 / (a * d - b * c); - float x = worldX - _worldX; - float y = worldY - _worldY; - - outLocalX = (x * d * invDet - y * b * invDet); - outLocalY = (y * a * invDet - x * c * invDet); -} - -void Bone::localToWorld(float localX, float localY, float &outWorldX, float &outWorldY) { - outWorldX = localX * _a + localY * _b + _worldX; - outWorldY = localX * _c + localY * _d + _worldY; -} - -float Bone::worldToLocalRotation(float worldRotation) { - float sin = MathUtil::sinDeg(worldRotation); - float cos = MathUtil::cosDeg(worldRotation); - - return MathUtil::atan2(_a * sin - _c * cos, _d * cos - _b * sin) * MathUtil::Rad_Deg + this->_rotation - this->_shearX; -} - -float Bone::localToWorldRotation(float localRotation) { - localRotation -= this->_rotation - this->_shearX; - float sin = MathUtil::sinDeg(localRotation); - float cos = MathUtil::cosDeg(localRotation); - - return MathUtil::atan2(cos * _c + sin * _d, cos * _a + sin * _b) * MathUtil::Rad_Deg; -} - -void Bone::rotateWorld(float degrees) { - float a = _a; - float b = _b; - float c = _c; - float d = _d; - - float cos = MathUtil::cosDeg(degrees); - float sin = MathUtil::sinDeg(degrees); - - _a = cos * a - sin * c; - _b = cos * b - sin * d; - _c = sin * a + cos * c; - _d = sin * b + cos * d; - - _appliedValid = false; -} - -float Bone::getWorldToLocalRotationX() { - Bone *parent = _parent; - if (!parent) { - return _arotation; - } - - float pa = parent->_a; - float pb = parent->_b; - float pc = parent->_c; - float pd = parent->_d; - float a = _a; - float c = _c; - - return MathUtil::atan2(pa * c - pc * a, pd * a - pb * c) * MathUtil::Rad_Deg; -} - -float Bone::getWorldToLocalRotationY() { - Bone *parent = _parent; - if (!parent) { - return _arotation; - } - - float pa = parent->_a; - float pb = parent->_b; - float pc = parent->_c; - float pd = parent->_d; - float b = _b; - float d = _d; - - return MathUtil::atan2(pa * d - pc * b, pd * b - pb * d) * MathUtil::Rad_Deg; -} - -BoneData &Bone::getData() { - return _data; -} - -Skeleton &Bone::getSkeleton() { - return _skeleton; -} - -Bone *Bone::getParent() { - return _parent; -} - -Vector &Bone::getChildren() { - return _children; -} - -float Bone::getX() { - return _x; -} - -void Bone::setX(float inValue) { - _x = inValue; -} - -float Bone::getY() { - return _y; -} - -void Bone::setY(float inValue) { - _y = inValue; -} - -float Bone::getRotation() { - return _rotation; -} - -void Bone::setRotation(float inValue) { - _rotation = inValue; -} - -float Bone::getScaleX() { - return _scaleX; -} - -void Bone::setScaleX(float inValue) { - _scaleX = inValue; -} - -float Bone::getScaleY() { - return _scaleY; -} - -void Bone::setScaleY(float inValue) { - _scaleY = inValue; -} - -float Bone::getShearX() { - return _shearX; -} - -void Bone::setShearX(float inValue) { - _shearX = inValue; -} - -float Bone::getShearY() { - return _shearY; -} - -void Bone::setShearY(float inValue) { - _shearY = inValue; -} - -float Bone::getAppliedRotation() { - return _arotation; -} - -void Bone::setAppliedRotation(float inValue) { - _arotation = inValue; -} - -float Bone::getAX() { - return _ax; -} - -void Bone::setAX(float inValue) { - _ax = inValue; -} - -float Bone::getAY() { - return _ay; -} - -void Bone::setAY(float inValue) { - _ay = inValue; -} - -float Bone::getAScaleX() { - return _ascaleX; -} - -void Bone::setAScaleX(float inValue) { - _ascaleX = inValue; -} - -float Bone::getAScaleY() { - return _ascaleY; -} - -void Bone::setAScaleY(float inValue) { - _ascaleY = inValue; -} - -float Bone::getAShearX() { - return _ashearX; -} - -void Bone::setAShearX(float inValue) { - _ashearX = inValue; -} - -float Bone::getAShearY() { - return _ashearY; -} - -void Bone::setAShearY(float inValue) { - _ashearY = inValue; -} - -float Bone::getA() { - return _a; -} - -void Bone::setA(float inValue) { - _a = inValue; -} - -float Bone::getB() { - return _b; -} - -void Bone::setB(float inValue) { - _b = inValue; -} - -float Bone::getC() { - return _c; -} - -void Bone::setC(float inValue) { - _c = inValue; -} - -float Bone::getD() { - return _d; -} - -void Bone::setD(float inValue) { - _d = inValue; -} - -float Bone::getWorldX() { - return _worldX; -} - -void Bone::setWorldX(float inValue) { - _worldX = inValue; -} - -float Bone::getWorldY() { - return _worldY; -} - -void Bone::setWorldY(float inValue) { - _worldY = inValue; -} - -float Bone::getWorldRotationX() { - return MathUtil::atan2(_c, _a) * MathUtil::MathUtil::Rad_Deg; -} - -float Bone::getWorldRotationY() { - return MathUtil::atan2(_d, _b) * MathUtil::Rad_Deg; -} - -float Bone::getWorldScaleX() { - return MathUtil::sqrt(_a * _a + _c * _c); -} - -float Bone::getWorldScaleY() { - return MathUtil::sqrt(_b * _b + _d * _d); -} - -bool Bone::isAppliedValid() { - return _appliedValid; -} -void Bone::setAppliedValid(bool valid) { - _appliedValid = valid; -} - -void Bone::updateAppliedTransform() { - Bone *parent = _parent; - _appliedValid = 1; - if (!parent) { - _ax = _worldX; - _ay = _worldY; - _arotation = MathUtil::atan2(_c, _a) * MathUtil::Rad_Deg; - _ascaleX = MathUtil::sqrt(_a * _a + _c * _c); - _ascaleY = MathUtil::sqrt(_b * _b + _d * _d); - _ashearX = 0; - _ashearY = MathUtil::atan2(_a * _b + _c * _d, _a * _d - _b * _c) * MathUtil::Rad_Deg; - } else { - float pa = parent->_a, pb = parent->_b, pc = parent->_c, pd = parent->_d; - float pid = 1 / (pa * pd - pb * pc); - float dx = _worldX - parent->_worldX, dy = _worldY - parent->_worldY; - float ia = pid * pd; - float id = pid * pa; - float ib = pid * pb; - float ic = pid * pc; - float ra = ia * _a - ib * _c; - float rb = ia * _b - ib * _d; - float rc = id * _c - ic * _a; - float rd = id * _d - ic * _b; - _ax = (dx * pd * pid - dy * pb * pid); - _ay = (dy * pa * pid - dx * pc * pid); - _ashearX = 0; - _ascaleX = MathUtil::sqrt(ra * ra + rc * rc); - if (_ascaleX > 0.0001f) { - float det = ra * rd - rb * rc; - _ascaleY = det / _ascaleX; - _ashearY = MathUtil::atan2(ra * rb + rc * rd, det) * MathUtil::Rad_Deg; - _arotation = MathUtil::atan2(rc, ra) * MathUtil::Rad_Deg; - } else { - _ascaleX = 0; - _ascaleY = MathUtil::sqrt(rb * rb + rd * rd); - _ashearY = 0; - _arotation = 90 - MathUtil::atan2(rd, rb) * MathUtil::Rad_Deg; - } - } -} diff --git a/native/cocos/editor-support/spine/Bone.h b/native/cocos/editor-support/spine/Bone.h deleted file mode 100644 index dbb837445b..0000000000 --- a/native/cocos/editor-support/spine/Bone.h +++ /dev/null @@ -1,249 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_Bone_h -#define Spine_Bone_h - -#include -#include -#include - -namespace spine { -class BoneData; - -class Skeleton; - -/// Stores a bone's current pose. -/// -/// A bone has a local transform which is used to compute its world transform. A bone also has an applied transform, which is a -/// local transform that can be applied to compute the world transform. The local transform and applied transform may differ if a -/// constraint or application code modifies the world transform after it was computed from the local transform. -class SP_API Bone : public Updatable { - friend class AnimationState; - - friend class RotateTimeline; - - friend class IkConstraint; - - friend class TransformConstraint; - - friend class VertexAttachment; - - friend class PathConstraint; - - friend class Skeleton; - - friend class RegionAttachment; - - friend class PointAttachment; - - friend class ScaleTimeline; - - friend class ShearTimeline; - - friend class TranslateTimeline; - -RTTI_DECL - -public: - static void setYDown(bool inValue); - - static bool isYDown(); - - /// @param parent May be NULL. - Bone(BoneData &data, Skeleton &skeleton, Bone *parent = NULL); - - /// Same as updateWorldTransform. This method exists for Bone to implement Spine::Updatable. - virtual void update(); - - /// Computes the world transform using the parent bone and this bone's local transform. - void updateWorldTransform(); - - /// Computes the world transform using the parent bone and the specified local transform. - void updateWorldTransform(float x, float y, float rotation, float scaleX, float scaleY, float shearX, float shearY); - - void setToSetupPose(); - - void worldToLocal(float worldX, float worldY, float &outLocalX, float &outLocalY); - - void localToWorld(float localX, float localY, float &outWorldX, float &outWorldY); - - float worldToLocalRotation(float worldRotation); - - float localToWorldRotation(float localRotation); - - /// - /// Rotates the world transform the specified amount and sets isAppliedValid to false. - /// - /// @param degrees Degrees. - void rotateWorld(float degrees); - - float getWorldToLocalRotationX(); - - float getWorldToLocalRotationY(); - - BoneData &getData(); - - Skeleton &getSkeleton(); - - Bone *getParent(); - - Vector &getChildren(); - - /// The local X translation. - float getX(); - - void setX(float inValue); - - /// The local Y translation. - float getY(); - - void setY(float inValue); - - /// The local rotation. - float getRotation(); - - void setRotation(float inValue); - - /// The local scaleX. - float getScaleX(); - - void setScaleX(float inValue); - - /// The local scaleY. - float getScaleY(); - - void setScaleY(float inValue); - - /// The local shearX. - float getShearX(); - - void setShearX(float inValue); - - /// The local shearY. - float getShearY(); - - void setShearY(float inValue); - - /// The rotation, as calculated by any constraints. - float getAppliedRotation(); - - void setAppliedRotation(float inValue); - - /// The applied local x translation. - float getAX(); - - void setAX(float inValue); - - /// The applied local y translation. - float getAY(); - - void setAY(float inValue); - - /// The applied local scaleX. - float getAScaleX(); - - void setAScaleX(float inValue); - - /// The applied local scaleY. - float getAScaleY(); - - void setAScaleY(float inValue); - - /// The applied local shearX. - float getAShearX(); - - void setAShearX(float inValue); - - /// The applied local shearY. - float getAShearY(); - - void setAShearY(float inValue); - - float getA(); - - void setA(float inValue); - - float getB(); - - void setB(float inValue); - - float getC(); - - void setC(float inValue); - - float getD(); - - void setD(float inValue); - - float getWorldX(); - - void setWorldX(float inValue); - - float getWorldY(); - - void setWorldY(float inValue); - - float getWorldRotationX(); - - float getWorldRotationY(); - - /// Returns the magnitide (always positive) of the world scale X. - float getWorldScaleX(); - - /// Returns the magnitide (always positive) of the world scale Y. - float getWorldScaleY(); - - bool isAppliedValid(); - void setAppliedValid(bool valid); - -private: - static bool yDown; - - BoneData &_data; - Skeleton &_skeleton; - Bone *_parent; - Vector _children; - float _x, _y, _rotation, _scaleX, _scaleY, _shearX, _shearY; - float _ax, _ay, _arotation, _ascaleX, _ascaleY, _ashearX, _ashearY; - bool _appliedValid; - float _a, _b, _worldX; - float _c, _d, _worldY; - bool _sorted; - - /// Computes the individual applied transform values from the world transform. This can be useful to perform processing using - /// the applied transform after the world transform has been modified directly (eg, by a constraint).. - /// - /// Some information is ambiguous in the world transform, such as -1,-1 scale versus 180 rotation. - void updateAppliedTransform(); -}; -} - -#endif /* Spine_Bone_h */ diff --git a/native/cocos/editor-support/spine/BoneData.cpp b/native/cocos/editor-support/spine/BoneData.cpp deleted file mode 100644 index bda7d5ed52..0000000000 --- a/native/cocos/editor-support/spine/BoneData.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include - -using namespace spine; - -BoneData::BoneData(int index, const String &name, BoneData *parent) : - _index(index), - _name(name), - _parent(parent), - _length(0), - _x(0), - _y(0), - _rotation(0), - _scaleX(1), - _scaleY(1), - _shearX(0), - _shearY(0), - _transformMode(TransformMode_Normal) { - assert(index >= 0); - assert(_name.length() > 0); -} - -int BoneData::getIndex() { - return _index; -} - -const String &BoneData::getName() { - return _name; -} - -BoneData *BoneData::getParent() { - return _parent; -} - -float BoneData::getLength() { - return _length; -} - -void BoneData::setLength(float inValue) { - _length = inValue; -} - -float BoneData::getX() { - return _x; -} - -void BoneData::setX(float inValue) { - _x = inValue; -} - -float BoneData::getY() { - return _y; -} - -void BoneData::setY(float inValue) { - _y = inValue; -} - -float BoneData::getRotation() { - return _rotation; -} - -void BoneData::setRotation(float inValue) { - _rotation = inValue; -} - -float BoneData::getScaleX() { - return _scaleX; -} - -void BoneData::setScaleX(float inValue) { - _scaleX = inValue; -} - -float BoneData::getScaleY() { - return _scaleY; -} - -void BoneData::setScaleY(float inValue) { - _scaleY = inValue; -} - -float BoneData::getShearX() { - return _shearX; -} - -void BoneData::setShearX(float inValue) { - _shearX = inValue; -} - -float BoneData::getShearY() { - return _shearY; -} - -void BoneData::setShearY(float inValue) { - _shearY = inValue; -} - -TransformMode BoneData::getTransformMode() { - return _transformMode; -} - -void BoneData::setTransformMode(TransformMode inValue) { - _transformMode = inValue; -} diff --git a/native/cocos/editor-support/spine/BoneData.h b/native/cocos/editor-support/spine/BoneData.h deleted file mode 100644 index d0487b7e6b..0000000000 --- a/native/cocos/editor-support/spine/BoneData.h +++ /dev/null @@ -1,120 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_BoneData_h -#define Spine_BoneData_h - -#include -#include -#include - -namespace spine { -class SP_API BoneData : public SpineObject { - friend class SkeletonBinary; - - friend class SkeletonJson; - - friend class AnimationState; - - friend class RotateTimeline; - - friend class ScaleTimeline; - - friend class ShearTimeline; - - friend class TranslateTimeline; - -public: - BoneData(int index, const String &name, BoneData *parent = NULL); - - /// The index of the bone in Skeleton.Bones - int getIndex(); - - /// The name of the bone, which is unique within the skeleton. - const String &getName(); - - /// May be NULL. - BoneData *getParent(); - - float getLength(); - - void setLength(float inValue); - - /// Local X translation. - float getX(); - - void setX(float inValue); - - /// Local Y translation. - float getY(); - - void setY(float inValue); - - /// Local rotation. - float getRotation(); - - void setRotation(float inValue); - - /// Local scaleX. - float getScaleX(); - - void setScaleX(float inValue); - - /// Local scaleY. - float getScaleY(); - - void setScaleY(float inValue); - - /// Local shearX. - float getShearX(); - - void setShearX(float inValue); - - /// Local shearY. - float getShearY(); - - void setShearY(float inValue); - - /// The transform mode for how parent world transforms affect this bone. - TransformMode getTransformMode(); - - void setTransformMode(TransformMode inValue); - -private: - const int _index; - const String _name; - BoneData *_parent; - float _length; - float _x, _y, _rotation, _scaleX, _scaleY, _shearX, _shearY; - TransformMode _transformMode; -}; -} - -#endif /* Spine_BoneData_h */ diff --git a/native/cocos/editor-support/spine/BoundingBoxAttachment.cpp b/native/cocos/editor-support/spine/BoundingBoxAttachment.cpp deleted file mode 100644 index 9e6ee5ec5d..0000000000 --- a/native/cocos/editor-support/spine/BoundingBoxAttachment.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -using namespace spine; - -RTTI_IMPL(BoundingBoxAttachment, VertexAttachment) - -BoundingBoxAttachment::BoundingBoxAttachment(const String &name) : VertexAttachment(name) { -} diff --git a/native/cocos/editor-support/spine/BoundingBoxAttachment.h b/native/cocos/editor-support/spine/BoundingBoxAttachment.h deleted file mode 100644 index fd7be209c1..0000000000 --- a/native/cocos/editor-support/spine/BoundingBoxAttachment.h +++ /dev/null @@ -1,46 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_BoundingBoxAttachment_h -#define Spine_BoundingBoxAttachment_h - -#include -#include - -namespace spine { - /// Attachment that has a polygon for bounds checking. - class SP_API BoundingBoxAttachment : public VertexAttachment { - RTTI_DECL - - explicit BoundingBoxAttachment(const String& name); - }; -} - -#endif /* Spine_BoundingBoxAttachment_h */ diff --git a/native/cocos/editor-support/spine/ClippingAttachment.cpp b/native/cocos/editor-support/spine/ClippingAttachment.cpp deleted file mode 100644 index 7b11101fb3..0000000000 --- a/native/cocos/editor-support/spine/ClippingAttachment.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include - -using namespace spine; - -RTTI_IMPL(ClippingAttachment, VertexAttachment) - -ClippingAttachment::ClippingAttachment(const String &name) : VertexAttachment(name), _endSlot(NULL) { -} - -SlotData *ClippingAttachment::getEndSlot() { - return _endSlot; -} - -void ClippingAttachment::setEndSlot(SlotData *inValue) { - _endSlot = inValue; -} diff --git a/native/cocos/editor-support/spine/ClippingAttachment.h b/native/cocos/editor-support/spine/ClippingAttachment.h deleted file mode 100644 index 64187745c8..0000000000 --- a/native/cocos/editor-support/spine/ClippingAttachment.h +++ /dev/null @@ -1,58 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_ClippingAttachment_h -#define Spine_ClippingAttachment_h - -#include - -namespace spine { - class SlotData; - - class SP_API ClippingAttachment : public VertexAttachment { - friend class SkeletonBinary; - friend class SkeletonJson; - - friend class SkeletonClipping; - - RTTI_DECL - - public: - explicit ClippingAttachment(const String& name); - - SlotData* getEndSlot(); - void setEndSlot(SlotData* inValue); - - private: - SlotData* _endSlot; - }; -} - -#endif /* Spine_ClippingAttachment_h */ diff --git a/native/cocos/editor-support/spine/Color.h b/native/cocos/editor-support/spine/Color.h deleted file mode 100644 index 0f0817f1bf..0000000000 --- a/native/cocos/editor-support/spine/Color.h +++ /dev/null @@ -1,94 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ -#ifndef SPINE_COLOR_H -#define SPINE_COLOR_H - -#include - -namespace spine { -class SP_API Color : public SpineObject { -public: - Color() : r(0), g(0), b(0), a(0) { - } - - Color(float r, float g, float b, float a) : r(r), g(g), b(b), a(a) { - clamp(); - } - - inline Color &set(float _r, float _g, float _b, float _a) { - this->r = _r; - this->g = _g; - this->b = _b; - this->a = _a; - clamp(); - return *this; - } - - inline Color &set(const Color &other) { - r = other.r; - g = other.g; - b = other.b; - a = other.a; - clamp(); - return *this; - } - - inline Color &add(float _r, float _g, float _b, float _a) { - this->r += _r; - this->g += _g; - this->b += _b; - this->a += _a; - clamp(); - return *this; - } - - inline Color &add(const Color &other) { - r += other.r; - g += other.g; - b += other.b; - a += other.a; - clamp(); - return *this; - } - - inline Color &clamp() { - r = MathUtil::clamp(this->r, 0, 1); - g = MathUtil::clamp(this->g, 0, 1); - b = MathUtil::clamp(this->b, 0, 1); - a = MathUtil::clamp(this->a, 0, 1); - return *this; - } - - float r, g, b, a; -}; -} - - -#endif //SPINE_COLOR_H diff --git a/native/cocos/editor-support/spine/ColorTimeline.cpp b/native/cocos/editor-support/spine/ColorTimeline.cpp deleted file mode 100644 index 604fdd7d9f..0000000000 --- a/native/cocos/editor-support/spine/ColorTimeline.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include - -#include -#include -#include -#include - -using namespace spine; - -RTTI_IMPL(ColorTimeline, CurveTimeline) - -const int ColorTimeline::ENTRIES = 5; -const int ColorTimeline::PREV_TIME = -5; -const int ColorTimeline::PREV_R = -4; -const int ColorTimeline::PREV_G = -3; -const int ColorTimeline::PREV_B = -2; -const int ColorTimeline::PREV_A = -1; -const int ColorTimeline::R = 1; -const int ColorTimeline::G = 2; -const int ColorTimeline::B = 3; -const int ColorTimeline::A = 4; - -ColorTimeline::ColorTimeline(int frameCount) : CurveTimeline(frameCount), _slotIndex(0) { - _frames.setSize(frameCount * ENTRIES, 0); -} - -void ColorTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, - MixBlend blend, MixDirection direction) { - SP_UNUSED(lastTime); - SP_UNUSED(pEvents); - SP_UNUSED(direction); - - Slot *slotP = skeleton._slots[_slotIndex]; - Slot &slot = *slotP; - if (time < _frames[0]) { - switch (blend) { - case MixBlend_Setup: - slot._color.set(slot._data._color); - return; - case MixBlend_First: { - Color &color = slot._color, setup = slot._data._color; - color.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha, - (setup.a - color.a) * alpha); - } - default: ; - } - return; - } - - float r, g, b, a; - if (time >= _frames[_frames.size() - ENTRIES]) { - // Time is after last frame. - size_t i = _frames.size(); - r = _frames[i + PREV_R]; - g = _frames[i + PREV_G]; - b = _frames[i + PREV_B]; - a = _frames[i + PREV_A]; - } else { - // Interpolate between the previous frame and the current frame. - size_t frame = (size_t)Animation::binarySearch(_frames, time, ENTRIES); - r = _frames[frame + PREV_R]; - g = _frames[frame + PREV_G]; - b = _frames[frame + PREV_B]; - a = _frames[frame + PREV_A]; - float frameTime = _frames[frame]; - float percent = getCurvePercent(frame / ENTRIES - 1, - 1 - (time - frameTime) / (_frames[frame + PREV_TIME] - frameTime)); - - r += (_frames[frame + R] - r) * percent; - g += (_frames[frame + G] - g) * percent; - b += (_frames[frame + B] - b) * percent; - a += (_frames[frame + A] - a) * percent; - } - - if (alpha == 1) { - slot.getColor().set(r, g, b, a); - } else { - Color &color = slot.getColor(); - if (blend == MixBlend_Setup) color.set(slot.getData().getColor()); - color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha); - } -} - -int ColorTimeline::getPropertyId() { - return ((int) TimelineType_Color << 24) + _slotIndex; -} - -void ColorTimeline::setFrame(int frameIndex, float time, float r, float g, float b, float a) { - frameIndex *= ENTRIES; - _frames[frameIndex] = time; - _frames[frameIndex + R] = r; - _frames[frameIndex + G] = g; - _frames[frameIndex + B] = b; - _frames[frameIndex + A] = a; -} - -int ColorTimeline::getSlotIndex() { - return _slotIndex; -} - -void ColorTimeline::setSlotIndex(int inValue) { - _slotIndex = inValue; -} - -Vector &ColorTimeline::getFrames() { - return _frames; -} diff --git a/native/cocos/editor-support/spine/ColorTimeline.h b/native/cocos/editor-support/spine/ColorTimeline.h deleted file mode 100644 index 49a6bbbb9e..0000000000 --- a/native/cocos/editor-support/spine/ColorTimeline.h +++ /dev/null @@ -1,81 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_ColorTimeline_h -#define Spine_ColorTimeline_h - -#include - -namespace spine { -class SP_API ColorTimeline : public CurveTimeline { - friend class SkeletonBinary; - - friend class SkeletonJson; - -RTTI_DECL - -public: - static const int ENTRIES; - - explicit ColorTimeline(int frameCount); - - virtual void - apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, MixBlend blend, - MixDirection direction); - - virtual int getPropertyId(); - - /// Sets the time and value of the specified keyframe. - void setFrame(int frameIndex, float time, float r, float g, float b, float a); - - int getSlotIndex(); - - void setSlotIndex(int inValue); - - Vector &getFrames(); - -protected: - static const int PREV_TIME; - static const int PREV_R; - static const int PREV_G; - static const int PREV_B; - static const int PREV_A; - static const int R; - static const int G; - static const int B; - static const int A; - -private: - int _slotIndex; - Vector _frames; -}; -} - -#endif /* Spine_ColorTimeline_h */ diff --git a/native/cocos/editor-support/spine/Constraint.cpp b/native/cocos/editor-support/spine/Constraint.cpp deleted file mode 100644 index 39ca6656ab..0000000000 --- a/native/cocos/editor-support/spine/Constraint.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -using namespace spine; - -RTTI_IMPL(Constraint, Updatable) - -Constraint::Constraint() { -} - -Constraint::~Constraint() { -} diff --git a/native/cocos/editor-support/spine/Constraint.h b/native/cocos/editor-support/spine/Constraint.h deleted file mode 100644 index 3d42586eb5..0000000000 --- a/native/cocos/editor-support/spine/Constraint.h +++ /dev/null @@ -1,53 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_Constraint_h -#define Spine_Constraint_h - -#include - -namespace spine { -/// The interface for all constraints. -class SP_API Constraint : public Updatable { -RTTI_DECL - -public: - Constraint(); - - virtual ~Constraint(); - - virtual void update() = 0; - - /// The ordinal for the order a skeleton's constraints will be applied. - virtual int getOrder() = 0; -}; -} - -#endif /* Spine_Constraint_h */ diff --git a/native/cocos/editor-support/spine/ContainerUtil.h b/native/cocos/editor-support/spine/ContainerUtil.h deleted file mode 100644 index 28e4ade1bc..0000000000 --- a/native/cocos/editor-support/spine/ContainerUtil.h +++ /dev/null @@ -1,128 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_ContainerUtil_h -#define Spine_ContainerUtil_h - -#include -#include -#include -#include -#include - -#include - -namespace spine { - class SP_API ContainerUtil : public SpineObject { - public: - /// Finds an item by comparing each item's name. - /// It is more efficient to cache the results of this method than to call it multiple times. - /// @return May be NULL. - template - static T* findWithName(Vector& items, const String& name) { - assert(name.length() > 0); - - for (size_t i = 0; i < items.size(); ++i) { - T* item = items[i]; - if (item->getName() == name) { - return item; - } - } - - return NULL; - } - - /// @return -1 if the item was not found. - template - static int findIndexWithName(Vector& items, const String& name) { - assert(name.length() > 0); - - for (size_t i = 0, len = items.size(); i < len; ++i) { - T* item = items[i]; - if (item->getName() == name) { - return static_cast(i); - } - } - - return -1; - } - - /// Finds an item by comparing each item's name. - /// It is more efficient to cache the results of this method than to call it multiple times. - /// @return May be NULL. - template - static T* findWithDataName(Vector& items, const String& name) { - assert(name.length() > 0); - - for (size_t i = 0; i < items.size(); ++i) { - T* item = items[i]; - if (item->getData().getName() == name) { - return item; - } - } - - return NULL; - } - - /// @return -1 if the item was not found. - template - static int findIndexWithDataName(Vector& items, const String& name) { - assert(name.length() > 0); - - for (size_t i = 0, len = items.size(); i < len; ++i) { - T* item = items[i]; - if (item->getData().getName() == name) { - return static_cast(i); - } - } - - return -1; - } - - template - static void cleanUpVectorOfPointers(Vector& items) { - for (int i = (int)items.size() - 1; i >= 0; i--) { - T* item = items[i]; - - delete item; - - items.removeAt(i); - } - } - - private: - // ctor, copy ctor, and assignment should be private in a Singleton - ContainerUtil(); - ContainerUtil(const ContainerUtil&); - ContainerUtil& operator=(const ContainerUtil&); - }; -} - -#endif /* Spine_ContainerUtil_h */ diff --git a/native/cocos/editor-support/spine/CurveTimeline.cpp b/native/cocos/editor-support/spine/CurveTimeline.cpp deleted file mode 100644 index adb2623ad1..0000000000 --- a/native/cocos/editor-support/spine/CurveTimeline.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include - -using namespace spine; - -RTTI_IMPL(CurveTimeline, Timeline) - -const float CurveTimeline::LINEAR = 0; -const float CurveTimeline::STEPPED = 1; -const float CurveTimeline::BEZIER = 2; -const int CurveTimeline::BEZIER_SIZE = 10 * 2 - 1; - -CurveTimeline::CurveTimeline(int frameCount) { - assert(frameCount > 0); - - _curves.setSize((frameCount - 1) * BEZIER_SIZE, 0); -} - -CurveTimeline::~CurveTimeline() { -} - -size_t CurveTimeline::getFrameCount() { - return _curves.size() / BEZIER_SIZE + 1; -} - -void CurveTimeline::setLinear(size_t frameIndex) { - _curves[frameIndex * BEZIER_SIZE] = LINEAR; -} - -void CurveTimeline::setStepped(size_t frameIndex) { - _curves[frameIndex * BEZIER_SIZE] = STEPPED; -} - -void CurveTimeline::setCurve(size_t frameIndex, float cx1, float cy1, float cx2, float cy2) { - float tmpx = (-cx1 * 2 + cx2) * 0.03f, tmpy = (-cy1 * 2 + cy2) * 0.03f; - float dddfx = ((cx1 - cx2) * 3 + 1) * 0.006f, dddfy = ((cy1 - cy2) * 3 + 1) * 0.006f; - float ddfx = tmpx * 2 + dddfx, ddfy = tmpy * 2 + dddfy; - float dfx = cx1 * 0.3f + tmpx + dddfx * 0.16666667f, dfy = cy1 * 0.3f + tmpy + dddfy * 0.16666667f; - - size_t i = frameIndex * BEZIER_SIZE; - _curves[i++] = BEZIER; - - float x = dfx, y = dfy; - for (size_t n = i + BEZIER_SIZE - 1; i < n; i += 2) { - _curves[i] = x; - _curves[i + 1] = y; - dfx += ddfx; - dfy += ddfy; - ddfx += dddfx; - ddfy += dddfy; - x += dfx; - y += dfy; - } -} - -float CurveTimeline::getCurvePercent(size_t frameIndex, float percent) { - percent = MathUtil::clamp(percent, 0, 1); - size_t i = frameIndex * BEZIER_SIZE; - float type = _curves[i]; - - if (type == LINEAR) { - return percent; - } - - if (type == STEPPED) { - return 0; - } - - i++; - float x = 0; - for (size_t start = i, n = i + BEZIER_SIZE - 1; i < n; i += 2) { - x = _curves[i]; - if (x >= percent) { - float prevX, prevY; - if (i == start) { - prevX = 0; - prevY = 0; - } else { - prevX = _curves[i - 2]; - prevY = _curves[i - 1]; - } - - return prevY + (_curves[i + 1] - prevY) * (percent - prevX) / (x - prevX); - } - } - - float y = _curves[i - 1]; - - return y + (1 - y) * (percent - x) / (1 - x); // Last point is 1,1. -} - -float CurveTimeline::getCurveType(size_t frameIndex) { - return _curves[frameIndex * BEZIER_SIZE]; -} diff --git a/native/cocos/editor-support/spine/CurveTimeline.h b/native/cocos/editor-support/spine/CurveTimeline.h deleted file mode 100644 index f78043bb4e..0000000000 --- a/native/cocos/editor-support/spine/CurveTimeline.h +++ /dev/null @@ -1,77 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_CurveTimeline_h -#define Spine_CurveTimeline_h - -#include -#include - -namespace spine { - /// Base class for frames that use an interpolation bezier curve. - class SP_API CurveTimeline : public Timeline { - RTTI_DECL - - public: - explicit CurveTimeline(int frameCount); - - virtual ~CurveTimeline(); - - virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector* pEvents, float alpha, MixBlend blend, MixDirection direction) = 0; - - virtual int getPropertyId() = 0; - - size_t getFrameCount(); - - void setLinear(size_t frameIndex); - - void setStepped(size_t frameIndex); - - /// Sets the control handle positions for an interpolation bezier curve used to transition from this keyframe to the next. - /// cx1 and cx2 are from 0 to 1, representing the percent of time between the two keyframes. cy1 and cy2 are the percent of - /// the difference between the keyframe's values. - void setCurve(size_t frameIndex, float cx1, float cy1, float cx2, float cy2); - - float getCurvePercent(size_t frameIndex, float percent); - - float getCurveType(size_t frameIndex); - - protected: - static const float LINEAR; - static const float STEPPED; - static const float BEZIER; - static const int BEZIER_SIZE; - - private: - Vector _curves; // type, x, y, ... - }; -} - -#endif /* Spine_CurveTimeline_h */ diff --git a/native/cocos/editor-support/spine/Debug.h b/native/cocos/editor-support/spine/Debug.h deleted file mode 100644 index 436df90b43..0000000000 --- a/native/cocos/editor-support/spine/Debug.h +++ /dev/null @@ -1,117 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef SPINE_DEBUG_H -#define SPINE_DEBUG_H - -#include - -#include - -namespace spine { -class SP_API DebugExtension : public SpineExtension { - struct Allocation { - void *address; - size_t size; - const char *fileName; - int line; - - Allocation() : address(NULL), size(0), fileName(NULL), line(0) { - } - - Allocation(void *a, size_t s, const char *f, int l) : address(a), size(s), fileName(f), line(l) { - } - }; - -public: - DebugExtension(SpineExtension* extension): _extension(extension), _allocations(0), _reallocations(0), _frees(0) { - } - - void reportLeaks() { - for (std::map::iterator it = _allocated.begin(); it != _allocated.end(); it++) { - printf("\"%s:%i (%zu bytes at %p)\n", it->second.fileName, it->second.line, it->second.size, it->second.address); - } - printf("allocations: %zu, reallocations: %zu, frees: %zu\n", _allocations, _reallocations, _frees); - if (_allocated.empty()) printf("No leaks detected"); - } - - void clearAllocations() { - _allocated.clear(); - } - - virtual void *_alloc(size_t size, const char *file, int line) { - void *result = _extension->_alloc(size, file, line); - _allocated[result] = Allocation(result, size, file, line); - _allocations++; - return result; - } - - virtual void *_calloc(size_t size, const char *file, int line) { - void *result = _extension->_calloc(size, file, line); - _allocated[result] = Allocation(result, size, file, line); - _allocations++; - return result; - } - - virtual void *_realloc(void *ptr, size_t size, const char *file, int line) { - _allocated.erase(ptr); - void *result = _extension->_realloc(ptr, size, file, line); - _reallocations++; - _allocated[result] = Allocation(result, size, file, line); - return result; - } - - virtual void _free(void *mem, const char *file, int line) { - if (_allocated.count(mem)) { - _extension->_free(mem, file, line); - _frees++; - _allocated.erase(mem); - return; - } - - printf("%s:%i (address %p): Double free or not allocated through SpineExtension\n", file, line, mem); - _extension->_free(mem, file, line); - } - - virtual char *_readFile(const String &path, int *length) { - return _extension->_readFile(path, length); - } - -private: - SpineExtension* _extension; - std::map _allocated; - size_t _allocations; - size_t _reallocations; - size_t _frees; -}; -} - - -#endif //SPINE_DEBUG_H diff --git a/native/cocos/editor-support/spine/DeformTimeline.cpp b/native/cocos/editor-support/spine/DeformTimeline.cpp deleted file mode 100644 index de62f9e65c..0000000000 --- a/native/cocos/editor-support/spine/DeformTimeline.cpp +++ /dev/null @@ -1,297 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include - -#include - -#include -#include -#include -#include - -using namespace spine; - -RTTI_IMPL(DeformTimeline, CurveTimeline) - -DeformTimeline::DeformTimeline(int frameCount) : CurveTimeline(frameCount), _slotIndex(0), _attachment(NULL) { - _frames.ensureCapacity(frameCount); - _frameVertices.ensureCapacity(frameCount); - - _frames.setSize(frameCount, 0); - - for (int i = 0; i < frameCount; ++i) { - Vector vec; - _frameVertices.add(vec); - } -} - -void DeformTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, - MixBlend blend, MixDirection direction) { - SP_UNUSED(lastTime); - SP_UNUSED(pEvents); - SP_UNUSED(direction); - - Slot *slotP = skeleton._slots[_slotIndex]; - Slot &slot = *slotP; - - Attachment *slotAttachment = slot.getAttachment(); - if (slotAttachment == NULL || !slotAttachment->getRTTI().instanceOf(VertexAttachment::rtti)) { - return; - } - - VertexAttachment *attachment = static_cast(slotAttachment); - if (!attachment->applyDeform(_attachment)) { - return; - } - - Vector &verticesArray = slot._attachmentVertices; - if (verticesArray.size() == 0) { - blend = MixBlend_Setup; - } - - Vector< Vector > &frameVertices = _frameVertices; - size_t vertexCount = frameVertices[0].size(); - - Vector &frames = _frames; - if (time < _frames[0]) { - switch (blend) { - case MixBlend_Setup: - verticesArray.clear(); - return; - case MixBlend_First: { - if (alpha == 1) { - verticesArray.clear(); - return; - } - verticesArray.setSize(vertexCount, 0); - Vector &vertices = verticesArray; - if (attachment->getBones().size() == 0) { - // Unweighted vertex positions. - Vector &setupVertices = attachment->getVertices(); - for (size_t i = 0; i < vertexCount; i++) - vertices[i] += (setupVertices[i] - vertices[i]) * alpha; - } else { - // Weighted deform offsets. - alpha = 1 - alpha; - for (size_t i = 0; i < vertexCount; i++) - vertices[i] *= alpha; - } - } - case MixBlend_Replace: - case MixBlend_Add: - return; - } - } - - verticesArray.setSize(vertexCount, 0); - Vector &vertices = verticesArray; - - if (time >= frames[frames.size() - 1]) { // Time is after last frame. - Vector &lastVertices = frameVertices[frames.size() - 1]; - if (alpha == 1) { - if (blend == MixBlend_Add) { - VertexAttachment *vertexAttachment = static_cast(slotAttachment); - if (vertexAttachment->getBones().size() == 0) { - // Unweighted vertex positions, no alpha. - Vector &setupVertices = vertexAttachment->getVertices(); - for (size_t i = 0; i < vertexCount; i++) - vertices[i] += lastVertices[i] - setupVertices[i]; - } else { - // Weighted deform offsets, no alpha. - for (size_t i = 0; i < vertexCount; i++) - vertices[i] += lastVertices[i]; - } - } else { - // Vertex positions or deform offsets, no alpha. - memcpy(vertices.buffer(), lastVertices.buffer(), vertexCount * sizeof(float)); - } - } else { - switch (blend) { - case MixBlend_Setup: { - VertexAttachment *vertexAttachment = static_cast(slotAttachment); - if (vertexAttachment->getBones().size() == 0) { - // Unweighted vertex positions, with alpha. - Vector &setupVertices = vertexAttachment->getVertices(); - for (size_t i = 0; i < vertexCount; i++) { - float setup = setupVertices[i]; - vertices[i] = setup + (lastVertices[i] - setup) * alpha; - } - } else { - // Weighted deform offsets, with alpha. - for (size_t i = 0; i < vertexCount; i++) - vertices[i] = lastVertices[i] * alpha; - } - break; - } - case MixBlend_First: - case MixBlend_Replace: - // Vertex positions or deform offsets, with alpha. - for (size_t i = 0; i < vertexCount; i++) - vertices[i] += (lastVertices[i] - vertices[i]) * alpha; - break; - case MixBlend_Add: - VertexAttachment *vertexAttachment = static_cast(slotAttachment); - if (vertexAttachment->getBones().size() == 0) { - // Unweighted vertex positions, no alpha. - Vector &setupVertices = vertexAttachment->getVertices(); - for (size_t i = 0; i < vertexCount; i++) - vertices[i] += (lastVertices[i] - setupVertices[i]) * alpha; - } else { - // Weighted deform offsets, alpha. - for (size_t i = 0; i < vertexCount; i++) - vertices[i] += lastVertices[i] * alpha; - } - } - } - return; - } - - // Interpolate between the previous frame and the current frame. - int frame = Animation::binarySearch(frames, time); - Vector &prevVertices = frameVertices[frame - 1]; - Vector &nextVertices = frameVertices[frame]; - float frameTime = frames[frame]; - float percent = getCurvePercent(frame - 1, 1 - (time - frameTime) / (frames[frame - 1] - frameTime)); - - if (alpha == 1) { - if (blend == MixBlend_Add) { - VertexAttachment *vertexAttachment = static_cast(slotAttachment); - if (vertexAttachment->getBones().size() == 0) { - // Unweighted vertex positions, no alpha. - Vector &setupVertices = vertexAttachment->getVertices(); - for (size_t i = 0; i < vertexCount; i++) { - float prev = prevVertices[i]; - vertices[i] += prev + (nextVertices[i] - prev) * percent - setupVertices[i]; - } - } else { - // Weighted deform offsets, no alpha. - for (size_t i = 0; i < vertexCount; i++) { - float prev = prevVertices[i]; - vertices[i] += prev + (nextVertices[i] - prev) * percent; - } - } - } else { - // Vertex positions or deform offsets, no alpha. - for (size_t i = 0; i < vertexCount; i++) { - float prev = prevVertices[i]; - vertices[i] = prev + (nextVertices[i] - prev) * percent; - } - } - } else { - switch (blend) { - case MixBlend_Setup: { - VertexAttachment *vertexAttachment = static_cast(slotAttachment); - if (vertexAttachment->getBones().size() == 0) { - // Unweighted vertex positions, with alpha. - Vector &setupVertices = vertexAttachment->getVertices(); - for (size_t i = 0; i < vertexCount; i++) { - float prev = prevVertices[i], setup = setupVertices[i]; - vertices[i] = setup + (prev + (nextVertices[i] - prev) * percent - setup) * alpha; - } - } else { - // Weighted deform offsets, with alpha. - for (size_t i = 0; i < vertexCount; i++) { - float prev = prevVertices[i]; - vertices[i] = (prev + (nextVertices[i] - prev) * percent) * alpha; - } - } - break; - } - case MixBlend_First: - case MixBlend_Replace: - // Vertex positions or deform offsets, with alpha. - for (size_t i = 0; i < vertexCount; i++) { - float prev = prevVertices[i]; - vertices[i] += (prev + (nextVertices[i] - prev) * percent - vertices[i]) * alpha; - } - break; - case MixBlend_Add: - VertexAttachment *vertexAttachment = static_cast(slotAttachment); - if (vertexAttachment->getBones().size() == 0) { - // Unweighted vertex positions, with alpha. - Vector &setupVertices = vertexAttachment->getVertices(); - for (size_t i = 0; i < vertexCount; i++) { - float prev = prevVertices[i]; - vertices[i] += (prev + (nextVertices[i] - prev) * percent - setupVertices[i]) * alpha; - } - } else { - // Weighted deform offsets, with alpha. - for (size_t i = 0; i < vertexCount; i++) { - float prev = prevVertices[i]; - vertices[i] += (prev + (nextVertices[i] - prev) * percent) * alpha; - } - } - } - } -} - -int DeformTimeline::getPropertyId() { - assert(_attachment != NULL); - - return ((int) TimelineType_Deform << 24) + _attachment->_id + _slotIndex; -} - -void DeformTimeline::setFrame(int frameIndex, float time, Vector &vertices) { - _frames[frameIndex] = time; - _frameVertices[frameIndex].clear(); - _frameVertices[frameIndex].addAll(vertices); -} - -int DeformTimeline::getSlotIndex() { - return _slotIndex; -} - -void DeformTimeline::setSlotIndex(int inValue) { - _slotIndex = inValue; -} - -Vector &DeformTimeline::getFrames() { - return _frames; -} - -Vector > &DeformTimeline::getVertices() { - return _frameVertices; -} - -VertexAttachment *DeformTimeline::getAttachment() { - return _attachment; -} - -void DeformTimeline::setAttachment(VertexAttachment *inValue) { - _attachment = inValue; -} diff --git a/native/cocos/editor-support/spine/DeformTimeline.h b/native/cocos/editor-support/spine/DeformTimeline.h deleted file mode 100644 index ccec3455e7..0000000000 --- a/native/cocos/editor-support/spine/DeformTimeline.h +++ /dev/null @@ -1,70 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_DeformTimeline_h -#define Spine_DeformTimeline_h - -#include - -namespace spine { - class VertexAttachment; - - class SP_API DeformTimeline : public CurveTimeline { - friend class SkeletonBinary; - friend class SkeletonJson; - - RTTI_DECL - - public: - explicit DeformTimeline(int frameCount); - - virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector* pEvents, float alpha, MixBlend blend, MixDirection direction); - - virtual int getPropertyId(); - - /// Sets the time and value of the specified keyframe. - void setFrame(int frameIndex, float time, Vector& vertices); - - int getSlotIndex(); - void setSlotIndex(int inValue); - Vector& getFrames(); - Vector< Vector >& getVertices(); - VertexAttachment* getAttachment(); - void setAttachment(VertexAttachment* inValue); - - private: - int _slotIndex; - Vector _frames; - Vector< Vector > _frameVertices; - VertexAttachment* _attachment; - }; -} - -#endif /* Spine_DeformTimeline_h */ diff --git a/native/cocos/editor-support/spine/DrawOrderTimeline.cpp b/native/cocos/editor-support/spine/DrawOrderTimeline.cpp deleted file mode 100644 index d79d3fc6c0..0000000000 --- a/native/cocos/editor-support/spine/DrawOrderTimeline.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include - -#include -#include -#include -#include - -using namespace spine; - -RTTI_IMPL(DrawOrderTimeline, Timeline) - -DrawOrderTimeline::DrawOrderTimeline(int frameCount) : Timeline() { - _frames.ensureCapacity(frameCount); - _drawOrders.ensureCapacity(frameCount); - - _frames.setSize(frameCount, 0); - - for (int i = 0; i < frameCount; ++i) { - Vector vec; - _drawOrders.add(vec); - } -} - -void DrawOrderTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, - MixBlend blend, MixDirection direction) { - SP_UNUSED(lastTime); - SP_UNUSED(pEvents); - SP_UNUSED(alpha); - - Vector &drawOrder = skeleton._drawOrder; - Vector &slots = skeleton._slots; - if (direction == MixDirection_Out && blend == MixBlend_Setup) { - drawOrder.clear(); - drawOrder.ensureCapacity(slots.size()); - for (size_t i = 0, n = slots.size(); i < n; ++i) { - drawOrder.add(slots[i]); - } - return; - } - - if (time < _frames[0]) { - if (blend == MixBlend_Setup || blend == MixBlend_First) { - drawOrder.clear(); - drawOrder.ensureCapacity(slots.size()); - for (size_t i = 0, n = slots.size(); i < n; ++i) { - drawOrder.add(slots[i]); - } - } - return; - } - - size_t frame; - if (time >= _frames[_frames.size() - 1]) { - // Time is after last frame. - frame = _frames.size() - 1; - } else { - frame = (size_t)Animation::binarySearch(_frames, time) - 1; - } - - Vector &drawOrderToSetupIndex = _drawOrders[frame]; - if (drawOrderToSetupIndex.size() == 0) { - drawOrder.clear(); - for (size_t i = 0, n = slots.size(); i < n; ++i) { - drawOrder.add(slots[i]); - } - } else { - for (size_t i = 0, n = drawOrderToSetupIndex.size(); i < n; ++i) { - drawOrder[i] = slots[drawOrderToSetupIndex[i]]; - } - } -} - -int DrawOrderTimeline::getPropertyId() { - return ((int) TimelineType_DrawOrder << 24); -} - -void DrawOrderTimeline::setFrame(size_t frameIndex, float time, Vector &drawOrder) { - _frames[frameIndex] = time; - _drawOrders[frameIndex].clear(); - _drawOrders[frameIndex].addAll(drawOrder); -} - -Vector &DrawOrderTimeline::getFrames() { - return _frames; -} - -Vector > &DrawOrderTimeline::getDrawOrders() { - return _drawOrders; -} - -size_t DrawOrderTimeline::getFrameCount() { - return _frames.size(); -} diff --git a/native/cocos/editor-support/spine/DrawOrderTimeline.h b/native/cocos/editor-support/spine/DrawOrderTimeline.h deleted file mode 100644 index cdb65e8d6b..0000000000 --- a/native/cocos/editor-support/spine/DrawOrderTimeline.h +++ /dev/null @@ -1,64 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_DrawOrderTimeline_h -#define Spine_DrawOrderTimeline_h - -#include - -namespace spine { - class SP_API DrawOrderTimeline : public Timeline { - friend class SkeletonBinary; - friend class SkeletonJson; - - RTTI_DECL - - public: - explicit DrawOrderTimeline(int frameCount); - - virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector* pEvents, float alpha, MixBlend blend, MixDirection direction); - - virtual int getPropertyId(); - - /// Sets the time and value of the specified keyframe. - /// @param drawOrder May be NULL to use bind pose draw order - void setFrame(size_t frameIndex, float time, Vector& drawOrder); - - Vector& getFrames(); - Vector< Vector >& getDrawOrders(); - size_t getFrameCount(); - - private: - Vector _frames; - Vector< Vector > _drawOrders; - }; -} - -#endif /* Spine_DrawOrderTimeline_h */ diff --git a/native/cocos/editor-support/spine/Event.cpp b/native/cocos/editor-support/spine/Event.cpp deleted file mode 100644 index e397b4e686..0000000000 --- a/native/cocos/editor-support/spine/Event.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include - -spine::Event::Event(float time, const spine::EventData &data) : - _data(data), - _time(time), - _intValue(0), - _floatValue(0), - _stringValue(), - _volume(1), - _balance(0) { -} - -const spine::EventData &spine::Event::getData() { - return _data; -} - -float spine::Event::getTime() { - return _time; -} - -int spine::Event::getIntValue() { - return _intValue; -} - -void spine::Event::setIntValue(int inValue) { - _intValue = inValue; -} - -float spine::Event::getFloatValue() { - return _floatValue; -} - -void spine::Event::setFloatValue(float inValue) { - _floatValue = inValue; -} - -const spine::String &spine::Event::getStringValue() { - return _stringValue; -} - -void spine::Event::setStringValue(const spine::String &inValue) { - _stringValue = inValue; -} - - -float spine::Event::getVolume() { - return _volume; -} - -void spine::Event::setVolume(float inValue) { - _volume = inValue; -} - -float spine::Event::getBalance() { - return _balance; -} - -void spine::Event::setBalance(float inValue) { - _balance = inValue; -} diff --git a/native/cocos/editor-support/spine/Event.h b/native/cocos/editor-support/spine/Event.h deleted file mode 100644 index 1378da9cfe..0000000000 --- a/native/cocos/editor-support/spine/Event.h +++ /dev/null @@ -1,87 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_Event_h -#define Spine_Event_h - -#include -#include - -namespace spine { -class EventData; - -/// Stores the current pose values for an Event. -class SP_API Event : public SpineObject { - friend class SkeletonBinary; - - friend class SkeletonJson; - - friend class AnimationState; - -public: - Event(float time, const EventData &data); - - const EventData &getData(); - - /// The animation time this event was keyed. - float getTime(); - - int getIntValue(); - - void setIntValue(int inValue); - - float getFloatValue(); - - void setFloatValue(float inValue); - - const String &getStringValue(); - - void setStringValue(const String &inValue); - - float getVolume(); - - void setVolume(float inValue); - - float getBalance(); - - void setBalance(float inValue); - -private: - const EventData &_data; - const float _time; - int _intValue; - float _floatValue; - String _stringValue; - float _volume; - float _balance; -}; -} - -#endif /* Spine_Event_h */ diff --git a/native/cocos/editor-support/spine/EventData.cpp b/native/cocos/editor-support/spine/EventData.cpp deleted file mode 100644 index 489f185b95..0000000000 --- a/native/cocos/editor-support/spine/EventData.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include - -spine::EventData::EventData(const spine::String &name) : - _name(name), - _intValue(0), - _floatValue(0), - _stringValue(), - _audioPath(), - _volume(1), - _balance(0) { - assert(_name.length() > 0); -} - -/// The name of the event, which is unique within the skeleton. -const spine::String &spine::EventData::getName() const { - return _name; -} - -int spine::EventData::getIntValue() { - return _intValue; -} - -void spine::EventData::setIntValue(int inValue) { - _intValue = inValue; -} - -float spine::EventData::getFloatValue() { - return _floatValue; -} - -void spine::EventData::setFloatValue(float inValue) { - _floatValue = inValue; -} - -const spine::String &spine::EventData::getStringValue() { - return _stringValue; -} - -void spine::EventData::setStringValue(const spine::String &inValue) { - this->_stringValue = inValue; -} - -const spine::String &spine::EventData::getAudioPath() { - return _audioPath; -} - -void spine::EventData::setAudioPath(const spine::String &inValue) { - _audioPath = inValue; -} - - -float spine::EventData::getVolume() { - return _volume; -} - -void spine::EventData::setVolume(float inValue) { - _volume = inValue; -} - -float spine::EventData::getBalance() { - return _balance; -} - -void spine::EventData::setBalance(float inValue) { - _balance = inValue; -} diff --git a/native/cocos/editor-support/spine/EventData.h b/native/cocos/editor-support/spine/EventData.h deleted file mode 100644 index ec5d533291..0000000000 --- a/native/cocos/editor-support/spine/EventData.h +++ /dev/null @@ -1,87 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_EventData_h -#define Spine_EventData_h - -#include -#include - -namespace spine { -/// Stores the setup pose values for an Event. -class SP_API EventData : public SpineObject { - friend class SkeletonBinary; - - friend class SkeletonJson; - - friend class Event; - -public: - explicit EventData(const String &name); - - /// The name of the event, which is unique within the skeleton. - const String &getName() const; - - int getIntValue(); - - void setIntValue(int inValue); - - float getFloatValue(); - - void setFloatValue(float inValue); - - const String &getStringValue(); - - void setStringValue(const String &inValue); - - const String &getAudioPath(); - - void setAudioPath(const String &inValue); - - float getVolume(); - - void setVolume(float inValue); - - float getBalance(); - - void setBalance(float inValue); - -private: - const String _name; - int _intValue; - float _floatValue; - String _stringValue; - String _audioPath; - float _volume; - float _balance; -}; -} - -#endif /* Spine_EventData_h */ diff --git a/native/cocos/editor-support/spine/EventTimeline.cpp b/native/cocos/editor-support/spine/EventTimeline.cpp deleted file mode 100644 index d1218380f9..0000000000 --- a/native/cocos/editor-support/spine/EventTimeline.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -using namespace spine; - -RTTI_IMPL(EventTimeline, Timeline) - -EventTimeline::EventTimeline(int frameCount) : Timeline() { - _frames.setSize(frameCount, 0); - _events.setSize(frameCount, NULL); -} - -EventTimeline::~EventTimeline() { - ContainerUtil::cleanUpVectorOfPointers(_events); -} - -void EventTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, - MixBlend blend, MixDirection direction) { - if (pEvents == NULL) { - return; - } - - Vector &events = *pEvents; - - size_t frameCount = _frames.size(); - - if (lastTime > time) { - // Fire events after last time for looped animations. - apply(skeleton, lastTime, std::numeric_limits::max(), pEvents, alpha, blend, direction); - lastTime = -1.0f; - } else if (lastTime >= _frames[frameCount - 1]) { - // Last time is after last frame. - return; - } - - if (time < _frames[0]) { - return; // Time is before first frame. - } - - int frame; - if (lastTime < _frames[0]) { - frame = 0; - } else { - frame = Animation::binarySearch(_frames, lastTime); - float frameTime = _frames[frame]; - while (frame > 0) { - // Fire multiple events with the same frame. - if (_frames[frame - 1] != frameTime) { - break; - } - frame--; - } - } - - for (; (size_t)frame < frameCount && time >= _frames[frame]; ++frame) { - events.add(_events[frame]); - } -} - -int EventTimeline::getPropertyId() { - return ((int) TimelineType_Event << 24); -} - -void EventTimeline::setFrame(size_t frameIndex, Event *event) { - _frames[frameIndex] = event->getTime(); - _events[frameIndex] = event; -} - -Vector EventTimeline::getFrames() { return _frames; } - -Vector &EventTimeline::getEvents() { return _events; } - -size_t EventTimeline::getFrameCount() { return _frames.size(); } diff --git a/native/cocos/editor-support/spine/EventTimeline.h b/native/cocos/editor-support/spine/EventTimeline.h deleted file mode 100644 index a3a14bd388..0000000000 --- a/native/cocos/editor-support/spine/EventTimeline.h +++ /dev/null @@ -1,65 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_EventTimeline_h -#define Spine_EventTimeline_h - -#include - -namespace spine { - class SP_API EventTimeline : public Timeline { - friend class SkeletonBinary; - friend class SkeletonJson; - - RTTI_DECL - - public: - explicit EventTimeline(int frameCount); - - ~EventTimeline(); - - virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector* pEvents, float alpha, MixBlend blend, MixDirection direction); - - virtual int getPropertyId(); - - /// Sets the time and value of the specified keyframe. - void setFrame(size_t frameIndex, Event* event); - - Vector getFrames(); - Vector& getEvents(); - size_t getFrameCount(); - - private: - Vector _frames; - Vector _events; - }; -} - -#endif /* Spine_EventTimeline_h */ diff --git a/native/cocos/editor-support/spine/Extension.cpp b/native/cocos/editor-support/spine/Extension.cpp deleted file mode 100644 index 3766524bb6..0000000000 --- a/native/cocos/editor-support/spine/Extension.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include -#include - -#include - -using namespace spine; - -SpineExtension *SpineExtension::_instance = NULL; - -void SpineExtension::setInstance(SpineExtension *inValue) { - assert(inValue); - - _instance = inValue; -} - -SpineExtension *SpineExtension::getInstance() { - if (!_instance) _instance = spine::getDefaultExtension(); - assert(_instance); - - return _instance; -} - -SpineExtension::~SpineExtension() { -} - -SpineExtension::SpineExtension() { -} - -DefaultSpineExtension::~DefaultSpineExtension() { -} - -void *DefaultSpineExtension::_alloc(size_t size, const char *file, int line) { - SP_UNUSED(file); - SP_UNUSED(line); - - if (size == 0) - return 0; - void *ptr = ::malloc(size); - return ptr; -} - -void *DefaultSpineExtension::_calloc(size_t size, const char *file, int line) { - SP_UNUSED(file); - SP_UNUSED(line); - - if (size == 0) - return 0; - - void *ptr = ::malloc(size); - if (ptr) { - memset(ptr, 0, size); - } - return ptr; -} - -void *DefaultSpineExtension::_realloc(void *ptr, size_t size, const char *file, int line) { - SP_UNUSED(file); - SP_UNUSED(line); - - void *mem = NULL; - if (size == 0) - return 0; - if (ptr == NULL) - mem = ::malloc(size); - else - mem = ::realloc(ptr, size); - return mem; -} - -void DefaultSpineExtension::_free(void *mem, const char *file, int line) { - SP_UNUSED(file); - SP_UNUSED(line); - - ::free(mem); -} - -char *DefaultSpineExtension::_readFile(const String &path, int *length) { - char *data; - FILE *file = fopen(path.buffer(), "rb"); - if (!file) return 0; - - fseek(file, 0, SEEK_END); - *length = (int) ftell(file); - fseek(file, 0, SEEK_SET); - - data = SpineExtension::alloc(*length, __FILE__, __LINE__); - fread(data, 1, *length, file); - fclose(file); - - return data; -} - -DefaultSpineExtension::DefaultSpineExtension() : SpineExtension() { -} diff --git a/native/cocos/editor-support/spine/Extension.h b/native/cocos/editor-support/spine/Extension.h deleted file mode 100644 index 95d9cd9fea..0000000000 --- a/native/cocos/editor-support/spine/Extension.h +++ /dev/null @@ -1,118 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_Extension_h -#define Spine_Extension_h - -#include -#include - -#define SP_UNUSED(x) (void)(x) - -namespace spine { -class String; - -class SP_API SpineExtension { -public: - template - static T *alloc(size_t num, const char *file, int line) { - return (T *) getInstance()->_alloc(sizeof(T) * num, file, line); - } - - template - static T *calloc(size_t num, const char *file, int line) { - return (T *) getInstance()->_calloc(sizeof(T) * num, file, line); - } - - template - static T *realloc(T *ptr, size_t num, const char *file, int line) { - return (T *) getInstance()->_realloc(ptr, sizeof(T) * num, file, line); - } - - template - static void free(T *ptr, const char *file, int line) { - getInstance()->_free((void *) ptr, file, line); - } - - static char *readFile(const String &path, int *length) { - return getInstance()->_readFile(path, length); - } - - static void setInstance(SpineExtension *inSpineExtension); - - static SpineExtension *getInstance(); - - virtual ~SpineExtension(); - - /// Implement this function to use your own memory allocator - virtual void *_alloc(size_t size, const char *file, int line) = 0; - - virtual void *_calloc(size_t size, const char *file, int line) = 0; - - virtual void *_realloc(void *ptr, size_t size, const char *file, int line) = 0; - - /// If you provide a spineAllocFunc, you should also provide a spineFreeFunc - virtual void _free(void *mem, const char *file, int line) = 0; - - virtual char *_readFile(const String &path, int *length) = 0; - -protected: - SpineExtension(); - -private: - static SpineExtension *_instance; -}; - -class SP_API DefaultSpineExtension : public SpineExtension { -public: - DefaultSpineExtension(); - - virtual ~DefaultSpineExtension(); - -protected: - virtual void *_alloc(size_t size, const char *file, int line); - - virtual void *_calloc(size_t size, const char *file, int line); - - virtual void *_realloc(void *ptr, size_t size, const char *file, int line); - - virtual void _free(void *mem, const char *file, int line); - - virtual char *_readFile(const String &path, int *length); -}; - -// This function is to be implemented by engine specific runtimes to provide -// the default extension for that engine. It is called the first time -// SpineExtension::getInstance() is called, when no instance has been set -// yet. -extern SpineExtension *getDefaultExtension(); -} - -#endif /* Spine_Extension_h */ diff --git a/native/cocos/editor-support/spine/HasRendererObject.h b/native/cocos/editor-support/spine/HasRendererObject.h deleted file mode 100644 index 929fee7997..0000000000 --- a/native/cocos/editor-support/spine/HasRendererObject.h +++ /dev/null @@ -1,59 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_HasRendererObject_h -#define Spine_HasRendererObject_h - -namespace spine { - -typedef void (*DisposeRendererObject) (void* rendererObject); - -class SP_API HasRendererObject { -public: - explicit HasRendererObject() : _rendererObject(NULL), _dispose(NULL) {}; - - virtual ~HasRendererObject() { - if (_dispose && _rendererObject) - _dispose(_rendererObject); - } - - void* getRendererObject() { return _rendererObject; } - void setRendererObject(void* rendererObject, DisposeRendererObject dispose = NULL) { - _rendererObject = rendererObject; - _dispose = dispose; - } -private: - void *_rendererObject; - DisposeRendererObject _dispose; -}; - -} - -#endif diff --git a/native/cocos/editor-support/spine/HashMap.h b/native/cocos/editor-support/spine/HashMap.h deleted file mode 100755 index 2aa5a2158f..0000000000 --- a/native/cocos/editor-support/spine/HashMap.h +++ /dev/null @@ -1,185 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_HashMap_h -#define Spine_HashMap_h - -#include -#include -#include - - // Required for new with line number and file name in MSVC -#ifdef _MSC_VER -#pragma warning(disable:4291) -#endif - -namespace spine { -template -class SP_API HashMap : public SpineObject { -private: - class Entry; - -public: - class SP_API Pair { - public: - explicit Pair(K &k, V &v) : key(k), value(v) {} - - K &key; - V &value; - }; - - class SP_API Entries { - public: - friend class HashMap; - - explicit Entries(Entry *entry) : _entry(NULL), _hasChecked(false) { - _start.next = entry; - _entry = &_start; - } - - Pair next() { - assert(_entry); - assert(_hasChecked); - _entry = _entry->next; - Pair pair(_entry->_key, _entry->_value); - _hasChecked = false; - return pair; - } - - bool hasNext() { - _hasChecked = true; - return _entry->next; - } - - private: - bool _hasChecked; - Entry _start; - Entry *_entry; - }; - - HashMap() : - _head(NULL), - _size(0) { - } - - ~HashMap() { - for (Entry *entry = _head; entry != NULL;) { - Entry* next = entry->next; - delete entry; - entry = next; - } - } - - size_t size() { - return _size; - } - - void put(const K &key, const V &value) { - Entry *entry = find(key); - if (entry) { - entry->_key = key; - entry->_value = value; - } else { - entry = new(__FILE__, __LINE__) Entry(); - entry->_key = key; - entry->_value = value; - - Entry *oldHead = _head; - - if (oldHead) { - _head = entry; - oldHead->prev = entry; - entry->next = oldHead; - } else { - _head = entry; - } - _size++; - } - } - - bool containsKey(const K &key) { - return find(key) != NULL; - } - - bool remove(const K &key) { - Entry *entry = find(key); - if (!entry) return false; - - Entry *prev = entry->prev; - Entry *next = entry->next; - - if (prev) prev->next = next; - else _head = next; - if (next) next->prev = entry->prev; - - delete entry; - _size--; - - return true; - } - - V operator[](const K &key) { - Entry *entry = find(key); - if (entry) return entry->_value; - else { - assert(false); - return 0; - } - } - - Entries getEntries() const { - return Entries(_head); - } - -private: - Entry *find(const K &key) { - for (Entry *entry = _head; entry != NULL; entry = entry->next) { - if (entry->_key == key) - return entry; - } - return NULL; - } - - class SP_API Entry : public SpineObject { - public: - K _key; - V _value; - Entry *next; - Entry *prev; - - Entry() : next(NULL), prev(NULL) {} - }; - - Entry *_head; - size_t _size; -}; -} - -#endif /* Spine_HashMap_h */ diff --git a/native/cocos/editor-support/spine/IkConstraint.cpp b/native/cocos/editor-support/spine/IkConstraint.cpp deleted file mode 100644 index 1c2237e62a..0000000000 --- a/native/cocos/editor-support/spine/IkConstraint.cpp +++ /dev/null @@ -1,297 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include -#include - -#include - -using namespace spine; - -RTTI_IMPL(IkConstraint, Constraint) - -void IkConstraint::apply(Bone &bone, float targetX, float targetY, bool compress, bool stretch, bool uniform, float alpha) { - Bone *p = bone.getParent(); - float id, x, y, tx, ty, rotationIK; - if (!bone._appliedValid) bone.updateAppliedTransform(); - id = 1 / (p->_a * p->_d - p->_b * p->_c); - x = targetX - p->_worldX, y = targetY - p->_worldY; - tx = (x * p->_d - y * p->_b) * id - bone._ax; - ty = (y * p->_a - x * p->_c) * id - bone._ay; - rotationIK = MathUtil::atan2(ty, tx) * MathUtil::Rad_Deg - bone._ashearX - bone._arotation; - if (bone._ascaleX < 0) rotationIK += 180; - if (rotationIK > 180) rotationIK -= 360; - else if (rotationIK < -180) rotationIK += 360; - float sx = bone._ascaleX; - float sy = bone._ascaleY; - if (compress || stretch) { - float b = bone._data.getLength() * sx, dd = MathUtil::sqrt(tx * tx + ty * ty); - if (((compress && dd < b) || (stretch && dd > b)) && (b > 0.0001f)) { - float s = (dd / b - 1) * alpha + 1; - sx *= s; - if (uniform) sy *= s; - } - } - bone.updateWorldTransform(bone._ax, bone._ay, bone._arotation + rotationIK * alpha, sx, - sy, bone._ashearX, bone._ashearY); -} - -void IkConstraint::apply(Bone &parent, Bone &child, float targetX, float targetY, int bendDir, bool stretch, float alpha) { - float px, py, psx, sx, psy; - float cx, cy, csx, cwx, cwy; - int o1, o2, s2, u; - Bone *pp = parent.getParent(); - float tx, ty, dx, dy, dd, l1, l2, a1, a2, r; - float id, x, y; - if (alpha == 0) { - child.updateWorldTransform(); - return; - } - if (!parent._appliedValid) parent.updateAppliedTransform(); - if (!child._appliedValid) child.updateAppliedTransform(); - px = parent._ax; - py = parent._ay; - psx = parent._ascaleX; - sx = psx; - psy = parent._ascaleY; - csx = child._ascaleX; - if (psx < 0) { - psx = -psx; - o1 = 180; - s2 = -1; - } else { - o1 = 0; - s2 = 1; - } - if (psy < 0) { - psy = -psy; - s2 = -s2; - } - if (csx < 0) { - csx = -csx; - o2 = 180; - } else - o2 = 0; - r = psx - psy; - cx = child._ax; - u = (r < 0 ? -r : r) <= 0.0001f; - if (!u) { - cy = 0; - cwx = parent._a * cx + parent._worldX; - cwy = parent._c * cx + parent._worldY; - } else { - cy = child._ay; - cwx = parent._a * cx + parent._b * cy + parent._worldX; - cwy = parent._c * cx + parent._d * cy + parent._worldY; - } - id = 1 / (pp->_a * pp->_d - pp->_b * pp->_c); - x = targetX - pp->_worldX; - y = targetY - pp->_worldY; - tx = (x * pp->_d - y * pp->_b) * id - px; - ty = (y * pp->_a - x * pp->_c) * id - py; - dd = tx * tx + ty * ty; - x = cwx - pp->_worldX; - y = cwy - pp->_worldY; - dx = (x * pp->_d - y * pp->_b) * id - px; - dy = (y * pp->_a - x * pp->_c) * id - py; - l1 = MathUtil::sqrt(dx * dx + dy * dy); - l2 = child.getData().getLength() * csx; - if (u) { - float cosine, a, b; - l2 *= psx; - cosine = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2); - if (cosine < -1) cosine = -1; - else if (cosine > 1) { - cosine = 1; - if (stretch && l1 + l2 > 0.0001f) sx *= (MathUtil::sqrt(dd) / (l1 + l2) - 1) * alpha + 1; - } - a2 = MathUtil::acos(cosine) * bendDir; - a = l1 + l2 * cosine; - b = l2 * MathUtil::sin(a2); - a1 = MathUtil::atan2(ty * a - tx * b, tx * a + ty * b); - } else { - float a = psx * l2, b = psy * l2; - float aa = a * a, bb = b * b, ll = l1 * l1, ta = MathUtil::atan2(ty, tx); - float c0 = bb * ll + aa * dd - aa * bb, c1 = -2 * bb * l1, c2 = bb - aa; - float d = c1 * c1 - 4 * c2 * c0; - if (d >= 0) { - float q = MathUtil::sqrt(d), r0, r1; - if (c1 < 0) q = -q; - q = -(c1 + q) / 2; - r0 = q / c2; - r1 = c0 / q; - r = MathUtil::abs(r0) < MathUtil::abs(r1) ? r0 : r1; - if (r * r <= dd) { - y = MathUtil::sqrt(dd - r * r) * bendDir; - a1 = ta - MathUtil::atan2(y, r); - a2 = MathUtil::atan2(y / psy, (r - l1) / psx); - goto break_outer; - } - } - { - float minAngle = MathUtil::Pi, minX = l1 - a, minDist = minX * minX, minY = 0; - float maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0; - c0 = -a * l1 / (aa - bb); - if (c0 >= -1 && c0 <= 1) { - c0 = MathUtil::acos(c0); - x = a * MathUtil::cos(c0) + l1; - y = b * MathUtil::sin(c0); - d = x * x + y * y; - if (d < minDist) { - minAngle = c0; - minDist = d; - minX = x; - minY = y; - } - if (d > maxDist) { - maxAngle = c0; - maxDist = d; - maxX = x; - maxY = y; - } - } - if (dd <= (minDist + maxDist) / 2) { - a1 = ta - MathUtil::atan2(minY * bendDir, minX); - a2 = minAngle * bendDir; - } else { - a1 = ta - MathUtil::atan2(maxY * bendDir, maxX); - a2 = maxAngle * bendDir; - } - } - } - break_outer: - { - float os = MathUtil::atan2(cy, cx) * s2; - a1 = (a1 - os) * MathUtil::Rad_Deg + o1 - parent._arotation; - if (a1 > 180) a1 -= 360; - else if (a1 < -180) a1 += 360; - parent.updateWorldTransform(px, py, parent._rotation + a1 * alpha, sx, parent._ascaleY, 0, 0); - a2 = ((a2 + os) * MathUtil::Rad_Deg - child._ashearX) * s2 + o2 - child._arotation; - if (a2 > 180) a2 -= 360; - else if (a2 < -180) a2 += 360; - child.updateWorldTransform(cx, cy, child._arotation + a2 * alpha, child._ascaleX, child._ascaleY, - child._ashearX, child._ashearY); - } -} - -IkConstraint::IkConstraint(IkConstraintData &data, Skeleton &skeleton) : Constraint(), - _data(data), - _bendDirection(data.getBendDirection()), - _compress(data.getCompress()), - _stretch(data.getStretch()), - _mix(data.getMix()), - _target(skeleton.findBone( - data.getTarget()->getName())) { - _bones.ensureCapacity(_data.getBones().size()); - for (size_t i = 0; i < _data.getBones().size(); i++) { - BoneData *boneData = _data.getBones()[i]; - _bones.add(skeleton.findBone(boneData->getName())); - } -} - -/// Applies the constraint to the constrained bones. -void IkConstraint::apply() { - update(); -} - -void IkConstraint::update() { - switch (_bones.size()) { - case 1: { - Bone *bone0 = _bones[0]; - apply(*bone0, _target->getWorldX(), _target->getWorldY(), _compress, _stretch, _data._uniform, _mix); - } - break; - case 2: { - Bone *bone0 = _bones[0]; - Bone *bone1 = _bones[1]; - apply(*bone0, *bone1, _target->getWorldX(), _target->getWorldY(), _bendDirection, _stretch, _mix); - } - break; - } -} - -int IkConstraint::getOrder() { - return _data.getOrder(); -} - -IkConstraintData &IkConstraint::getData() { - return _data; -} - -Vector &IkConstraint::getBones() { - return _bones; -} - -Bone *IkConstraint::getTarget() { - return _target; -} - -void IkConstraint::setTarget(Bone *inValue) { - _target = inValue; -} - -int IkConstraint::getBendDirection() { - return _bendDirection; -} - -void IkConstraint::setBendDirection(int inValue) { - _bendDirection = inValue; -} - -float IkConstraint::getMix() { - return _mix; -} - -void IkConstraint::setMix(float inValue) { - _mix = inValue; -} - -bool IkConstraint::getStretch() { - return _stretch; -} - -void IkConstraint::setStretch(bool inValue) { - _stretch = inValue; -} - -bool IkConstraint::getCompress() { - return _compress; -} - -void IkConstraint::setCompress(bool inValue) { - _compress = inValue; -} diff --git a/native/cocos/editor-support/spine/IkConstraint.h b/native/cocos/editor-support/spine/IkConstraint.h deleted file mode 100644 index fc0cffb84c..0000000000 --- a/native/cocos/editor-support/spine/IkConstraint.h +++ /dev/null @@ -1,106 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_IkConstraint_h -#define Spine_IkConstraint_h - -#include - -#include - -namespace spine { -class IkConstraintData; - -class Skeleton; - -class Bone; - -class SP_API IkConstraint : public Constraint { - friend class Skeleton; - - friend class IkConstraintTimeline; - -RTTI_DECL - -public: - /// Adjusts the bone rotation so the tip is as close to the target position as possible. The target is specified - /// in the world coordinate system. - static void apply(Bone &bone, float targetX, float targetY, bool compress, bool stretch, bool uniform, float alpha); - - /// Adjusts the parent and child bone rotations so the tip of the child is as close to the target position as - /// possible. The target is specified in the world coordinate system. - /// @param child A direct descendant of the parent bone. - static void apply(Bone &parent, Bone &child, float targetX, float targetY, int bendDir, bool stretch, float alpha); - - IkConstraint(IkConstraintData &data, Skeleton &skeleton); - - /// Applies the constraint to the constrained bones. - void apply(); - - virtual void update(); - - virtual int getOrder(); - - IkConstraintData &getData(); - - Vector &getBones(); - - Bone *getTarget(); - - void setTarget(Bone *inValue); - - int getBendDirection(); - - void setBendDirection(int inValue); - - bool getCompress(); - - void setCompress(bool inValue); - - bool getStretch(); - - void setStretch(bool inValue); - - float getMix(); - - void setMix(float inValue); - -private: - IkConstraintData &_data; - Vector _bones; - int _bendDirection; - bool _compress; - bool _stretch; - float _mix; - Bone *_target; -}; -} - -#endif /* Spine_IkConstraint_h */ diff --git a/native/cocos/editor-support/spine/IkConstraintData.cpp b/native/cocos/editor-support/spine/IkConstraintData.cpp deleted file mode 100644 index 149ab0e715..0000000000 --- a/native/cocos/editor-support/spine/IkConstraintData.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include - -using namespace spine; - -IkConstraintData::IkConstraintData(const String &name) : - _name(name), - _order(0), - _target(NULL), - _bendDirection(1), - _compress(false), - _stretch(false), - _uniform(false), - _mix(1) { -} - -const String &IkConstraintData::getName() { - return _name; -} - -size_t IkConstraintData::getOrder() { - return _order; -} - -void IkConstraintData::setOrder(size_t inValue) { - _order = inValue; -} - -Vector &IkConstraintData::getBones() { - return _bones; -} - -BoneData *IkConstraintData::getTarget() { - return _target; -} - -void IkConstraintData::setTarget(BoneData *inValue) { - _target = inValue; -} - -int IkConstraintData::getBendDirection() { - return _bendDirection; -} - -void IkConstraintData::setBendDirection(int inValue) { - _bendDirection = inValue; -} - -float IkConstraintData::getMix() { - return _mix; -} - -void IkConstraintData::setMix(float inValue) { - _mix = inValue; -} - -bool IkConstraintData::getStretch() { - return _stretch; -} - -void IkConstraintData::setStretch(bool inValue) { - _stretch = inValue; -} - -bool IkConstraintData::getCompress() { - return _compress; -} - -void IkConstraintData::setCompress(bool inValue) { - _compress = inValue; -} - - -bool IkConstraintData::getUniform() { - return _uniform; -} - -void IkConstraintData::setUniform(bool inValue) { - _uniform = inValue; -} diff --git a/native/cocos/editor-support/spine/IkConstraintData.h b/native/cocos/editor-support/spine/IkConstraintData.h deleted file mode 100644 index 7432e497a6..0000000000 --- a/native/cocos/editor-support/spine/IkConstraintData.h +++ /dev/null @@ -1,93 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_IkConstraintData_h -#define Spine_IkConstraintData_h - -#include -#include -#include - -namespace spine { - class BoneData; - - class SP_API IkConstraintData : public SpineObject { - friend class SkeletonBinary; - friend class SkeletonJson; - friend class IkConstraint; - friend class Skeleton; - friend class IkConstraintTimeline; - - public: - explicit IkConstraintData(const String& name); - - /// The IK constraint's name, which is unique within the skeleton. - const String& getName(); - - size_t getOrder(); - void setOrder(size_t inValue); - - /// The bones that are constrained by this IK Constraint. - Vector& getBones(); - - /// The bone that is the IK target. - BoneData* getTarget(); - void setTarget(BoneData* inValue); - - /// Controls the bend direction of the IK bones, either 1 or -1. - int getBendDirection(); - void setBendDirection(int inValue); - - bool getCompress(); - void setCompress(bool inValue); - - bool getStretch(); - void setStretch(bool inValue); - - bool getUniform(); - void setUniform(bool inValue); - - float getMix(); - void setMix(float inValue); - - private: - const String _name; - size_t _order; - Vector _bones; - BoneData* _target; - int _bendDirection; - bool _compress; - bool _stretch; - bool _uniform; - float _mix; - }; -} - -#endif /* Spine_IkConstraintData_h */ diff --git a/native/cocos/editor-support/spine/IkConstraintTimeline.cpp b/native/cocos/editor-support/spine/IkConstraintTimeline.cpp deleted file mode 100644 index 6293964e04..0000000000 --- a/native/cocos/editor-support/spine/IkConstraintTimeline.cpp +++ /dev/null @@ -1,157 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -using namespace spine; - -RTTI_IMPL(IkConstraintTimeline, CurveTimeline) - -const int IkConstraintTimeline::ENTRIES = 5; -const int IkConstraintTimeline::PREV_TIME = -5; -const int IkConstraintTimeline::PREV_MIX = -4; -const int IkConstraintTimeline::PREV_BEND_DIRECTION = -3; -const int IkConstraintTimeline::PREV_COMPRESS = -2; -const int IkConstraintTimeline::PREV_STRETCH = -1; -const int IkConstraintTimeline::MIX = 1; -const int IkConstraintTimeline::BEND_DIRECTION = 2; -const int IkConstraintTimeline::COMPRESS = 3; -const int IkConstraintTimeline::STRETCH = 4; - -IkConstraintTimeline::IkConstraintTimeline(int frameCount) : CurveTimeline(frameCount), _ikConstraintIndex(0) { - _frames.setSize(frameCount * ENTRIES, 0); -} - -void IkConstraintTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, - MixBlend blend, MixDirection direction) { - SP_UNUSED(lastTime); - SP_UNUSED(pEvents); - - IkConstraint *constraintP = skeleton._ikConstraints[_ikConstraintIndex]; - IkConstraint &constraint = *constraintP; - if (time < _frames[0]) { - switch (blend) { - case MixBlend_Setup: - constraint._mix = constraint._data._mix; - constraint._bendDirection = constraint._data._bendDirection; - constraint._compress = constraint._data._compress; - constraint._stretch = constraint._data._stretch; - return; - case MixBlend_First: - constraint._mix += (constraint._data._mix - constraint._mix) * alpha; - constraint._bendDirection = constraint._data._bendDirection; - constraint._compress = constraint._data._compress; - constraint._stretch = constraint._data._stretch; - return; - default: - return; - } - } - - if (time >= _frames[_frames.size() - ENTRIES]) { - // Time is after last frame. - if (blend == MixBlend_Setup) { - constraint._mix = - constraint._data._mix + (_frames[_frames.size() + PREV_MIX] - constraint._data._mix) * alpha; - if (direction == MixDirection_Out) { - constraint._bendDirection = constraint._data._bendDirection; - constraint._compress = constraint._data._compress; - constraint._stretch = constraint._data._stretch; - } else { - constraint._bendDirection = (int) _frames[_frames.size() + PREV_BEND_DIRECTION]; - constraint._compress = _frames[_frames.size() + PREV_COMPRESS] != 0; - constraint._stretch = _frames[_frames.size() + PREV_STRETCH] != 0; - } - } else { - constraint._mix += (_frames[_frames.size() + PREV_MIX] - constraint._mix) * alpha; - if (direction == MixDirection_In) { - constraint._bendDirection = (int) _frames[_frames.size() + PREV_BEND_DIRECTION]; - constraint._compress = _frames[_frames.size() + PREV_COMPRESS] != 0; - constraint._stretch = _frames[_frames.size() + PREV_STRETCH] != 0; - } - } - return; - } - - // Interpolate between the previous frame and the current frame. - int frame = Animation::binarySearch(_frames, time, ENTRIES); - float mix = _frames[frame + PREV_MIX]; - float frameTime = _frames[frame]; - float percent = getCurvePercent(frame / ENTRIES - 1, - 1 - (time - frameTime) / (_frames[frame + PREV_TIME] - frameTime)); - - if (blend == MixBlend_Setup) { - constraint._mix = - constraint._data._mix + (mix + (_frames[frame + MIX] - mix) * percent - constraint._data._mix) * alpha; - if (direction == MixDirection_Out) { - constraint._bendDirection = constraint._data._bendDirection; - constraint._compress = constraint._data._compress; - constraint._stretch = constraint._data._stretch; - } else { - constraint._bendDirection = (int) _frames[_frames.size() + PREV_BEND_DIRECTION]; - constraint._compress = _frames[frame + PREV_COMPRESS] != 0; - constraint._stretch = _frames[frame + PREV_STRETCH] != 0; - } - } else { - constraint._mix += (mix + (_frames[frame + MIX] - mix) * percent - constraint._mix) * alpha; - if (direction == MixDirection_In) { - constraint._bendDirection = (int) _frames[frame + PREV_BEND_DIRECTION]; - constraint._compress = _frames[frame + PREV_COMPRESS] != 0; - constraint._stretch = _frames[frame + PREV_STRETCH] != 0; - } - } -} - -int IkConstraintTimeline::getPropertyId() { - return ((int) TimelineType_IkConstraint << 24) + _ikConstraintIndex; -} - -void IkConstraintTimeline::setFrame(int frameIndex, float time, float mix, int bendDirection, bool compress, bool stretch) { - frameIndex *= ENTRIES; - _frames[frameIndex] = time; - _frames[frameIndex + MIX] = mix; - _frames[frameIndex + BEND_DIRECTION] = (float)bendDirection; - _frames[frameIndex + COMPRESS] = compress ? 1 : 0; - _frames[frameIndex + STRETCH] = stretch ? 1 : 0; -} diff --git a/native/cocos/editor-support/spine/IkConstraintTimeline.h b/native/cocos/editor-support/spine/IkConstraintTimeline.h deleted file mode 100644 index 82001b994e..0000000000 --- a/native/cocos/editor-support/spine/IkConstraintTimeline.h +++ /dev/null @@ -1,72 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_IkConstraintTimeline_h -#define Spine_IkConstraintTimeline_h - -#include - -namespace spine { - - class SP_API IkConstraintTimeline : public CurveTimeline { - friend class SkeletonBinary; - friend class SkeletonJson; - - RTTI_DECL - - public: - static const int ENTRIES; - - explicit IkConstraintTimeline(int frameCount); - - virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector* pEvents, float alpha, MixBlend blend, MixDirection direction); - - virtual int getPropertyId(); - - /// Sets the time, mix and bend direction of the specified keyframe. - void setFrame (int frameIndex, float time, float mix, int bendDirection, bool compress, bool stretch); - - private: - static const int PREV_TIME; - static const int PREV_MIX; - static const int PREV_BEND_DIRECTION; - static const int PREV_COMPRESS; - static const int PREV_STRETCH; - static const int MIX; - static const int BEND_DIRECTION; - static const int COMPRESS; - static const int STRETCH; - - Vector _frames; - int _ikConstraintIndex; - }; -} - -#endif /* Spine_IkConstraintTimeline_h */ diff --git a/native/cocos/editor-support/spine/Json.cpp b/native/cocos/editor-support/spine/Json.cpp deleted file mode 100644 index e3817b6d96..0000000000 --- a/native/cocos/editor-support/spine/Json.cpp +++ /dev/null @@ -1,544 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -/* Json */ -/* JSON parser in CPP, shamelessly ripped from json.c in the spine-c runtime */ - -#ifndef _DEFAULT_SOURCE -/* Bring strings.h definitions into string.h, where appropriate */ -#define _DEFAULT_SOURCE -#endif - -#ifndef _BSD_SOURCE -/* Bring strings.h definitions into string.h, where appropriate */ -#define _BSD_SOURCE -#endif - -#include -#include -#include - -#include -#include - -using namespace spine; - -const int Json::JSON_FALSE = 0; -const int Json::JSON_TRUE = 1; -const int Json::JSON_NULL = 2; -const int Json::JSON_NUMBER = 3; -const int Json::JSON_STRING = 4; -const int Json::JSON_ARRAY = 5; -const int Json::JSON_OBJECT = 6; - -const char *Json::_error = NULL; - -Json *Json::getItem(Json *object, const char *string) { - Json *c = object->_child; - while (c && json_strcasecmp(c->_name, string)) { - c = c->_next; - } - return c; -} - -const char *Json::getString(Json *object, const char *name, const char *defaultValue) { - object = getItem(object, name); - if (object) { - return object->_valueString; - } - - return defaultValue; -} - -float Json::getFloat(Json *value, const char *name, float defaultValue) { - value = getItem(value, name); - return value ? value->_valueFloat : defaultValue; -} - -int Json::getInt(Json *value, const char *name, int defaultValue) { - value = getItem(value, name); - return value ? value->_valueInt : defaultValue; -} - -const char *Json::getError() { - return _error; -} - -Json::Json(const char *value) : - _next(NULL), -#if SPINE_JSON_HAVE_PREV - _prev(NULL), -#endif - _child(NULL), - _type(0), - _size(0), - _valueString(NULL), - _valueInt(0), - _valueFloat(0), - _name(NULL) { - if (value) { - value = parseValue(this, skip(value)); - - assert(value); - } -} - -Json::~Json() { - delete _child; - - if (_valueString) { - SpineExtension::free(_valueString, __FILE__, __LINE__); - } - - if (_name) { - SpineExtension::free(_name, __FILE__, __LINE__); - } - - delete _next; -} - -const char *Json::skip(const char *inValue) { - if (!inValue) { - /* must propagate NULL since it's often called in skip(f(...)) form */ - return NULL; - } - - while (*inValue && (unsigned char) *inValue <= 32) { - inValue++; - } - - return inValue; -} - -const char *Json::parseValue(Json *item, const char *value) { - /* Referenced by constructor, parseArray(), and parseObject(). */ - /* Always called with the result of skip(). */ -#ifdef SPINE_JSON_DEBUG /* Checked at entry to graph, constructor, and after every parse call. */ - if (!value) { - /* Fail on null. */ - return NULL; - } -#endif - - switch (*value) { - case 'n': { - if (!strncmp(value + 1, "ull", 3)) { - item->_type = JSON_NULL; - return value + 4; - } - break; - } - case 'f': { - if (!strncmp(value + 1, "alse", 4)) { - item->_type = JSON_FALSE; - /* calloc prevents us needing item->_type = JSON_FALSE or valueInt = 0 here */ - return value + 5; - } - break; - } - case 't': { - if (!strncmp(value + 1, "rue", 3)) { - item->_type = JSON_TRUE; - item->_valueInt = 1; - return value + 4; - } - break; - } - case '\"': - return parseString(item, value); - case '[': - return parseArray(item, value); - case '{': - return parseObject(item, value); - case '-': /* fallthrough */ - case '0': /* fallthrough */ - case '1': /* fallthrough */ - case '2': /* fallthrough */ - case '3': /* fallthrough */ - case '4': /* fallthrough */ - case '5': /* fallthrough */ - case '6': /* fallthrough */ - case '7': /* fallthrough */ - case '8': /* fallthrough */ - case '9': - return parseNumber(item, value); - default: - break; - } - - _error = value; - return NULL; /* failure. */ -} - -static const unsigned char firstByteMark[7] = {0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC}; - -const char *Json::parseString(Json *item, const char *str) { - const char *ptr = str + 1; - char *ptr2; - char *out; - int len = 0; - unsigned uc, uc2; - if (*str != '\"') { - /* TODO: don't need this check when called from parseValue, but do need from parseObject */ - _error = str; - return 0; - } /* not a string! */ - - while (*ptr != '\"' && *ptr && ++len) { - if (*ptr++ == '\\') { - ptr++; /* Skip escaped quotes. */ - } - } - - out = SpineExtension::alloc(len + 1, __FILE__, __LINE__); /* The length needed for the string, roughly. */ - if (!out) { - return 0; - } - - ptr = str + 1; - ptr2 = out; - while (*ptr != '\"' && *ptr) { - if (*ptr != '\\') { - *ptr2++ = *ptr++; - } else { - ptr++; - switch (*ptr) { - case 'b': - *ptr2++ = '\b'; - break; - case 'f': - *ptr2++ = '\f'; - break; - case 'n': - *ptr2++ = '\n'; - break; - case 'r': - *ptr2++ = '\r'; - break; - case 't': - *ptr2++ = '\t'; - break; - case 'u': { - /* transcode utf16 to utf8. */ - sscanf(ptr + 1, "%4x", &uc); - ptr += 4; /* get the unicode char. */ - - if ((uc >= 0xDC00 && uc <= 0xDFFF) || uc == 0) { - break; /* check for invalid. */ - } - - /* TODO provide an option to ignore surrogates, use unicode replacement character? */ - if (uc >= 0xD800 && uc <= 0xDBFF) /* UTF16 surrogate pairs. */ { - if (ptr[1] != '\\' || ptr[2] != 'u') { - break; /* missing second-half of surrogate. */ - } - sscanf(ptr + 3, "%4x", &uc2); - ptr += 6; - if (uc2 < 0xDC00 || uc2 > 0xDFFF) { - break; /* invalid second-half of surrogate. */ - } - uc = 0x10000 + (((uc & 0x3FF) << 10) | (uc2 & 0x3FF)); - } - - len = 4; - if (uc < 0x80) { - len = 1; - } else if (uc < 0x800) { - len = 2; - } else if (uc < 0x10000) { - len = 3; - } - ptr2 += len; - - switch (len) { - case 4: - *--ptr2 = ((uc | 0x80) & 0xBF); - uc >>= 6; - /* fallthrough */ - case 3: - *--ptr2 = ((uc | 0x80) & 0xBF); - uc >>= 6; - /* fallthrough */ - case 2: - *--ptr2 = ((uc | 0x80) & 0xBF); - uc >>= 6; - /* fallthrough */ - case 1: - *--ptr2 = (uc | firstByteMark[len]); - } - ptr2 += len; - break; - } - default: - *ptr2++ = *ptr; - break; - } - ptr++; - } - } - - *ptr2 = 0; - - if (*ptr == '\"') { - ptr++; /* TODO error handling if not \" or \0 ? */ - } - - item->_valueString = out; - item->_type = JSON_STRING; - - return ptr; -} - -const char *Json::parseNumber(Json *item, const char *num) { - double result = 0.0; - int negative = 0; - char *ptr = (char *) num; - - if (*ptr == '-') { - negative = -1; - ++ptr; - } - - while (*ptr >= '0' && *ptr <= '9') { - result = result * 10.0 + (*ptr - '0'); - ++ptr; - } - - if (*ptr == '.') { - double fraction = 0.0; - int n = 0; - ++ptr; - - while (*ptr >= '0' && *ptr <= '9') { - fraction = (fraction * 10.0) + (*ptr - '0'); - ++ptr; - ++n; - } - result += fraction / pow(10.0, n); - } - - if (negative) { - result = -result; - } - - if (*ptr == 'e' || *ptr == 'E') { - double exponent = 0; - int expNegative = 0; - int n = 0; - ++ptr; - - if (*ptr == '-') { - expNegative = -1; - ++ptr; - } else if (*ptr == '+') { - ++ptr; - } - - while (*ptr >= '0' && *ptr <= '9') { - exponent = (exponent * 10.0) + (*ptr - '0'); - ++ptr; - ++n; - } - - if (expNegative) { - result = result / pow(10, exponent); - } else { - result = result * pow(10, exponent); - } - } - - if (ptr != num) { - /* Parse success, number found. */ - item->_valueFloat = (float)result; - item->_valueInt = (int)result; - item->_type = JSON_NUMBER; - return ptr; - } else { - /* Parse failure, _error is set. */ - _error = num; - return NULL; - } -} - -const char *Json::parseArray(Json *item, const char *value) { - Json *child; - -#ifdef SPINE_JSON_DEBUG /* unnecessary, only callsite (parse_value) verifies this */ - if (*value != '[') { - ep = value; - return 0; - } /* not an array! */ -#endif - - item->_type = JSON_ARRAY; - value = skip(value + 1); - if (*value == ']') { - return value + 1; /* empty array. */ - } - - item->_child = child = new Json(NULL); - if (!item->_child) { - return NULL; /* memory fail */ - } - - value = skip(parseValue(child, skip(value))); /* skip any spacing, get the value. */ - - if (!value) { - return NULL; - } - - item->_size = 1; - - while (*value == ',') { - Json *new_item = new Json(NULL); - if (!new_item) { - return NULL; /* memory fail */ - } - child->_next = new_item; -#if SPINE_JSON_HAVE_PREV - new_item->prev = child; -#endif - child = new_item; - value = skip(parseValue(child, skip(value + 1))); - if (!value) { - return NULL; /* parse fail */ - } - item->_size++; - } - - if (*value == ']') { - return value + 1; /* end of array */ - } - - _error = value; - - return NULL; /* malformed. */ -} - -/* Build an object from the text. */ -const char *Json::parseObject(Json *item, const char *value) { - Json *child; - -#ifdef SPINE_JSON_DEBUG /* unnecessary, only callsite (parse_value) verifies this */ - if (*value != '{') { - ep = value; - return 0; - } /* not an object! */ -#endif - - item->_type = JSON_OBJECT; - value = skip(value + 1); - if (*value == '}') { - return value + 1; /* empty array. */ - } - - item->_child = child = new Json(NULL); - if (!item->_child) { - return NULL; - } - value = skip(parseString(child, skip(value))); - if (!value) { - return NULL; - } - child->_name = child->_valueString; - child->_valueString = 0; - if (*value != ':') { - _error = value; - return NULL; - } /* fail! */ - - value = skip(parseValue(child, skip(value + 1))); /* skip any spacing, get the value. */ - if (!value) { - return NULL; - } - - item->_size = 1; - - while (*value == ',') { - Json *new_item = new Json(NULL); - if (!new_item) { - return NULL; /* memory fail */ - } - child->_next = new_item; -#if SPINE_JSON_HAVE_PREV - new_item->prev = child; -#endif - child = new_item; - value = skip(parseString(child, skip(value + 1))); - if (!value) { - return NULL; - } - child->_name = child->_valueString; - child->_valueString = 0; - if (*value != ':') { - _error = value; - return NULL; - } /* fail! */ - - value = skip(parseValue(child, skip(value + 1))); /* skip any spacing, get the value. */ - if (!value) { - return NULL; - } - item->_size++; - } - - if (*value == '}') { - return value + 1; /* end of array */ - } - - _error = value; - - return NULL; /* malformed. */ -} - -int Json::json_strcasecmp(const char *s1, const char *s2) { - /* TODO we may be able to elide these NULL checks if we can prove - * the graph and input (only callsite is Json_getItem) should not have NULLs - */ - if (s1 && s2) { -#if defined(_WIN32) - return _stricmp(s1, s2); -#else - return strcasecmp(s1, s2); -#endif - } else { - if (s1 < s2) { - return -1; /* s1 is null, s2 is not */ - } else if (s1 == s2) { - return 0; /* both are null */ - } else { - return 1; /* s2 is nul s1 is not */ - } - } -} diff --git a/native/cocos/editor-support/spine/Json.h b/native/cocos/editor-support/spine/Json.h deleted file mode 100644 index 10cc30f7cf..0000000000 --- a/native/cocos/editor-support/spine/Json.h +++ /dev/null @@ -1,114 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_Json_h -#define Spine_Json_h - -#include - -#ifndef SPINE_JSON_HAVE_PREV -/* spine doesn't use the "prev" link in the Json sibling lists. */ -#define SPINE_JSON_HAVE_PREV 0 -#endif - -namespace spine { -class SP_API Json { - friend class SkeletonJson; - -public: - /* Json Types: */ - static const int JSON_FALSE; - static const int JSON_TRUE; - static const int JSON_NULL; - static const int JSON_NUMBER; - static const int JSON_STRING; - static const int JSON_ARRAY; - static const int JSON_OBJECT; - - /* Get item "string" from object. Case insensitive. */ - static Json *getItem(Json *object, const char *string); - - static const char *getString(Json *object, const char *name, const char *defaultValue); - - static float getFloat(Json *object, const char *name, float defaultValue); - - static int getInt(Json *object, const char *name, int defaultValue); - - /* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when Json_create() returns 0. 0 when Json_create() succeeds. */ - static const char *getError(); - - /* Supply a block of JSON, and this returns a Json object you can interrogate. Call Json_dispose when finished. */ - explicit Json(const char *value); - - ~Json(); - - - -private: - static const char *_error; - - Json *_next; -#if SPINE_JSON_HAVE_PREV - Json* _prev; /* next/prev allow you to walk array/object chains. Alternatively, use getSize/getItem */ -#endif - Json *_child; /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */ - - int _type; /* The type of the item, as above. */ - int _size; /* The number of children. */ - - const char *_valueString; /* The item's string, if type==JSON_STRING */ - int _valueInt; /* The item's number, if type==JSON_NUMBER */ - float _valueFloat; /* The item's number, if type==JSON_NUMBER */ - - const char *_name; /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */ - - /* Utility to jump whitespace and cr/lf */ - static const char *skip(const char *inValue); - - /* Parser core - when encountering text, process appropriately. */ - static const char *parseValue(Json *item, const char *value); - - /* Parse the input text into an unescaped cstring, and populate item. */ - static const char *parseString(Json *item, const char *str); - - /* Parse the input text to generate a number, and populate the result into item. */ - static const char *parseNumber(Json *item, const char *num); - - /* Build an array from input text. */ - static const char *parseArray(Json *item, const char *value); - - /* Build an object from the text. */ - static const char *parseObject(Json *item, const char *value); - - static int json_strcasecmp(const char *s1, const char *s2); -}; -} - -#endif /* Spine_Json_h */ diff --git a/native/cocos/editor-support/spine/LinkedMesh.cpp b/native/cocos/editor-support/spine/LinkedMesh.cpp deleted file mode 100644 index ee07057e58..0000000000 --- a/native/cocos/editor-support/spine/LinkedMesh.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include - -using namespace spine; - -LinkedMesh::LinkedMesh(MeshAttachment *mesh, const String &skin, size_t slotIndex, const String &parent) : - _mesh(mesh), - _skin(skin), - _slotIndex(slotIndex), - _parent(parent) { -} diff --git a/native/cocos/editor-support/spine/LinkedMesh.h b/native/cocos/editor-support/spine/LinkedMesh.h deleted file mode 100644 index b2086ac186..0000000000 --- a/native/cocos/editor-support/spine/LinkedMesh.h +++ /dev/null @@ -1,56 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_LinkedMesh_h -#define Spine_LinkedMesh_h - -#include -#include - -namespace spine { -class MeshAttachment; - -class SP_API LinkedMesh : public SpineObject { - friend class SkeletonBinary; - - friend class SkeletonJson; - -public: - LinkedMesh(MeshAttachment *mesh, const String &skin, size_t slotIndex, const String &parent); - -private: - MeshAttachment *_mesh; - String _skin; - size_t _slotIndex; - String _parent; -}; -} - -#endif /* Spine_LinkedMesh_h */ diff --git a/native/cocos/editor-support/spine/MathUtil.cpp b/native/cocos/editor-support/spine/MathUtil.cpp deleted file mode 100644 index 4304f9d17c..0000000000 --- a/native/cocos/editor-support/spine/MathUtil.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include -#include -#include -#include - -// Required for division by 0 in _isNaN on MSVC -#ifdef _MSC_VER -#pragma warning(disable:4723) -#endif - -using namespace spine; - -const float MathUtil::Pi = 3.1415926535897932385f; -const float MathUtil::Pi_2 = 3.1415926535897932385f * 2; -const float MathUtil::Deg_Rad = (3.1415926535897932385f / 180.0f); -const float MathUtil::Rad_Deg = (180.0f / 3.1415926535897932385f); - -float MathUtil::abs(float v) { - return ((v) < 0 ? -(v) : (v)); -} - -float MathUtil::sign(float v) { - return ((v) < 0 ? -1.0f : (v) > 0 ? 1.0f : 0.0f); -} - -float MathUtil::clamp(float x, float min, float max) { - return ((x) < (min) ? (min) : ((x) > (max) ? (max) : (x))); -} - -float MathUtil::fmod(float a, float b) { - return (float)::fmod(a, b); -} - -/// Returns atan2 in radians, faster but less accurate than Math.Atan2. Average error of 0.00231 radians (0.1323 -/// degrees), largest error of 0.00488 radians (0.2796 degrees). -float MathUtil::atan2(float y, float x) { - return (float)::atan2(y, x); -} - -/// Returns the cosine in radians from a lookup table. -float MathUtil::cos(float radians) { - return (float)::cos(radians); -} - -/// Returns the sine in radians from a lookup table. -float MathUtil::sin(float radians) { - return (float)::sin(radians); -} - -float MathUtil::sqrt(float v) { - return (float)::sqrt(v); -} - -float MathUtil::acos(float v) { - return (float)::acos(v); -} - -/// Returns the sine in radians from a lookup table. -float MathUtil::sinDeg(float degrees) { - return (float)::sin(degrees * MathUtil::Deg_Rad); -} - -/// Returns the cosine in radians from a lookup table. -float MathUtil::cosDeg(float degrees) { - return (float)::cos(degrees * MathUtil::Deg_Rad); -} - -/* Need to pass 0 as an argument, so VC++ doesn't error with C2124 */ -static bool _isNan(float value, float zero) { - float _nan = (float) 0.0 / zero; - return 0 == memcmp((void *) &value, (void *) &_nan, sizeof(value)); -} - -bool MathUtil::isNan(float v) { - return _isNan(v, 0); -} - -float MathUtil::random() { - return ::rand() / (float)RAND_MAX; -} - -float MathUtil::randomTriangular(float min, float max) { - return randomTriangular(min, max, (min + max) * 0.5f); -} - -float MathUtil::randomTriangular(float min, float max, float mode) { - float u = random(); - float d = max - min; - if (u <= (mode - min) / d) return min + sqrt(u * d * (mode - min)); - return max - sqrt((1 - u) * d * (max - mode)); -} - -float MathUtil::pow(float a, float b) { - return (float)::pow(a, b); -} diff --git a/native/cocos/editor-support/spine/MathUtil.h b/native/cocos/editor-support/spine/MathUtil.h deleted file mode 100644 index 44522d5a51..0000000000 --- a/native/cocos/editor-support/spine/MathUtil.h +++ /dev/null @@ -1,130 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_MathUtil_h -#define Spine_MathUtil_h - -#include - -#include - -namespace spine { - -class SP_API MathUtil : public SpineObject { -private: - MathUtil(); - -public: - static const float Pi; - static const float Pi_2; - static const float Deg_Rad; - static const float Rad_Deg; - - template - static inline T min(T a, T b) { return a < b ? a : b; } - - template - static inline T max(T a, T b) { return a > b ? a : b; } - - static float sign(float val); - - static float clamp(float x, float lower, float upper); - - static float abs(float v); - - /// Returns the sine in radians from a lookup table. - static float sin(float radians); - - /// Returns the cosine in radians from a lookup table. - static float cos(float radians); - - /// Returns the sine in radians from a lookup table. - static float sinDeg(float degrees); - - /// Returns the cosine in radians from a lookup table. - static float cosDeg(float degrees); - - /// Returns atan2 in radians, faster but less accurate than Math.Atan2. Average error of 0.00231 radians (0.1323 - /// degrees), largest error of 0.00488 radians (0.2796 degrees). - static float atan2(float y, float x); - - static float acos(float v); - - static float sqrt(float v); - - static float fmod(float a, float b); - - static bool isNan(float v); - - static float random(); - - static float randomTriangular(float min, float max); - - static float randomTriangular(float min, float max, float mode); - - static float pow(float a, float b); -}; - -struct SP_API Interpolation { - virtual float apply(float a) = 0; - - virtual float interpolate(float start, float end, float a) { - return start + (end - start) * apply(a); - } - - virtual ~Interpolation() {}; -}; - -struct SP_API PowInterpolation: public Interpolation { - PowInterpolation(int power): power(power) { - } - - float apply(float a) { - if (a <= 0.5f) return MathUtil::pow(a * 2.0f, (float)power) / 2.0f; - return MathUtil::pow((a - 1.0f) * 2.0f, (float)power) / (power % 2 == 0 ? -2.0f : 2.0f) + 1.0f; - } - - int power; -}; - -struct SP_API PowOutInterpolation: public Interpolation { - PowOutInterpolation(int power): power(power) { - } - - float apply(float a) { - return MathUtil::pow(a - 1, (float)power) * (power % 2 == 0 ? -1.0f : 1.0f) + 1.0f; - } - - int power; -}; - -} - -#endif /* Spine_MathUtil_h */ diff --git a/native/cocos/editor-support/spine/MeshAttachment.cpp b/native/cocos/editor-support/spine/MeshAttachment.cpp deleted file mode 100644 index 9058210944..0000000000 --- a/native/cocos/editor-support/spine/MeshAttachment.cpp +++ /dev/null @@ -1,264 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include -#include - -using namespace spine; - -RTTI_IMPL(MeshAttachment, VertexAttachment) - -MeshAttachment::MeshAttachment(const String &name) : VertexAttachment(name), HasRendererObject(), - _regionOffsetX(0), - _regionOffsetY(0), - _regionWidth(0), - _regionHeight(0), - _regionOriginalWidth(0), - _regionOriginalHeight(0), - _parentMesh(NULL), - _path(), - _regionU(0), - _regionV(0), - _regionU2(0), - _regionV2(0), - _width(0), - _height(0), - _color(1, 1, 1, 1), - _hullLength(0), - _inheritDeform(false), - _regionRotate(false) { -} - -MeshAttachment::~MeshAttachment() {} - -void MeshAttachment::updateUVs() { - if (_uvs.size() != _regionUVs.size()) { - _uvs.setSize(_regionUVs.size(), 0); - } - - if (_regionRotate) { - float textureHeight = _regionWidth / (_regionV2 - _regionV); - float textureWidth = _regionHeight / (_regionU2 - _regionU); - float u = _regionU - (_regionOriginalHeight - _regionOffsetY - _regionHeight) / textureWidth; - float v = _regionV - (_regionOriginalWidth - _regionOffsetX - _regionWidth) / textureHeight; - float width = _regionOriginalHeight / textureWidth; - float height = _regionOriginalWidth / textureHeight; - for (size_t i = 0, n = _uvs.size(); i < n; i += 2) { - _uvs[i] = u + _regionUVs[i + 1] * width; - _uvs[i + 1] = v + height - _regionUVs[i] * height; - } - } else { - float textureWidth = _regionWidth / (_regionU2 - _regionU); - float textureHeight = _regionHeight / (_regionV2 - _regionV); - float u = _regionU - _regionOffsetX / textureWidth; - float v = _regionV - (_regionOriginalHeight - _regionOffsetY - _regionHeight) / textureHeight; - float width = _regionOriginalWidth / textureWidth; - float height = _regionOriginalHeight / textureHeight; - for (size_t i = 0, n = _uvs.size(); i < n; i += 2) { - _uvs[i] = u + _regionUVs[i] * width; - _uvs[i + 1] = v + _regionUVs[i + 1] * height; - } - } -} - -bool MeshAttachment::applyDeform(VertexAttachment *sourceAttachment) { - return this == sourceAttachment || (_inheritDeform && _parentMesh == sourceAttachment); -} - -int MeshAttachment::getHullLength() { - return _hullLength; -} - -void MeshAttachment::setHullLength(int inValue) { - _hullLength = inValue; -} - -Vector &MeshAttachment::getRegionUVs() { - return _regionUVs; -} - -Vector &MeshAttachment::getUVs() { - return _uvs; -} - -Vector &MeshAttachment::getTriangles() { - return _triangles; -} - -const String &MeshAttachment::getPath() { - return _path; -} - -void MeshAttachment::setPath(const String &inValue) { - _path = inValue; -} - -float MeshAttachment::getRegionU() { - return _regionU; -} - -void MeshAttachment::setRegionU(float inValue) { - _regionU = inValue; -} - -float MeshAttachment::getRegionV() { - return _regionV; -} - -void MeshAttachment::setRegionV(float inValue) { - _regionV = inValue; -} - -float MeshAttachment::getRegionU2() { - return _regionU2; -} - -void MeshAttachment::setRegionU2(float inValue) { - _regionU2 = inValue; -} - -float MeshAttachment::getRegionV2() { - return _regionV2; -} - -void MeshAttachment::setRegionV2(float inValue) { - _regionV2 = inValue; -} - -bool MeshAttachment::getRegionRotate() { - return _regionRotate; -} - -void MeshAttachment::setRegionRotate(bool inValue) { - _regionRotate = inValue; -} - -float MeshAttachment::getRegionOffsetX() { - return _regionOffsetX; -} - -void MeshAttachment::setRegionOffsetX(float inValue) { - _regionOffsetX = inValue; -} - -float MeshAttachment::getRegionOffsetY() { - return _regionOffsetY; -} - -void MeshAttachment::setRegionOffsetY(float inValue) { - _regionOffsetY = inValue; -} - -float MeshAttachment::getRegionWidth() { - return _regionWidth; -} - -void MeshAttachment::setRegionWidth(float inValue) { - _regionWidth = inValue; -} - -float MeshAttachment::getRegionHeight() { - return _regionHeight; -} - -void MeshAttachment::setRegionHeight(float inValue) { - _regionHeight = inValue; -} - -float MeshAttachment::getRegionOriginalWidth() { - return _regionOriginalWidth; -} - -void MeshAttachment::setRegionOriginalWidth(float inValue) { - _regionOriginalWidth = inValue; -} - -float MeshAttachment::getRegionOriginalHeight() { - return _regionOriginalHeight; -} - -void MeshAttachment::setRegionOriginalHeight(float inValue) { - _regionOriginalHeight = inValue; -} - -bool MeshAttachment::getInheritDeform() { - return _inheritDeform; -} - -void MeshAttachment::setInheritDeform(bool inValue) { - _inheritDeform = inValue; -} - -MeshAttachment *MeshAttachment::getParentMesh() { - return _parentMesh; -} - -void MeshAttachment::setParentMesh(MeshAttachment *inValue) { - _parentMesh = inValue; - if (inValue != NULL) { - _bones.clearAndAddAll(inValue->_bones); - _vertices.clearAndAddAll(inValue->_vertices); - _worldVerticesLength = inValue->_worldVerticesLength; - _regionUVs.clearAndAddAll(inValue->_regionUVs); - _triangles.clearAndAddAll(inValue->_triangles); - _hullLength = inValue->_hullLength; - _edges.clearAndAddAll(inValue->_edges); - _width = inValue->_width; - _height = inValue->_height; - } -} - -Vector &MeshAttachment::getEdges() { - return _edges; -} - -float MeshAttachment::getWidth() { - return _width; -} - -void MeshAttachment::setWidth(float inValue) { - _width = inValue; -} - -float MeshAttachment::getHeight() { - return _height; -} - -void MeshAttachment::setHeight(float inValue) { - _height = inValue; -} - -spine::Color &MeshAttachment::getColor() { - return _color; -} diff --git a/native/cocos/editor-support/spine/MeshAttachment.h b/native/cocos/editor-support/spine/MeshAttachment.h deleted file mode 100644 index 8f42c5518b..0000000000 --- a/native/cocos/editor-support/spine/MeshAttachment.h +++ /dev/null @@ -1,142 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_MeshAttachment_h -#define Spine_MeshAttachment_h - -#include -#include -#include -#include - -namespace spine { - /// Attachment that displays a texture region using a mesh. - class SP_API MeshAttachment : public VertexAttachment, public HasRendererObject { - friend class SkeletonBinary; - friend class SkeletonJson; - friend class AtlasAttachmentLoader; - - RTTI_DECL - - public: - explicit MeshAttachment(const String& name); - - virtual ~MeshAttachment(); - - void updateUVs(); - - virtual bool applyDeform(VertexAttachment* sourceAttachment); - - int getHullLength(); - void setHullLength(int inValue); - - Vector& getRegionUVs(); - - /// The UV pair for each vertex, normalized within the entire texture. See also MeshAttachment::updateUVs - Vector& getUVs(); - - Vector& getTriangles(); - - Color& getColor(); - - const String& getPath(); - void setPath(const String& inValue); - - float getRegionU(); - void setRegionU(float inValue); - - float getRegionV(); - void setRegionV(float inValue); - - float getRegionU2(); - void setRegionU2(float inValue); - - float getRegionV2(); - void setRegionV2(float inValue); - - bool getRegionRotate(); - void setRegionRotate(bool inValue); - - float getRegionOffsetX(); - void setRegionOffsetX(float inValue); - - // Pixels stripped from the bottom left, unrotated. - float getRegionOffsetY(); - void setRegionOffsetY(float inValue); - - float getRegionWidth(); - void setRegionWidth(float inValue); - - // Unrotated, stripped size. - float getRegionHeight(); - void setRegionHeight(float inValue); - - float getRegionOriginalWidth(); - void setRegionOriginalWidth(float inValue); - - // Unrotated, unstripped size. - float getRegionOriginalHeight(); - void setRegionOriginalHeight(float inValue); - - bool getInheritDeform(); - void setInheritDeform(bool inValue); - - MeshAttachment* getParentMesh(); - void setParentMesh(MeshAttachment* inValue); - - // Nonessential. - Vector& getEdges(); - float getWidth(); - void setWidth(float inValue); - float getHeight(); - void setHeight(float inValue); - - private: - float _regionOffsetX, _regionOffsetY, _regionWidth, _regionHeight, _regionOriginalWidth, _regionOriginalHeight; - MeshAttachment* _parentMesh; - Vector _uvs; - Vector _regionUVs; - Vector _triangles; - Vector _edges; - String _path; - float _regionU; - float _regionV; - float _regionU2; - float _regionV2; - float _width; - float _height; - Color _color; - int _hullLength; - bool _inheritDeform; - bool _regionRotate; - }; -} - -#endif /* Spine_MeshAttachment_h */ diff --git a/native/cocos/editor-support/spine/MixBlend.h b/native/cocos/editor-support/spine/MixBlend.h deleted file mode 100644 index 937f1d40ea..0000000000 --- a/native/cocos/editor-support/spine/MixBlend.h +++ /dev/null @@ -1,46 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_MixPose_h -#define Spine_MixPose_h - -namespace spine { -/// -/// Controls how a timeline is mixed with the setup or current pose. -/// See also Timeline::apply(Skeleton&, float, float, Vector&, float, Blend, MixDirection) -enum MixBlend { - MixBlend_Setup = 0, - MixBlend_First, - MixBlend_Replace, - MixBlend_Add -}; -} - -#endif /* Spine_MixPose_h */ diff --git a/native/cocos/editor-support/spine/MixDirection.h b/native/cocos/editor-support/spine/MixDirection.h deleted file mode 100644 index 6c758d0a8a..0000000000 --- a/native/cocos/editor-support/spine/MixDirection.h +++ /dev/null @@ -1,44 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_MixDirection_h -#define Spine_MixDirection_h - -namespace spine { -/// -/// Indicates whether a timeline's alpha is mixing out over time toward 0 (the setup or current pose) or mixing in toward 1 (the timeline's pose). -/// See also Timeline::apply(Skeleton&, float, float, Vector&, float, MixPose, MixDirection) -enum MixDirection { - MixDirection_In = 0, - MixDirection_Out -}; -} - -#endif /* Spine_MixDirection_h */ diff --git a/native/cocos/editor-support/spine/PathAttachment.cpp b/native/cocos/editor-support/spine/PathAttachment.cpp deleted file mode 100644 index bcf54c6e3d..0000000000 --- a/native/cocos/editor-support/spine/PathAttachment.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -using namespace spine; - -RTTI_IMPL(PathAttachment, VertexAttachment) - -PathAttachment::PathAttachment(const String &name) : VertexAttachment(name), _closed(false), _constantSpeed(false) { -} - -Vector &PathAttachment::getLengths() { - return _lengths; -} - -bool PathAttachment::isClosed() { - return _closed; -} - -void PathAttachment::setClosed(bool inValue) { - _closed = inValue; -} - -bool PathAttachment::isConstantSpeed() { - return _constantSpeed; -} - -void PathAttachment::setConstantSpeed(bool inValue) { - _constantSpeed = inValue; -} diff --git a/native/cocos/editor-support/spine/PathAttachment.h b/native/cocos/editor-support/spine/PathAttachment.h deleted file mode 100644 index bde8744904..0000000000 --- a/native/cocos/editor-support/spine/PathAttachment.h +++ /dev/null @@ -1,60 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_PathAttachment_h -#define Spine_PathAttachment_h - -#include - -namespace spine { - class SP_API PathAttachment : public VertexAttachment { - friend class SkeletonBinary; - friend class SkeletonJson; - - RTTI_DECL - - public: - explicit PathAttachment(const String& name); - - /// The length in the setup pose from the start of the path to the end of each curve. - Vector& getLengths(); - bool isClosed(); - void setClosed(bool inValue); - bool isConstantSpeed(); - void setConstantSpeed(bool inValue); - - private: - Vector _lengths; - bool _closed; - bool _constantSpeed; - }; -} - -#endif /* Spine_PathAttachment_h */ diff --git a/native/cocos/editor-support/spine/PathConstraint.cpp b/native/cocos/editor-support/spine/PathConstraint.cpp deleted file mode 100644 index 2796079c4c..0000000000 --- a/native/cocos/editor-support/spine/PathConstraint.cpp +++ /dev/null @@ -1,571 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include -#include -#include -#include - -#include -#include - -using namespace spine; - -RTTI_IMPL(PathConstraint, Constraint) - -const float PathConstraint::EPSILON = 0.00001f; -const int PathConstraint::NONE = -1; -const int PathConstraint::BEFORE = -2; -const int PathConstraint::AFTER = -3; - -PathConstraint::PathConstraint(PathConstraintData &data, Skeleton &skeleton) : Constraint(), - _data(data), - _target(skeleton.findSlot( - data.getTarget()->getName())), - _position(data.getPosition()), - _spacing(data.getSpacing()), - _rotateMix(data.getRotateMix()), - _translateMix(data.getTranslateMix()) { - _bones.ensureCapacity(_data.getBones().size()); - for (size_t i = 0; i < _data.getBones().size(); i++) { - BoneData *boneData = _data.getBones()[i]; - _bones.add(skeleton.findBone(boneData->getName())); - } - - _segments.setSize(10, 0); -} - -void PathConstraint::apply() { - update(); -} - -void PathConstraint::update() { - Attachment *baseAttachment = _target->getAttachment(); - if (baseAttachment == NULL || !baseAttachment->getRTTI().instanceOf(PathAttachment::rtti)) { - return; - } - - PathAttachment *attachment = static_cast(baseAttachment); - - float rotateMix = _rotateMix; - float translateMix = _translateMix; - bool translate = translateMix > 0; - bool rotate = rotateMix > 0; - if (!translate && !rotate) { - return; - } - - PathConstraintData &data = _data; - bool percentSpacing = data._spacingMode == SpacingMode_Percent; - RotateMode rotateMode = data._rotateMode; - bool tangents = rotateMode == RotateMode_Tangent, scale = rotateMode == RotateMode_ChainScale; - size_t boneCount = _bones.size(); - size_t spacesCount = tangents ? boneCount : boneCount + 1; - _spaces.setSize(spacesCount, 0); - float spacing = _spacing; - if (scale || !percentSpacing) { - if (scale) { - _lengths.setSize(boneCount, 0); - } - bool lengthSpacing = data._spacingMode == SpacingMode_Length; - - for (size_t i = 0, n = spacesCount - 1; i < n;) { - Bone *boneP = _bones[i]; - Bone &bone = *boneP; - float setupLength = bone._data.getLength(); - if (setupLength < PathConstraint::EPSILON) { - if (scale) { - _lengths[i] = 0; - } - _spaces[++i] = 0; - } else if (percentSpacing) { - if (scale) { - float x = setupLength * bone._a, y = setupLength * bone._c; - float length = MathUtil::sqrt(x * x + y * y); - _lengths[i] = length; - } - _spaces[++i] = spacing; - } else { - float x = setupLength * bone._a; - float y = setupLength * bone._c; - float length = MathUtil::sqrt(x * x + y * y); - if (scale) { - _lengths[i] = length; - } - - _spaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length / setupLength; - } - } - } else { - for (size_t i = 1; i < spacesCount; ++i) { - _spaces[i] = spacing; - } - } - - Vector& positions = computeWorldPositions(*attachment, spacesCount, tangents, - data.getPositionMode() == PositionMode_Percent, - percentSpacing); - float boneX = positions[0]; - float boneY = positions[1]; - float offsetRotation = data.getOffsetRotation(); - bool tip; - if (offsetRotation == 0) { - tip = rotateMode == RotateMode_Chain; - } else { - tip = false; - Bone &p = _target->getBone(); - offsetRotation *= p.getA() * p.getD() - p.getB() * p.getC() > 0 ? MathUtil::Deg_Rad : -MathUtil::Deg_Rad; - } - - for (size_t i = 0, p = 3; i < boneCount; i++, p += 3) { - Bone *boneP = _bones[i]; - Bone &bone = *boneP; - bone._worldX += (boneX - bone._worldX) * translateMix; - bone._worldY += (boneY - bone._worldY) * translateMix; - float x = positions[p]; - float y = positions[p + 1]; - float dx = x - boneX; - float dy = y - boneY; - if (scale) { - float length = _lengths[i]; - if (length >= PathConstraint::EPSILON) { - float s = (MathUtil::sqrt(dx * dx + dy * dy) / length - 1) * rotateMix + 1; - bone._a *= s; - bone._c *= s; - } - } - - boneX = x; - boneY = y; - - if (rotate) { - float a = bone._a, b = bone._b, c = bone._c, d = bone._d, r, cos, sin; - if (tangents) { - r = positions[p - 1]; - } else if (_spaces[i + 1] < PathConstraint::EPSILON) { - r = positions[p + 2]; - } else { - r = MathUtil::atan2(dy, dx); - } - - r -= MathUtil::atan2(c, a); - - if (tip) { - cos = MathUtil::cos(r); - sin = MathUtil::sin(r); - float length = bone._data.getLength(); - boneX += (length * (cos * a - sin * c) - dx) * rotateMix; - boneY += (length * (sin * a + cos * c) - dy) * rotateMix; - } else { - r += offsetRotation; - } - - if (r > MathUtil::Pi) { - r -= MathUtil::Pi_2; - } else if (r < -MathUtil::Pi) { - r += MathUtil::Pi_2; - } - - r *= rotateMix; - cos = MathUtil::cos(r); - sin = MathUtil::sin(r); - bone._a = cos * a - sin * c; - bone._b = cos * b - sin * d; - bone._c = sin * a + cos * c; - bone._d = sin * b + cos * d; - } - - bone._appliedValid = false; - } -} - -int PathConstraint::getOrder() { - return _data.getOrder(); -} - -float PathConstraint::getPosition() { - return _position; -} - -void PathConstraint::setPosition(float inValue) { - _position = inValue; -} - -float PathConstraint::getSpacing() { - return _spacing; -} - -void PathConstraint::setSpacing(float inValue) { - _spacing = inValue; -} - -float PathConstraint::getRotateMix() { - return _rotateMix; -} - -void PathConstraint::setRotateMix(float inValue) { - _rotateMix = inValue; -} - -float PathConstraint::getTranslateMix() { - return _translateMix; -} - -void PathConstraint::setTranslateMix(float inValue) { - _translateMix = inValue; -} - -Vector &PathConstraint::getBones() { - return _bones; -} - -Slot *PathConstraint::getTarget() { - return _target; -} - -void PathConstraint::setTarget(Slot *inValue) { - _target = inValue; -} - -PathConstraintData &PathConstraint::getData() { - return _data; -} - -Vector& -PathConstraint::computeWorldPositions(PathAttachment &path, int spacesCount, bool tangents, bool percentPosition, - bool percentSpacing) { - Slot &target = *_target; - float position = _position; - _positions.setSize(spacesCount * 3 + 2, 0); - Vector &out = _positions; - Vector &world = _world; - bool closed = path.isClosed(); - int verticesLength = path.getWorldVerticesLength(); - int curveCount = verticesLength / 6; - int prevCurve = NONE; - - float pathLength; - if (!path.isConstantSpeed()) { - Vector &lengths = path.getLengths(); - curveCount -= closed ? 1 : 2; - pathLength = lengths[curveCount]; - if (percentPosition) { - position *= pathLength; - } - - if (percentSpacing) { - for (int i = 1; i < spacesCount; ++i) { - _spaces[i] *= pathLength; - } - } - - world.setSize(8, 0); - for (int i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) { - float space = _spaces[i]; - position += space; - float p = position; - - if (closed) { - p = MathUtil::fmod(p, pathLength); - - if (p < 0) { - p += pathLength; - } - curve = 0; - } else if (p < 0) { - if (prevCurve != BEFORE) { - prevCurve = BEFORE; - path.computeWorldVertices(target, 2, 4, world, 0); - } - - addBeforePosition(p, world, 0, out, o); - - continue; - } else if (p > pathLength) { - if (prevCurve != AFTER) { - prevCurve = AFTER; - path.computeWorldVertices(target, verticesLength - 6, 4, world, 0); - } - - addAfterPosition(p - pathLength, world, 0, out, o); - - continue; - } - - // Determine curve containing position. - for (;; curve++) { - float length = lengths[curve]; - if (p > length) { - continue; - } - - if (curve == 0) { - p /= length; - } else { - float prev = lengths[curve - 1]; - p = (p - prev) / (length - prev); - } - break; - } - - if (curve != prevCurve) { - prevCurve = curve; - if (closed && curve == curveCount) { - path.computeWorldVertices(target, verticesLength - 4, 4, world, 0); - path.computeWorldVertices(target, 0, 4, world, 4); - } else { - path.computeWorldVertices(target, curve * 6 + 2, 8, world, 0); - } - } - - addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], - out, o, tangents || (i > 0 && space < EPSILON)); - } - return out; - } - - // World vertices. - if (closed) { - verticesLength += 2; - world.setSize(verticesLength, 0); - path.computeWorldVertices(target, 2, verticesLength - 4, world, 0); - path.computeWorldVertices(target, 0, 2, world, verticesLength - 4); - world[verticesLength - 2] = world[0]; - world[verticesLength - 1] = world[1]; - } else { - curveCount--; - verticesLength -= 4; - world.setSize(verticesLength, 0); - path.computeWorldVertices(target, 2, verticesLength, world, 0); - } - - // Curve lengths. - _curves.setSize(curveCount, 0); - pathLength = 0; - float x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0; - float tmpx, tmpy, dddfx, dddfy, ddfx, ddfy, dfx, dfy; - for (int i = 0, w = 2; i < curveCount; i++, w += 6) { - cx1 = world[w]; - cy1 = world[w + 1]; - cx2 = world[w + 2]; - cy2 = world[w + 3]; - x2 = world[w + 4]; - y2 = world[w + 5]; - tmpx = (x1 - cx1 * 2 + cx2) * 0.1875f; - tmpy = (y1 - cy1 * 2 + cy2) * 0.1875f; - dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375f; - dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375f; - ddfx = tmpx * 2 + dddfx; - ddfy = tmpy * 2 + dddfy; - dfx = (cx1 - x1) * 0.75f + tmpx + dddfx * 0.16666667f; - dfy = (cy1 - y1) * 0.75f + tmpy + dddfy * 0.16666667f; - pathLength += MathUtil::sqrt(dfx * dfx + dfy * dfy); - dfx += ddfx; - dfy += ddfy; - ddfx += dddfx; - ddfy += dddfy; - pathLength += MathUtil::sqrt(dfx * dfx + dfy * dfy); - dfx += ddfx; - dfy += ddfy; - pathLength += MathUtil::sqrt(dfx * dfx + dfy * dfy); - dfx += ddfx + dddfx; - dfy += ddfy + dddfy; - pathLength += MathUtil::sqrt(dfx * dfx + dfy * dfy); - _curves[i] = pathLength; - x1 = x2; - y1 = y2; - } - - if (percentPosition) { - position *= pathLength; - } else { - position *= pathLength / path.getLengths()[curveCount - 1]; - } - - if (percentSpacing) { - for (int i = 1; i < spacesCount; ++i) { - _spaces[i] *= pathLength; - } - } - - float curveLength = 0; - for (int i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) { - float space = _spaces[i]; - position += space; - float p = position; - - if (closed) { - p = MathUtil::fmod(p, pathLength); - - if (p < 0) { - p += pathLength; - } - curve = 0; - } else if (p < 0) { - addBeforePosition(p, world, 0, out, o); - continue; - } else if (p > pathLength) { - addAfterPosition(p - pathLength, world, verticesLength - 4, out, o); - continue; - } - - // Determine curve containing position. - for (;; curve++) { - float length = _curves[curve]; - if (p > length) { - continue; - } - - if (curve == 0) { - p /= length; - } else { - float prev = _curves[curve - 1]; - p = (p - prev) / (length - prev); - } - break; - } - - // Curve segment lengths. - if (curve != prevCurve) { - prevCurve = curve; - int ii = curve * 6; - x1 = world[ii]; - y1 = world[ii + 1]; - cx1 = world[ii + 2]; - cy1 = world[ii + 3]; - cx2 = world[ii + 4]; - cy2 = world[ii + 5]; - x2 = world[ii + 6]; - y2 = world[ii + 7]; - tmpx = (x1 - cx1 * 2 + cx2) * 0.03f; - tmpy = (y1 - cy1 * 2 + cy2) * 0.03f; - dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006f; - dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006f; - ddfx = tmpx * 2 + dddfx; - ddfy = tmpy * 2 + dddfy; - dfx = (cx1 - x1) * 0.3f + tmpx + dddfx * 0.16666667f; - dfy = (cy1 - y1) * 0.3f + tmpy + dddfy * 0.16666667f; - curveLength = MathUtil::sqrt(dfx * dfx + dfy * dfy); - _segments[0] = curveLength; - for (ii = 1; ii < 8; ii++) { - dfx += ddfx; - dfy += ddfy; - ddfx += dddfx; - ddfy += dddfy; - curveLength += MathUtil::sqrt(dfx * dfx + dfy * dfy); - _segments[ii] = curveLength; - } - dfx += ddfx; - dfy += ddfy; - curveLength += MathUtil::sqrt(dfx * dfx + dfy * dfy); - _segments[8] = curveLength; - dfx += ddfx + dddfx; - dfy += ddfy + dddfy; - curveLength += MathUtil::sqrt(dfx * dfx + dfy * dfy); - _segments[9] = curveLength; - segment = 0; - } - - // Weight by segment length. - p *= curveLength; - for (;; segment++) { - float length = _segments[segment]; - if (p > length) { - continue; - } - - if (segment == 0) { - p /= length; - } else { - float prev = _segments[segment - 1]; - p = segment + (p - prev) / (length - prev); - } - break; - } - addCurvePosition(p * 0.1f, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, - tangents || (i > 0 && space < EPSILON)); - } - - return out; -} - -void PathConstraint::addBeforePosition(float p, Vector &temp, int i, Vector &output, int o) { - float x1 = temp[i]; - float y1 = temp[i + 1]; - float dx = temp[i + 2] - x1; - float dy = temp[i + 3] - y1; - float r = MathUtil::atan2(dy, dx); - - output[o] = x1 + p * MathUtil::cos(r); - output[o + 1] = y1 + p * MathUtil::sin(r); - output[o + 2] = r; -} - -void PathConstraint::addAfterPosition(float p, Vector &temp, int i, Vector &output, int o) { - float x1 = temp[i + 2]; - float y1 = temp[i + 3]; - float dx = x1 - temp[i]; - float dy = y1 - temp[i + 1]; - float r = MathUtil::atan2(dy, dx); - output[o] = x1 + p * MathUtil::cos(r); - output[o + 1] = y1 + p * MathUtil::sin(r); - output[o + 2] = r; -} - -void PathConstraint::addCurvePosition(float p, float x1, float y1, float cx1, float cy1, float cx2, float cy2, float x2, - float y2, Vector &output, int o, bool tangents) { - if (p < EPSILON || MathUtil::isNan(p)) { - output[o] = x1; - output[o + 1] = y1; - output[o + 2] = MathUtil::atan2(cy1 - y1, cx1 - x1); - return; - } - - float tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u; - float ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p; - float x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt; - output[o] = x; - output[o + 1] = y; - if (tangents) { - if (p < 0.001) { - output[o + 2] = MathUtil::atan2(cy1 - y1, cx1 - x1); - } else { - output[o + 2] = MathUtil::atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), - x - (x1 * uu + cx1 * ut * 2 + cx2 * tt)); - } - } -} diff --git a/native/cocos/editor-support/spine/PathConstraint.h b/native/cocos/editor-support/spine/PathConstraint.h deleted file mode 100644 index 7a7632b7d0..0000000000 --- a/native/cocos/editor-support/spine/PathConstraint.h +++ /dev/null @@ -1,110 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_PathConstraint_h -#define Spine_PathConstraint_h - -#include - -#include - -namespace spine { - class PathConstraintData; - class Skeleton; - class PathAttachment; - class Bone; - class Slot; - - class SP_API PathConstraint : public Constraint { - friend class Skeleton; - friend class PathConstraintMixTimeline; - friend class PathConstraintPositionTimeline; - friend class PathConstraintSpacingTimeline; - - RTTI_DECL - - public: - PathConstraint(PathConstraintData& data, Skeleton& skeleton); - - /// Applies the constraint to the constrained bones. - void apply(); - - virtual void update(); - - virtual int getOrder(); - - float getPosition(); - void setPosition(float inValue); - - float getSpacing(); - void setSpacing(float inValue); - - float getRotateMix(); - void setRotateMix(float inValue); - - float getTranslateMix(); - void setTranslateMix(float inValue); - - Vector& getBones(); - - Slot* getTarget(); - void setTarget(Slot* inValue); - - PathConstraintData& getData(); - - private: - static const float EPSILON; - static const int NONE; - static const int BEFORE; - static const int AFTER; - - PathConstraintData& _data; - Vector _bones; - Slot* _target; - float _position, _spacing, _rotateMix, _translateMix; - - Vector _spaces; - Vector _positions; - Vector _world; - Vector _curves; - Vector _lengths; - Vector _segments; - - Vector& computeWorldPositions(PathAttachment& path, int spacesCount, bool tangents, bool percentPosition, bool percentSpacing); - - static void addBeforePosition(float p, Vector& temp, int i, Vector& output, int o); - - static void addAfterPosition(float p, Vector& temp, int i, Vector& output, int o); - - static void addCurvePosition(float p, float x1, float y1, float cx1, float cy1, float cx2, float cy2, float x2, float y2, Vector& output, int o, bool tangents); - }; -} - -#endif /* Spine_PathConstraint_h */ diff --git a/native/cocos/editor-support/spine/PathConstraintData.cpp b/native/cocos/editor-support/spine/PathConstraintData.cpp deleted file mode 100644 index 381030dc2b..0000000000 --- a/native/cocos/editor-support/spine/PathConstraintData.cpp +++ /dev/null @@ -1,145 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include - -#include - -using namespace spine; - -PathConstraintData::PathConstraintData(const String &name) : - _name(name), - _order(0), - _target(NULL), - _positionMode(PositionMode_Fixed), - _spacingMode(SpacingMode_Length), - _rotateMode(RotateMode_Tangent), - _offsetRotation(0), - _position(0), - _spacing(0), - _rotateMix(0), - _translateMix(0) { - assert(_name.length() > 0); -} - -const String &PathConstraintData::getName() { - return _name; -} - -int PathConstraintData::getOrder() { - return _order; -} - -void PathConstraintData::setOrder(int inValue) { - _order = inValue; -} - -Vector &PathConstraintData::getBones() { - return _bones; -} - -SlotData *PathConstraintData::getTarget() { - return _target; -} - -void PathConstraintData::setTarget(SlotData *inValue) { - _target = inValue; -} - -PositionMode PathConstraintData::getPositionMode() { - return _positionMode; -} - -void PathConstraintData::setPositionMode(PositionMode inValue) { - _positionMode = inValue; -} - -SpacingMode PathConstraintData::getSpacingMode() { - return _spacingMode; -} - -void PathConstraintData::setSpacingMode(SpacingMode inValue) { - _spacingMode = inValue; -} - -RotateMode PathConstraintData::getRotateMode() { - return _rotateMode; -} - -void PathConstraintData::setRotateMode(RotateMode inValue) { - _rotateMode = inValue; -} - -float PathConstraintData::getOffsetRotation() { - return _offsetRotation; -} - -void PathConstraintData::setOffsetRotation(float inValue) { - _offsetRotation = inValue; -} - -float PathConstraintData::getPosition() { - return _position; -} - -void PathConstraintData::setPosition(float inValue) { - _position = inValue; -} - -float PathConstraintData::getSpacing() { - return _spacing; -} - -void PathConstraintData::setSpacing(float inValue) { - _spacing = inValue; -} - -float PathConstraintData::getRotateMix() { - return _rotateMix; -} - -void PathConstraintData::setRotateMix(float inValue) { - _rotateMix = inValue; -} - -float PathConstraintData::getTranslateMix() { - return _translateMix; -} - -void PathConstraintData::setTranslateMix(float inValue) { - _translateMix = inValue; -} diff --git a/native/cocos/editor-support/spine/PathConstraintData.h b/native/cocos/editor-support/spine/PathConstraintData.h deleted file mode 100644 index ee86ecd5ca..0000000000 --- a/native/cocos/editor-support/spine/PathConstraintData.h +++ /dev/null @@ -1,105 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_PathConstraintData_h -#define Spine_PathConstraintData_h - -#include -#include -#include -#include -#include -#include - -namespace spine { - class BoneData; - class SlotData; - - class SP_API PathConstraintData : public SpineObject { - friend class SkeletonBinary; - friend class SkeletonJson; - - friend class PathConstraint; - friend class Skeleton; - friend class PathConstraintMixTimeline; - friend class PathConstraintPositionTimeline; - friend class PathConstraintSpacingTimeline; - - public: - explicit PathConstraintData(const String& name); - - const String& getName(); - - int getOrder(); - void setOrder(int inValue); - - Vector& getBones(); - - SlotData* getTarget(); - void setTarget(SlotData* inValue); - - PositionMode getPositionMode(); - void setPositionMode(PositionMode inValue); - - SpacingMode getSpacingMode(); - void setSpacingMode(SpacingMode inValue); - - RotateMode getRotateMode(); - void setRotateMode(RotateMode inValue); - - float getOffsetRotation(); - void setOffsetRotation(float inValue); - - float getPosition(); - void setPosition(float inValue); - - float getSpacing(); - void setSpacing(float inValue); - - float getRotateMix(); - void setRotateMix(float inValue); - - float getTranslateMix(); - void setTranslateMix(float inValue); - - private: - const String _name; - int _order; - Vector _bones; - SlotData* _target; - PositionMode _positionMode; - SpacingMode _spacingMode; - RotateMode _rotateMode; - float _offsetRotation; - float _position, _spacing, _rotateMix, _translateMix; - }; -} - -#endif /* Spine_PathConstraintData_h */ diff --git a/native/cocos/editor-support/spine/PathConstraintMixTimeline.cpp b/native/cocos/editor-support/spine/PathConstraintMixTimeline.cpp deleted file mode 100644 index a879bdbf8a..0000000000 --- a/native/cocos/editor-support/spine/PathConstraintMixTimeline.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -using namespace spine; - -RTTI_IMPL(PathConstraintMixTimeline, CurveTimeline) - -const int PathConstraintMixTimeline::ENTRIES = 3; -const int PathConstraintMixTimeline::PREV_TIME = -3; -const int PathConstraintMixTimeline::PREV_ROTATE = -2; -const int PathConstraintMixTimeline::PREV_TRANSLATE = -1; -const int PathConstraintMixTimeline::ROTATE = 1; -const int PathConstraintMixTimeline::TRANSLATE = 2; - -PathConstraintMixTimeline::PathConstraintMixTimeline(int frameCount) : CurveTimeline(frameCount), - _pathConstraintIndex(0) { - _frames.setSize(frameCount * ENTRIES, 0); -} - -void -PathConstraintMixTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, - MixBlend blend, MixDirection direction) { - SP_UNUSED(lastTime); - SP_UNUSED(pEvents); - SP_UNUSED(direction); - - PathConstraint *constraintP = skeleton._pathConstraints[_pathConstraintIndex]; - PathConstraint &constraint = *constraintP; - if (time < _frames[0]) { - switch (blend) { - case MixBlend_Setup: - constraint._rotateMix = constraint._data._rotateMix; - constraint._translateMix = constraint._data._translateMix; - return; - case MixBlend_First: - constraint._rotateMix += (constraint._data._rotateMix - constraint._rotateMix) * alpha; - constraint._translateMix += (constraint._data._translateMix - constraint._translateMix) * alpha; - return; - default: - return; - } - } - - float rotate, translate; - if (time >= _frames[_frames.size() - ENTRIES]) { - // Time is after last frame. - rotate = _frames[_frames.size() + PREV_ROTATE]; - translate = _frames[_frames.size() + PREV_TRANSLATE]; - } else { - // Interpolate between the previous frame and the current frame. - int frame = Animation::binarySearch(_frames, time, ENTRIES); - rotate = _frames[frame + PREV_ROTATE]; - translate = _frames[frame + PREV_TRANSLATE]; - float frameTime = _frames[frame]; - float percent = getCurvePercent(frame / ENTRIES - 1, - 1 - (time - frameTime) / (_frames[frame + PREV_TIME] - frameTime)); - - rotate += (_frames[frame + ROTATE] - rotate) * percent; - translate += (_frames[frame + TRANSLATE] - translate) * percent; - } - - if (blend == MixBlend_Setup) { - constraint._rotateMix = constraint._data._rotateMix + (rotate - constraint._data._rotateMix) * alpha; - constraint._translateMix = - constraint._data._translateMix + (translate - constraint._data._translateMix) * alpha; - } else { - constraint._rotateMix += (rotate - constraint._rotateMix) * alpha; - constraint._translateMix += (translate - constraint._translateMix) * alpha; - } -} - -int PathConstraintMixTimeline::getPropertyId() { - return ((int) TimelineType_PathConstraintMix << 24) + _pathConstraintIndex; -} - -void PathConstraintMixTimeline::setFrame(int frameIndex, float time, float rotateMix, float translateMix) { - frameIndex *= ENTRIES; - _frames[frameIndex] = time; - _frames[frameIndex + ROTATE] = rotateMix; - _frames[frameIndex + TRANSLATE] = translateMix; -} diff --git a/native/cocos/editor-support/spine/PathConstraintMixTimeline.h b/native/cocos/editor-support/spine/PathConstraintMixTimeline.h deleted file mode 100644 index 0b53ede2ce..0000000000 --- a/native/cocos/editor-support/spine/PathConstraintMixTimeline.h +++ /dev/null @@ -1,69 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_PathConstraintMixTimeline_h -#define Spine_PathConstraintMixTimeline_h - -#include - -namespace spine { -#define SP_PATHCONSTRAINTMIXTIMELINE_ENTRIES 5 - - class SP_API PathConstraintMixTimeline : public CurveTimeline { - friend class SkeletonBinary; - friend class SkeletonJson; - - RTTI_DECL - - public: - static const int ENTRIES; - - explicit PathConstraintMixTimeline(int frameCount); - - virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector* pEvents, float alpha, MixBlend blend, MixDirection direction); - - virtual int getPropertyId(); - - private: - static const int PREV_TIME; - static const int PREV_ROTATE; - static const int PREV_TRANSLATE; - static const int ROTATE; - static const int TRANSLATE; - - Vector _frames; - int _pathConstraintIndex; - - /// Sets the time and mixes of the specified keyframe. - void setFrame(int frameIndex, float time, float rotateMix, float translateMix); - }; -} - -#endif /* Spine_PathConstraintMixTimeline_h */ diff --git a/native/cocos/editor-support/spine/PathConstraintPositionTimeline.cpp b/native/cocos/editor-support/spine/PathConstraintPositionTimeline.cpp deleted file mode 100644 index 55a8f76002..0000000000 --- a/native/cocos/editor-support/spine/PathConstraintPositionTimeline.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -using namespace spine; - -RTTI_IMPL(PathConstraintPositionTimeline, CurveTimeline) - -const int PathConstraintPositionTimeline::ENTRIES = 2; -const int PathConstraintPositionTimeline::PREV_TIME = -2; -const int PathConstraintPositionTimeline::PREV_VALUE = -1; -const int PathConstraintPositionTimeline::VALUE = 1; - -PathConstraintPositionTimeline::PathConstraintPositionTimeline(int frameCount) : CurveTimeline(frameCount), - _pathConstraintIndex(0) { - _frames.setSize(frameCount * ENTRIES, 0); -} - -PathConstraintPositionTimeline::~PathConstraintPositionTimeline() { -} - -void PathConstraintPositionTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, - float alpha, MixBlend blend, MixDirection direction) { - SP_UNUSED(lastTime); - SP_UNUSED(pEvents); - SP_UNUSED(direction); - - PathConstraint *constraintP = skeleton._pathConstraints[_pathConstraintIndex]; - PathConstraint &constraint = *constraintP; - if (time < _frames[0]) { - switch (blend) { - case MixBlend_Setup: - constraint._position = constraint._data._position; - return; - case MixBlend_First: - constraint._position += (constraint._data._position - constraint._position) * alpha; - return; - default: - return; - } - } - - float position; - if (time >= _frames[_frames.size() - ENTRIES]) { - // Time is after last frame. - position = _frames[_frames.size() + PREV_VALUE]; - } else { - // Interpolate between the previous frame and the current frame. - int frame = Animation::binarySearch(_frames, time, ENTRIES); - position = _frames[frame + PREV_VALUE]; - float frameTime = _frames[frame]; - float percent = getCurvePercent(frame / ENTRIES - 1, - 1 - (time - frameTime) / (_frames[frame + PREV_TIME] - frameTime)); - - position += (_frames[frame + VALUE] - position) * percent; - } - if (blend == MixBlend_Setup) { - constraint._position = constraint._data._position + (position - constraint._data._position) * alpha; - } else { - constraint._position += (position - constraint._position) * alpha; - } -} - -int PathConstraintPositionTimeline::getPropertyId() { - return ((int) TimelineType_PathConstraintPosition << 24) + _pathConstraintIndex; -} - -void PathConstraintPositionTimeline::setFrame(int frameIndex, float time, float value) { - frameIndex *= ENTRIES; - _frames[frameIndex] = time; - _frames[frameIndex + VALUE] = value; -} diff --git a/native/cocos/editor-support/spine/PathConstraintPositionTimeline.h b/native/cocos/editor-support/spine/PathConstraintPositionTimeline.h deleted file mode 100644 index a9ae41db9f..0000000000 --- a/native/cocos/editor-support/spine/PathConstraintPositionTimeline.h +++ /dev/null @@ -1,68 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_PathConstraintPositionTimeline_h -#define Spine_PathConstraintPositionTimeline_h - -#include - -namespace spine { - - class SP_API PathConstraintPositionTimeline : public CurveTimeline { - friend class SkeletonBinary; - friend class SkeletonJson; - - RTTI_DECL - - public: - static const int ENTRIES; - - explicit PathConstraintPositionTimeline(int frameCount); - - virtual ~PathConstraintPositionTimeline(); - - virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector* pEvents, float alpha, MixBlend blend, MixDirection direction); - - virtual int getPropertyId(); - - /// Sets the time and value of the specified keyframe. - void setFrame(int frameIndex, float time, float value); - - protected: - static const int PREV_TIME; - static const int PREV_VALUE; - static const int VALUE; - - Vector _frames; - int _pathConstraintIndex; - }; -} - -#endif /* Spine_PathConstraintPositionTimeline_h */ diff --git a/native/cocos/editor-support/spine/PathConstraintSpacingTimeline.cpp b/native/cocos/editor-support/spine/PathConstraintSpacingTimeline.cpp deleted file mode 100644 index c46c73bbf5..0000000000 --- a/native/cocos/editor-support/spine/PathConstraintSpacingTimeline.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -using namespace spine; - -RTTI_IMPL(PathConstraintSpacingTimeline, PathConstraintPositionTimeline) - -PathConstraintSpacingTimeline::PathConstraintSpacingTimeline(int frameCount) : PathConstraintPositionTimeline( - frameCount) { -} - -void PathConstraintSpacingTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, - float alpha, MixBlend blend, MixDirection direction) { - SP_UNUSED(lastTime); - SP_UNUSED(pEvents); - SP_UNUSED(direction); - - PathConstraint *constraintP = skeleton._pathConstraints[_pathConstraintIndex]; - PathConstraint &constraint = *constraintP; - if (time < _frames[0]) { - switch (blend) { - case MixBlend_Setup: - constraint._spacing = constraint._data._spacing; - return; - case MixBlend_First: - constraint._spacing += (constraint._data._spacing - constraint._spacing) * alpha; - return; - default: - return; - } - } - - float spacing; - if (time >= _frames[_frames.size() - ENTRIES]) { - // Time is after last frame. - spacing = _frames[_frames.size() + PREV_VALUE]; - } else { - // Interpolate between the previous frame and the current frame. - int frame = Animation::binarySearch(_frames, time, ENTRIES); - spacing = _frames[frame + PREV_VALUE]; - float frameTime = _frames[frame]; - float percent = getCurvePercent(frame / ENTRIES - 1, - 1 - (time - frameTime) / (_frames[frame + PREV_TIME] - frameTime)); - - spacing += (_frames[frame + VALUE] - spacing) * percent; - } - - if (blend == MixBlend_Setup) { - constraint._spacing = constraint._data._spacing + (spacing - constraint._data._spacing) * alpha; - } else { - constraint._spacing += (spacing - constraint._spacing) * alpha; - } -} - -int PathConstraintSpacingTimeline::getPropertyId() { - return ((int) TimelineType_PathConstraintSpacing << 24) + _pathConstraintIndex; -} diff --git a/native/cocos/editor-support/spine/PathConstraintSpacingTimeline.h b/native/cocos/editor-support/spine/PathConstraintSpacingTimeline.h deleted file mode 100644 index 3dd9649194..0000000000 --- a/native/cocos/editor-support/spine/PathConstraintSpacingTimeline.h +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_PathConstraintSpacingTimeline_h -#define Spine_PathConstraintSpacingTimeline_h - -#include - -namespace spine { - class SP_API PathConstraintSpacingTimeline : public PathConstraintPositionTimeline { - friend class SkeletonBinary; - friend class SkeletonJson; - - RTTI_DECL - - public: - explicit PathConstraintSpacingTimeline(int frameCount); - - virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector* pEvents, float alpha, MixBlend blend, MixDirection direction); - - virtual int getPropertyId(); - }; -} - -#endif /* Spine_PathConstraintSpacingTimeline_h */ diff --git a/native/cocos/editor-support/spine/PointAttachment.cpp b/native/cocos/editor-support/spine/PointAttachment.cpp deleted file mode 100644 index 39c76236d7..0000000000 --- a/native/cocos/editor-support/spine/PointAttachment.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include - -#include - -using namespace spine; - -RTTI_IMPL(PointAttachment, Attachment) - -PointAttachment::PointAttachment(const String &name) : Attachment(name), _x(0), _y(0), _rotation(0) { -} - -void PointAttachment::computeWorldPosition(Bone &bone, float &ox, float &oy) { - bone.localToWorld(_x, _y, ox, oy); -} - -float PointAttachment::computeWorldRotation(Bone &bone) { - float cos = MathUtil::cosDeg(_rotation); - float sin = MathUtil::sinDeg(_rotation); - float ix = cos * bone._a + sin * bone._b; - float iy = cos * bone._c + sin * bone._d; - - return MathUtil::atan2(iy, ix) * MathUtil::Rad_Deg; -} - -float PointAttachment::getX() { - return _x; -} - -void PointAttachment::setX(float inValue) { - _x = inValue; -} - -float PointAttachment::getY() { - return _y; -} - -void PointAttachment::setY(float inValue) { - _y = inValue; -} - -float PointAttachment::getRotation() { - return _rotation; -} - -void PointAttachment::setRotation(float inValue) { - _rotation = inValue; -} diff --git a/native/cocos/editor-support/spine/PointAttachment.h b/native/cocos/editor-support/spine/PointAttachment.h deleted file mode 100644 index 6751ed2f7d..0000000000 --- a/native/cocos/editor-support/spine/PointAttachment.h +++ /dev/null @@ -1,73 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_PointAttachment_h -#define Spine_PointAttachment_h - -#include - -namespace spine { - class Bone; - - /// - /// An attachment which is a single point and a rotation. This can be used to spawn projectiles, particles, etc. A bone can be - /// used in similar ways, but a PointAttachment is slightly less expensive to compute and can be hidden, shown, and placed in a - /// skin. - /// - /// See http://esotericsoftware.com/spine-point-attachments for Point Attachments in the Spine User Guide. - /// - class SP_API PointAttachment : public Attachment { - friend class SkeletonBinary; - friend class SkeletonJson; - - RTTI_DECL - - public: - explicit PointAttachment(const String& name); - - void computeWorldPosition(Bone& bone, float& ox, float& oy); - - float computeWorldRotation(Bone& bone); - - float getX(); - void setX(float inValue); - - float getY(); - void setY(float inValue); - - float getRotation(); - void setRotation(float inValue); - - private: - float _x, _y, _rotation; - }; -} - -#endif /* Spine_PointAttachment_h */ diff --git a/native/cocos/editor-support/spine/Pool.h b/native/cocos/editor-support/spine/Pool.h deleted file mode 100644 index 01e0cfdb64..0000000000 --- a/native/cocos/editor-support/spine/Pool.h +++ /dev/null @@ -1,75 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_Pool_h -#define Spine_Pool_h - -#include -#include -#include -#include - -namespace spine { -template -class SP_API Pool : public SpineObject { -public: - Pool() { - } - - ~Pool() { - ContainerUtil::cleanUpVectorOfPointers(_objects); - } - - T *obtain() { - if (_objects.size() > 0) { - T **object = &_objects[_objects.size() - 1]; - T *ret = *object; - _objects.removeAt(_objects.size() - 1); - - return ret; - } else { - T *ret = new(__FILE__, __LINE__) T(); - - return ret; - } - } - - void free(T *object) { - if (!_objects.contains(object)) { - _objects.add(object); - } - } - -private: - Vector _objects; -}; -} - -#endif /* Spine_Pool_h */ diff --git a/native/cocos/editor-support/spine/PositionMode.h b/native/cocos/editor-support/spine/PositionMode.h deleted file mode 100644 index 46fb89646e..0000000000 --- a/native/cocos/editor-support/spine/PositionMode.h +++ /dev/null @@ -1,41 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_PositionMode_h -#define Spine_PositionMode_h - -namespace spine { -enum PositionMode { - PositionMode_Fixed = 0, - PositionMode_Percent -}; -} - -#endif /* Spine_PositionMode_h */ diff --git a/native/cocos/editor-support/spine/RTTI.cpp b/native/cocos/editor-support/spine/RTTI.cpp deleted file mode 100644 index 0822ebc72b..0000000000 --- a/native/cocos/editor-support/spine/RTTI.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include -#include - -using namespace spine; - -RTTI::RTTI(const std::string &className) : _className(className), _pBaseRTTI(NULL) { -} - -RTTI::RTTI(const std::string &className, const RTTI &baseRTTI) : _className(className), _pBaseRTTI(&baseRTTI) { -} - -const std::string &RTTI::getClassName() const { - return _className; -} - -bool RTTI::isExactly(const RTTI &rtti) const { - return (this->_className == rtti._className); -} - -bool RTTI::instanceOf(const RTTI &rtti) const { - const RTTI *pCompare = this; - - while (pCompare) { - if (pCompare->_className == rtti._className) { - return true; - } - - pCompare = pCompare->_pBaseRTTI; - } - - return false; -} diff --git a/native/cocos/editor-support/spine/RTTI.h b/native/cocos/editor-support/spine/RTTI.h deleted file mode 100644 index 987f5da68c..0000000000 --- a/native/cocos/editor-support/spine/RTTI.h +++ /dev/null @@ -1,76 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_RTTI_h -#define Spine_RTTI_h - -#include - -#include - -namespace spine { -class SP_API RTTI : public SpineObject { -public: - explicit RTTI(const std::string &className); - - RTTI(const std::string &className, const RTTI &baseRTTI); - - const std::string &getClassName() const; - - bool isExactly(const RTTI &rtti) const; - - bool instanceOf(const RTTI &rtti) const; - -private: - // Prevent copying - RTTI(const RTTI &obj); - - RTTI &operator=(const RTTI &obj); - - const std::string _className; - const RTTI *_pBaseRTTI; -}; -} - -#define RTTI_DECL \ -public: \ -static const spine::RTTI rtti; \ -virtual const spine::RTTI& getRTTI() const; - -#define RTTI_IMPL_NOPARENT(name) \ -const spine::RTTI name::rtti(#name); \ -const spine::RTTI& name::getRTTI() const { return rtti; } - -#define RTTI_IMPL(name, parent) \ -const spine::RTTI name::rtti(#name, parent::rtti); \ -const spine::RTTI& name::getRTTI() const { return rtti; } - -#endif /* Spine_RTTI_h */ - diff --git a/native/cocos/editor-support/spine/RegionAttachment.cpp b/native/cocos/editor-support/spine/RegionAttachment.cpp deleted file mode 100644 index cdd05e0cb1..0000000000 --- a/native/cocos/editor-support/spine/RegionAttachment.cpp +++ /dev/null @@ -1,284 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include - -#include - -using namespace spine; - -RTTI_IMPL(RegionAttachment, Attachment) - -const int RegionAttachment::BLX = 0; -const int RegionAttachment::BLY = 1; -const int RegionAttachment::ULX = 2; -const int RegionAttachment::ULY = 3; -const int RegionAttachment::URX = 4; -const int RegionAttachment::URY = 5; -const int RegionAttachment::BRX = 6; -const int RegionAttachment::BRY = 7; - -RegionAttachment::RegionAttachment(const String &name) : Attachment(name), HasRendererObject(), - _x(0), - _y(0), - _rotation(0), - _scaleX(1), - _scaleY(1), - _width(0), - _height(0), - _regionOffsetX(0), - _regionOffsetY(0), - _regionWidth(0), - _regionHeight(0), - _regionOriginalWidth(0), - _regionOriginalHeight(0), - _path(), - _regionU(0), - _regionV(0), - _regionU2(0), - _regionV2(0), - _color(1, 1, 1, 1) { - _vertexOffset.setSize(NUM_UVS, 0); - _uvs.setSize(NUM_UVS, 0); -} - -void RegionAttachment::updateOffset() { - float regionScaleX = _width / _regionOriginalWidth * _scaleX; - float regionScaleY = _height / _regionOriginalHeight * _scaleY; - float localX = -_width / 2 * _scaleX + _regionOffsetX * regionScaleX; - float localY = -_height / 2 * _scaleY + _regionOffsetY * regionScaleY; - float localX2 = localX + _regionWidth * regionScaleX; - float localY2 = localY + _regionHeight * regionScaleY; - float cos = MathUtil::cosDeg(_rotation); - float sin = MathUtil::sinDeg(_rotation); - float localXCos = localX * cos + _x; - float localXSin = localX * sin; - float localYCos = localY * cos + _y; - float localYSin = localY * sin; - float localX2Cos = localX2 * cos + _x; - float localX2Sin = localX2 * sin; - float localY2Cos = localY2 * cos + _y; - float localY2Sin = localY2 * sin; - - _vertexOffset[BLX] = localXCos - localYSin; - _vertexOffset[BLY] = localYCos + localXSin; - _vertexOffset[ULX] = localXCos - localY2Sin; - _vertexOffset[ULY] = localY2Cos + localXSin; - _vertexOffset[URX] = localX2Cos - localY2Sin; - _vertexOffset[URY] = localY2Cos + localX2Sin; - _vertexOffset[BRX] = localX2Cos - localYSin; - _vertexOffset[BRY] = localYCos + localX2Sin; -} - -void RegionAttachment::setUVs(float u, float v, float u2, float v2, bool rotate) { - if (rotate) { - _uvs[URX] = u; - _uvs[URY] = v2; - _uvs[BRX] = u; - _uvs[BRY] = v; - _uvs[BLX] = u2; - _uvs[BLY] = v; - _uvs[ULX] = u2; - _uvs[ULY] = v2; - } else { - _uvs[ULX] = u; - _uvs[ULY] = v2; - _uvs[URX] = u; - _uvs[URY] = v; - _uvs[BRX] = u2; - _uvs[BRY] = v; - _uvs[BLX] = u2; - _uvs[BLY] = v2; - } -} - -void RegionAttachment::computeWorldVertices(Bone &bone, Vector &worldVertices, size_t offset, size_t stride) { - assert(worldVertices.size() >= (offset + 8)); - computeWorldVertices(bone, worldVertices.buffer(), offset, stride); -} - -void RegionAttachment::computeWorldVertices(Bone &bone, float* worldVertices, size_t offset, size_t stride) { - float x = bone.getWorldX(), y = bone.getWorldY(); - float a = bone.getA(), b = bone.getB(), c = bone.getC(), d = bone.getD(); - float offsetX, offsetY; - - offsetX = _vertexOffset[BRX]; - offsetY = _vertexOffset[BRY]; - worldVertices[offset] = offsetX * a + offsetY * b + x; // br - worldVertices[offset + 1] = offsetX * c + offsetY * d + y; - offset += stride; - - offsetX = _vertexOffset[BLX]; - offsetY = _vertexOffset[BLY]; - worldVertices[offset] = offsetX * a + offsetY * b + x; // bl - worldVertices[offset + 1] = offsetX * c + offsetY * d + y; - offset += stride; - - offsetX = _vertexOffset[ULX]; - offsetY = _vertexOffset[ULY]; - worldVertices[offset] = offsetX * a + offsetY * b + x; // ul - worldVertices[offset + 1] = offsetX * c + offsetY * d + y; - offset += stride; - - offsetX = _vertexOffset[URX]; - offsetY = _vertexOffset[URY]; - worldVertices[offset] = offsetX * a + offsetY * b + x; // ur - worldVertices[offset + 1] = offsetX * c + offsetY * d + y; -} - -float RegionAttachment::getX() { - return _x; -} - -void RegionAttachment::setX(float inValue) { - _x = inValue; -} - -float RegionAttachment::getY() { - return _y; -} - -void RegionAttachment::setY(float inValue) { - _y = inValue; -} - -float RegionAttachment::getRotation() { - return _rotation; -} - -void RegionAttachment::setRotation(float inValue) { - _rotation = inValue; -} - -float RegionAttachment::getScaleX() { - return _scaleX; -} - -void RegionAttachment::setScaleX(float inValue) { - _scaleX = inValue; -} - -float RegionAttachment::getScaleY() { - return _scaleY; -} - -void RegionAttachment::setScaleY(float inValue) { - _scaleY = inValue; -} - -float RegionAttachment::getWidth() { - return _width; -} - -void RegionAttachment::setWidth(float inValue) { - _width = inValue; -} - -float RegionAttachment::getHeight() { - return _height; -} - -void RegionAttachment::setHeight(float inValue) { - _height = inValue; -} - -const String &RegionAttachment::getPath() { - return _path; -} - -void RegionAttachment::setPath(const String &inValue) { - _path = inValue; -} - -float RegionAttachment::getRegionOffsetX() { - return _regionOffsetX; -} - -void RegionAttachment::setRegionOffsetX(float inValue) { - _regionOffsetX = inValue; -} - -float RegionAttachment::getRegionOffsetY() { - return _regionOffsetY; -} - -void RegionAttachment::setRegionOffsetY(float inValue) { - _regionOffsetY = inValue; -} - -float RegionAttachment::getRegionWidth() { - return _regionWidth; -} - -void RegionAttachment::setRegionWidth(float inValue) { - _regionWidth = inValue; -} - -float RegionAttachment::getRegionHeight() { - return _regionHeight; -} - -void RegionAttachment::setRegionHeight(float inValue) { - _regionHeight = inValue; -} - -float RegionAttachment::getRegionOriginalWidth() { - return _regionOriginalWidth; -} - -void RegionAttachment::setRegionOriginalWidth(float inValue) { - _regionOriginalWidth = inValue; -} - -float RegionAttachment::getRegionOriginalHeight() { - return _regionOriginalHeight; -} - -void RegionAttachment::setRegionOriginalHeight(float inValue) { - _regionOriginalHeight = inValue; -} - -Vector &RegionAttachment::getOffset() { - return _vertexOffset; -} - -Vector &RegionAttachment::getUVs() { - return _uvs; -} - -spine::Color &RegionAttachment::getColor() { - return _color; -} diff --git a/native/cocos/editor-support/spine/RegionAttachment.h b/native/cocos/editor-support/spine/RegionAttachment.h deleted file mode 100644 index 995cc39924..0000000000 --- a/native/cocos/editor-support/spine/RegionAttachment.h +++ /dev/null @@ -1,133 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_RegionAttachment_h -#define Spine_RegionAttachment_h - -#include -#include -#include - -#include -#include - -#define NUM_UVS 8 - -namespace spine { - class Bone; - - /// Attachment that displays a texture region. - class SP_API RegionAttachment : public Attachment, public HasRendererObject { - friend class SkeletonBinary; - friend class SkeletonJson; - friend class AtlasAttachmentLoader; - - RTTI_DECL - - public: - explicit RegionAttachment(const String& name); - - void updateOffset(); - - void setUVs(float u, float v, float u2, float v2, bool rotate); - - /// Transforms the attachment's four vertices to world coordinates. - /// @param bone The parent bone. - /// @param worldVertices The output world vertices. Must have a length greater than or equal to offset + 8. - /// @param offset The worldVertices index to begin writing values. - /// @param stride The number of worldVertices entries between the value pairs written. - void computeWorldVertices(Bone& bone, float *worldVertices, size_t offset, size_t stride = 2); - void computeWorldVertices(Bone& bone, Vector& worldVertices, size_t offset, size_t stride = 2); - - float getX(); - void setX(float inValue); - float getY(); - void setY(float inValue); - float getRotation(); - void setRotation(float inValue); - float getScaleX(); - void setScaleX(float inValue); - float getScaleY(); - void setScaleY(float inValue); - float getWidth(); - void setWidth(float inValue); - float getHeight(); - void setHeight(float inValue); - - Color& getColor(); - - const String& getPath(); - void setPath(const String& inValue); - - float getRegionOffsetX(); - void setRegionOffsetX(float inValue); - - float getRegionOffsetY(); - void setRegionOffsetY(float inValue); - - float getRegionWidth(); - void setRegionWidth(float inValue); - - float getRegionHeight(); - void setRegionHeight(float inValue); - - float getRegionOriginalWidth(); - void setRegionOriginalWidth(float inValue); - - float getRegionOriginalHeight(); - void setRegionOriginalHeight(float inValue); - - Vector& getOffset(); - Vector& getUVs(); - - private: - static const int BLX; - static const int BLY; - static const int ULX; - static const int ULY; - static const int URX; - static const int URY; - static const int BRX; - static const int BRY; - - float _x, _y, _rotation, _scaleX, _scaleY, _width, _height; - float _regionOffsetX, _regionOffsetY, _regionWidth, _regionHeight, _regionOriginalWidth, _regionOriginalHeight; - Vector _vertexOffset; - Vector _uvs; - String _path; - float _regionU; - float _regionV; - float _regionU2; - float _regionV2; - Color _color; - }; -} - -#endif /* Spine_RegionAttachment_h */ diff --git a/native/cocos/editor-support/spine/RotateMode.h b/native/cocos/editor-support/spine/RotateMode.h deleted file mode 100644 index a9a78f665f..0000000000 --- a/native/cocos/editor-support/spine/RotateMode.h +++ /dev/null @@ -1,42 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_RotateMode_h -#define Spine_RotateMode_h - -namespace spine { -enum RotateMode { - RotateMode_Tangent = 0, - RotateMode_Chain, - RotateMode_ChainScale -}; -} - -#endif /* Spine_RotateMode_h */ diff --git a/native/cocos/editor-support/spine/RotateTimeline.cpp b/native/cocos/editor-support/spine/RotateTimeline.cpp deleted file mode 100644 index 4f4e1b86a9..0000000000 --- a/native/cocos/editor-support/spine/RotateTimeline.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include - -#include -#include -#include -#include - -using namespace spine; - -RTTI_IMPL(RotateTimeline, CurveTimeline) - -RotateTimeline::RotateTimeline(int frameCount) : CurveTimeline(frameCount), _boneIndex(0) { - _frames.setSize(frameCount << 1, 0); -} - -void RotateTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, - MixBlend blend, MixDirection direction) { - SP_UNUSED(lastTime); - SP_UNUSED(pEvents); - SP_UNUSED(direction); - - Bone *bone = skeleton.getBones()[_boneIndex]; - - if (time < _frames[0]) { - switch (blend) { - case MixBlend_Setup: { - bone->_rotation = bone->_data._rotation; - break; - } - case MixBlend_First: { - float r = bone->_data._rotation - bone->_rotation; - bone->_rotation += (r - (16384 - (int) (16384.499999999996 - r / 360)) * 360) * alpha; - break; - } - default: { - // TODO? - break; - } - } - - return; - } - - if (time >= _frames[_frames.size() - ENTRIES]) { - float r = _frames[_frames.size() + PREV_ROTATION]; - switch (blend) { - case MixBlend_Setup: - bone->_rotation = bone->_data._rotation + r * alpha; - break; - case MixBlend_First: - case MixBlend_Replace: - r += bone->_data._rotation - bone->_rotation; - r -= (16384 - (int)(16384.499999999996 - r / 360)) * 360; - // Fall through. - case MixBlend_Add: - bone->_rotation += r * alpha; - } - return; - } - - // Interpolate between the previous frame and the current frame. - int frame = Animation::binarySearch(_frames, time, ENTRIES); - float prevRotation = _frames[frame + PREV_ROTATION]; - float frameTime = _frames[frame]; - float percent = getCurvePercent((frame >> 1) - 1, - 1 - (time - frameTime) / (_frames[frame + PREV_TIME] - frameTime)); - float r = _frames[frame + ROTATION] - prevRotation; - r = prevRotation + (r - (16384 - (int)(16384.499999999996 - r / 360)) * 360) * percent; - switch (blend) { - case MixBlend_Setup: - bone->_rotation = bone->_data._rotation + (r - (16384 - (int)(16384.499999999996 - r / 360)) * 360) * alpha; - break; - case MixBlend_First: - case MixBlend_Replace: - r += bone->_data._rotation - bone->_rotation; - // Fall through. - case MixBlend_Add: - bone->_rotation += (r - (16384 - (int)(16384.499999999996 - r / 360)) * 360) * alpha; - } -} - -int RotateTimeline::getPropertyId() { - return ((int) TimelineType_Rotate << 24) + _boneIndex; -} - -void RotateTimeline::setFrame(int frameIndex, float time, float degrees) { - frameIndex <<= 1; - _frames[frameIndex] = time; - _frames[frameIndex + ROTATION] = degrees; -} - -int RotateTimeline::getBoneIndex() { - return _boneIndex; -} - -void RotateTimeline::setBoneIndex(int inValue) { - _boneIndex = inValue; -} - -Vector &RotateTimeline::getFrames() { - return _frames; -} diff --git a/native/cocos/editor-support/spine/RotateTimeline.h b/native/cocos/editor-support/spine/RotateTimeline.h deleted file mode 100644 index cdc46d5075..0000000000 --- a/native/cocos/editor-support/spine/RotateTimeline.h +++ /dev/null @@ -1,71 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_RotateTimeline_h -#define Spine_RotateTimeline_h - -#include - -namespace spine { - class SP_API RotateTimeline : public CurveTimeline { - friend class SkeletonBinary; - friend class SkeletonJson; - friend class AnimationState; - - RTTI_DECL - - public: - static const int ENTRIES = 2; - - explicit RotateTimeline(int frameCount); - - virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector* pEvents, float alpha, MixBlend blend, MixDirection direction); - - virtual int getPropertyId(); - - /// Sets the time and value of the specified keyframe. - void setFrame(int frameIndex, float time, float degrees); - - int getBoneIndex(); - void setBoneIndex(int inValue); - - Vector& getFrames(); - - private: - static const int PREV_TIME = -2; - static const int PREV_ROTATION = -1; - static const int ROTATION = 1; - - int _boneIndex; - Vector _frames; // time, angle, ... - }; -} - -#endif /* Spine_RotateTimeline_h */ diff --git a/native/cocos/editor-support/spine/ScaleTimeline.cpp b/native/cocos/editor-support/spine/ScaleTimeline.cpp deleted file mode 100644 index f2a8d6600d..0000000000 --- a/native/cocos/editor-support/spine/ScaleTimeline.cpp +++ /dev/null @@ -1,151 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include - -#include -#include -#include -#include - -using namespace spine; - -RTTI_IMPL(ScaleTimeline, TranslateTimeline) - -ScaleTimeline::ScaleTimeline(int frameCount) : TranslateTimeline(frameCount) { -} - -void ScaleTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, - MixBlend blend, MixDirection direction) { - SP_UNUSED(lastTime); - SP_UNUSED(pEvents); - - Bone *boneP = skeleton._bones[_boneIndex]; - Bone &bone = *boneP; - - if (time < _frames[0]) { - switch (blend) { - case MixBlend_Setup: - bone._scaleX = bone._data._scaleX; - bone._scaleY = bone._data._scaleY; - return; - case MixBlend_First: - bone._scaleX += (bone._data._scaleX - bone._scaleX) * alpha; - bone._scaleY += (bone._data._scaleY - bone._scaleY) * alpha; - default: {} - } - return; - } - - float x, y; - if (time >= _frames[_frames.size() - ENTRIES]) { - // Time is after last frame. - x = _frames[_frames.size() + PREV_X] * bone._data._scaleX; - y = _frames[_frames.size() + PREV_Y] * bone._data._scaleY; - } else { - // Interpolate between the previous frame and the current frame. - int frame = Animation::binarySearch(_frames, time, ENTRIES); - x = _frames[frame + PREV_X]; - y = _frames[frame + PREV_Y]; - float frameTime = _frames[frame]; - float percent = getCurvePercent(frame / ENTRIES - 1, - 1 - (time - frameTime) / (_frames[frame + PREV_TIME] - frameTime)); - - x = (x + (_frames[frame + X] - x) * percent) * bone._data._scaleX; - y = (y + (_frames[frame + Y] - y) * percent) * bone._data._scaleY; - } - - if (alpha == 1) { - if (blend == MixBlend_Add) { - bone._scaleX += x - bone._data._scaleX; - bone._scaleY += y - bone._data._scaleY; - } else { - bone._scaleX = x; - bone._scaleY = y; - } - } else { - // Mixing out uses sign of setup or current pose, else use sign of key. - float bx, by; - if (direction == MixDirection_Out) { - switch (blend) { - case MixBlend_Setup: - bx = bone._data._scaleX; - by = bone._data._scaleY; - bone._scaleX = bx + (MathUtil::abs(x) * MathUtil::sign(bx) - bx) * alpha; - bone._scaleY = by + (MathUtil::abs(y) * MathUtil::sign(by) - by) * alpha; - break; - case MixBlend_First: - case MixBlend_Replace: - bx = bone._scaleX; - by = bone._scaleY; - bone._scaleX = bx + (MathUtil::abs(x) * MathUtil::sign(bx) - bx) * alpha; - bone._scaleY = by + (MathUtil::abs(y) * MathUtil::sign(by) - by) * alpha; - break; - case MixBlend_Add: - bx = bone._scaleX; - by = bone._scaleY; - bone._scaleX = bx + (MathUtil::abs(x) * MathUtil::sign(bx) - bone._data._scaleX) * alpha; - bone._scaleY = by + (MathUtil::abs(y) * MathUtil::sign(by) - bone._data._scaleY) * alpha; - } - } else { - switch (blend) { - case MixBlend_Setup: - bx = MathUtil::abs(bone._data._scaleX) * MathUtil::sign(x); - by = MathUtil::abs(bone._data._scaleY) * MathUtil::sign(y); - bone._scaleX = bx + (x - bx) * alpha; - bone._scaleY = by + (y - by) * alpha; - break; - case MixBlend_First: - case MixBlend_Replace: - bx = MathUtil::abs(bone._scaleX) * MathUtil::sign(x); - by = MathUtil::abs(bone._scaleY) * MathUtil::sign(y); - bone._scaleX = bx + (x - bx) * alpha; - bone._scaleY = by + (y - by) * alpha; - break; - case MixBlend_Add: - bx = MathUtil::sign(x); - by = MathUtil::sign(y); - bone._scaleX = MathUtil::abs(bone._scaleX) * bx + (x - MathUtil::abs(bone._data._scaleX) * bx) * alpha; - bone._scaleY = MathUtil::abs(bone._scaleY) * by + (y - MathUtil::abs(bone._data._scaleY) * by) * alpha; - } - } - } -} - -int ScaleTimeline::getPropertyId() { - return ((int) TimelineType_Scale << 24) + _boneIndex; -} diff --git a/native/cocos/editor-support/spine/ScaleTimeline.h b/native/cocos/editor-support/spine/ScaleTimeline.h deleted file mode 100644 index fcb75721d0..0000000000 --- a/native/cocos/editor-support/spine/ScaleTimeline.h +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_ScaleTimeline_h -#define Spine_ScaleTimeline_h - -#include - -namespace spine { - class SP_API ScaleTimeline : public TranslateTimeline { - friend class SkeletonBinary; - friend class SkeletonJson; - - RTTI_DECL - - public: - explicit ScaleTimeline(int frameCount); - - virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector* pEvents, float alpha, MixBlend blend, MixDirection direction); - - virtual int getPropertyId(); - }; -} - -#endif /* Spine_ScaleTimeline_h */ diff --git a/native/cocos/editor-support/spine/ShearTimeline.cpp b/native/cocos/editor-support/spine/ShearTimeline.cpp deleted file mode 100644 index cf4f01519e..0000000000 --- a/native/cocos/editor-support/spine/ShearTimeline.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include - -#include -#include -#include -#include - -using namespace spine; - -RTTI_IMPL(ShearTimeline, TranslateTimeline) - -ShearTimeline::ShearTimeline(int frameCount) : TranslateTimeline(frameCount) { -} - -void ShearTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, - MixBlend blend, MixDirection direction) { - SP_UNUSED(lastTime); - SP_UNUSED(pEvents); - SP_UNUSED(direction); - - Bone *boneP = skeleton._bones[_boneIndex]; - Bone &bone = *boneP; - - if (time < _frames[0]) { - switch (blend) { - case MixBlend_Setup: - bone._shearX = bone._data._shearX; - bone._shearY = bone._data._shearY; - return; - case MixBlend_First: - bone._shearX += (bone._data._shearX - bone._shearX) * alpha; - bone._shearY += (bone._data._shearY - bone._shearY) * alpha; - default: {} - } - return; - } - - float x, y; - if (time >= _frames[_frames.size() - ENTRIES]) { - // Time is after last frame. - x = _frames[_frames.size() + PREV_X]; - y = _frames[_frames.size() + PREV_Y]; - } else { - // Interpolate between the previous frame and the current frame. - int frame = Animation::binarySearch(_frames, time, ENTRIES); - x = _frames[frame + PREV_X]; - y = _frames[frame + PREV_Y]; - float frameTime = _frames[frame]; - float percent = getCurvePercent(frame / ENTRIES - 1, - 1 - (time - frameTime) / (_frames[frame + PREV_TIME] - frameTime)); - - x = x + (_frames[frame + X] - x) * percent; - y = y + (_frames[frame + Y] - y) * percent; - } - - switch (blend) { - case MixBlend_Setup: - bone._shearX = bone._data._shearX + x * alpha; - bone._shearY = bone._data._shearY + y * alpha; - break; - case MixBlend_First: - case MixBlend_Replace: - bone._shearX += (bone._data._shearX + x - bone._shearX) * alpha; - bone._shearY += (bone._data._shearY + y - bone._shearY) * alpha; - break; - case MixBlend_Add: - bone._shearX += x * alpha; - bone._shearY += y * alpha; - } -} - -int ShearTimeline::getPropertyId() { - return ((int) TimelineType_Shear << 24) + _boneIndex; -} diff --git a/native/cocos/editor-support/spine/ShearTimeline.h b/native/cocos/editor-support/spine/ShearTimeline.h deleted file mode 100644 index 69631f7ce9..0000000000 --- a/native/cocos/editor-support/spine/ShearTimeline.h +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_ShearTimeline_h -#define Spine_ShearTimeline_h - -#include - -namespace spine { - class SP_API ShearTimeline : public TranslateTimeline { - friend class SkeletonBinary; - friend class SkeletonJson; - - RTTI_DECL - - public: - explicit ShearTimeline(int frameCount); - - virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector* pEvents, float alpha, MixBlend blend, MixDirection direction); - - virtual int getPropertyId(); - }; -} - -#endif /* Spine_ShearTimeline_h */ diff --git a/native/cocos/editor-support/spine/Skeleton.cpp b/native/cocos/editor-support/spine/Skeleton.cpp deleted file mode 100644 index c8772d14c1..0000000000 --- a/native/cocos/editor-support/spine/Skeleton.cpp +++ /dev/null @@ -1,653 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -using namespace spine; - -Skeleton::Skeleton(SkeletonData *skeletonData) : - _data(skeletonData), - _skin(NULL), - _color(1, 1, 1, 1), - _time(0), - _scaleX(1), - _scaleY(1), - _x(0), - _y(0) { - _bones.ensureCapacity(_data->getBones().size()); - for (size_t i = 0; i < _data->getBones().size(); ++i) { - BoneData *data = _data->getBones()[i]; - - Bone *bone; - if (data->getParent() == NULL) { - bone = new(__FILE__, __LINE__) Bone(*data, *this, NULL); - } else { - Bone *parent = _bones[data->getParent()->getIndex()]; - bone = new(__FILE__, __LINE__) Bone(*data, *this, parent); - parent->getChildren().add(bone); - } - - _bones.add(bone); - } - - _slots.ensureCapacity(_data->getSlots().size()); - _drawOrder.ensureCapacity(_data->getSlots().size()); - for (size_t i = 0; i < _data->getSlots().size(); ++i) { - SlotData *data = _data->getSlots()[i]; - - Bone *bone = _bones[data->getBoneData().getIndex()]; - Slot *slot = new(__FILE__, __LINE__) Slot(*data, *bone); - - _slots.add(slot); - _drawOrder.add(slot); - } - - _ikConstraints.ensureCapacity(_data->getIkConstraints().size()); - for (size_t i = 0; i < _data->getIkConstraints().size(); ++i) { - IkConstraintData *data = _data->getIkConstraints()[i]; - - IkConstraint *constraint = new(__FILE__, __LINE__) IkConstraint(*data, *this); - - _ikConstraints.add(constraint); - } - - _transformConstraints.ensureCapacity(_data->getTransformConstraints().size()); - for (size_t i = 0; i < _data->getTransformConstraints().size(); ++i) { - TransformConstraintData *data = _data->getTransformConstraints()[i]; - - TransformConstraint *constraint = new(__FILE__, __LINE__) TransformConstraint(*data, *this); - - _transformConstraints.add(constraint); - } - - _pathConstraints.ensureCapacity(_data->getPathConstraints().size()); - for (size_t i = 0; i < _data->getPathConstraints().size(); ++i) { - PathConstraintData *data = _data->getPathConstraints()[i]; - - PathConstraint *constraint = new(__FILE__, __LINE__) PathConstraint(*data, *this); - - _pathConstraints.add(constraint); - } - - updateCache(); -} - -Skeleton::~Skeleton() { - ContainerUtil::cleanUpVectorOfPointers(_bones); - ContainerUtil::cleanUpVectorOfPointers(_slots); - ContainerUtil::cleanUpVectorOfPointers(_ikConstraints); - ContainerUtil::cleanUpVectorOfPointers(_transformConstraints); - ContainerUtil::cleanUpVectorOfPointers(_pathConstraints); -} - -void Skeleton::updateCache() { - _updateCache.clear(); - _updateCacheReset.clear(); - - for (size_t i = 0, n = _bones.size(); i < n; ++i) { - _bones[i]->_sorted = false; - } - - size_t ikCount = _ikConstraints.size(); - size_t transformCount = _transformConstraints.size(); - size_t pathCount = _pathConstraints.size(); - - size_t constraintCount = ikCount + transformCount + pathCount; - - size_t i = 0; - continue_outer: - for (; i < constraintCount; ++i) { - for (size_t ii = 0; ii < ikCount; ++ii) { - IkConstraint *constraint = _ikConstraints[ii]; - if (constraint->getData().getOrder() == i) { - sortIkConstraint(constraint); - i++; - goto continue_outer; - } - } - - for (size_t ii = 0; ii < transformCount; ++ii) { - TransformConstraint *constraint = _transformConstraints[ii]; - if (constraint->getData().getOrder() == (int)i) { - sortTransformConstraint(constraint); - i++; - goto continue_outer; - } - } - - for (size_t ii = 0; ii < pathCount; ++ii) { - PathConstraint *constraint = _pathConstraints[ii]; - if (constraint->getData().getOrder() == (int)i) { - sortPathConstraint(constraint); - i++; - goto continue_outer; - } - } - } - - size_t n = _bones.size(); - for (i = 0; i < n; ++i) { - sortBone(_bones[i]); - } -} - -void Skeleton::printUpdateCache() { - for (size_t i = 0; i < _updateCache.size(); i++) { - Updatable *updatable = _updateCache[i]; - if (updatable->getRTTI().isExactly(Bone::rtti)) { - printf("bone %s\n", ((Bone *) updatable)->getData().getName().buffer()); - } else if (updatable->getRTTI().isExactly(TransformConstraint::rtti)) { - printf("transform constraint %s\n", ((TransformConstraint *) updatable)->getData().getName().buffer()); - } else if (updatable->getRTTI().isExactly(IkConstraint::rtti)) { - printf("ik constraint %s\n", ((IkConstraint *) updatable)->getData().getName().buffer()); - } else if (updatable->getRTTI().isExactly(PathConstraint::rtti)) { - printf("path constraint %s\n", ((PathConstraint *) updatable)->getData().getName().buffer()); - } - } -} - -void Skeleton::updateWorldTransform() { - for (size_t i = 0, n = _updateCacheReset.size(); i < n; ++i) { - Bone *boneP = _updateCacheReset[i]; - Bone &bone = *boneP; - bone._ax = bone._x; - bone._ay = bone._y; - bone._arotation = bone._rotation; - bone._ascaleX = bone._scaleX; - bone._ascaleY = bone._scaleY; - bone._ashearX = bone._shearX; - bone._ashearY = bone._shearY; - bone._appliedValid = true; - } - - for (size_t i = 0, n = _updateCache.size(); i < n; ++i) { - _updateCache[i]->update(); - } -} - -void Skeleton::setToSetupPose() { - setBonesToSetupPose(); - setSlotsToSetupPose(); -} - -void Skeleton::setBonesToSetupPose() { - for (size_t i = 0, n = _bones.size(); i < n; ++i) { - _bones[i]->setToSetupPose(); - } - - for (size_t i = 0, n = _ikConstraints.size(); i < n; ++i) { - IkConstraint *constraintP = _ikConstraints[i]; - IkConstraint &constraint = *constraintP; - - constraint._bendDirection = constraint._data._bendDirection; - constraint._compress = constraint._data._compress; - constraint._stretch = constraint._data._stretch; - constraint._mix = constraint._data._mix; - } - - for (size_t i = 0, n = _transformConstraints.size(); i < n; ++i) { - TransformConstraint *constraintP = _transformConstraints[i]; - TransformConstraint &constraint = *constraintP; - TransformConstraintData &constraintData = constraint._data; - - constraint._rotateMix = constraintData._rotateMix; - constraint._translateMix = constraintData._translateMix; - constraint._scaleMix = constraintData._scaleMix; - constraint._shearMix = constraintData._shearMix; - } - - for (size_t i = 0, n = _pathConstraints.size(); i < n; ++i) { - PathConstraint *constraintP = _pathConstraints[i]; - PathConstraint &constraint = *constraintP; - PathConstraintData &constraintData = constraint._data; - - constraint._position = constraintData._position; - constraint._spacing = constraintData._spacing; - constraint._rotateMix = constraintData._rotateMix; - constraint._translateMix = constraintData._translateMix; - } -} - -void Skeleton::setSlotsToSetupPose() { - _drawOrder.clear(); - for (size_t i = 0, n = _slots.size(); i < n; ++i) { - _drawOrder.add(_slots[i]); - } - - for (size_t i = 0, n = _slots.size(); i < n; ++i) { - _slots[i]->setToSetupPose(); - } -} - -Bone *Skeleton::findBone(const String &boneName) { - return ContainerUtil::findWithDataName(_bones, boneName); -} - -int Skeleton::findBoneIndex(const String &boneName) { - return ContainerUtil::findIndexWithDataName(_bones, boneName); -} - -Slot *Skeleton::findSlot(const String &slotName) { - return ContainerUtil::findWithDataName(_slots, slotName); -} - -int Skeleton::findSlotIndex(const String &slotName) { - return ContainerUtil::findIndexWithDataName(_slots, slotName); -} - -void Skeleton::setSkin(const String &skinName) { - Skin *foundSkin = _data->findSkin(skinName); - - assert(foundSkin != NULL); - - setSkin(foundSkin); -} - -void Skeleton::setSkin(Skin *newSkin) { - if (newSkin != NULL) { - if (_skin != NULL) { - Skeleton &thisRef = *this; - newSkin->attachAll(thisRef, *_skin); - } else { - for (size_t i = 0, n = _slots.size(); i < n; ++i) { - Slot *slotP = _slots[i]; - Slot &slot = *slotP; - const String &name = slot._data.getAttachmentName(); - if (name.length() > 0) { - Attachment *attachment = newSkin->getAttachment(i, name); - if (attachment != NULL) { - slot.setAttachment(attachment); - } - } - } - } - } - - _skin = newSkin; -} - -Attachment *Skeleton::getAttachment(const String &slotName, const String &attachmentName) { - return getAttachment(_data->findSlotIndex(slotName), attachmentName); -} - -Attachment *Skeleton::getAttachment(int slotIndex, const String &attachmentName) { - assert(attachmentName.length() > 0); - - if (_skin != NULL) { - Attachment *attachment = _skin->getAttachment(slotIndex, attachmentName); - if (attachment != NULL) { - return attachment; - } - } - - return _data->getDefaultSkin() != NULL ? _data->getDefaultSkin()->getAttachment(slotIndex, attachmentName) : NULL; -} - -void Skeleton::setAttachment(const String &slotName, const String &attachmentName) { - assert(slotName.length() > 0); - - for (size_t i = 0, n = _slots.size(); i < n; ++i) { - Slot *slot = _slots[i]; - if (slot->_data.getName() == slotName) { - Attachment *attachment = NULL; - if (attachmentName.length() > 0) { - attachment = getAttachment(i, attachmentName); - - assert(attachment != NULL); - } - - slot->setAttachment(attachment); - - return; - } - } - - printf("Slot not found: %s", slotName.buffer()); - - assert(false); -} - -IkConstraint *Skeleton::findIkConstraint(const String &constraintName) { - assert(constraintName.length() > 0); - - for (size_t i = 0, n = _ikConstraints.size(); i < n; ++i) { - IkConstraint *ikConstraint = _ikConstraints[i]; - if (ikConstraint->_data.getName() == constraintName) { - return ikConstraint; - } - } - return NULL; -} - -TransformConstraint *Skeleton::findTransformConstraint(const String &constraintName) { - assert(constraintName.length() > 0); - - for (size_t i = 0, n = _transformConstraints.size(); i < n; ++i) { - TransformConstraint *transformConstraint = _transformConstraints[i]; - if (transformConstraint->_data.getName() == constraintName) { - return transformConstraint; - } - } - - return NULL; -} - -PathConstraint *Skeleton::findPathConstraint(const String &constraintName) { - assert(constraintName.length() > 0); - - for (size_t i = 0, n = _pathConstraints.size(); i < n; ++i) { - PathConstraint *constraint = _pathConstraints[i]; - if (constraint->_data.getName() == constraintName) { - return constraint; - } - } - - return NULL; -} - -void Skeleton::update(float delta) { - _time += delta; -} - -void Skeleton::getBounds(float &outX, float &outY, float &outWidth, float &outHeight, Vector &outVertexBuffer) { - float minX = std::numeric_limits::max(); - float minY = std::numeric_limits::max(); - float maxX = std::numeric_limits::min(); - float maxY = std::numeric_limits::min(); - - for (size_t i = 0; i < _drawOrder.size(); ++i) { - Slot *slot = _drawOrder[i]; - size_t verticesLength = 0; - Attachment *attachment = slot->getAttachment(); - - if (attachment != NULL && attachment->getRTTI().instanceOf(RegionAttachment::rtti)) { - RegionAttachment *regionAttachment = static_cast(attachment); - - verticesLength = 8; - if (outVertexBuffer.size() < 8) { - outVertexBuffer.setSize(8, 0); - } - regionAttachment->computeWorldVertices(slot->getBone(), outVertexBuffer, 0); - } else if (attachment != NULL && attachment->getRTTI().instanceOf(MeshAttachment::rtti)) { - MeshAttachment *mesh = static_cast(attachment); - - verticesLength = mesh->getWorldVerticesLength(); - if (outVertexBuffer.size() < verticesLength) { - outVertexBuffer.setSize(verticesLength, 0); - } - - mesh->computeWorldVertices(*slot, 0, verticesLength, outVertexBuffer, 0); - } - - for (size_t ii = 0; ii < verticesLength; ii += 2) { - float vx = outVertexBuffer[ii]; - float vy = outVertexBuffer[ii + 1]; - - minX = MathUtil::min(minX, vx); - minY = MathUtil::min(minY, vy); - maxX = MathUtil::max(maxX, vx); - maxY = MathUtil::max(maxY, vy); - } - } - - outX = minX; - outY = minY; - outWidth = maxX - minX; - outHeight = maxY - minY; -} - -Bone *Skeleton::getRootBone() { - return _bones.size() == 0 ? NULL : _bones[0]; -} - -SkeletonData *Skeleton::getData() { - return _data; -} - -Vector &Skeleton::getBones() { - return _bones; -} - -Vector &Skeleton::getUpdateCacheList() { - return _updateCache; -} - -Vector &Skeleton::getSlots() { - return _slots; -} - -Vector &Skeleton::getDrawOrder() { - return _drawOrder; -} - -Vector &Skeleton::getIkConstraints() { - return _ikConstraints; -} - -Vector &Skeleton::getPathConstraints() { - return _pathConstraints; -} - -Vector &Skeleton::getTransformConstraints() { - return _transformConstraints; -} - -Skin *Skeleton::getSkin() { - return _skin; -} - -Color &Skeleton::getColor() { - return _color; -} - -float Skeleton::getTime() { - return _time; -} - -void Skeleton::setTime(float inValue) { - _time = inValue; -} - -void Skeleton::setPosition(float x, float y) { - _x = x; - _y = y; -} - -float Skeleton::getX() { - return _x; -} - -void Skeleton::setX(float inValue) { - _x = inValue; -} - -float Skeleton::getY() { - return _y; -} - -void Skeleton::setY(float inValue) { - _y = inValue; -} - -float Skeleton::getScaleX() { - return _scaleX; -} - -void Skeleton::setScaleX(float inValue) { - _scaleX = inValue; -} - -float Skeleton::getScaleY() { - return _scaleY * (Bone::isYDown() ? -1 : 1); -} - -void Skeleton::setScaleY(float inValue) { - _scaleY = inValue; -} - -void Skeleton::sortIkConstraint(IkConstraint *constraint) { - Bone *target = constraint->getTarget(); - sortBone(target); - - Vector &constrained = constraint->getBones(); - Bone *parent = constrained[0]; - sortBone(parent); - - if (constrained.size() > 1) { - Bone *child = constrained[constrained.size() - 1]; - if (!_updateCache.contains(child)) _updateCacheReset.add(child); - } - - _updateCache.add(constraint); - - sortReset(parent->getChildren()); - constrained[constrained.size() - 1]->_sorted = true; -} - -void Skeleton::sortPathConstraint(PathConstraint *constraint) { - Slot *slot = constraint->getTarget(); - int slotIndex = slot->getData().getIndex(); - Bone &slotBone = slot->getBone(); - if (_skin != NULL) sortPathConstraintAttachment(_skin, slotIndex, slotBone); - if (_data->_defaultSkin != NULL && _data->_defaultSkin != _skin) - sortPathConstraintAttachment(_data->_defaultSkin, slotIndex, slotBone); - for (size_t ii = 0, nn = _data->_skins.size(); ii < nn; ii++) - sortPathConstraintAttachment(_data->_skins[ii], slotIndex, slotBone); - - Attachment *attachment = slot->getAttachment(); - if (attachment != NULL && attachment->getRTTI().instanceOf(PathAttachment::rtti)) - sortPathConstraintAttachment(attachment, slotBone); - - Vector &constrained = constraint->getBones(); - size_t boneCount = constrained.size(); - for (size_t i = 0; i < boneCount; ++i) { - sortBone(constrained[i]); - } - - _updateCache.add(constraint); - - for (size_t i = 0; i < boneCount; i++) - sortReset(constrained[i]->getChildren()); - for (size_t i = 0; i < boneCount; i++) - constrained[i]->_sorted = true; -} - -void Skeleton::sortTransformConstraint(TransformConstraint *constraint) { - sortBone(constraint->getTarget()); - - Vector &constrained = constraint->getBones(); - size_t boneCount = constrained.size(); - if (constraint->_data.isLocal()) { - for (size_t i = 0; i < boneCount; i++) { - Bone *child = constrained[i]; - sortBone(child->getParent()); - if (!_updateCache.contains(child)) _updateCacheReset.add(child); - } - } else { - for (size_t i = 0; i < boneCount; ++i) { - sortBone(constrained[i]); - } - } - - _updateCache.add(constraint); - - for (size_t i = 0; i < boneCount; ++i) - sortReset(constrained[i]->getChildren()); - for (size_t i = 0; i < boneCount; ++i) - constrained[i]->_sorted = true; -} - -void Skeleton::sortPathConstraintAttachment(Skin *skin, size_t slotIndex, Bone &slotBone) { - Skin::AttachmentMap::Entries attachments = skin->getAttachments(); - - while (attachments.hasNext()) { - Skin::AttachmentMap::Entry entry = attachments.next(); - if (entry._slotIndex == slotIndex) { - Attachment *value = entry._attachment; - sortPathConstraintAttachment(value, slotBone); - } - } -} - -void Skeleton::sortPathConstraintAttachment(Attachment *attachment, Bone &slotBone) { - if (attachment == NULL || !attachment->getRTTI().instanceOf(PathAttachment::rtti)) return; - Vector &pathBones = static_cast(attachment)->getBones(); - if (pathBones.size() == 0) - sortBone(&slotBone); - else { - for (size_t i = 0, n = pathBones.size(); i < n;) { - size_t nn = pathBones[i++]; - nn += i; - while (i < nn) { - sortBone(_bones[pathBones[i++]]); - } - } - } -} - -void Skeleton::sortBone(Bone *bone) { - if (bone->_sorted) return; - Bone *parent = bone->_parent; - if (parent != NULL) sortBone(parent); - bone->_sorted = true; - _updateCache.add(bone); -} - -void Skeleton::sortReset(Vector &bones) { - for (size_t i = 0, n = bones.size(); i < n; ++i) { - Bone *bone = bones[i]; - if (bone->_sorted) sortReset(bone->getChildren()); - bone->_sorted = false; - } -} diff --git a/native/cocos/editor-support/spine/Skeleton.h b/native/cocos/editor-support/spine/Skeleton.h deleted file mode 100644 index 7e33eda116..0000000000 --- a/native/cocos/editor-support/spine/Skeleton.h +++ /dev/null @@ -1,247 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_Skeleton_h -#define Spine_Skeleton_h - -#include -#include -#include -#include -#include - -#include // std::numeric_limits - -namespace spine { -class SkeletonData; - -class Bone; - -class Updatable; - -class Slot; - -class IkConstraint; - -class PathConstraint; - -class TransformConstraint; - -class Skin; - -class Attachment; - -class SP_API Skeleton : public SpineObject { - friend class AnimationState; - - friend class SkeletonBounds; - - friend class SkeletonClipping; - - friend class AttachmentTimeline; - - friend class ColorTimeline; - - friend class DeformTimeline; - - friend class DrawOrderTimeline; - - friend class EventTimeline; - - friend class IkConstraintTimeline; - - friend class PathConstraintMixTimeline; - - friend class PathConstraintPositionTimeline; - - friend class PathConstraintSpacingTimeline; - - friend class ScaleTimeline; - - friend class ShearTimeline; - - friend class TransformConstraintTimeline; - - friend class TranslateTimeline; - - friend class TwoColorTimeline; - -public: - explicit Skeleton(SkeletonData *skeletonData); - - ~Skeleton(); - - /// Caches information about bones and constraints. Must be called if bones, constraints or weighted path attachments are added - /// or removed. - void updateCache(); - - void printUpdateCache(); - - /// Updates the world transform for each bone and applies constraints. - void updateWorldTransform(); - - /// Sets the bones, constraints, and slots to their setup pose values. - void setToSetupPose(); - - /// Sets the bones and constraints to their setup pose values. - void setBonesToSetupPose(); - - void setSlotsToSetupPose(); - - /// @return May be NULL. - Bone *findBone(const String &boneName); - - /// @return -1 if the bone was not found. - int findBoneIndex(const String &boneName); - - /// @return May be NULL. - Slot *findSlot(const String &slotName); - - /// @return -1 if the bone was not found. - int findSlotIndex(const String &slotName); - - /// Sets a skin by name (see setSkin). - void setSkin(const String &skinName); - - /// Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. - /// If there was no old skin, each slot's setup mode attachment is attached from the new skin. - /// After changing the skin, the visible attachments can be reset to those attached in the setup pose by calling - /// See Skeleton::setSlotsToSetupPose() - /// Also, often AnimationState::apply(Skeleton&) is called before the next time the - /// skeleton is rendered to allow any attachment keys in the current animation(s) to hide or show attachments from the new skin. - /// - /// @param newSkin May be NULL. - void setSkin(Skin *newSkin); - - /// @return May be NULL. - Attachment *getAttachment(const String &slotName, const String &attachmentName); - - /// @return May be NULL. - Attachment *getAttachment(int slotIndex, const String &attachmentName); - - /// @param attachmentName May be empty. - void setAttachment(const String &slotName, const String &attachmentName); - - /// @return May be NULL. - IkConstraint *findIkConstraint(const String &constraintName); - - /// @return May be NULL. - TransformConstraint *findTransformConstraint(const String &constraintName); - - /// @return May be NULL. - PathConstraint *findPathConstraint(const String &constraintName); - - void update(float delta); - - /// Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose. - /// @param outX The horizontal distance between the skeleton origin and the left side of the AABB. - /// @param outY The vertical distance between the skeleton origin and the bottom side of the AABB. - /// @param outWidth The width of the AABB - /// @param outHeight The height of the AABB. - /// @param outVertexBuffer Reference to hold a Vector of floats. This method will assign it with new floats as needed. - void getBounds(float &outX, float &outY, float &outWidth, float &outHeight, Vector &outVertexBuffer); - - Bone *getRootBone(); - - SkeletonData *getData(); - - Vector &getBones(); - - Vector &getUpdateCacheList(); - - Vector &getSlots(); - - Vector &getDrawOrder(); - - Vector &getIkConstraints(); - - Vector &getPathConstraints(); - - Vector &getTransformConstraints(); - - Skin *getSkin(); - - Color &getColor(); - - float getTime(); - - void setTime(float inValue); - - void setPosition(float x, float y); - - float getX(); - - void setX(float inValue); - - float getY(); - - void setY(float inValue); - - float getScaleX(); - - void setScaleX(float inValue); - - float getScaleY(); - - void setScaleY(float inValue); - -private: - SkeletonData *_data; - Vector _bones; - Vector _slots; - Vector _drawOrder; - Vector _ikConstraints; - Vector _transformConstraints; - Vector _pathConstraints; - Vector _updateCache; - Vector _updateCacheReset; - Skin *_skin; - Color _color; - float _time; - float _scaleX, _scaleY; - float _x, _y; - - void sortIkConstraint(IkConstraint *constraint); - - void sortPathConstraint(PathConstraint *constraint); - - void sortTransformConstraint(TransformConstraint *constraint); - - void sortPathConstraintAttachment(Skin *skin, size_t slotIndex, Bone &slotBone); - - void sortPathConstraintAttachment(Attachment *attachment, Bone &slotBone); - - void sortBone(Bone *bone); - - static void sortReset(Vector &bones); -}; -} - -#endif /* Spine_Skeleton_h */ diff --git a/native/cocos/editor-support/spine/SkeletonBinary.cpp b/native/cocos/editor-support/spine/SkeletonBinary.cpp deleted file mode 100644 index 521b1b271f..0000000000 --- a/native/cocos/editor-support/spine/SkeletonBinary.cpp +++ /dev/null @@ -1,1053 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace spine; - -const int SkeletonBinary::BONE_ROTATE = 0; -const int SkeletonBinary::BONE_TRANSLATE = 1; -const int SkeletonBinary::BONE_SCALE = 2; -const int SkeletonBinary::BONE_SHEAR = 3; - -const int SkeletonBinary::SLOT_ATTACHMENT = 0; -const int SkeletonBinary::SLOT_COLOR = 1; -const int SkeletonBinary::SLOT_TWO_COLOR = 2; - -const int SkeletonBinary::PATH_POSITION = 0; -const int SkeletonBinary::PATH_SPACING = 1; -const int SkeletonBinary::PATH_MIX = 2; - -const int SkeletonBinary::CURVE_LINEAR = 0; -const int SkeletonBinary::CURVE_STEPPED = 1; -const int SkeletonBinary::CURVE_BEZIER = 2; - -SkeletonBinary::SkeletonBinary(Atlas *atlasArray) : _attachmentLoader( - new(__FILE__, __LINE__) AtlasAttachmentLoader(atlasArray)), _error(), _scale(1), _ownsLoader(true) { - -} - -SkeletonBinary::SkeletonBinary(AttachmentLoader *attachmentLoader) : _attachmentLoader(attachmentLoader), _error(), - _scale(1), _ownsLoader(false) { - assert(_attachmentLoader != NULL); -} - -SkeletonBinary::~SkeletonBinary() { - ContainerUtil::cleanUpVectorOfPointers(_linkedMeshes); - _linkedMeshes.clear(); - - if (_ownsLoader) { - delete _attachmentLoader; - } -} - -SkeletonData *SkeletonBinary::readSkeletonData(const unsigned char *binary, const int length) { - bool nonessential; - SkeletonData *skeletonData; - - DataInput *input = new(__FILE__, __LINE__) DataInput(); - input->cursor = binary; - input->end = binary + length; - - _linkedMeshes.clear(); - - skeletonData = new(__FILE__, __LINE__) SkeletonData(); - - char *skeletonData_hash = readString(input); - skeletonData->_hash.own(skeletonData_hash); - - char *skeletonData_version = readString(input); - skeletonData->_version.own(skeletonData_version); - - skeletonData->_width = readFloat(input); - skeletonData->_height = readFloat(input); - - nonessential = readBoolean(input); - - if (nonessential) { - /* Skip images path, audio path & fps */ - skeletonData->_fps = readFloat(input); - skeletonData->_imagesPath.own(readString(input)); - skeletonData->_audioPath.own(readString(input)); - } - - /* Bones. */ - int numBones = readVarint(input, true); - skeletonData->_bones.setSize(numBones, 0); - for (int i = 0; i < numBones; ++i) { - const char *name = readString(input); - BoneData *parent = i == 0 ? 0 : skeletonData->_bones[readVarint(input, true)]; - BoneData *data = new(__FILE__, __LINE__) BoneData(i, String(name, true), parent); - data->_rotation = readFloat(input); - data->_x = readFloat(input) * _scale; - data->_y = readFloat(input) * _scale; - data->_scaleX = readFloat(input); - data->_scaleY = readFloat(input); - data->_shearX = readFloat(input); - data->_shearY = readFloat(input); - data->_length = readFloat(input) * _scale; - data->_transformMode = static_cast(readVarint(input, true)); - if (nonessential) { - /* Skip bone color. */ - readInt(input); - } - skeletonData->_bones[i] = data; - } - - /* Slots. */ - int slotsCount = readVarint(input, true); - skeletonData->_slots.setSize(slotsCount, 0); - for (int i = 0; i < slotsCount; ++i) { - const char *slotName = readString(input); - BoneData *boneData = skeletonData->_bones[readVarint(input, true)]; - SlotData *slotData = new(__FILE__, __LINE__) SlotData(i, String(slotName, true), *boneData); - - readColor(input, slotData->getColor()); - unsigned char r = readByte(input); - unsigned char g = readByte(input); - unsigned char b = readByte(input); - unsigned char a = readByte(input); - if (!(r == 0xff && g == 0xff && b == 0xff && a == 0xff)) { - slotData->getDarkColor().set(r / 255.0f, g / 255.0f, b / 255.0f, 1); - slotData->setHasDarkColor(true); - } - slotData->_attachmentName.own(readString(input)); - slotData->_blendMode = static_cast(readVarint(input, true)); - skeletonData->_slots[i] = slotData; - } - - /* IK constraints. */ - int ikConstraintsCount = readVarint(input, true); - skeletonData->_ikConstraints.setSize(ikConstraintsCount, 0); - for (int i = 0; i < ikConstraintsCount; ++i) { - const char *name = readString(input); - IkConstraintData *data = new(__FILE__, __LINE__) IkConstraintData(String(name, true)); - data->_order = readVarint(input, true); - int bonesCount = readVarint(input, true); - data->_bones.setSize(bonesCount, 0); - for (int ii = 0; ii < bonesCount; ++ii) { - data->_bones[ii] = skeletonData->_bones[readVarint(input, true)]; - } - data->_target = skeletonData->_bones[readVarint(input, true)]; - data->_mix = readFloat(input); - data->_bendDirection = readSByte(input); - data->_compress = readBoolean(input); - data->_stretch = readBoolean(input); - data->_uniform = readBoolean(input); - skeletonData->_ikConstraints[i] = data; - } - - /* Transform constraints. */ - int transformConstraintsCount = readVarint(input, true); - skeletonData->_transformConstraints.setSize(transformConstraintsCount, 0); - for (int i = 0; i < transformConstraintsCount; ++i) { - const char *name = readString(input); - TransformConstraintData *data = new(__FILE__, __LINE__) TransformConstraintData(String(name, true)); - data->_order = readVarint(input, true); - int bonesCount = readVarint(input, true); - data->_bones.setSize(bonesCount, 0); - for (int ii = 0; ii < bonesCount; ++ii) { - data->_bones[ii] = skeletonData->_bones[readVarint(input, true)]; - } - data->_target = skeletonData->_bones[readVarint(input, true)]; - data->_local = readBoolean(input); - data->_relative = readBoolean(input); - data->_offsetRotation = readFloat(input); - data->_offsetX = readFloat(input) * _scale; - data->_offsetY = readFloat(input) * _scale; - data->_offsetScaleX = readFloat(input); - data->_offsetScaleY = readFloat(input); - data->_offsetShearY = readFloat(input); - data->_rotateMix = readFloat(input); - data->_translateMix = readFloat(input); - data->_scaleMix = readFloat(input); - data->_shearMix = readFloat(input); - skeletonData->_transformConstraints[i] = data; - } - - /* Path constraints */ - int pathConstraintsCount = readVarint(input, true); - skeletonData->_pathConstraints.setSize(pathConstraintsCount, 0); - for (int i = 0; i < pathConstraintsCount; ++i) { - const char *name = readString(input); - PathConstraintData *data = new(__FILE__, __LINE__) PathConstraintData(String(name, true)); - data->_order = readVarint(input, true); - int bonesCount = readVarint(input, true); - data->_bones.setSize(bonesCount, 0); - for (int ii = 0; ii < bonesCount; ++ii) { - data->_bones[ii] = skeletonData->_bones[readVarint(input, true)]; - } - data->_target = skeletonData->_slots[readVarint(input, true)]; - data->_positionMode = static_cast(readVarint(input, true)); - data->_spacingMode = static_cast(readVarint(input, true)); - data->_rotateMode = static_cast(readVarint(input, true)); - data->_offsetRotation = readFloat(input); - data->_position = readFloat(input); - if (data->_positionMode == PositionMode_Fixed) data->_position *= _scale; - data->_spacing = readFloat(input); - if (data->_spacingMode == SpacingMode_Length || data->_spacingMode == SpacingMode_Fixed) - data->_spacing *= _scale; - data->_rotateMix = readFloat(input); - data->_translateMix = readFloat(input); - skeletonData->_pathConstraints[i] = data; - } - - /* Default skin. */ - skeletonData->_defaultSkin = readSkin(input, "default", skeletonData, nonessential); - int skinsCount = readVarint(input, true); - if (skeletonData->_defaultSkin) { - ++skinsCount; - } - skeletonData->_skins.setSize(skinsCount, 0); - if (skeletonData->_defaultSkin) { - skeletonData->_skins[0] = skeletonData->_defaultSkin; - } - - /* Skins. */ - for (size_t i = skeletonData->_defaultSkin ? 1 : 0; i < skeletonData->_skins.size(); ++i) { - String skinName(readString(input), true); - skeletonData->_skins[i] = readSkin(input, skinName, skeletonData, nonessential); - } - - /* Linked meshes. */ - for (int i = 0, n = _linkedMeshes.size(); i < n; ++i) { - LinkedMesh *linkedMesh = _linkedMeshes[i]; - Skin *skin = linkedMesh->_skin.length() == 0 ? skeletonData->getDefaultSkin() : skeletonData->findSkin( - linkedMesh->_skin); - if (skin == NULL) { - delete input; - delete skeletonData; - setError("Skin not found: ", linkedMesh->_skin.buffer()); - return NULL; - } - Attachment *parent = skin->getAttachment(linkedMesh->_slotIndex, linkedMesh->_parent); - if (parent == NULL) { - delete input; - delete skeletonData; - setError("Parent mesh not found: ", linkedMesh->_parent.buffer()); - return NULL; - } - linkedMesh->_mesh->setParentMesh(static_cast(parent)); - linkedMesh->_mesh->updateUVs(); - _attachmentLoader->configureAttachment(linkedMesh->_mesh); - } - ContainerUtil::cleanUpVectorOfPointers(_linkedMeshes); - _linkedMeshes.clear(); - - /* Events. */ - int eventsCount = readVarint(input, true); - skeletonData->_events.setSize(eventsCount, 0); - for (int i = 0; i < eventsCount; ++i) { - const char *name = readString(input); - EventData *eventData = new(__FILE__, __LINE__) EventData(String(name, true)); - eventData->_intValue = readVarint(input, false); - eventData->_floatValue = readFloat(input); - eventData->_stringValue.own(readString(input)); - eventData->_audioPath.own(readString(input)); // skip audio path - if (!eventData->_audioPath.isEmpty()) { - eventData->_volume = readFloat(input); - eventData->_balance = readFloat(input); - } - skeletonData->_events[i] = eventData; - } - - /* Animations. */ - int animationsCount = readVarint(input, true); - skeletonData->_animations.setSize(animationsCount, 0); - for (int i = 0; i < animationsCount; ++i) { - String name(readString(input), true); - Animation *animation = readAnimation(name, input, skeletonData); - if (!animation) { - delete input; - delete skeletonData; - return NULL; - } - skeletonData->_animations[i] = animation; - } - - delete input; - return skeletonData; -} - -SkeletonData *SkeletonBinary::readSkeletonDataFile(const String &path) { - int length; - SkeletonData *skeletonData; - const char *binary = SpineExtension::readFile(path.buffer(), &length); - if (length == 0 || !binary) { - setError("Unable to read skeleton file: ", path.buffer()); - return NULL; - } - skeletonData = readSkeletonData((unsigned char *) binary, length); - SpineExtension::free(binary, __FILE__, __LINE__); - return skeletonData; -} - -void SkeletonBinary::setError(const char *value1, const char *value2) { - char message[256]; - int length; - strcpy(message, value1); - length = (int) strlen(value1); - if (value2) { - strncat(message + length, value2, 255 - length); - } - - _error = String(message); -} - -char *SkeletonBinary::readString(DataInput *input) { - int length = readVarint(input, true); - char *string; - if (length == 0) { - return NULL; - } - string = SpineExtension::alloc(length, __FILE__, __LINE__); - memcpy(string, input->cursor, length - 1); - input->cursor += length - 1; - string[length - 1] = '\0'; - return string; -} - -float SkeletonBinary::readFloat(DataInput *input) { - union { - int intValue; - float floatValue; - } intToFloat; - - intToFloat.intValue = readInt(input); - - return intToFloat.floatValue; -} - -unsigned char SkeletonBinary::readByte(DataInput *input) { - return *input->cursor++; -} - -signed char SkeletonBinary::readSByte(DataInput *input) { - return (signed char) readByte(input); -} - -bool SkeletonBinary::readBoolean(DataInput *input) { - return readByte(input) != 0; -} - -int SkeletonBinary::readInt(DataInput *input) { - int result = readByte(input); - result <<= 8; - result |= readByte(input); - result <<= 8; - result |= readByte(input); - result <<= 8; - result |= readByte(input); - return result; -} - -void SkeletonBinary::readColor(DataInput *input, Color &color) { - color.r = readByte(input) / 255.0f; - color.g = readByte(input) / 255.0f; - color.b = readByte(input) / 255.0f; - color.a = readByte(input) / 255.0f; -} - -int SkeletonBinary::readVarint(DataInput *input, bool optimizePositive) { - unsigned char b = readByte(input); - int value = b & 0x7F; - if (b & 0x80) { - b = readByte(input); - value |= (b & 0x7F) << 7; - if (b & 0x80) { - b = readByte(input); - value |= (b & 0x7F) << 14; - if (b & 0x80) { - b = readByte(input); - value |= (b & 0x7F) << 21; - if (b & 0x80) value |= (readByte(input) & 0x7F) << 28; - } - } - } - - if (!optimizePositive) { - value = (((unsigned int) value >> 1) ^ -(value & 1)); - } - - return value; -} - -Skin * -SkeletonBinary::readSkin(DataInput *input, const String &skinName, SkeletonData *skeletonData, bool nonessential) { - int slotCount = readVarint(input, true); - if (slotCount == 0) return NULL; - Skin *skin = new(__FILE__, __LINE__) Skin(skinName); - for (int i = 0; i < slotCount; ++i) { - int slotIndex = readVarint(input, true); - for (int ii = 0, nn = readVarint(input, true); ii < nn; ++ii) { - String name(readString(input), true); - Attachment *attachment = readAttachment(input, skin, slotIndex, name, skeletonData, nonessential); - if (attachment) skin->addAttachment(slotIndex, String(name), attachment); - } - } - return skin; -} - -Attachment *SkeletonBinary::readAttachment(DataInput *input, Skin *skin, int slotIndex, const String &attachmentName, - SkeletonData *skeletonData, bool nonessential) { - String name(readString(input), true); - if (name.isEmpty()) name = attachmentName; - - AttachmentType type = static_cast(readByte(input)); - switch (type) { - case AttachmentType_Region: { - String path(readString(input), true); - if (path.isEmpty()) path = name; - RegionAttachment *region = _attachmentLoader->newRegionAttachment(*skin, String(name), String(path)); - region->_path = path; - region->_rotation = readFloat(input); - region->_x = readFloat(input) * _scale; - region->_y = readFloat(input) * _scale; - region->_scaleX = readFloat(input); - region->_scaleY = readFloat(input); - region->_width = readFloat(input) * _scale; - region->_height = readFloat(input) * _scale; - readColor(input, region->getColor()); - region->updateOffset(); - _attachmentLoader->configureAttachment(region); - return region; - } - case AttachmentType_Boundingbox: { - int vertexCount = readVarint(input, true); - BoundingBoxAttachment *box = _attachmentLoader->newBoundingBoxAttachment(*skin, String(name)); - readVertices(input, static_cast(box), vertexCount); - if (nonessential) { - /* Skip color. */ - readInt(input); - } - _attachmentLoader->configureAttachment(box); - return box; - } - case AttachmentType_Mesh: { - int vertexCount; - MeshAttachment *mesh; - String path(readString(input), true); - if (path.isEmpty()) path = name; - - mesh = _attachmentLoader->newMeshAttachment(*skin, String(name), String(path)); - mesh->_path = path; - readColor(input, mesh->getColor()); - vertexCount = readVarint(input, true); - readFloatArray(input, vertexCount << 1, 1, mesh->getRegionUVs()); - readShortArray(input, mesh->getTriangles()); - readVertices(input, static_cast(mesh), vertexCount); - mesh->updateUVs(); - mesh->_hullLength = readVarint(input, true) << 1; - if (nonessential) { - readShortArray(input, mesh->getEdges()); - mesh->_width = readFloat(input) * _scale; - mesh->_height = readFloat(input) * _scale; - } else { - mesh->_width = 0; - mesh->_height = 0; - } - _attachmentLoader->configureAttachment(mesh); - return mesh; - } - case AttachmentType_Linkedmesh: { - String path(readString(input), true); - if (path.isEmpty()) path = name; - - MeshAttachment *mesh = _attachmentLoader->newMeshAttachment(*skin, String(name), String(path)); - mesh->_path = path; - readColor(input, mesh->getColor()); - String skinName(readString(input), true); - String parent(readString(input), true); - mesh->_inheritDeform = readBoolean(input); - if (nonessential) { - mesh->_width = readFloat(input) * _scale; - mesh->_height = readFloat(input) * _scale; - } - - LinkedMesh *linkedMesh = new(__FILE__, __LINE__) LinkedMesh(mesh, String(skinName), slotIndex, - String(parent)); - _linkedMeshes.add(linkedMesh); - return mesh; - } - case AttachmentType_Path: { - PathAttachment *path = _attachmentLoader->newPathAttachment(*skin, String(name)); - path->_closed = readBoolean(input); - path->_constantSpeed = readBoolean(input); - int vertexCount = readVarint(input, true); - readVertices(input, static_cast(path), vertexCount); - int lengthsLength = vertexCount / 3; - path->_lengths.setSize(lengthsLength, 0); - for (int i = 0; i < lengthsLength; ++i) { - path->_lengths[i] = readFloat(input) * _scale; - } - if (nonessential) { - /* Skip color. */ - readInt(input); - } - _attachmentLoader->configureAttachment(path); - return path; - } - case AttachmentType_Point: { - PointAttachment *point = _attachmentLoader->newPointAttachment(*skin, String(name)); - point->_rotation = readFloat(input); - point->_x = readFloat(input) * _scale; - point->_y = readFloat(input) * _scale; - - if (nonessential) { - /* Skip color. */ - readInt(input); - } - _attachmentLoader->configureAttachment(point); - return point; - } - case AttachmentType_Clipping: { - int endSlotIndex = readVarint(input, true); - int vertexCount = readVarint(input, true); - ClippingAttachment *clip = _attachmentLoader->newClippingAttachment(*skin, name); - readVertices(input, static_cast(clip), vertexCount); - clip->_endSlot = skeletonData->_slots[endSlotIndex]; - if (nonessential) { - /* Skip color. */ - readInt(input); - } - _attachmentLoader->configureAttachment(clip); - return clip; - } - } - return NULL; -} - -void SkeletonBinary::readVertices(DataInput *input, VertexAttachment *attachment, int vertexCount) { - float scale = _scale; - int verticesLength = vertexCount << 1; - attachment->setWorldVerticesLength(vertexCount << 1); - - if (!readBoolean(input)) { - readFloatArray(input, verticesLength, scale, attachment->getVertices()); - return; - } - - Vector &vertices = attachment->getVertices(); - Vector &bones = attachment->getBones(); - vertices.ensureCapacity(verticesLength * 3 * 3); - bones.ensureCapacity(verticesLength * 3); - - for (int i = 0; i < vertexCount; ++i) { - int boneCount = readVarint(input, true); - bones.add(boneCount); - for (int ii = 0; ii < boneCount; ++ii) { - bones.add(readVarint(input, true)); - vertices.add(readFloat(input) * scale); - vertices.add(readFloat(input) * scale); - vertices.add(readFloat(input)); - } - } -} - -void SkeletonBinary::readFloatArray(DataInput *input, int n, float scale, Vector &array) { - array.setSize(n, 0); - - int i; - if (scale == 1) { - for (i = 0; i < n; ++i) { - array[i] = readFloat(input); - } - } else { - for (i = 0; i < n; ++i) { - array[i] = readFloat(input) * scale; - } - } -} - -void SkeletonBinary::readShortArray(DataInput *input, Vector &array) { - int n = readVarint(input, true); - array.setSize(n, 0); - - int i; - for (i = 0; i < n; ++i) { - array[i] = readByte(input) << 8; - array[i] |= readByte(input); - } -} - -Animation *SkeletonBinary::readAnimation(const String &name, DataInput *input, SkeletonData *skeletonData) { - Vector timelines; - float scale = _scale; - float duration = 0; - - // Slot timelines. - for (int i = 0, n = readVarint(input, true); i < n; ++i) { - int slotIndex = readVarint(input, true); - for (int ii = 0, nn = readVarint(input, true); ii < nn; ++ii) { - unsigned char timelineType = readByte(input); - int frameCount = readVarint(input, true); - switch (timelineType) { - case SLOT_ATTACHMENT: { - AttachmentTimeline *timeline = new(__FILE__, __LINE__) AttachmentTimeline(frameCount); - timeline->_slotIndex = slotIndex; - for (int frameIndex = 0; frameIndex < frameCount; ++frameIndex) { - float time = readFloat(input); - String attachmentName = String(readString(input), true); - timeline->setFrame(frameIndex, time, attachmentName); - } - timelines.add(timeline); - duration = MathUtil::max(duration, timeline->_frames[frameCount - 1]); - break; - } - case SLOT_COLOR: { - ColorTimeline *timeline = new(__FILE__, __LINE__) ColorTimeline(frameCount); - timeline->_slotIndex = slotIndex; - for (int frameIndex = 0; frameIndex < frameCount; ++frameIndex) { - float time = readFloat(input); - int color = readInt(input); - float r = ((color & 0xff000000) >> 24) / 255.0f; - float g = ((color & 0x00ff0000) >> 16) / 255.0f; - float b = ((color & 0x0000ff00) >> 8) / 255.0f; - float a = ((color & 0x000000ff)) / 255.0f; - timeline->setFrame(frameIndex, time, r, g, b, a); - if (frameIndex < frameCount - 1) { - readCurve(input, frameIndex, timeline); - } - } - timelines.add(timeline); - duration = MathUtil::max(duration, timeline->_frames[(frameCount - 1) * ColorTimeline::ENTRIES]); - break; - } - case SLOT_TWO_COLOR: { - TwoColorTimeline *timeline = new(__FILE__, __LINE__) TwoColorTimeline(frameCount); - timeline->_slotIndex = slotIndex; - for (int frameIndex = 0; frameIndex < frameCount; ++frameIndex) { - float time = readFloat(input); - int color = readInt(input); - float r = ((color & 0xff000000) >> 24) / 255.0f; - float g = ((color & 0x00ff0000) >> 16) / 255.0f; - float b = ((color & 0x0000ff00) >> 8) / 255.0f; - float a = ((color & 0x000000ff)) / 255.0f; - int color2 = readInt(input); // 0x00rrggbb - float r2 = ((color2 & 0x00ff0000) >> 16) / 255.0f; - float g2 = ((color2 & 0x0000ff00) >> 8) / 255.0f; - float b2 = ((color2 & 0x000000ff)) / 255.0f; - - timeline->setFrame(frameIndex, time, r, g, b, a, r2, g2, b2); - if (frameIndex < frameCount - 1) { - readCurve(input, frameIndex, timeline); - } - } - timelines.add(timeline); - duration = MathUtil::max(duration, timeline->_frames[(frameCount - 1) * TwoColorTimeline::ENTRIES]); - break; - } - default: { - ContainerUtil::cleanUpVectorOfPointers(timelines); - setError("Invalid timeline type for a slot: ", skeletonData->_slots[slotIndex]->_name.buffer()); - return NULL; - } - } - } - } - - // Bone timelines. - for (int i = 0, n = readVarint(input, true); i < n; ++i) { - int boneIndex = readVarint(input, true); - for (int ii = 0, nn = readVarint(input, true); ii < nn; ++ii) { - unsigned char timelineType = readByte(input); - int frameCount = readVarint(input, true); - switch (timelineType) { - case BONE_ROTATE: { - RotateTimeline *timeline = new(__FILE__, __LINE__) RotateTimeline(frameCount); - timeline->_boneIndex = boneIndex; - for (int frameIndex = 0; frameIndex < frameCount; ++frameIndex) { - float time = readFloat(input); - float degrees = readFloat(input); - timeline->setFrame(frameIndex, time, degrees); - if (frameIndex < frameCount - 1) { - readCurve(input, frameIndex, timeline); - } - } - timelines.add(timeline); - duration = MathUtil::max(duration, timeline->_frames[(frameCount - 1) * RotateTimeline::ENTRIES]); - break; - } - case BONE_TRANSLATE: - case BONE_SCALE: - case BONE_SHEAR: { - TranslateTimeline *timeline; - float timelineScale = 1; - if (timelineType == BONE_SCALE) { - timeline = new(__FILE__, __LINE__) ScaleTimeline(frameCount); - } else if (timelineType == BONE_SHEAR) { - timeline = new(__FILE__, __LINE__) ShearTimeline(frameCount); - } else { - timeline = new(__FILE__, __LINE__) TranslateTimeline(frameCount); - timelineScale = scale; - } - timeline->_boneIndex = boneIndex; - for (int frameIndex = 0; frameIndex < frameCount; ++frameIndex) { - float time = readFloat(input); - float x = readFloat(input) * timelineScale; - float y = readFloat(input) * timelineScale; - timeline->setFrame(frameIndex, time, x, y); - if (frameIndex < frameCount - 1) { - readCurve(input, frameIndex, timeline); - } - } - timelines.add(timeline); - duration = MathUtil::max(duration, - timeline->_frames[(frameCount - 1) * TranslateTimeline::ENTRIES]); - break; - } - default: { - ContainerUtil::cleanUpVectorOfPointers(timelines); - setError("Invalid timeline type for a bone: ", skeletonData->_bones[boneIndex]->_name.buffer()); - return NULL; - } - } - } - } - - // IK timelines. - for (int i = 0, n = readVarint(input, true); i < n; ++i) { - int index = readVarint(input, true); - int frameCount = readVarint(input, true); - IkConstraintTimeline *timeline = new(__FILE__, __LINE__) IkConstraintTimeline(frameCount); - timeline->_ikConstraintIndex = index; - for (int frameIndex = 0; frameIndex < frameCount; ++frameIndex) { - float time = readFloat(input); - float mix = readFloat(input); - signed char bendDirection = readSByte(input); - bool compress = readBoolean(input); - bool stretch = readBoolean(input); - timeline->setFrame(frameIndex, time, mix, bendDirection, compress, stretch); - if (frameIndex < frameCount - 1) { - readCurve(input, frameIndex, timeline); - } - } - timelines.add(timeline); - duration = MathUtil::max(duration, timeline->_frames[(frameCount - 1) * IkConstraintTimeline::ENTRIES]); - } - - // Transform constraint timelines. - for (int i = 0, n = readVarint(input, true); i < n; ++i) { - int index = readVarint(input, true); - int frameCount = readVarint(input, true); - TransformConstraintTimeline *timeline = new(__FILE__, __LINE__) TransformConstraintTimeline(frameCount); - timeline->_transformConstraintIndex = index; - for (int frameIndex = 0; frameIndex < frameCount; ++frameIndex) { - float time = readFloat(input); - float rotateMix = readFloat(input); - float translateMix = readFloat(input); - float scaleMix = readFloat(input); - float shearMix = readFloat(input); - timeline->setFrame(frameIndex, time, rotateMix, translateMix, scaleMix, shearMix); - if (frameIndex < frameCount - 1) { - readCurve(input, frameIndex, timeline); - } - } - timelines.add(timeline); - duration = MathUtil::max(duration, timeline->_frames[(frameCount - 1) * TransformConstraintTimeline::ENTRIES]); - } - - // Path constraint timelines. - for (int i = 0, n = readVarint(input, true); i < n; ++i) { - int index = readVarint(input, true); - PathConstraintData *data = skeletonData->_pathConstraints[index]; - for (int ii = 0, nn = readVarint(input, true); ii < nn; ++ii) { - int timelineType = readSByte(input); - int frameCount = readVarint(input, true); - switch (timelineType) { - case PATH_POSITION: - case PATH_SPACING: { - PathConstraintPositionTimeline *timeline; - float timelineScale = 1; - if (timelineType == PATH_SPACING) { - timeline = new(__FILE__, __LINE__) PathConstraintSpacingTimeline(frameCount); - - if (data->_spacingMode == SpacingMode_Length || data->_spacingMode == SpacingMode_Fixed) { - timelineScale = scale; - } - } else { - timeline = new(__FILE__, __LINE__) PathConstraintPositionTimeline(frameCount); - - if (data->_positionMode == PositionMode_Fixed) { - timelineScale = scale; - } - } - timeline->_pathConstraintIndex = index; - for (int frameIndex = 0; frameIndex < frameCount; ++frameIndex) { - float time = readFloat(input); - float value = readFloat(input) * timelineScale; - timeline->setFrame(frameIndex, time, value); - if (frameIndex < frameCount - 1) { - readCurve(input, frameIndex, timeline); - } - } - timelines.add(timeline); - duration = MathUtil::max(duration, timeline->_frames[(frameCount - 1) * - PathConstraintPositionTimeline::ENTRIES]); - break; - } - case PATH_MIX: { - PathConstraintMixTimeline *timeline = new(__FILE__, __LINE__) PathConstraintMixTimeline(frameCount); - - timeline->_pathConstraintIndex = index; - for (int frameIndex = 0; frameIndex < frameCount; ++frameIndex) { - float time = readFloat(input); - float rotateMix = readFloat(input); - float translateMix = readFloat(input); - timeline->setFrame(frameIndex, time, rotateMix, translateMix); - if (frameIndex < frameCount - 1) { - readCurve(input, frameIndex, timeline); - } - } - timelines.add(timeline); - duration = MathUtil::max(duration, - timeline->_frames[(frameCount - 1) * PathConstraintMixTimeline::ENTRIES]); - break; - } - } - } - } - - // Deform timelines. - for (int i = 0, n = readVarint(input, true); i < n; ++i) { - Skin *skin = skeletonData->_skins[readVarint(input, true)]; - for (int ii = 0, nn = readVarint(input, true); ii < nn; ++ii) { - int slotIndex = readVarint(input, true); - for (int iii = 0, nnn = readVarint(input, true); iii < nnn; iii++) { - const char *attachmentName = readString(input); - Attachment *baseAttachment = skin->getAttachment(slotIndex, String(attachmentName, true)); - - if (!baseAttachment) { - ContainerUtil::cleanUpVectorOfPointers(timelines); - setError("Attachment not found: ", attachmentName); - return NULL; - } - - VertexAttachment *attachment = static_cast(baseAttachment); - - bool weighted = attachment->_bones.size() > 0; - Vector &vertices = attachment->_vertices; - size_t deformLength = weighted ? vertices.size() / 3 * 2 - : vertices.size(); - - size_t frameCount = (size_t)readVarint(input, true); - - DeformTimeline *timeline = new(__FILE__, __LINE__) DeformTimeline(frameCount); - - timeline->_slotIndex = slotIndex; - timeline->_attachment = attachment; - - for (size_t frameIndex = 0; frameIndex < frameCount; ++frameIndex) { - float time = readFloat(input); - Vector deform; - size_t end = (size_t)readVarint(input, true); - if (end == 0) { - if (weighted) { - deform.setSize(deformLength, 0); - for (size_t iiii = 0; iiii < deformLength; ++iiii) { - deform[iiii] = 0; - } - } else { - deform.clearAndAddAll(vertices); - } - } else { - deform.setSize(deformLength, 0); - size_t start = (size_t)readVarint(input, true); - end += start; - if (scale == 1) { - for (size_t v = start; v < end; ++v) { - deform[v] = readFloat(input); - } - } else { - for (size_t v = start; v < end; ++v) { - deform[v] = readFloat(input) * scale; - } - } - - if (!weighted) { - for (size_t v = 0, vn = deform.size(); v < vn; ++v) { - deform[v] += vertices[v]; - } - } - } - - timeline->setFrame(frameIndex, time, deform); - if (frameIndex < frameCount - 1) { - readCurve(input, frameIndex, timeline); - } - } - - timelines.add(timeline); - duration = MathUtil::max(duration, timeline->_frames[frameCount - 1]); - } - } - } - - // Draw order timeline. - size_t drawOrderCount = (size_t)readVarint(input, true); - if (drawOrderCount > 0) { - DrawOrderTimeline *timeline = new(__FILE__, __LINE__) DrawOrderTimeline(drawOrderCount); - - size_t slotCount = skeletonData->_slots.size(); - for (size_t i = 0; i < drawOrderCount; ++i) { - float time = readFloat(input); - size_t offsetCount = (size_t)readVarint(input, true); - - Vector drawOrder; - drawOrder.setSize(slotCount, 0); - for (int ii = (int)slotCount - 1; ii >= 0; --ii) { - drawOrder[ii] = -1; - } - - Vector unchanged; - unchanged.setSize(slotCount - offsetCount, 0); - size_t originalIndex = 0, unchangedIndex = 0; - for (size_t ii = 0; ii < offsetCount; ++ii) { - size_t slotIndex = (size_t)readVarint(input, true); - // Collect unchanged items. - while (originalIndex != slotIndex) { - unchanged[unchangedIndex++] = originalIndex++; - } - // Set changed items. - size_t index = originalIndex; - drawOrder[index + (size_t)readVarint(input, true)] = originalIndex++; - } - - // Collect remaining unchanged items. - while (originalIndex < slotCount) { - unchanged[unchangedIndex++] = originalIndex++; - } - - // Fill in unchanged items. - for (int ii = (int)slotCount - 1; ii >= 0; --ii) { - if (drawOrder[ii] == -1) { - drawOrder[ii] = unchanged[--unchangedIndex]; - } - } - timeline->setFrame(i, time, drawOrder); - } - timelines.add(timeline); - duration = MathUtil::max(duration, timeline->_frames[drawOrderCount - 1]); - } - - // Event timeline. - int eventCount = readVarint(input, true); - if (eventCount > 0) { - EventTimeline *timeline = new(__FILE__, __LINE__) EventTimeline(eventCount); - - for (int i = 0; i < eventCount; ++i) { - float time = readFloat(input); - EventData *eventData = skeletonData->_events[readVarint(input, true)]; - Event *event = new(__FILE__, __LINE__) Event(time, *eventData); - - event->_intValue = readVarint(input, false); - event->_floatValue = readFloat(input); - bool freeString = readBoolean(input); - const char *event_stringValue = freeString ? readString(input) : eventData->_stringValue.buffer(); - event->_stringValue = String(event_stringValue); - if (freeString) { - SpineExtension::free(event_stringValue, __FILE__, __LINE__); - } - - if (!eventData->_audioPath.isEmpty()) { - event->_volume = readFloat(input); - event->_balance = readFloat(input); - } - timeline->setFrame(i, event); - } - - timelines.add(timeline); - duration = MathUtil::max(duration, timeline->_frames[eventCount - 1]); - } - - return new(__FILE__, __LINE__) Animation(String(name), timelines, duration); -} - -void SkeletonBinary::readCurve(DataInput *input, int frameIndex, CurveTimeline *timeline) { - switch (readByte(input)) { - case CURVE_STEPPED: { - timeline->setStepped(frameIndex); - break; - } - case CURVE_BEZIER: { - float cx1 = readFloat(input); - float cy1 = readFloat(input); - float cx2 = readFloat(input); - float cy2 = readFloat(input); - timeline->setCurve(frameIndex, cx1, cy1, cx2, cy2); - break; - } - } -} diff --git a/native/cocos/editor-support/spine/SkeletonBinary.h b/native/cocos/editor-support/spine/SkeletonBinary.h deleted file mode 100644 index a5c5082475..0000000000 --- a/native/cocos/editor-support/spine/SkeletonBinary.h +++ /dev/null @@ -1,130 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_SkeletonBinary_h -#define Spine_SkeletonBinary_h - -#include -#include -#include -#include -#include - -namespace spine { - class SkeletonData; - class Atlas; - class AttachmentLoader; - class LinkedMesh; - class Skin; - class Attachment; - class VertexAttachment; - class Animation; - class CurveTimeline; - - class SP_API SkeletonBinary : public SpineObject { - public: - static const int BONE_ROTATE; - static const int BONE_TRANSLATE; - static const int BONE_SCALE; - static const int BONE_SHEAR; - - static const int SLOT_ATTACHMENT; - static const int SLOT_COLOR; - static const int SLOT_TWO_COLOR; - - static const int PATH_POSITION; - static const int PATH_SPACING; - static const int PATH_MIX; - - static const int CURVE_LINEAR; - static const int CURVE_STEPPED; - static const int CURVE_BEZIER; - - explicit SkeletonBinary(Atlas* atlasArray); - - explicit SkeletonBinary(AttachmentLoader* attachmentLoader); - - ~SkeletonBinary(); - - SkeletonData* readSkeletonData(const unsigned char* binary, int length); - - SkeletonData* readSkeletonDataFile(const String& path); - - void setScale(float scale) { _scale = scale; } - - String& getError() { return _error; } - - private: - struct DataInput : public SpineObject { - const unsigned char* cursor; - const unsigned char* end; - }; - - AttachmentLoader* _attachmentLoader; - Vector _linkedMeshes; - String _error; - float _scale; - const bool _ownsLoader; - - void setError(const char* value1, const char* value2); - - char* readString(DataInput* input); - - float readFloat(DataInput* input); - - unsigned char readByte(DataInput* input); - - signed char readSByte(DataInput* input); - - bool readBoolean(DataInput* input); - - int readInt(DataInput* input); - - void readColor(DataInput* input, Color& color); - - int readVarint(DataInput* input, bool optimizePositive); - - Skin* readSkin(DataInput* input, const String& skinName, SkeletonData* skeletonData, bool nonessential); - - Attachment* readAttachment(DataInput* input, Skin* skin, int slotIndex, const String& attachmentName, SkeletonData* skeletonData, bool nonessential); - - void readVertices(DataInput* input, VertexAttachment* attachment, int vertexCount); - - void readFloatArray(DataInput *input, int n, float scale, Vector& array); - - void readShortArray(DataInput *input, Vector& array); - - Animation* readAnimation(const String& name, DataInput* input, SkeletonData *skeletonData); - - void readCurve(DataInput* input, int frameIndex, CurveTimeline* timeline); - }; -} - -#endif /* Spine_SkeletonBinary_h */ diff --git a/native/cocos/editor-support/spine/SkeletonBounds.cpp b/native/cocos/editor-support/spine/SkeletonBounds.cpp deleted file mode 100644 index 5e9ed15858..0000000000 --- a/native/cocos/editor-support/spine/SkeletonBounds.cpp +++ /dev/null @@ -1,238 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include - -#include - -using namespace spine; - -SkeletonBounds::SkeletonBounds() : _minX(0), _minY(0), _maxX(0), _maxY(0) { -} - -void SkeletonBounds::update(Skeleton &skeleton, bool updateAabb) { - Vector &slots = skeleton._slots; - size_t slotCount = slots.size(); - - _boundingBoxes.clear(); - for (size_t i = 0, n = _polygons.size(); i < n; ++i) { - _polygonPool.add(_polygons[i]); - } - - _polygons.clear(); - - for (size_t i = 0; i < slotCount; i++) { - Slot *slot = slots[i]; - Attachment *attachment = slot->getAttachment(); - if (attachment == NULL || !attachment->getRTTI().instanceOf(BoundingBoxAttachment::rtti)) { - continue; - } - BoundingBoxAttachment *boundingBox = static_cast(attachment); - _boundingBoxes.add(boundingBox); - - Polygon *polygonP = NULL; - size_t poolCount = _polygonPool.size(); - if (poolCount > 0) { - polygonP = _polygonPool[poolCount - 1]; - _polygonPool.removeAt(poolCount - 1); - } else { - polygonP = new(__FILE__, __LINE__) Polygon(); - } - - _polygons.add(polygonP); - - Polygon &polygon = *polygonP; - - size_t count = boundingBox->getWorldVerticesLength(); - polygon._count = count; - if (polygon._vertices.size() < count) { - polygon._vertices.setSize(count, 0); - } - boundingBox->computeWorldVertices(*slot, polygon._vertices); - } - - if (updateAabb) { - aabbCompute(); - } else { - _minX = std::numeric_limits::min(); - _minY = std::numeric_limits::min(); - _maxX = std::numeric_limits::max(); - _maxY = std::numeric_limits::max(); - } -} - -bool SkeletonBounds::aabbcontainsPoint(float x, float y) { - return x >= _minX && x <= _maxX && y >= _minY && y <= _maxY; -} - -bool SkeletonBounds::aabbintersectsSegment(float x1, float y1, float x2, float y2) { - float minX = _minX; - float minY = _minY; - float maxX = _maxX; - float maxY = _maxY; - - if ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || - (y1 >= maxY && y2 >= maxY)) { - return false; - } - - float m = (y2 - y1) / (x2 - x1); - float y = m * (minX - x1) + y1; - if (y > minY && y < maxY) { - return true; - } - y = m * (maxX - x1) + y1; - if (y > minY && y < maxY) { - return true; - } - float x = (minY - y1) / m + x1; - if (x > minX && x < maxX) { - return true; - } - x = (maxY - y1) / m + x1; - if (x > minX && x < maxX) { - return true; - } - return false; -} - -bool SkeletonBounds::aabbIntersectsSkeleton(SkeletonBounds bounds) { - return _minX < bounds._maxX && _maxX > bounds._minX && _minY < bounds._maxY && _maxY > bounds._minY; -} - -bool SkeletonBounds::containsPoint(Polygon *polygon, float x, float y) { - Vector &vertices = polygon->_vertices; - int nn = polygon->_count; - - int prevIndex = nn - 2; - bool inside = false; - for (int ii = 0; ii < nn; ii += 2) { - float vertexY = vertices[ii + 1]; - float prevY = vertices[prevIndex + 1]; - if ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) { - float vertexX = vertices[ii]; - if (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x) { - inside = !inside; - } - } - prevIndex = ii; - } - return inside; -} - -BoundingBoxAttachment *SkeletonBounds::containsPoint(float x, float y) { - for (size_t i = 0, n = _polygons.size(); i < n; ++i) { - if (containsPoint(_polygons[i], x, y)) { - return _boundingBoxes[i]; - } - } - - return NULL; -} - -BoundingBoxAttachment *SkeletonBounds::intersectsSegment(float x1, float y1, float x2, float y2) { - for (size_t i = 0, n = _polygons.size(); i < n; ++i) { - if (intersectsSegment(_polygons[i], x1, y1, x2, y2)) { - return _boundingBoxes[i]; - } - } - return NULL; -} - -bool SkeletonBounds::intersectsSegment(Polygon *polygon, float x1, float y1, float x2, float y2) { - Vector &vertices = polygon->_vertices; - size_t nn = polygon->_count; - - float width12 = x1 - x2, height12 = y1 - y2; - float det1 = x1 * y2 - y1 * x2; - float x3 = vertices[nn - 2], y3 = vertices[nn - 1]; - for (size_t ii = 0; ii < nn; ii += 2) { - float x4 = vertices[ii], y4 = vertices[ii + 1]; - float det2 = x3 * y4 - y3 * x4; - float width34 = x3 - x4, height34 = y3 - y4; - float det3 = width12 * height34 - height12 * width34; - float x = (det1 * width34 - width12 * det2) / det3; - if (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) { - float y = (det1 * height34 - height12 * det2) / det3; - if (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1))) { - return true; - } - } - x3 = x4; - y3 = y4; - } - - return false; -} - -spine::Polygon *SkeletonBounds::getPolygon(BoundingBoxAttachment *attachment) { - int index = _boundingBoxes.indexOf(attachment); - - return index == -1 ? NULL : _polygons[index]; -} - -float SkeletonBounds::getWidth() { - return _maxX - _minX; -} - -float SkeletonBounds::getHeight() { - return _maxY - _minY; -} - -void SkeletonBounds::aabbCompute() { - float minX = std::numeric_limits::min(); - float minY = std::numeric_limits::min(); - float maxX = std::numeric_limits::max(); - float maxY = std::numeric_limits::max(); - - for (size_t i = 0, n = _polygons.size(); i < n; ++i) { - Polygon *polygon = _polygons[i]; - Vector &vertices = polygon->_vertices; - for (int ii = 0, nn = polygon->_count; ii < nn; ii += 2) { - float x = vertices[ii]; - float y = vertices[ii + 1]; - minX = MathUtil::min(minX, x); - minY = MathUtil::min(minY, y); - maxX = MathUtil::max(maxX, x); - maxY = MathUtil::max(maxY, y); - } - } - _minX = minX; - _minY = minY; - _maxX = maxX; - _maxY = maxY; -} diff --git a/native/cocos/editor-support/spine/SkeletonBounds.h b/native/cocos/editor-support/spine/SkeletonBounds.h deleted file mode 100644 index 28a1a94921..0000000000 --- a/native/cocos/editor-support/spine/SkeletonBounds.h +++ /dev/null @@ -1,108 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_SkeletonBounds_h -#define Spine_SkeletonBounds_h - -#include -#include - -namespace spine { - class Skeleton; - class BoundingBoxAttachment; - class Polygon; - - /// - /// Collects each BoundingBoxAttachment that is visible and computes the world vertices for its polygon. - /// The polygon vertices are provided along with convenience methods for doing hit detection. - /// - class SP_API SkeletonBounds : public SpineObject { - public: - SkeletonBounds(); - - /// - /// Clears any previous polygons, finds all visible bounding box attachments, - /// and computes the world vertices for each bounding box's polygon. - /// @param skeleton The skeleton. - /// @param updateAabb - /// If true, the axis aligned bounding box containing all the polygons is computed. - /// If false, the SkeletonBounds AABB methods will always return true. - /// - void update(Skeleton& skeleton, bool updateAabb); - - /// Returns true if the axis aligned bounding box contains the point. - bool aabbcontainsPoint(float x, float y); - - /// Returns true if the axis aligned bounding box intersects the line segment. - bool aabbintersectsSegment(float x1, float y1, float x2, float y2); - - /// Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds. - bool aabbIntersectsSkeleton(SkeletonBounds bounds); - - /// Returns true if the polygon contains the point. - bool containsPoint(Polygon* polygon, float x, float y); - - /// Returns the first bounding box attachment that contains the point, or NULL. When doing many checks, it is usually more - /// efficient to only call this method if {@link #aabbcontainsPoint(float, float)} returns true. - BoundingBoxAttachment* containsPoint(float x, float y); - - /// Returns the first bounding box attachment that contains the line segment, or NULL. When doing many checks, it is usually - /// more efficient to only call this method if {@link #aabbintersectsSegment(float, float, float, float)} returns true. - BoundingBoxAttachment* intersectsSegment(float x1, float y1, float x2, float y2); - - /// Returns true if the polygon contains the line segment. - bool intersectsSegment(Polygon* polygon, float x1, float y1, float x2, float y2); - - Polygon* getPolygon(BoundingBoxAttachment* attachment); - - float getWidth(); - float getHeight(); - - private: - Vector _polygonPool; - Vector _boundingBoxes; - Vector _polygons; - float _minX, _minY, _maxX, _maxY; - - void aabbCompute(); - }; - - class Polygon : public SpineObject { - public: - Vector _vertices; - int _count; - - Polygon() : _count(0) { - _vertices.ensureCapacity(16); - } - }; -} - -#endif /* Spine_SkeletonBounds_h */ diff --git a/native/cocos/editor-support/spine/SkeletonClipping.cpp b/native/cocos/editor-support/spine/SkeletonClipping.cpp deleted file mode 100644 index d86aff2f56..0000000000 --- a/native/cocos/editor-support/spine/SkeletonClipping.cpp +++ /dev/null @@ -1,336 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include - -using namespace spine; - -SkeletonClipping::SkeletonClipping() : _clipAttachment(NULL) { - _clipOutput.ensureCapacity(128); - _clippedVertices.ensureCapacity(128); - _clippedTriangles.ensureCapacity(128); - _clippedUVs.ensureCapacity(128); -} - -size_t SkeletonClipping::clipStart(Slot &slot, ClippingAttachment *clip) { - if (_clipAttachment != NULL) { - return 0; - } - - _clipAttachment = clip; - - int n = clip->getWorldVerticesLength(); - _clippingPolygon.setSize(n, 0); - clip->computeWorldVertices(slot, 0, n, _clippingPolygon, 0, 2); - makeClockwise(_clippingPolygon); - _clippingPolygons = &_triangulator.decompose(_clippingPolygon, _triangulator.triangulate(_clippingPolygon)); - - for (size_t i = 0; i < _clippingPolygons->size(); ++i) { - Vector *polygonP = (*_clippingPolygons)[i]; - Vector &polygon = *polygonP; - makeClockwise(polygon); - polygon.add(polygon[0]); - polygon.add(polygon[1]); - } - - return (*_clippingPolygons).size(); -} - -void SkeletonClipping::clipEnd(Slot &slot) { - if (_clipAttachment != NULL && _clipAttachment->_endSlot == &slot._data) { - clipEnd(); - } -} - -void SkeletonClipping::clipEnd() { - if (_clipAttachment == NULL) { - return; - } - - _clipAttachment = NULL; - _clippingPolygons = NULL; - _clippedVertices.clear(); - _clippedUVs.clear(); - _clippedTriangles.clear(); - _clippingPolygon.clear(); -} - -void SkeletonClipping::clipTriangles(Vector &vertices, Vector &triangles, Vector &uvs, size_t stride) { - clipTriangles(vertices.buffer(), triangles.buffer(), triangles.size(), uvs.buffer(), stride); -} - -void SkeletonClipping::clipTriangles(float *vertices, unsigned short *triangles, - size_t trianglesLength, float *uvs, size_t stride) { - Vector &clipOutput = _clipOutput; - Vector &clippedVertices = _clippedVertices; - Vector &clippedTriangles = _clippedTriangles; - Vector *> &polygons = *_clippingPolygons; - size_t polygonsCount = (*_clippingPolygons).size(); - - size_t index = 0; - clippedVertices.clear(); - _clippedUVs.clear(); - clippedTriangles.clear(); - - size_t i = 0; - continue_outer: - for (; i < trianglesLength; i += 3) { - int vertexOffset = triangles[i] * stride; - float x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1]; - float u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1]; - - vertexOffset = triangles[i + 1] * stride; - float x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1]; - float u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1]; - - vertexOffset = triangles[i + 2] * stride; - float x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1]; - float u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1]; - - for (size_t p = 0; p < polygonsCount; p++) { - size_t s = clippedVertices.size(); - if (clip(x1, y1, x2, y2, x3, y3, &(*polygons[p]), &clipOutput)) { - size_t clipOutputLength = clipOutput.size(); - if (clipOutputLength == 0) { - continue; - } - float d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1; - float d = 1 / (d0 * d2 + d1 * (y1 - y3)); - - size_t clipOutputCount = clipOutputLength >> 1; - clippedVertices.setSize(s + clipOutputCount * 2, 0); - _clippedUVs.setSize(s + clipOutputCount * 2, 0); - for (size_t ii = 0; ii < clipOutputLength; ii += 2) { - float x = clipOutput[ii], y = clipOutput[ii + 1]; - clippedVertices[s] = x; - clippedVertices[s + 1] = y; - float c0 = x - x3, c1 = y - y3; - float a = (d0 * c0 + d1 * c1) * d; - float b = (d4 * c0 + d2 * c1) * d; - float c = 1 - a - b; - _clippedUVs[s] = u1 * a + u2 * b + u3 * c; - _clippedUVs[s + 1] = v1 * a + v2 * b + v3 * c; - s += 2; - } - - s = clippedTriangles.size(); - clippedTriangles.setSize(s + 3 * (clipOutputCount - 2), 0); - clipOutputCount--; - for (size_t ii = 1; ii < clipOutputCount; ii++) { - clippedTriangles[s] = (unsigned short)(index); - clippedTriangles[s + 1] = (unsigned short)(index + ii); - clippedTriangles[s + 2] = (unsigned short)(index + ii + 1); - s += 3; - } - index += clipOutputCount + 1; - } else { - clippedVertices.setSize(s + 3 * 2, 0); - _clippedUVs.setSize(s + 3 * 2, 0); - clippedVertices[s] = x1; - clippedVertices[s + 1] = y1; - clippedVertices[s + 2] = x2; - clippedVertices[s + 3] = y2; - clippedVertices[s + 4] = x3; - clippedVertices[s + 5] = y3; - - _clippedUVs[s] = u1; - _clippedUVs[s + 1] = v1; - _clippedUVs[s + 2] = u2; - _clippedUVs[s + 3] = v2; - _clippedUVs[s + 4] = u3; - _clippedUVs[s + 5] = v3; - - s = clippedTriangles.size(); - clippedTriangles.setSize(s + 3, 0); - clippedTriangles[s] = (unsigned short)index; - clippedTriangles[s + 1] = (unsigned short)(index + 1); - clippedTriangles[s + 2] = (unsigned short)(index + 2); - index += 3; - i += 3; - goto continue_outer; - } - } - } -} - -bool SkeletonClipping::isClipping() { - return _clipAttachment != NULL; -} - -Vector &SkeletonClipping::getClippedVertices() { - return _clippedVertices; -} - -Vector &SkeletonClipping::getClippedTriangles() { - return _clippedTriangles; -} - -Vector &SkeletonClipping::getClippedUVs() { - return _clippedUVs; -} - -bool SkeletonClipping::clip(float x1, float y1, float x2, float y2, float x3, float y3, Vector *clippingArea, - Vector *output) { - Vector *originalOutput = output; - bool clipped = false; - - // Avoid copy at the end. - Vector *input; - if (clippingArea->size() % 4 >= 2) { - input = output; - output = &_scratch; - } else { - input = &_scratch; - } - - input->clear(); - input->add(x1); - input->add(y1); - input->add(x2); - input->add(y2); - input->add(x3); - input->add(y3); - input->add(x1); - input->add(y1); - output->clear(); - - Vector &clippingVertices = *clippingArea; - size_t clippingVerticesLast = clippingArea->size() - 4; - for (size_t i = 0;; i += 2) { - float edgeX = clippingVertices[i], edgeY = clippingVertices[i + 1]; - float edgeX2 = clippingVertices[i + 2], edgeY2 = clippingVertices[i + 3]; - float deltaX = edgeX - edgeX2, deltaY = edgeY - edgeY2; - - Vector &inputVertices = *input; - size_t inputVerticesLength = input->size() - 2, outputStart = output->size(); - for (size_t ii = 0; ii < inputVerticesLength; ii += 2) { - float inputX = inputVertices[ii], inputY = inputVertices[ii + 1]; - float inputX2 = inputVertices[ii + 2], inputY2 = inputVertices[ii + 3]; - bool side2 = deltaX * (inputY2 - edgeY2) - deltaY * (inputX2 - edgeX2) > 0; - if (deltaX * (inputY - edgeY2) - deltaY * (inputX - edgeX2) > 0) { - if (side2) { - // v1 inside, v2 inside - output->add(inputX2); - output->add(inputY2); - continue; - } - // v1 inside, v2 outside - float c0 = inputY2 - inputY, c2 = inputX2 - inputX; - float s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY); - if (MathUtil::abs(s) > 0.000001f) { - float ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s; - output->add(edgeX + (edgeX2 - edgeX) * ua); - output->add(edgeY + (edgeY2 - edgeY) * ua); - } else { - output->add(edgeX); - output->add(edgeY); - } - } else if (side2) { - // v1 outside, v2 inside - float c0 = inputY2 - inputY, c2 = inputX2 - inputX; - float s = c0 * (edgeX2 - edgeX) - c2 * (edgeY2 - edgeY); - if (MathUtil::abs(s) > 0.000001f) { - float ua = (c2 * (edgeY - inputY) - c0 * (edgeX - inputX)) / s; - output->add(edgeX + (edgeX2 - edgeX) * ua); - output->add(edgeY + (edgeY2 - edgeY) * ua); - } else { - output->add(edgeX); - output->add(edgeY); - } - output->add(inputX2); - output->add(inputY2); - } - clipped = true; - } - - if (outputStart == output->size()) { - // All edges outside. - originalOutput->clear(); - return true; - } - - output->add((*output)[0]); - output->add((*output)[1]); - - if (i == clippingVerticesLast) { - break; - } - Vector *temp = output; - output = input; - output->clear(); - input = temp; - } - - if (originalOutput != output) { - originalOutput->clear(); - for (size_t i = 0, n = output->size() - 2; i < n; ++i) { - originalOutput->add((*output)[i]); - } - } else { - originalOutput->setSize(originalOutput->size() - 2, 0); - } - - return clipped; -} - -void SkeletonClipping::makeClockwise(Vector &polygon) { - size_t verticeslength = polygon.size(); - - float area = - polygon[verticeslength - 2] * polygon[1] - polygon[0] * polygon[verticeslength - 1], p1x, p1y, p2x, p2y; - - for (size_t i = 0, n = verticeslength - 3; i < n; i += 2) { - p1x = polygon[i]; - p1y = polygon[i + 1]; - p2x = polygon[i + 2]; - p2y = polygon[i + 3]; - area += p1x * p2y - p2x * p1y; - } - - if (area < 0) { - return; - } - - for (size_t i = 0, lastX = verticeslength - 2, n = verticeslength >> 1; i < n; i += 2) { - float x = polygon[i], y = polygon[i + 1]; - int other = lastX - i; - polygon[i] = polygon[other]; - polygon[i + 1] = polygon[other + 1]; - polygon[other] = x; - polygon[other + 1] = y; - } -} diff --git a/native/cocos/editor-support/spine/SkeletonClipping.h b/native/cocos/editor-support/spine/SkeletonClipping.h deleted file mode 100644 index f2b97dcfd5..0000000000 --- a/native/cocos/editor-support/spine/SkeletonClipping.h +++ /dev/null @@ -1,80 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_SkeletonClipping_h -#define Spine_SkeletonClipping_h - -#include -#include - -namespace spine { - class Slot; - class ClippingAttachment; - - class SP_API SkeletonClipping : public SpineObject { - public: - SkeletonClipping(); - - size_t clipStart(Slot& slot, ClippingAttachment* clip); - - void clipEnd(Slot& slot); - - void clipEnd(); - - void clipTriangles(float* vertices, unsigned short* triangles, size_t trianglesLength, float* uvs, size_t stride); - - void clipTriangles(Vector& vertices, Vector& triangles, Vector& uvs, size_t stride); - - bool isClipping(); - - Vector& getClippedVertices(); - Vector& getClippedTriangles(); - Vector& getClippedUVs(); - - private: - Triangulator _triangulator; - Vector _clippingPolygon; - Vector _clipOutput; - Vector _clippedVertices; - Vector _clippedTriangles; - Vector _clippedUVs; - Vector _scratch; - ClippingAttachment* _clipAttachment; - Vector< Vector* > *_clippingPolygons; - - /** Clips the input triangle against the convex, clockwise clipping area. If the triangle lies entirely within the clipping - * area, false is returned. The clipping area must duplicate the first vertex at the end of the vertices list. */ - bool clip(float x1, float y1, float x2, float y2, float x3, float y3, Vector* clippingArea, Vector* output); - - static void makeClockwise(Vector& polygon); - }; -} - -#endif /* Spine_SkeletonClipping_h */ diff --git a/native/cocos/editor-support/spine/SkeletonData.cpp b/native/cocos/editor-support/spine/SkeletonData.cpp deleted file mode 100644 index e0b24a7965..0000000000 --- a/native/cocos/editor-support/spine/SkeletonData.cpp +++ /dev/null @@ -1,222 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -using namespace spine; - -SkeletonData::SkeletonData() : - _name(), - _defaultSkin(NULL), - _width(0), - _height(0), - _version(), - _hash(), - _fps(0), - _imagesPath() { -} - -SkeletonData::~SkeletonData() { - ContainerUtil::cleanUpVectorOfPointers(_bones); - ContainerUtil::cleanUpVectorOfPointers(_slots); - ContainerUtil::cleanUpVectorOfPointers(_skins); - - _defaultSkin = NULL; - - ContainerUtil::cleanUpVectorOfPointers(_events); - ContainerUtil::cleanUpVectorOfPointers(_animations); - ContainerUtil::cleanUpVectorOfPointers(_ikConstraints); - ContainerUtil::cleanUpVectorOfPointers(_transformConstraints); - ContainerUtil::cleanUpVectorOfPointers(_pathConstraints); -} - -BoneData *SkeletonData::findBone(const String &boneName) { - return ContainerUtil::findWithName(_bones, boneName); -} - -int SkeletonData::findBoneIndex(const String &boneName) { - return ContainerUtil::findIndexWithName(_bones, boneName); -} - -SlotData *SkeletonData::findSlot(const String &slotName) { - return ContainerUtil::findWithName(_slots, slotName); -} - -int SkeletonData::findSlotIndex(const String &slotName) { - return ContainerUtil::findIndexWithName(_slots, slotName); -} - -Skin *SkeletonData::findSkin(const String &skinName) { - return ContainerUtil::findWithName(_skins, skinName); -} - -spine::EventData *SkeletonData::findEvent(const String &eventDataName) { - return ContainerUtil::findWithName(_events, eventDataName); -} - -Animation *SkeletonData::findAnimation(const String &animationName) { - return ContainerUtil::findWithName(_animations, animationName); -} - -IkConstraintData *SkeletonData::findIkConstraint(const String &constraintName) { - return ContainerUtil::findWithName(_ikConstraints, constraintName); -} - -TransformConstraintData *SkeletonData::findTransformConstraint(const String &constraintName) { - return ContainerUtil::findWithName(_transformConstraints, constraintName); -} - -PathConstraintData *SkeletonData::findPathConstraint(const String &constraintName) { - return ContainerUtil::findWithName(_pathConstraints, constraintName); -} - -int SkeletonData::findPathConstraintIndex(const String &pathConstraintName) { - return ContainerUtil::findIndexWithName(_pathConstraints, pathConstraintName); -} - -const String &SkeletonData::getName() { - return _name; -} - -void SkeletonData::setName(const String &inValue) { - _name = inValue; -} - -Vector &SkeletonData::getBones() { - return _bones; -} - -Vector &SkeletonData::getSlots() { - return _slots; -} - -Vector &SkeletonData::getSkins() { - return _skins; -} - -Skin *SkeletonData::getDefaultSkin() { - return _defaultSkin; -} - -void SkeletonData::setDefaultSkin(Skin *inValue) { - _defaultSkin = inValue; -} - -Vector &SkeletonData::getEvents() { - return _events; -} - -Vector &SkeletonData::getAnimations() { - return _animations; -} - -Vector &SkeletonData::getIkConstraints() { - return _ikConstraints; -} - -Vector &SkeletonData::getTransformConstraints() { - return _transformConstraints; -} - -Vector &SkeletonData::getPathConstraints() { - return _pathConstraints; -} - -float SkeletonData::getWidth() { - return _width; -} - -void SkeletonData::setWidth(float inValue) { - _width = inValue; -} - -float SkeletonData::getHeight() { - return _height; -} - -void SkeletonData::setHeight(float inValue) { - _height = inValue; -} - -const String &SkeletonData::getVersion() { - return _version; -} - -void SkeletonData::setVersion(const String &inValue) { - _version = inValue; -} - -const String &SkeletonData::getHash() { - return _hash; -} - -void SkeletonData::setHash(const String &inValue) { - _hash = inValue; -} - -const String &SkeletonData::getImagesPath() { - return _imagesPath; -} - -void SkeletonData::setImagesPath(const String &inValue) { - _imagesPath = inValue; -} - - -const String &SkeletonData::getAudioPath() { - return _audioPath; -} - -void SkeletonData::setAudioPath(const String &inValue) { - _audioPath = inValue; -} - -float SkeletonData::getFps() { - return _fps; -} - -void SkeletonData::setFps(float inValue) { - _fps = inValue; -} diff --git a/native/cocos/editor-support/spine/SkeletonData.h b/native/cocos/editor-support/spine/SkeletonData.h deleted file mode 100644 index 4baf6bdb46..0000000000 --- a/native/cocos/editor-support/spine/SkeletonData.h +++ /dev/null @@ -1,184 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_SkeletonData_h -#define Spine_SkeletonData_h - -#include -#include - -namespace spine { -class BoneData; - -class SlotData; - -class Skin; - -class EventData; - -class Animation; - -class IkConstraintData; - -class TransformConstraintData; - -class PathConstraintData; - -/// Stores the setup pose and all of the stateless data for a skeleton. -class SP_API SkeletonData : public SpineObject { - friend class SkeletonBinary; - - friend class SkeletonJson; - - friend class Skeleton; - -public: - SkeletonData(); - - ~SkeletonData(); - - /// Finds a bone by comparing each bone's name. - /// It is more efficient to cache the results of this method than to call it multiple times. - /// @return May be NULL. - BoneData *findBone(const String &boneName); - - /// @return -1 if the bone was not found. - int findBoneIndex(const String &boneName); - - /// @return May be NULL. - SlotData *findSlot(const String &slotName); - - /// @return -1 if the slot was not found. - int findSlotIndex(const String &slotName); - - /// @return May be NULL. - Skin *findSkin(const String &skinName); - - /// @return May be NULL. - spine::EventData *findEvent(const String &eventDataName); - - /// @return May be NULL. - Animation *findAnimation(const String &animationName); - - /// @return May be NULL. - IkConstraintData *findIkConstraint(const String &constraintName); - - /// @return May be NULL. - TransformConstraintData *findTransformConstraint(const String &constraintName); - - /// @return May be NULL. - PathConstraintData *findPathConstraint(const String &constraintName); - - /// @return -1 if the path constraint was not found. - int findPathConstraintIndex(const String &pathConstraintName); - - const String &getName(); - - void setName(const String &inValue); - - /// The skeleton's bones, sorted parent first. The root bone is always the first bone. - Vector &getBones(); - - Vector &getSlots(); - - /// All skins, including the default skin. - Vector &getSkins(); - - /// The skeleton's default skin. - /// By default this skin contains all attachments that were not in a skin in Spine. - /// - /// @return May be NULL. - Skin *getDefaultSkin(); - - void setDefaultSkin(Skin *inValue); - - Vector &getEvents(); - - Vector &getAnimations(); - - Vector &getIkConstraints(); - - Vector &getTransformConstraints(); - - Vector &getPathConstraints(); - - float getWidth(); - - void setWidth(float inValue); - - float getHeight(); - - void setHeight(float inValue); - - /// The Spine version used to export this data, or NULL. - const String &getVersion(); - - void setVersion(const String &inValue); - - const String &getHash(); - - void setHash(const String &inValue); - - const String &getImagesPath(); - - void setImagesPath(const String &inValue); - - const String &getAudioPath(); - - void setAudioPath(const String &inValue); - - /// The dopesheet FPS in Spine. Available only when nonessential data was exported. - float getFps(); - - void setFps(float inValue); - -private: - String _name; - Vector _bones; // Ordered parents first - Vector _slots; // Setup pose draw order. - Vector _skins; - Skin *_defaultSkin; - Vector _events; - Vector _animations; - Vector _ikConstraints; - Vector _transformConstraints; - Vector _pathConstraints; - float _width, _height; - String _version; - String _hash; - - // Nonessential. - float _fps; - String _imagesPath; - String _audioPath; -}; -} - -#endif /* Spine_SkeletonData_h */ diff --git a/native/cocos/editor-support/spine/SkeletonJson.cpp b/native/cocos/editor-support/spine/SkeletonJson.cpp deleted file mode 100644 index b3c0491fd8..0000000000 --- a/native/cocos/editor-support/spine/SkeletonJson.cpp +++ /dev/null @@ -1,1251 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__) -#define strdup _strdup -#endif - -using namespace spine; - -SkeletonJson::SkeletonJson(Atlas *atlas) : _attachmentLoader(new(__FILE__, __LINE__) AtlasAttachmentLoader(atlas)), - _scale(1), _ownsLoader(true) { -} - -SkeletonJson::SkeletonJson(AttachmentLoader *attachmentLoader) : _attachmentLoader(attachmentLoader), _scale(1), - _ownsLoader(false) { - assert(_attachmentLoader != NULL); -} - -SkeletonJson::~SkeletonJson() { - ContainerUtil::cleanUpVectorOfPointers(_linkedMeshes); - - if (_ownsLoader) { - delete _attachmentLoader; - } -} - -SkeletonData *SkeletonJson::readSkeletonDataFile(const String &path) { - int length; - SkeletonData *skeletonData; - const char *json = SpineExtension::readFile(path, &length); - if (length == 0 || !json) { - setError(NULL, "Unable to read skeleton file: ", path); - return NULL; - } - - skeletonData = readSkeletonData(json); - - SpineExtension::free(json, __FILE__, __LINE__); - - return skeletonData; -} - -SkeletonData *SkeletonJson::readSkeletonData(const char *json) { - int i, ii; - SkeletonData *skeletonData; - Json *root, *skeleton, *bones, *boneMap, *ik, *transform, *path, *slots, *skins, *animations, *events; - - _error = ""; - _linkedMeshes.clear(); - - root = new Json(json); - - if (!root) { - setError(NULL, "Invalid skeleton JSON: ", Json::getError()); - return NULL; - } - - skeletonData = new(__FILE__, __LINE__) SkeletonData(); - - skeleton = Json::getItem(root, "skeleton"); - if (skeleton) { - skeletonData->_hash = Json::getString(skeleton, "hash", 0); - skeletonData->_version = Json::getString(skeleton, "spine", 0); - skeletonData->_width = Json::getFloat(skeleton, "width", 0); - skeletonData->_height = Json::getFloat(skeleton, "height", 0); - skeletonData->_fps = Json::getFloat(skeleton, "fps", 30); - skeletonData->_audioPath = Json::getString(skeleton, "audio", 0); - skeletonData->_imagesPath = Json::getString(skeleton, "images", 0); - } - - /* Bones. */ - bones = Json::getItem(root, "bones"); - skeletonData->_bones.setSize(bones->_size, 0); - int bonesCount = 0; - for (boneMap = bones->_child, i = 0; boneMap; boneMap = boneMap->_next, ++i) { - BoneData *data; - const char *transformMode; - - BoneData *parent = 0; - const char *parentName = Json::getString(boneMap, "parent", 0); - if (parentName) { - parent = skeletonData->findBone(parentName); - if (!parent) { - delete skeletonData; - setError(root, "Parent bone not found: ", parentName); - return NULL; - } - } - - data = new(__FILE__, __LINE__) BoneData(bonesCount, Json::getString(boneMap, "name", 0), parent); - - data->_length = Json::getFloat(boneMap, "length", 0) * _scale; - data->_x = Json::getFloat(boneMap, "x", 0) * _scale; - data->_y = Json::getFloat(boneMap, "y", 0) * _scale; - data->_rotation = Json::getFloat(boneMap, "rotation", 0); - data->_scaleX = Json::getFloat(boneMap, "scaleX", 1); - data->_scaleY = Json::getFloat(boneMap, "scaleY", 1); - data->_shearX = Json::getFloat(boneMap, "shearX", 0); - data->_shearY = Json::getFloat(boneMap, "shearY", 0); - transformMode = Json::getString(boneMap, "transform", "normal"); - data->_transformMode = TransformMode_Normal; - if (strcmp(transformMode, "normal") == 0) { - data->_transformMode = TransformMode_Normal; - } - if (strcmp(transformMode, "onlyTranslation") == 0) { - data->_transformMode = TransformMode_OnlyTranslation; - } - if (strcmp(transformMode, "noRotationOrReflection") == 0) { - data->_transformMode = TransformMode_NoRotationOrReflection; - } - if (strcmp(transformMode, "noScale") == 0) { - data->_transformMode = TransformMode_NoScale; - } - if (strcmp(transformMode, "noScaleOrReflection") == 0) { - data->_transformMode = TransformMode_NoScaleOrReflection; - } - - skeletonData->_bones[i] = data; - bonesCount++; - } - - /* Slots. */ - slots = Json::getItem(root, "slots"); - if (slots) { - Json *slotMap; - skeletonData->_slots.ensureCapacity(slots->_size); - skeletonData->_slots.setSize(slots->_size, 0); - for (slotMap = slots->_child, i = 0; slotMap; slotMap = slotMap->_next, ++i) { - SlotData *data; - const char *color; - const char *dark; - Json *item; - - const char *boneName = Json::getString(slotMap, "bone", 0); - BoneData *boneData = skeletonData->findBone(boneName); - if (!boneData) { - delete skeletonData; - setError(root, "Slot bone not found: ", boneName); - return NULL; - } - - data = new(__FILE__, __LINE__) SlotData(i, Json::getString(slotMap, "name", 0), *boneData); - - color = Json::getString(slotMap, "color", 0); - if (color) { - Color &c = data->getColor(); - c.r = toColor(color, 0); - c.g = toColor(color, 1); - c.b = toColor(color, 2); - c.a = toColor(color, 3); - } - - dark = Json::getString(slotMap, "dark", 0); - if (dark) { - Color &darkColor = data->getDarkColor(); - darkColor.r = toColor(dark, 0); - darkColor.g = toColor(dark, 1); - darkColor.b = toColor(dark, 2); - darkColor.a = 1; - data->setHasDarkColor(true); - } - - item = Json::getItem(slotMap, "attachment"); - if (item) { - data->setAttachmentName(item->_valueString); - } - - item = Json::getItem(slotMap, "blend"); - if (item) { - if (strcmp(item->_valueString, "additive") == 0) { - data->_blendMode = BlendMode_Additive; - } else if (strcmp(item->_valueString, "multiply") == 0) { - data->_blendMode = BlendMode_Multiply; - } else if (strcmp(item->_valueString, "screen") == 0) { - data->_blendMode = BlendMode_Screen; - } - } - - skeletonData->_slots[i] = data; - } - } - - /* IK constraints. */ - ik = Json::getItem(root, "ik"); - if (ik) { - Json *constraintMap; - skeletonData->_ikConstraints.ensureCapacity(ik->_size); - skeletonData->_ikConstraints.setSize(ik->_size, 0); - for (constraintMap = ik->_child, i = 0; constraintMap; constraintMap = constraintMap->_next, ++i) { - const char *targetName; - - IkConstraintData *data = new(__FILE__, __LINE__) IkConstraintData( - Json::getString(constraintMap, "name", 0)); - - data->_order = Json::getInt(constraintMap, "order", 0); - - boneMap = Json::getItem(constraintMap, "bones"); - data->_bones.ensureCapacity(boneMap->_size); - data->_bones.setSize(boneMap->_size, 0); - for (boneMap = boneMap->_child, ii = 0; boneMap; boneMap = boneMap->_next, ++ii) { - data->_bones[ii] = skeletonData->findBone(boneMap->_valueString); - if (!data->_bones[ii]) { - delete skeletonData; - setError(root, "IK bone not found: ", boneMap->_valueString); - return NULL; - } - } - - targetName = Json::getString(constraintMap, "target", 0); - data->_target = skeletonData->findBone(targetName); - if (!data->_target) { - delete skeletonData; - setError(root, "Target bone not found: ", targetName); - return NULL; - } - - data->_mix = Json::getFloat(constraintMap, "mix", 1); - data->_bendDirection = Json::getInt(constraintMap, "bendPositive", 1) ? 1 : -1; - data->_compress = Json::getInt(constraintMap, "compress", 0) ? true: false; - data->_stretch = Json::getInt(constraintMap, "stretch", 0) ? true: false; - data->_uniform = Json::getInt(constraintMap, "uniform", 0) ? true: false; - - skeletonData->_ikConstraints[i] = data; - } - } - - /* Transform constraints. */ - transform = Json::getItem(root, "transform"); - if (transform) { - Json *constraintMap; - skeletonData->_transformConstraints.ensureCapacity(transform->_size); - skeletonData->_transformConstraints.setSize(transform->_size, 0); - for (constraintMap = transform->_child, i = 0; constraintMap; constraintMap = constraintMap->_next, ++i) { - const char *name; - - TransformConstraintData *data = new(__FILE__, __LINE__) TransformConstraintData( - Json::getString(constraintMap, "name", 0)); - - data->_order = Json::getInt(constraintMap, "order", 0); - - boneMap = Json::getItem(constraintMap, "bones"); - data->_bones.ensureCapacity(boneMap->_size); - data->_bones.setSize(boneMap->_size, 0); - for (boneMap = boneMap->_child, ii = 0; boneMap; boneMap = boneMap->_next, ++ii) { - data->_bones[ii] = skeletonData->findBone(boneMap->_valueString); - if (!data->_bones[ii]) { - delete skeletonData; - setError(root, "Transform bone not found: ", boneMap->_valueString); - return NULL; - } - } - - name = Json::getString(constraintMap, "target", 0); - data->_target = skeletonData->findBone(name); - if (!data->_target) { - delete skeletonData; - setError(root, "Target bone not found: ", name); - return NULL; - } - - data->_local = Json::getInt(constraintMap, "local", 0) ? true : false; - data->_relative = Json::getInt(constraintMap, "relative", 0) ? true : false; - data->_offsetRotation = Json::getFloat(constraintMap, "rotation", 0); - data->_offsetX = Json::getFloat(constraintMap, "x", 0) * _scale; - data->_offsetY = Json::getFloat(constraintMap, "y", 0) * _scale; - data->_offsetScaleX = Json::getFloat(constraintMap, "scaleX", 0); - data->_offsetScaleY = Json::getFloat(constraintMap, "scaleY", 0); - data->_offsetShearY = Json::getFloat(constraintMap, "shearY", 0); - - data->_rotateMix = Json::getFloat(constraintMap, "rotateMix", 1); - data->_translateMix = Json::getFloat(constraintMap, "translateMix", 1); - data->_scaleMix = Json::getFloat(constraintMap, "scaleMix", 1); - data->_shearMix = Json::getFloat(constraintMap, "shearMix", 1); - - skeletonData->_transformConstraints[i] = data; - } - } - - /* Path constraints */ - path = Json::getItem(root, "path"); - if (path) { - Json *constraintMap; - skeletonData->_pathConstraints.ensureCapacity(path->_size); - skeletonData->_pathConstraints.setSize(path->_size, 0); - for (constraintMap = path->_child, i = 0; constraintMap; constraintMap = constraintMap->_next, ++i) { - const char *name; - const char *item; - - PathConstraintData *data = new(__FILE__, __LINE__) PathConstraintData( - Json::getString(constraintMap, "name", 0)); - - data->_order = Json::getInt(constraintMap, "order", 0); - - boneMap = Json::getItem(constraintMap, "bones"); - data->_bones.ensureCapacity(boneMap->_size); - data->_bones.setSize(boneMap->_size, 0); - for (boneMap = boneMap->_child, ii = 0; boneMap; boneMap = boneMap->_next, ++ii) { - data->_bones[ii] = skeletonData->findBone(boneMap->_valueString); - if (!data->_bones[ii]) { - delete skeletonData; - setError(root, "Path bone not found: ", boneMap->_valueString); - return NULL; - } - } - - name = Json::getString(constraintMap, "target", 0); - data->_target = skeletonData->findSlot(name); - if (!data->_target) { - delete skeletonData; - setError(root, "Target slot not found: ", name); - return NULL; - } - - item = Json::getString(constraintMap, "positionMode", "percent"); - if (strcmp(item, "fixed") == 0) { - data->_positionMode = PositionMode_Fixed; - } else if (strcmp(item, "percent") == 0) { - data->_positionMode = PositionMode_Percent; - } - - item = Json::getString(constraintMap, "spacingMode", "length"); - if (strcmp(item, "length") == 0) { - data->_spacingMode = SpacingMode_Length; - } else if (strcmp(item, "fixed") == 0) { - data->_spacingMode = SpacingMode_Fixed; - } else if (strcmp(item, "percent") == 0) { - data->_spacingMode = SpacingMode_Percent; - } - - item = Json::getString(constraintMap, "rotateMode", "tangent"); - if (strcmp(item, "tangent") == 0) { - data->_rotateMode = RotateMode_Tangent; - } else if (strcmp(item, "chain") == 0) { - data->_rotateMode = RotateMode_Chain; - } else if (strcmp(item, "chainScale") == 0) { - data->_rotateMode = RotateMode_ChainScale; - } - - data->_offsetRotation = Json::getFloat(constraintMap, "rotation", 0); - data->_position = Json::getFloat(constraintMap, "position", 0); - if (data->_positionMode == PositionMode_Fixed) { - data->_position *= _scale; - } - data->_spacing = Json::getFloat(constraintMap, "spacing", 0); - if (data->_spacingMode == SpacingMode_Length || data->_spacingMode == SpacingMode_Fixed) { - data->_spacing *= _scale; - } - data->_rotateMix = Json::getFloat(constraintMap, "rotateMix", 1); - data->_translateMix = Json::getFloat(constraintMap, "translateMix", 1); - - skeletonData->_pathConstraints[i] = data; - } - } - - /* Skins. */ - skins = Json::getItem(root, "skins"); - if (skins) { - Json *skinMap; - skeletonData->_skins.ensureCapacity(skins->_size); - skeletonData->_skins.setSize(skins->_size, 0); - int skinsIndex = 0; - for (skinMap = skins->_child, i = 0; skinMap; skinMap = skinMap->_next, ++i) { - Json *attachmentsMap; - Json *curves; - - Skin *skin = new(__FILE__, __LINE__) Skin(skinMap->_name); - - skeletonData->_skins[skinsIndex++] = skin; - if (strcmp(skinMap->_name, "default") == 0) { - skeletonData->_defaultSkin = skin; - } - - for (attachmentsMap = skinMap->_child; attachmentsMap; attachmentsMap = attachmentsMap->_next) { - int slotIndex = skeletonData->findSlotIndex(attachmentsMap->_name); - Json *attachmentMap; - - for (attachmentMap = attachmentsMap->_child; attachmentMap; attachmentMap = attachmentMap->_next) { - Attachment *attachment = NULL; - const char *skinAttachmentName = attachmentMap->_name; - const char *attachmentName = Json::getString(attachmentMap, "name", skinAttachmentName); - const char *attachmentPath = Json::getString(attachmentMap, "path", attachmentName); - const char *color; - Json *entry; - - const char *typeString = Json::getString(attachmentMap, "type", "region"); - AttachmentType type; - if (strcmp(typeString, "region") == 0) { - type = AttachmentType_Region; - } else if (strcmp(typeString, "mesh") == 0) { - type = AttachmentType_Mesh; - } else if (strcmp(typeString, "linkedmesh") == 0) { - type = AttachmentType_Linkedmesh; - } else if (strcmp(typeString, "boundingbox") == 0) { - type = AttachmentType_Boundingbox; - } else if (strcmp(typeString, "path") == 0) { - type = AttachmentType_Path; - } else if (strcmp(typeString, "clipping") == 0) { - type = AttachmentType_Clipping; - } else if (strcmp(typeString, "point") == 0) { - type = AttachmentType_Point; - }else { - delete skeletonData; - setError(root, "Unknown attachment type: ", typeString); - return NULL; - } - - switch (type) { - case AttachmentType_Region: { - attachment = _attachmentLoader->newRegionAttachment(*skin, attachmentName, attachmentPath); - if (!attachment) { - delete skeletonData; - setError(root, "Error reading attachment: ", skinAttachmentName); - return NULL; - } - - RegionAttachment *region = static_cast(attachment); - region->_path = attachmentPath; - - region->_x = Json::getFloat(attachmentMap, "x", 0) * _scale; - region->_y = Json::getFloat(attachmentMap, "y", 0) * _scale; - region->_scaleX = Json::getFloat(attachmentMap, "scaleX", 1); - region->_scaleY = Json::getFloat(attachmentMap, "scaleY", 1); - region->_rotation = Json::getFloat(attachmentMap, "rotation", 0); - region->_width = Json::getFloat(attachmentMap, "width", 32) * _scale; - region->_height = Json::getFloat(attachmentMap, "height", 32) * _scale; - - color = Json::getString(attachmentMap, "color", 0); - if (color) { - region->getColor().r = toColor(color, 0); - region->getColor().g = toColor(color, 1); - region->getColor().b = toColor(color, 2); - region->getColor().a = toColor(color, 3); - } - - region->updateOffset(); - _attachmentLoader->configureAttachment(region); - break; - } - case AttachmentType_Mesh: - case AttachmentType_Linkedmesh: { - attachment = _attachmentLoader->newMeshAttachment(*skin, attachmentName, attachmentPath); - - if (!attachment) { - delete skeletonData; - setError(root, "Error reading attachment: ", skinAttachmentName); - return NULL; - } - - MeshAttachment *mesh = static_cast(attachment); - mesh->_path = attachmentPath; - - color = Json::getString(attachmentMap, "color", 0); - if (color) { - mesh->getColor().r = toColor(color, 0); - mesh->getColor().g = toColor(color, 1); - mesh->getColor().b = toColor(color, 2); - mesh->getColor().a = toColor(color, 3); - } - - mesh->_width = Json::getFloat(attachmentMap, "width", 32) * _scale; - mesh->_height = Json::getFloat(attachmentMap, "height", 32) * _scale; - - entry = Json::getItem(attachmentMap, "parent"); - if (!entry) { - int verticesLength; - entry = Json::getItem(attachmentMap, "triangles"); - mesh->_triangles.ensureCapacity(entry->_size); - mesh->_triangles.setSize(entry->_size, 0); - for (entry = entry->_child, ii = 0; entry; entry = entry->_next, ++ii) { - mesh->_triangles[ii] = (unsigned short) entry->_valueInt; - } - - entry = Json::getItem(attachmentMap, "uvs"); - verticesLength = entry->_size; - mesh->_regionUVs.ensureCapacity(verticesLength); - mesh->_regionUVs.setSize(verticesLength, 0); - for (entry = entry->_child, ii = 0; entry; entry = entry->_next, ++ii) { - mesh->_regionUVs[ii] = entry->_valueFloat; - } - - readVertices(attachmentMap, mesh, verticesLength); - - mesh->updateUVs(); - - mesh->_hullLength = Json::getInt(attachmentMap, "hull", 0); - - entry = Json::getItem(attachmentMap, "edges"); - if (entry) { - mesh->_edges.ensureCapacity(entry->_size); - mesh->_edges.setSize(entry->_size, 0); - for (entry = entry->_child, ii = 0; entry; entry = entry->_next, ++ii) { - mesh->_edges[ii] = entry->_valueInt; - } - } - _attachmentLoader->configureAttachment(mesh); - } else { - mesh->_inheritDeform = Json::getInt(attachmentMap, "deform", 1) ? true : false; - LinkedMesh *linkedMesh = new(__FILE__, __LINE__) LinkedMesh(mesh, - String(Json::getString( - attachmentMap, - "skin", 0)), - slotIndex, - String(entry->_valueString)); - _linkedMeshes.add(linkedMesh); - } - break; - } - case AttachmentType_Boundingbox: { - attachment = _attachmentLoader->newBoundingBoxAttachment(*skin, attachmentName); - - BoundingBoxAttachment *box = static_cast(attachment); - - int vertexCount = Json::getInt(attachmentMap, "vertexCount", 0) << 1; - readVertices(attachmentMap, box, vertexCount); - _attachmentLoader->configureAttachment(attachment); - break; - } - case AttachmentType_Path: { - attachment = _attachmentLoader->newPathAttachment(*skin, attachmentName); - - PathAttachment *pathAttatchment = static_cast(attachment); - - int vertexCount = 0; - pathAttatchment->_closed = Json::getInt(attachmentMap, "closed", 0) ? true : false; - pathAttatchment->_constantSpeed = Json::getInt(attachmentMap, "constantSpeed", 1) ? true : false; - vertexCount = Json::getInt(attachmentMap, "vertexCount", 0); - readVertices(attachmentMap, pathAttatchment, vertexCount << 1); - - pathAttatchment->_lengths.ensureCapacity(vertexCount / 3); - pathAttatchment->_lengths.setSize(vertexCount / 3, 0); - - curves = Json::getItem(attachmentMap, "lengths"); - for (curves = curves->_child, ii = 0; curves; curves = curves->_next, ++ii) { - pathAttatchment->_lengths[ii] = curves->_valueFloat * _scale; - } - _attachmentLoader->configureAttachment(attachment); - break; - } - case AttachmentType_Point: { - attachment = _attachmentLoader->newPointAttachment(*skin, attachmentName); - - PointAttachment *point = static_cast(attachment); - - point->_x = Json::getFloat(attachmentMap, "x", 0) * _scale; - point->_y = Json::getFloat(attachmentMap, "y", 0) * _scale; - point->_rotation = Json::getFloat(attachmentMap, "rotation", 0); - _attachmentLoader->configureAttachment(attachment); - break; - } - case AttachmentType_Clipping: { - attachment = _attachmentLoader->newClippingAttachment(*skin, attachmentName); - - ClippingAttachment *clip = static_cast(attachment); - - int vertexCount = 0; - const char *end = Json::getString(attachmentMap, "end", 0); - if (end) { - SlotData *slot = skeletonData->findSlot(end); - clip->_endSlot = slot; - } - vertexCount = Json::getInt(attachmentMap, "vertexCount", 0) << 1; - readVertices(attachmentMap, clip, vertexCount); - _attachmentLoader->configureAttachment(attachment); - break; - } - } - - skin->addAttachment(slotIndex, skinAttachmentName, attachment); - } - } - } - } - - /* Linked meshes. */ - int n = _linkedMeshes.size(); - for (i = 0; i < n; ++i) { - LinkedMesh *linkedMesh = _linkedMeshes[i]; - Skin *skin = linkedMesh->_skin.length() == 0 ? skeletonData->getDefaultSkin() : skeletonData->findSkin( - linkedMesh->_skin); - if (skin == NULL) { - delete skeletonData; - setError(root, "Skin not found: ", linkedMesh->_skin.buffer()); - return NULL; - } - Attachment *parent = skin->getAttachment(linkedMesh->_slotIndex, linkedMesh->_parent); - if (parent == NULL) { - delete skeletonData; - setError(root, "Parent mesh not found: ", linkedMesh->_parent.buffer()); - return NULL; - } - linkedMesh->_mesh->setParentMesh(static_cast(parent)); - linkedMesh->_mesh->updateUVs(); - _attachmentLoader->configureAttachment(linkedMesh->_mesh); - } - ContainerUtil::cleanUpVectorOfPointers(_linkedMeshes); - _linkedMeshes.clear(); - - /* Events. */ - events = Json::getItem(root, "events"); - if (events) { - Json *eventMap; - skeletonData->_events.ensureCapacity(events->_size); - skeletonData->_events.setSize(events->_size, 0); - for (eventMap = events->_child, i = 0; eventMap; eventMap = eventMap->_next, ++i) { - EventData *eventData = new(__FILE__, __LINE__) EventData(String(eventMap->_name)); - - eventData->_intValue = Json::getInt(eventMap, "int", 0); - eventData->_floatValue = Json::getFloat(eventMap, "float", 0); - const char *stringValue = Json::getString(eventMap, "string", 0); - eventData->_stringValue = stringValue; - const char *audioPath = Json::getString(eventMap, "audio", 0); - eventData->_audioPath = audioPath; - if (audioPath) { - eventData->_volume = Json::getFloat(eventMap, "volume", 1); - eventData->_balance = Json::getFloat(eventMap, "balance", 0); - } - skeletonData->_events[i] = eventData; - } - } - - /* Animations. */ - animations = Json::getItem(root, "animations"); - if (animations) { - Json *animationMap; - skeletonData->_animations.ensureCapacity(animations->_size); - skeletonData->_animations.setSize(animations->_size, 0); - int animationsIndex = 0; - for (animationMap = animations->_child; animationMap; animationMap = animationMap->_next) { - Animation *animation = readAnimation(animationMap, skeletonData); - if (!animation) { - delete skeletonData; - delete root; - return NULL; - } - skeletonData->_animations[animationsIndex++] = animation; - } - } - - delete root; - - return skeletonData; -} - -float SkeletonJson::toColor(const char *value, size_t index) { - char digits[3]; - char *error; - int color; - - if (index >= strlen(value) / 2) { - return -1; - } - - value += index * 2; - - digits[0] = *value; - digits[1] = *(value + 1); - digits[2] = '\0'; - color = (int) strtoul(digits, &error, 16); - if (*error != 0) { - return -1; - } - - return color / (float) 255; -} - -void SkeletonJson::readCurve(Json *frame, CurveTimeline *timeline, size_t frameIndex) { - Json *curve = Json::getItem(frame, "curve"); - if (!curve) { - return; - } - if (curve->_type == Json::JSON_STRING && strcmp(curve->_valueString, "stepped") == 0) { - timeline->setStepped(frameIndex); - } else if (curve->_type == Json::JSON_ARRAY) { - Json *child0 = curve->_child; - Json *child1 = child0->_next; - Json *child2 = child1->_next; - Json *child3 = child2->_next; - timeline->setCurve(frameIndex, child0->_valueFloat, child1->_valueFloat, child2->_valueFloat, - child3->_valueFloat); - } -} - -Animation *SkeletonJson::readAnimation(Json *root, SkeletonData *skeletonData) { - Vector timelines; - float duration = 0; - - size_t frameIndex; - Json *valueMap; - int timelinesCount = 0; - - Json *bones = Json::getItem(root, "bones"); - Json *slots = Json::getItem(root, "slots"); - Json *ik = Json::getItem(root, "ik"); - Json *transform = Json::getItem(root, "transform"); - Json *paths = Json::getItem(root, "paths"); - Json *deform = Json::getItem(root, "deform"); - Json *drawOrder = Json::getItem(root, "drawOrder"); - Json *events = Json::getItem(root, "events"); - Json *boneMap, *slotMap, *constraintMap; - if (!drawOrder) { - drawOrder = Json::getItem(root, "draworder"); - } - - for (boneMap = bones ? bones->_child : NULL; boneMap; boneMap = boneMap->_next) { - timelinesCount += boneMap->_size; - } - - for (slotMap = slots ? slots->_child : NULL; slotMap; slotMap = slotMap->_next) { - timelinesCount += slotMap->_size; - } - - timelinesCount += ik ? ik->_size : 0; - timelinesCount += transform ? transform->_size : 0; - - for (constraintMap = paths ? paths->_child : NULL; constraintMap; constraintMap = constraintMap->_next) { - timelinesCount += constraintMap->_size; - } - - for (constraintMap = deform ? deform->_child : NULL; constraintMap; constraintMap = constraintMap->_next) { - for (slotMap = constraintMap->_child; slotMap; slotMap = slotMap->_next) { - timelinesCount += slotMap->_size; - } - } - - if (drawOrder) { - ++timelinesCount; - } - - if (events) { - ++timelinesCount; - } - - /** Slot timelines. */ - for (slotMap = slots ? slots->_child : 0; slotMap; slotMap = slotMap->_next) { - Json *timelineMap; - - int slotIndex = skeletonData->findSlotIndex(slotMap->_name); - if (slotIndex == -1) { - ContainerUtil::cleanUpVectorOfPointers(timelines); - setError(NULL, "Slot not found: ", slotMap->_name); - return NULL; - } - - for (timelineMap = slotMap->_child; timelineMap; timelineMap = timelineMap->_next) { - if (strcmp(timelineMap->_name, "attachment") == 0) { - AttachmentTimeline *timeline = new(__FILE__, __LINE__) AttachmentTimeline(timelineMap->_size); - - timeline->_slotIndex = slotIndex; - - for (valueMap = timelineMap->_child, frameIndex = 0; valueMap; valueMap = valueMap->_next, ++frameIndex) { - Json *name = Json::getItem(valueMap, "name"); - String attachmentName = name->_type == Json::JSON_NULL ? "" : name->_valueString; - timeline->setFrame(frameIndex, Json::getFloat(valueMap, "time", 0), attachmentName); - } - timelines.add(timeline); - timelinesCount++; - duration = MathUtil::max(duration, timeline->_frames[timelineMap->_size - 1]); - - } else if (strcmp(timelineMap->_name, "color") == 0) { - ColorTimeline *timeline = new(__FILE__, __LINE__) ColorTimeline(timelineMap->_size); - - timeline->_slotIndex = slotIndex; - - for (valueMap = timelineMap->_child, frameIndex = 0; valueMap; valueMap = valueMap->_next, ++frameIndex) { - const char *s = Json::getString(valueMap, "color", 0); - timeline->setFrame(frameIndex, Json::getFloat(valueMap, "time", 0), toColor(s, 0), toColor(s, 1), - toColor(s, 2), toColor(s, 3)); - readCurve(valueMap, timeline, frameIndex); - } - timelines.add(timeline); - timelinesCount++; - duration = MathUtil::max(duration, - timeline->_frames[(timelineMap->_size - 1) * ColorTimeline::ENTRIES]); - - } else if (strcmp(timelineMap->_name, "twoColor") == 0) { - TwoColorTimeline *timeline = new(__FILE__, __LINE__) TwoColorTimeline(timelineMap->_size); - - timeline->_slotIndex = slotIndex; - - for (valueMap = timelineMap->_child, frameIndex = 0; valueMap; valueMap = valueMap->_next, ++frameIndex) { - const char *s = Json::getString(valueMap, "light", 0); - const char *ds = Json::getString(valueMap, "dark", 0); - timeline->setFrame(frameIndex, Json::getFloat(valueMap, "time", 0), toColor(s, 0), toColor(s, 1), - toColor(s, 2), - toColor(s, 3), toColor(ds, 0), toColor(ds, 1), toColor(ds, 2)); - readCurve(valueMap, timeline, frameIndex); - } - timelines.add(timeline); - timelinesCount++; - duration = MathUtil::max(duration, - timeline->_frames[(timelineMap->_size - 1) * TwoColorTimeline::ENTRIES]); - } else { - ContainerUtil::cleanUpVectorOfPointers(timelines); - setError(NULL, "Invalid timeline type for a slot: ", timelineMap->_name); - return NULL; - } - } - } - - /** Bone timelines. */ - for (boneMap = bones ? bones->_child : 0; boneMap; boneMap = boneMap->_next) { - Json *timelineMap; - - int boneIndex = skeletonData->findBoneIndex(boneMap->_name); - if (boneIndex == -1) { - ContainerUtil::cleanUpVectorOfPointers(timelines); - setError(NULL, "Bone not found: ", boneMap->_name); - return NULL; - } - - for (timelineMap = boneMap->_child; timelineMap; timelineMap = timelineMap->_next) { - if (strcmp(timelineMap->_name, "rotate") == 0) { - RotateTimeline *timeline = new(__FILE__, __LINE__) RotateTimeline(timelineMap->_size); - - timeline->_boneIndex = boneIndex; - - for (valueMap = timelineMap->_child, frameIndex = 0; valueMap; valueMap = valueMap->_next, ++frameIndex) { - timeline->setFrame(frameIndex, Json::getFloat(valueMap, "time", 0), - Json::getFloat(valueMap, "angle", 0)); - readCurve(valueMap, timeline, frameIndex); - } - timelines.add(timeline); - timelinesCount++; - duration = MathUtil::max(duration, - timeline->_frames[(timelineMap->_size - 1) * RotateTimeline::ENTRIES]); - } else { - int isScale = strcmp(timelineMap->_name, "scale") == 0; - int isTranslate = strcmp(timelineMap->_name, "translate") == 0; - int isShear = strcmp(timelineMap->_name, "shear") == 0; - if (isScale || isTranslate || isShear) { - float timelineScale = isTranslate ? _scale : 1; - TranslateTimeline *timeline = 0; - if (isScale) { - timeline = new(__FILE__, __LINE__) ScaleTimeline(timelineMap->_size); - } else if (isTranslate) { - timeline = new(__FILE__, __LINE__) TranslateTimeline(timelineMap->_size); - } else if (isShear) { - timeline = new(__FILE__, __LINE__) ShearTimeline(timelineMap->_size); - } - timeline->_boneIndex = boneIndex; - - for (valueMap = timelineMap->_child, frameIndex = 0; valueMap; valueMap = valueMap->_next, ++frameIndex) { - timeline->setFrame(frameIndex, Json::getFloat(valueMap, "time", 0), - Json::getFloat(valueMap, "x", 0) * timelineScale, - Json::getFloat(valueMap, "y", 0) * timelineScale); - readCurve(valueMap, timeline, frameIndex); - } - - timelines.add(timeline); - timelinesCount++; - duration = MathUtil::max(duration, - timeline->_frames[(timelineMap->_size - 1) * TranslateTimeline::ENTRIES]); - } else { - ContainerUtil::cleanUpVectorOfPointers(timelines); - setError(NULL, "Invalid timeline type for a bone: ", timelineMap->_name); - return NULL; - } - } - } - } - - /** IK constraint timelines. */ - for (constraintMap = ik ? ik->_child : 0; constraintMap; constraintMap = constraintMap->_next) { - IkConstraintData *constraint = skeletonData->findIkConstraint(constraintMap->_name); - IkConstraintTimeline *timeline = new(__FILE__, __LINE__) IkConstraintTimeline(constraintMap->_size); - - for (frameIndex = 0; frameIndex < skeletonData->_ikConstraints.size(); ++frameIndex) { - if (constraint == skeletonData->_ikConstraints[frameIndex]) { - timeline->_ikConstraintIndex = frameIndex; - break; - } - } - for (valueMap = constraintMap->_child, frameIndex = 0; valueMap; valueMap = valueMap->_next, ++frameIndex) { - timeline->setFrame(frameIndex, Json::getFloat(valueMap, "time", 0), Json::getFloat(valueMap, "mix", 1), - Json::getInt(valueMap, "bendPositive", 1) ? 1 : -1, Json::getInt(valueMap, "compress", 0) ? true : false, Json::getInt(valueMap, "stretch", 0) ? true : false); - readCurve(valueMap, timeline, frameIndex); - } - timelines.add(timeline); - timelinesCount++; - duration = MathUtil::max(duration, - timeline->_frames[(constraintMap->_size - 1) * IkConstraintTimeline::ENTRIES]); - } - - /** Transform constraint timelines. */ - for (constraintMap = transform ? transform->_child : 0; constraintMap; constraintMap = constraintMap->_next) { - TransformConstraintData *constraint = skeletonData->findTransformConstraint(constraintMap->_name); - TransformConstraintTimeline *timeline = new(__FILE__, __LINE__) TransformConstraintTimeline( - constraintMap->_size); - - for (frameIndex = 0; frameIndex < skeletonData->_transformConstraints.size(); ++frameIndex) { - if (constraint == skeletonData->_transformConstraints[frameIndex]) { - timeline->_transformConstraintIndex = frameIndex; - break; - } - } - for (valueMap = constraintMap->_child, frameIndex = 0; valueMap; valueMap = valueMap->_next, ++frameIndex) { - timeline->setFrame(frameIndex, Json::getFloat(valueMap, "time", 0), - Json::getFloat(valueMap, "rotateMix", 1), Json::getFloat(valueMap, "translateMix", 1), - Json::getFloat(valueMap, "scaleMix", 1), Json::getFloat(valueMap, "shearMix", 1)); - readCurve(valueMap, timeline, frameIndex); - } - timelines.add(timeline); - timelinesCount++; - duration = MathUtil::max(duration, - timeline->_frames[(constraintMap->_size - 1) * TransformConstraintTimeline::ENTRIES]); - } - - /** Path constraint timelines. */ - for (constraintMap = paths ? paths->_child : 0; constraintMap; constraintMap = constraintMap->_next) { - size_t constraintIndex = 0, i; - Json *timelineMap; - - PathConstraintData *data = skeletonData->findPathConstraint(constraintMap->_name); - if (!data) { - ContainerUtil::cleanUpVectorOfPointers(timelines); - setError(NULL, "Path constraint not found: ", constraintMap->_name); - return NULL; - } - - for (i = 0; i < skeletonData->_pathConstraints.size(); i++) { - if (skeletonData->_pathConstraints[i] == data) { - constraintIndex = i; - break; - } - } - - for (timelineMap = constraintMap->_child; timelineMap; timelineMap = timelineMap->_next) { - const char *timelineName = timelineMap->_name; - if (strcmp(timelineName, "position") == 0 || strcmp(timelineName, "spacing") == 0) { - PathConstraintPositionTimeline *timeline; - float timelineScale = 1; - if (strcmp(timelineName, "spacing") == 0) { - timeline = new(__FILE__, __LINE__) PathConstraintSpacingTimeline(timelineMap->_size); - - if (data->_spacingMode == SpacingMode_Length || data->_spacingMode == SpacingMode_Fixed) { - timelineScale = _scale; - } - } else { - timeline = new(__FILE__, __LINE__) PathConstraintPositionTimeline(timelineMap->_size); - - if (data->_positionMode == PositionMode_Fixed) { - timelineScale = _scale; - } - } - - timeline->_pathConstraintIndex = constraintIndex; - for (valueMap = timelineMap->_child, frameIndex = 0; valueMap; valueMap = valueMap->_next, ++frameIndex) { - timeline->setFrame(frameIndex, Json::getFloat(valueMap, "time", 0), - Json::getFloat(valueMap, timelineName, 0) * timelineScale); - readCurve(valueMap, timeline, frameIndex); - } - timelines.add(timeline); - timelinesCount++; - duration = MathUtil::max(duration, timeline->_frames[(timelineMap->_size - 1) * - PathConstraintPositionTimeline::ENTRIES]); - } else if (strcmp(timelineName, "mix") == 0) { - PathConstraintMixTimeline *timeline = new(__FILE__, __LINE__) PathConstraintMixTimeline( - timelineMap->_size); - timeline->_pathConstraintIndex = constraintIndex; - for (valueMap = timelineMap->_child, frameIndex = 0; valueMap; valueMap = valueMap->_next, ++frameIndex) { - timeline->setFrame(frameIndex, Json::getFloat(valueMap, "time", 0), - Json::getFloat(valueMap, "rotateMix", 1), - Json::getFloat(valueMap, "translateMix", 1)); - readCurve(valueMap, timeline, frameIndex); - } - timelines.add(timeline); - timelinesCount++; - duration = MathUtil::max(duration, timeline->_frames[(timelineMap->_size - 1) * - PathConstraintMixTimeline::ENTRIES]); - } - } - } - - /** Deform timelines. */ - for (constraintMap = deform ? deform->_child : NULL; constraintMap; constraintMap = constraintMap->_next) { - Skin *skin = skeletonData->findSkin(constraintMap->_name); - for (slotMap = constraintMap->_child; slotMap; slotMap = slotMap->_next) { - int slotIndex = skeletonData->findSlotIndex(slotMap->_name); - Json *timelineMap; - for (timelineMap = slotMap->_child; timelineMap; timelineMap = timelineMap->_next) { - DeformTimeline *timeline; - int weighted, deformLength; - - Attachment *baseAttachment = skin->getAttachment(slotIndex, timelineMap->_name); - - if (!baseAttachment) { - ContainerUtil::cleanUpVectorOfPointers(timelines); - setError(NULL, "Attachment not found: ", timelineMap->_name); - return NULL; - } - - VertexAttachment *attachment = static_cast(baseAttachment); - - weighted = attachment->_bones.size() != 0; - Vector &verts = attachment->_vertices; - deformLength = weighted ? verts.size() / 3 * 2 : verts.size(); - - timeline = new(__FILE__, __LINE__) DeformTimeline(timelineMap->_size); - - timeline->_slotIndex = slotIndex; - timeline->_attachment = attachment; - - for (valueMap = timelineMap->_child, frameIndex = 0; valueMap; valueMap = valueMap->_next, ++frameIndex) { - Json *vertices = Json::getItem(valueMap, "vertices"); - Vector deformed; - if (!vertices) { - if (weighted) { - deformed.setSize(deformLength, 0); - } else { - deformed.clearAndAddAll(attachment->_vertices); - } - } else { - int v, start = Json::getInt(valueMap, "offset", 0); - Json *vertex; - deformed.setSize(deformLength, 0); - if (_scale == 1) { - for (vertex = vertices->_child, v = start; vertex; vertex = vertex->_next, ++v) { - deformed[v] = vertex->_valueFloat; - } - } else { - for (vertex = vertices->_child, v = start; vertex; vertex = vertex->_next, ++v) { - deformed[v] = vertex->_valueFloat * _scale; - } - } - if (!weighted) { - Vector &verticesAttachment = attachment->_vertices; - for (v = 0; v < deformLength; ++v) { - deformed[v] += verticesAttachment[v]; - } - } - } - timeline->setFrame(frameIndex, Json::getFloat(valueMap, "time", 0), deformed); - readCurve(valueMap, timeline, frameIndex); - } - - timelines.add(timeline); - timelinesCount++; - duration = MathUtil::max(duration, timeline->_frames[timelineMap->_size - 1]); - } - } - } - - /** Draw order timeline. */ - if (drawOrder) { - DrawOrderTimeline *timeline = new(__FILE__, __LINE__) DrawOrderTimeline(drawOrder->_size); - - for (valueMap = drawOrder->_child, frameIndex = 0; valueMap; valueMap = valueMap->_next, ++frameIndex) { - int ii; - Vector drawOrder2; - Json *offsets = Json::getItem(valueMap, "offsets"); - if (offsets) { - Json *offsetMap; - Vector unchanged; - unchanged.ensureCapacity(skeletonData->_slots.size() - offsets->_size); - unchanged.setSize(skeletonData->_slots.size() - offsets->_size, 0); - size_t originalIndex = 0, unchangedIndex = 0; - - drawOrder2.ensureCapacity(skeletonData->_slots.size()); - drawOrder2.setSize(skeletonData->_slots.size(), 0); - for (ii = (int)skeletonData->_slots.size() - 1; ii >= 0; --ii) { - drawOrder2[ii] = -1; - } - - for (offsetMap = offsets->_child; offsetMap; offsetMap = offsetMap->_next) { - int slotIndex = skeletonData->findSlotIndex(Json::getString(offsetMap, "slot", 0)); - if (slotIndex == -1) { - ContainerUtil::cleanUpVectorOfPointers(timelines); - setError(NULL, "Slot not found: ", Json::getString(offsetMap, "slot", 0)); - return NULL; - } - /* Collect unchanged items. */ - while (originalIndex != (size_t)slotIndex) { - unchanged[unchangedIndex++] = originalIndex++; - } - /* Set changed items. */ - drawOrder2[originalIndex + Json::getInt(offsetMap, "offset", 0)] = originalIndex; - originalIndex++; - } - /* Collect remaining unchanged items. */ - while (originalIndex < skeletonData->_slots.size()) { - unchanged[unchangedIndex++] = originalIndex++; - } - /* Fill in unchanged items. */ - for (ii = (int)skeletonData->_slots.size() - 1; ii >= 0; ii--) { - if (drawOrder2[ii] == -1) { - drawOrder2[ii] = unchanged[--unchangedIndex]; - } - } - } - timeline->setFrame(frameIndex, Json::getFloat(valueMap, "time", 0), drawOrder2); - } - timelines.add(timeline); - timelinesCount++; - duration = MathUtil::max(duration, timeline->_frames[drawOrder->_size - 1]); - } - - /** Event timeline. */ - if (events) { - EventTimeline *timeline = new(__FILE__, __LINE__) EventTimeline(events->_size); - - for (valueMap = events->_child, frameIndex = 0; valueMap; valueMap = valueMap->_next, ++frameIndex) { - Event *event; - EventData *eventData = skeletonData->findEvent(Json::getString(valueMap, "name", 0)); - if (!eventData) { - ContainerUtil::cleanUpVectorOfPointers(timelines); - setError(NULL, "Event not found: ", Json::getString(valueMap, "name", 0)); - return NULL; - } - - event = new(__FILE__, __LINE__) Event(Json::getFloat(valueMap, "time", 0), *eventData); - event->_intValue = Json::getInt(valueMap, "int", eventData->_intValue); - event->_floatValue = Json::getFloat(valueMap, "float", eventData->_floatValue); - event->_stringValue = Json::getString(valueMap, "string", eventData->_stringValue.buffer()); - if (!eventData->_audioPath.isEmpty()) { - event->_volume = Json::getFloat(valueMap, "volume", 1); - event->_balance = Json::getFloat(valueMap, "balance", 0); - } - timeline->setFrame(frameIndex, event); - } - timelines.add(timeline); - timelinesCount++; - duration = MathUtil::max(duration, timeline->_frames[events->_size - 1]); - } - - return new(__FILE__, __LINE__) Animation(String(root->_name), timelines, duration); -} - -void SkeletonJson::readVertices(Json *attachmentMap, VertexAttachment *attachment, size_t verticesLength) { - Json *entry; - size_t i, n, nn, entrySize; - Vector vertices; - - attachment->setWorldVerticesLength(verticesLength); - - entry = Json::getItem(attachmentMap, "vertices"); - entrySize = entry->_size; - vertices.ensureCapacity(entrySize); - vertices.setSize(entrySize, 0); - for (entry = entry->_child, i = 0; entry; entry = entry->_next, ++i) { - vertices[i] = entry->_valueFloat; - } - - if (verticesLength == entrySize) { - if (_scale != 1) { - for (i = 0; i < entrySize; ++i) { - vertices[i] *= _scale; - } - } - - attachment->getVertices().clearAndAddAll(vertices); - return; - } - - Vertices bonesAndWeights; - bonesAndWeights._bones.ensureCapacity(verticesLength * 3); - bonesAndWeights._vertices.ensureCapacity(verticesLength * 3 * 3); - - for (i = 0, n = entrySize; i < n;) { - int boneCount = (int) vertices[i++]; - bonesAndWeights._bones.add(boneCount); - for (nn = i + boneCount * 4; i < nn; i += 4) { - bonesAndWeights._bones.add((int) vertices[i]); - bonesAndWeights._vertices.add(vertices[i + 1] * _scale); - bonesAndWeights._vertices.add(vertices[i + 2] * _scale); - bonesAndWeights._vertices.add(vertices[i + 3]); - } - } - - attachment->getVertices().clearAndAddAll(bonesAndWeights._vertices); - attachment->getBones().clearAndAddAll(bonesAndWeights._bones); -} - -void SkeletonJson::setError(Json *root, const String &value1, const String &value2) { - _error = String(value1).append(value2); - - delete root; -} diff --git a/native/cocos/editor-support/spine/SkeletonJson.h b/native/cocos/editor-support/spine/SkeletonJson.h deleted file mode 100644 index 5b07c4dff6..0000000000 --- a/native/cocos/editor-support/spine/SkeletonJson.h +++ /dev/null @@ -1,92 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_SkeletonJson_h -#define Spine_SkeletonJson_h - -#include -#include -#include - -namespace spine { -class CurveTimeline; - -class VertexAttachment; - -class Animation; - -class Json; - -class SkeletonData; - -class Atlas; - -class AttachmentLoader; - -class LinkedMesh; - -class String; - -class SP_API SkeletonJson : public SpineObject { -public: - explicit SkeletonJson(Atlas *atlas); - - explicit SkeletonJson(AttachmentLoader *attachmentLoader); - - ~SkeletonJson(); - - SkeletonData *readSkeletonDataFile(const String &path); - - SkeletonData *readSkeletonData(const char *json); - - void setScale(float scale) { _scale = scale; } - - String &getError() { return _error; } - -private: - AttachmentLoader *_attachmentLoader; - Vector _linkedMeshes; - float _scale; - const bool _ownsLoader; - String _error; - - static float toColor(const char *value, size_t index); - - static void readCurve(Json *frame, CurveTimeline *timeline, size_t frameIndex); - - Animation *readAnimation(Json *root, SkeletonData *skeletonData); - - void readVertices(Json *attachmentMap, VertexAttachment *attachment, size_t verticesLength); - - void setError(Json *root, const String &value1, const String &value2); -}; -} - -#endif /* Spine_SkeletonJson_h */ diff --git a/native/cocos/editor-support/spine/Skin.cpp b/native/cocos/editor-support/spine/Skin.cpp deleted file mode 100644 index a1be7d8b80..0000000000 --- a/native/cocos/editor-support/spine/Skin.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include - -#include - -#include - -using namespace spine; - -Skin::AttachmentMap::AttachmentMap() { -} - -void Skin::AttachmentMap::put(size_t slotIndex, const String &attachmentName, Attachment *attachment) { - if (slotIndex >= _buckets.size()) - _buckets.setSize(slotIndex + 1, Vector()); - Vector &bucket = _buckets[slotIndex]; - int existing = findInBucket(bucket, attachmentName); - if (existing >= 0) { - bucket[existing]._attachment = attachment; - } else { - bucket.add(Entry(slotIndex, attachmentName, attachment)); - } -} - -Attachment *Skin::AttachmentMap::get(size_t slotIndex, const String &attachmentName) { - if (slotIndex >= _buckets.size()) return NULL; - int existing = findInBucket(_buckets[slotIndex], attachmentName); - return existing >= 0 ? _buckets[slotIndex][existing]._attachment : NULL; -} - -void Skin::AttachmentMap::remove(size_t slotIndex, const String &attachmentName) { - if (slotIndex >= _buckets.size()) return; - int existing = findInBucket(_buckets[slotIndex], attachmentName); - if (existing >= 0) _buckets[slotIndex].removeAt(existing); -} - -int Skin::AttachmentMap::findInBucket(Vector &bucket, const String &attachmentName) { - for (size_t i = 0; i < bucket.size(); i++) - if (bucket[i]._name == attachmentName) return i; - return -1; -} - -Skin::AttachmentMap::Entries Skin::AttachmentMap::getEntries() { - return Skin::AttachmentMap::Entries(_buckets); -} - -Skin::Skin(const String &name) : _name(name), _attachments() { - assert(_name.length() > 0); -} - -Skin::~Skin() { - Skin::AttachmentMap::Entries entries = _attachments.getEntries(); - while (entries.hasNext()) { - Skin::AttachmentMap::Entry entry = entries.next(); - delete entry._attachment; - } -} - -void Skin::addAttachment(size_t slotIndex, const String &name, Attachment *attachment) { - assert(attachment); - _attachments.put(slotIndex, name, attachment); -} - -Attachment *Skin::getAttachment(size_t slotIndex, const String &name) { - return _attachments.get(slotIndex, name); -} - -void Skin::findNamesForSlot(size_t slotIndex, Vector &names) { - Skin::AttachmentMap::Entries entries = _attachments.getEntries(); - while (entries.hasNext()) { - Skin::AttachmentMap::Entry &entry = entries.next(); - if (entry._slotIndex == slotIndex) { - names.add(entry._name); - } - } -} - -void Skin::findAttachmentsForSlot(size_t slotIndex, Vector &attachments) { - Skin::AttachmentMap::Entries entries = _attachments.getEntries(); - while (entries.hasNext()) { - Skin::AttachmentMap::Entry &entry = entries.next(); - if (entry._slotIndex == slotIndex) { - attachments.add(entry._attachment); - } - } -} - -const String &Skin::getName() { - return _name; -} - -Skin::AttachmentMap::Entries Skin::getAttachments() { - return _attachments.getEntries(); -} - -void Skin::attachAll(Skeleton &skeleton, Skin &oldSkin) { - Vector &slots = skeleton.getSlots(); - Skin::AttachmentMap::Entries entries = oldSkin.getAttachments(); - while (entries.hasNext()) { - Skin::AttachmentMap::Entry &entry = entries.next(); - int slotIndex = entry._slotIndex; - Slot *slot = slots[slotIndex]; - - if (slot->getAttachment() == entry._attachment) { - Attachment *attachment = getAttachment(slotIndex, entry._name); - if (attachment) { - slot->setAttachment(attachment); - } - } - } -} diff --git a/native/cocos/editor-support/spine/Skin.h b/native/cocos/editor-support/spine/Skin.h deleted file mode 100644 index cb0295fe3c..0000000000 --- a/native/cocos/editor-support/spine/Skin.h +++ /dev/null @@ -1,149 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_Skin_h -#define Spine_Skin_h - -#include -#include - -namespace spine { -class Attachment; - -class Skeleton; - -/// Stores attachments by slot index and attachment name. -/// See SkeletonData::getDefaultSkin, Skeleton::getSkin, and -/// http://esotericsoftware.com/spine-runtime-skins in the Spine Runtimes Guide. -class SP_API Skin : public SpineObject { - friend class Skeleton; - -public: - class SP_API AttachmentMap : public SpineObject { - friend class Skin; - - public: - struct SP_API Entry { - size_t _slotIndex; - String _name; - Attachment *_attachment; - - Entry(size_t slotIndex, const String &name, Attachment *attachment) : - _slotIndex(slotIndex), - _name(name), - _attachment(attachment) { - } - }; - - class SP_API Entries { - friend class AttachmentMap; - - public: - bool hasNext() { - while(true) { - if (_slotIndex >= _buckets.size()) return false; - if (_bucketIndex >= _buckets[_slotIndex].size()) { - _bucketIndex = 0; - ++_slotIndex; - continue; - }; - return true; - } - } - - Entry &next() { - Entry &result = _buckets[_slotIndex][_bucketIndex]; - ++_bucketIndex; - return result; - } - - protected: - Entries(Vector< Vector > &buckets) : _buckets(buckets), _slotIndex(0), _bucketIndex(0) { - } - - private: - Vector< Vector > &_buckets; - size_t _slotIndex; - size_t _bucketIndex; - }; - - void put(size_t slotIndex, const String &attachmentName, Attachment *attachment); - - Attachment *get(size_t slotIndex, const String &attachmentName); - - void remove(size_t slotIndex, const String &attachmentName); - - Entries getEntries(); - - protected: - AttachmentMap(); - - private: - - int findInBucket(Vector &, const String &attachmentName); - - Vector > _buckets; - }; - - explicit Skin(const String &name); - - ~Skin(); - - /// Adds an attachment to the skin for the specified slot index and name. - /// If the name already exists for the slot, the previous value is replaced. - void addAttachment(size_t slotIndex, const String &name, Attachment *attachment); - - /// Returns the attachment for the specified slot index and name, or NULL. - Attachment *getAttachment(size_t slotIndex, const String &name); - - /// Finds the skin keys for a given slot. The results are added to the passed array of names. - /// @param slotIndex The target slotIndex. To find the slot index, use Skeleton::findSlotIndex or SkeletonData::findSlotIndex - /// @param names Found skin key names will be added to this array. - void findNamesForSlot(size_t slotIndex, Vector &names); - - /// Finds the attachments for a given slot. The results are added to the passed array of Attachments. - /// @param slotIndex The target slotIndex. To find the slot index, use Skeleton::findSlotIndex or SkeletonData::findSlotIndex - /// @param attachments Found Attachments will be added to this array. - void findAttachmentsForSlot(size_t slotIndex, Vector &attachments); - - const String &getName(); - - AttachmentMap::Entries getAttachments(); - -private: - const String _name; - AttachmentMap _attachments; - - /// Attach all attachments from this skin if the corresponding attachment from the old skin is currently attached. - void attachAll(Skeleton &skeleton, Skin &oldSkin); -}; -} - -#endif /* Spine_Skin_h */ diff --git a/native/cocos/editor-support/spine/Slot.cpp b/native/cocos/editor-support/spine/Slot.cpp deleted file mode 100644 index 35051b59a2..0000000000 --- a/native/cocos/editor-support/spine/Slot.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include -#include -#include - -using namespace spine; - -Slot::Slot(SlotData &data, Bone &bone) : - _data(data), - _bone(bone), - _skeleton(bone.getSkeleton()), - _color(1, 1, 1, 1), - _darkColor(0, 0, 0, 0), - _hasDarkColor(data.hasDarkColor()), - _attachment(NULL), - _attachmentTime(0) { - setToSetupPose(); -} - -void Slot::setToSetupPose() { - _color.set(_data.getColor()); - - const String &attachmentName = _data.getAttachmentName(); - if (attachmentName.length() > 0) { - _attachment = NULL; - setAttachment(_skeleton.getAttachment(_data.getIndex(), attachmentName)); - } else { - setAttachment(NULL); - } -} - -SlotData &Slot::getData() { - return _data; -} - -Bone &Slot::getBone() { - return _bone; -} - -Skeleton &Slot::getSkeleton() { - return _skeleton; -} - -Color &Slot::getColor() { - return _color; -} - -Color &Slot::getDarkColor() { - return _darkColor; -} - -bool Slot::hasDarkColor() { - return _hasDarkColor; -} - -Attachment *Slot::getAttachment() { - return _attachment; -} - -void Slot::setAttachment(Attachment *inValue) { - if (_attachment == inValue) { - return; - } - - _attachment = inValue; - _attachmentTime = _skeleton.getTime(); - _attachmentVertices.clear(); -} - -float Slot::getAttachmentTime() { - return _skeleton.getTime() - _attachmentTime; -} - -void Slot::setAttachmentTime(float inValue) { - _attachmentTime = _skeleton.getTime() - inValue; -} - -Vector &Slot::getAttachmentVertices() { - return _attachmentVertices; -} diff --git a/native/cocos/editor-support/spine/Slot.h b/native/cocos/editor-support/spine/Slot.h deleted file mode 100644 index b1f83c8694..0000000000 --- a/native/cocos/editor-support/spine/Slot.h +++ /dev/null @@ -1,127 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_Slot_h -#define Spine_Slot_h - -#include -#include -#include - -#include - -namespace spine { -class SlotData; - -class Bone; - -class Skeleton; - -class Attachment; - -class SP_API Slot : public SpineObject { - friend class VertexAttachment; - - friend class Skeleton; - - friend class SkeletonBounds; - - friend class SkeletonClipping; - - friend class AttachmentTimeline; - - friend class ColorTimeline; - - friend class DeformTimeline; - - friend class DrawOrderTimeline; - - friend class EventTimeline; - - friend class IkConstraintTimeline; - - friend class PathConstraintMixTimeline; - - friend class PathConstraintPositionTimeline; - - friend class PathConstraintSpacingTimeline; - - friend class ScaleTimeline; - - friend class ShearTimeline; - - friend class TransformConstraintTimeline; - - friend class TranslateTimeline; - - friend class TwoColorTimeline; - -public: - Slot(SlotData &data, Bone &bone); - - void setToSetupPose(); - - SlotData &getData(); - - Bone &getBone(); - - Skeleton &getSkeleton(); - - Color &getColor(); - - Color &getDarkColor(); - - bool hasDarkColor(); - - /// May be NULL. - Attachment *getAttachment(); - - void setAttachment(Attachment *inValue); - - float getAttachmentTime(); - - void setAttachmentTime(float inValue); - - Vector &getAttachmentVertices(); - -private: - SlotData &_data; - Bone &_bone; - Skeleton &_skeleton; - Color _color; - Color _darkColor; - bool _hasDarkColor; - Attachment *_attachment; - float _attachmentTime; - Vector _attachmentVertices; -}; -} - -#endif /* Spine_Slot_h */ diff --git a/native/cocos/editor-support/spine/SlotData.cpp b/native/cocos/editor-support/spine/SlotData.cpp deleted file mode 100644 index f5b7bb51d4..0000000000 --- a/native/cocos/editor-support/spine/SlotData.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include - -using namespace spine; - -SlotData::SlotData(int index, const String &name, BoneData &boneData) : - _index(index), - _name(name), - _boneData(boneData), - _color(1, 1, 1, 1), - _darkColor(0, 0, 0, 0), - _hasDarkColor(false), - _attachmentName(), - _blendMode(BlendMode_Normal) { - assert(_index >= 0); - assert(_name.length() > 0); -} - -int SlotData::getIndex() { - return _index; -} - -const String &SlotData::getName() { - return _name; -} - -BoneData &SlotData::getBoneData() { - return _boneData; -} - -Color &SlotData::getColor() { - return _color; -} - -Color &SlotData::getDarkColor() { - return _darkColor; -} - -bool SlotData::hasDarkColor() { - return _hasDarkColor; -} - -void SlotData::setHasDarkColor(bool inValue) { - _hasDarkColor = inValue; -} - -const String &SlotData::getAttachmentName() { - return _attachmentName; -} - -void SlotData::setAttachmentName(const String &inValue) { - _attachmentName = inValue; -} - -BlendMode SlotData::getBlendMode() { - return _blendMode; -} - -void SlotData::setBlendMode(BlendMode inValue) { - _blendMode = inValue; -} diff --git a/native/cocos/editor-support/spine/SlotData.h b/native/cocos/editor-support/spine/SlotData.h deleted file mode 100644 index 8d7691a8e8..0000000000 --- a/native/cocos/editor-support/spine/SlotData.h +++ /dev/null @@ -1,114 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_SlotData_h -#define Spine_SlotData_h - -#include -#include -#include -#include - -namespace spine { -class BoneData; - -class SP_API SlotData : public SpineObject { - friend class SkeletonBinary; - - friend class SkeletonJson; - - friend class AttachmentTimeline; - - friend class ColorTimeline; - - friend class DeformTimeline; - - friend class DrawOrderTimeline; - - friend class EventTimeline; - - friend class IkConstraintTimeline; - - friend class PathConstraintMixTimeline; - - friend class PathConstraintPositionTimeline; - - friend class PathConstraintSpacingTimeline; - - friend class ScaleTimeline; - - friend class ShearTimeline; - - friend class TransformConstraintTimeline; - - friend class TranslateTimeline; - - friend class TwoColorTimeline; - -public: - SlotData(int index, const String &name, BoneData &boneData); - - int getIndex(); - - const String &getName(); - - BoneData &getBoneData(); - - Color &getColor(); - - Color &getDarkColor(); - - bool hasDarkColor(); - - void setHasDarkColor(bool inValue); - - /// May be empty. - const String &getAttachmentName(); - - void setAttachmentName(const String &inValue); - - BlendMode getBlendMode(); - - void setBlendMode(BlendMode inValue); - -private: - const int _index; - String _name; - BoneData &_boneData; - Color _color; - Color _darkColor; - - bool _hasDarkColor; - String _attachmentName; - BlendMode _blendMode; -}; -} - -#endif /* Spine_SlotData_h */ diff --git a/native/cocos/editor-support/spine/SpacingMode.h b/native/cocos/editor-support/spine/SpacingMode.h deleted file mode 100644 index 0bb5c4ebf2..0000000000 --- a/native/cocos/editor-support/spine/SpacingMode.h +++ /dev/null @@ -1,42 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_SpacingMode_h -#define Spine_SpacingMode_h - -namespace spine { -enum SpacingMode { - SpacingMode_Length = 0, - SpacingMode_Fixed, - SpacingMode_Percent -}; -} - -#endif /* Spine_SpacingMode_h */ diff --git a/native/cocos/editor-support/spine/SpineObject.cpp b/native/cocos/editor-support/spine/SpineObject.cpp deleted file mode 100644 index 55e1616f17..0000000000 --- a/native/cocos/editor-support/spine/SpineObject.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include -#include - -using namespace spine; - -void *SpineObject::operator new(size_t sz) { - return SpineExtension::calloc(sz, __FILE__, __LINE__); -} - -void *SpineObject::operator new(size_t sz, const char *file, int line) { - return SpineExtension::calloc(sz, file, line); -} - -void *SpineObject::operator new(size_t sz, void *ptr) { - SP_UNUSED(sz); - return ptr; -} - -void SpineObject::operator delete(void *p, const char *file, int line) { - SpineExtension::free(p, file, line); -} - -void SpineObject::operator delete(void *p, void *mem) { - SP_UNUSED(mem); - SpineExtension::free(p, __FILE__, __LINE__); -} - -void SpineObject::operator delete(void *p) { - SpineExtension::free(p, __FILE__, __LINE__); -} - -SpineObject::~SpineObject() { -} diff --git a/native/cocos/editor-support/spine/SpineObject.h b/native/cocos/editor-support/spine/SpineObject.h deleted file mode 100644 index 20ba68ddcd..0000000000 --- a/native/cocos/editor-support/spine/SpineObject.h +++ /dev/null @@ -1,60 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_Object_h -#define Spine_Object_h - -#include -#include - -#include - -namespace spine { -class String; - -class SP_API SpineObject { -public: - void *operator new(size_t sz); - - void *operator new(size_t sz, const char *file, int line); - - void *operator new(size_t sz, void *ptr); - - void operator delete(void *p, const char *file, int line); - - void operator delete(void *p, void *mem); - - void operator delete(void *p); - - virtual ~SpineObject(); -}; -} - -#endif diff --git a/native/cocos/editor-support/spine/SpineString.h b/native/cocos/editor-support/spine/SpineString.h deleted file mode 100644 index d94f99cffd..0000000000 --- a/native/cocos/editor-support/spine/SpineString.h +++ /dev/null @@ -1,213 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef SPINE_STRING_H -#define SPINE_STRING_H - -#include -#include - -#include -#include - -// Required for sprintf on MSVC -#ifdef _MSC_VER -#pragma warning(disable:4996) -#endif - -namespace spine { -class SP_API String : public SpineObject { -public: - String() : _length(0), _buffer(NULL) { - } - - String(const char *chars, bool own = false) { - if (!chars) { - _length = 0; - _buffer = NULL; - } else { - _length = strlen(chars); - if (!own) { - _buffer = SpineExtension::calloc(_length + 1, __FILE__, __LINE__); - memcpy((void *) _buffer, chars, _length + 1); - } else { - _buffer = (char *) chars; - } - } - } - - String(const String &other) { - if (!other._buffer) { - _length = 0; - _buffer = NULL; - } else { - _length = other._length; - _buffer = SpineExtension::calloc(other._length + 1, __FILE__, __LINE__); - memcpy((void *) _buffer, other._buffer, other._length + 1); - } - } - - size_t length() const { - return _length; - } - - bool isEmpty() const { - return _length == 0; - } - - const char *buffer() const { - return _buffer; - } - - void own(const String &other) { - if (this == &other) return; - if (_buffer) { - SpineExtension::free(_buffer, __FILE__, __LINE__); - } - _length = other._length; - _buffer = other._buffer; - other._length = 0; - other._buffer = NULL; - } - - void own(const char *chars) { - if (_buffer == chars) return; - if (_buffer) { - SpineExtension::free(_buffer, __FILE__, __LINE__); - } - - if (!chars) { - _length = 0; - _buffer = NULL; - } else { - _length = strlen(chars); - _buffer = (char *) chars; - } - } - - void unown() { - _length = 0; - _buffer = NULL; - } - - String &operator=(const String &other) { - if (this == &other) return *this; - if (_buffer) { - SpineExtension::free(_buffer, __FILE__, __LINE__); - } - if (!other._buffer) { - _length = 0; - _buffer = NULL; - } else { - _length = other._length; - _buffer = SpineExtension::calloc(other._length + 1, __FILE__, __LINE__); - memcpy((void *) _buffer, other._buffer, other._length + 1); - } - return *this; - } - - String &operator=(const char *chars) { - if (_buffer == chars) return *this; - if (_buffer) { - SpineExtension::free(_buffer, __FILE__, __LINE__); - } - if (!chars) { - _length = 0; - _buffer = NULL; - } else { - _length = strlen(chars); - _buffer = SpineExtension::calloc(_length + 1, __FILE__, __LINE__); - memcpy((void *) _buffer, chars, _length + 1); - } - return *this; - } - - String &append(const char *chars) { - size_t len = strlen(chars); - size_t thisLen = _length; - _length = _length + len; - bool same = chars == _buffer; - _buffer = SpineExtension::realloc(_buffer, _length + 1, __FILE__, __LINE__); - memcpy((void *) (_buffer + thisLen), (void *) (same ? _buffer : chars), len + 1); - return *this; - } - - String &append(const String &other) { - size_t len = other.length(); - size_t thisLen = _length; - _length = _length + len; - bool same = other._buffer == _buffer; - _buffer = SpineExtension::realloc(_buffer, _length + 1, __FILE__, __LINE__); - memcpy((void *) (_buffer + thisLen), (void *) (same ? _buffer : other._buffer), len + 1); - return *this; - } - - String &append(int other) { - char str[100]; - sprintf(str, "%i", other); - append(str); - return *this; - } - - String &append(float other) { - char str[100]; - sprintf(str, "%f", other); - append(str); - return *this; - } - - friend bool operator==(const String &a, const String &b) { - if (a._buffer == b._buffer) return true; - if (a._length != b._length) return false; - if (a._buffer && b._buffer) { - return strcmp(a._buffer, b._buffer) == 0; - } else { - return false; - } - } - - friend bool operator!=(const String &a, const String &b) { - return !(a == b); - } - - ~String() { - if (_buffer) { - SpineExtension::free(_buffer, __FILE__, __LINE__); - } - } - -private: - mutable size_t _length; - mutable char *_buffer; -}; -} - - -#endif //SPINE_STRING_H diff --git a/native/cocos/editor-support/spine/TextureLoader.cpp b/native/cocos/editor-support/spine/TextureLoader.cpp deleted file mode 100644 index a00d793b31..0000000000 --- a/native/cocos/editor-support/spine/TextureLoader.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -namespace spine { -TextureLoader::TextureLoader() { -} - -TextureLoader::~TextureLoader() { -} -} diff --git a/native/cocos/editor-support/spine/TextureLoader.h b/native/cocos/editor-support/spine/TextureLoader.h deleted file mode 100644 index eb1bc63987..0000000000 --- a/native/cocos/editor-support/spine/TextureLoader.h +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_TextureLoader_h -#define Spine_TextureLoader_h - -#include -#include - -namespace spine { - class AtlasPage; - - class SP_API TextureLoader : public SpineObject { - public: - TextureLoader(); - - virtual ~TextureLoader(); - - virtual void load(AtlasPage& page, const String& path) = 0; - - virtual void unload(void* texture) = 0; - }; -} - -#endif /* Spine_TextureLoader_h */ diff --git a/native/cocos/editor-support/spine/Timeline.cpp b/native/cocos/editor-support/spine/Timeline.cpp deleted file mode 100644 index 4b48a6a7f6..0000000000 --- a/native/cocos/editor-support/spine/Timeline.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include - -namespace spine { -RTTI_IMPL_NOPARENT(Timeline) - -Timeline::Timeline() { -} - -Timeline::~Timeline() { -} - -} diff --git a/native/cocos/editor-support/spine/Timeline.h b/native/cocos/editor-support/spine/Timeline.h deleted file mode 100644 index 91621fde16..0000000000 --- a/native/cocos/editor-support/spine/Timeline.h +++ /dev/null @@ -1,72 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_Timeline_h -#define Spine_Timeline_h - -#include -#include -#include -#include -#include - -namespace spine { -class Skeleton; - -class Event; - -class SP_API Timeline : public SpineObject { -RTTI_DECL - -public: - Timeline(); - - virtual ~Timeline(); - - /// Sets the value(s) for the specified time. - /// @param skeleton The skeleton the timeline is being applied to. This provides access to the bones, slots, and other skeleton components the timeline may change. - /// @param lastTime lastTime The time this timeline was last applied. Timelines such as EventTimeline trigger only at specific times rather than every frame. In that case, the timeline triggers everything between lastTime (exclusive) and time (inclusive). - /// @param time The time within the animation. Most timelines find the key before and the key after this time so they can interpolate between the keys. - /// @param pEvents If any events are fired, they are added to this array. Can be NULL to ignore firing events or if the timeline does not fire events. May be NULL. - /// @param alpha alpha 0 applies the current or setup pose value (depending on pose parameter). 1 applies the timeline - /// value. Between 0 and 1 applies a value between the current or setup pose and the timeline value. By adjusting - /// alpha over time, an animation can be mixed in or out. alpha can also be useful to - /// apply animations on top of each other (layered). - /// @param blend Controls how mixing is applied when alpha is than 1. - /// @param direction Indicates whether the timeline is mixing in or out. Used by timelines which perform instant transitions such as DrawOrderTimeline and AttachmentTimeline. - virtual void - apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, MixBlend blend, - MixDirection direction) = 0; - - virtual int getPropertyId() = 0; -}; -} - -#endif /* Spine_Timeline_h */ diff --git a/native/cocos/editor-support/spine/TimelineType.h b/native/cocos/editor-support/spine/TimelineType.h deleted file mode 100644 index 0f227cecfc..0000000000 --- a/native/cocos/editor-support/spine/TimelineType.h +++ /dev/null @@ -1,54 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_TimelineType_h -#define Spine_TimelineType_h - -namespace spine { -enum TimelineType { - TimelineType_Rotate = 0, - TimelineType_Translate, - TimelineType_Scale, - TimelineType_Shear, - TimelineType_Attachment, - TimelineType_Color, - TimelineType_Deform, - TimelineType_Event, - TimelineType_DrawOrder, - TimelineType_IkConstraint, - TimelineType_TransformConstraint, - TimelineType_PathConstraintPosition, - TimelineType_PathConstraintSpacing, - TimelineType_PathConstraintMix, - TimelineType_TwoColor -}; -} - -#endif /* Spine_TimelineType_h */ diff --git a/native/cocos/editor-support/spine/TransformConstraint.cpp b/native/cocos/editor-support/spine/TransformConstraint.cpp deleted file mode 100644 index 0cc82bfc67..0000000000 --- a/native/cocos/editor-support/spine/TransformConstraint.cpp +++ /dev/null @@ -1,383 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include -#include - -#include - -using namespace spine; - -RTTI_IMPL(TransformConstraint, Constraint) - -TransformConstraint::TransformConstraint(TransformConstraintData &data, Skeleton &skeleton) : Constraint(), - _data(data), - _target(skeleton.findBone( - data.getTarget()->getName())), - _rotateMix( - data.getRotateMix()), - _translateMix( - data.getTranslateMix()), - _scaleMix( - data.getScaleMix()), - _shearMix( - data.getShearMix()) { - _bones.ensureCapacity(_data.getBones().size()); - for (size_t i = 0; i < _data.getBones().size(); ++i) { - BoneData *boneData = _data.getBones()[i]; - - _bones.add(skeleton.findBone(boneData->getName())); - } -} - -void TransformConstraint::apply() { - update(); -} - -void TransformConstraint::update() { - if (_data.isLocal()) { - if (_data.isRelative()) { - applyRelativeLocal(); - } else { - applyAbsoluteLocal(); - } - } else { - if (_data.isRelative()) { - applyRelativeWorld(); - } else { - applyAbsoluteWorld(); - } - } -} - -int TransformConstraint::getOrder() { - return _data.getOrder(); -} - -TransformConstraintData &TransformConstraint::getData() { - return _data; -} - -Vector &TransformConstraint::getBones() { - return _bones; -} - -Bone *TransformConstraint::getTarget() { - return _target; -} - -void TransformConstraint::setTarget(Bone *inValue) { - _target = inValue; -} - -float TransformConstraint::getRotateMix() { - return _rotateMix; -} - -void TransformConstraint::setRotateMix(float inValue) { - _rotateMix = inValue; -} - -float TransformConstraint::getTranslateMix() { - return _translateMix; -} - -void TransformConstraint::setTranslateMix(float inValue) { - _translateMix = inValue; -} - -float TransformConstraint::getScaleMix() { - return _scaleMix; -} - -void TransformConstraint::setScaleMix(float inValue) { - _scaleMix = inValue; -} - -float TransformConstraint::getShearMix() { - return _shearMix; -} - -void TransformConstraint::setShearMix(float inValue) { - _shearMix = inValue; -} - -void TransformConstraint::applyAbsoluteWorld() { - float rotateMix = _rotateMix, translateMix = _translateMix, scaleMix = _scaleMix, shearMix = _shearMix; - Bone &target = *_target; - float ta = target._a, tb = target._b, tc = target._c, td = target._d; - float degRadReflect = ta * td - tb * tc > 0 ? MathUtil::Deg_Rad : -MathUtil::Deg_Rad; - float offsetRotation = _data._offsetRotation * degRadReflect, offsetShearY = _data._offsetShearY * degRadReflect; - - for (size_t i = 0; i < _bones.size(); ++i) { - Bone *item = _bones[i]; - Bone &bone = *item; - - bool modified = false; - - if (rotateMix != 0) { - float a = bone._a, b = bone._b, c = bone._c, d = bone._d; - float r = MathUtil::atan2(tc, ta) - MathUtil::atan2(c, a) + offsetRotation; - if (r > MathUtil::Pi) { - r -= MathUtil::Pi_2; - } else if (r < -MathUtil::Pi) { - r += MathUtil::Pi_2; - } - - r *= rotateMix; - float cos = MathUtil::cos(r), sin = MathUtil::sin(r); - bone._a = cos * a - sin * c; - bone._b = cos * b - sin * d; - bone._c = sin * a + cos * c; - bone._d = sin * b + cos * d; - modified = true; - } - - if (translateMix != 0) { - float tx, ty; - target.localToWorld(_data._offsetX, _data._offsetY, tx, ty); - bone._worldX += (tx - bone._worldX) * translateMix; - bone._worldY += (ty - bone._worldY) * translateMix; - modified = true; - } - - if (scaleMix > 0) { - float s = MathUtil::sqrt(bone._a * bone._a + bone._c * bone._c); - - if (s > 0.00001f) { - s = (s + (MathUtil::sqrt(ta * ta + tc * tc) - s + _data._offsetScaleX) * scaleMix) / s; - } - bone._a *= s; - bone._c *= s; - s = MathUtil::sqrt(bone._b * bone._b + bone._d * bone._d); - - if (s > 0.00001f) { - s = (s + (MathUtil::sqrt(tb * tb + td * td) - s + _data._offsetScaleY) * scaleMix) / s; - } - bone._b *= s; - bone._d *= s; - modified = true; - } - - if (shearMix > 0) { - float b = bone._b, d = bone._d; - float by = MathUtil::atan2(d, b); - float r = MathUtil::atan2(td, tb) - MathUtil::atan2(tc, ta) - (by - MathUtil::atan2(bone._c, bone._a)); - if (r > MathUtil::Pi) { - r -= MathUtil::Pi_2; - } else if (r < -MathUtil::Pi) { - r += MathUtil::Pi_2; - } - - r = by + (r + offsetShearY) * shearMix; - float s = MathUtil::sqrt(b * b + d * d); - bone._b = MathUtil::cos(r) * s; - bone._d = MathUtil::sin(r) * s; - modified = true; - } - - if (modified) { - bone._appliedValid = false; - } - } -} - -void TransformConstraint::applyRelativeWorld() { - float rotateMix = _rotateMix, translateMix = _translateMix, scaleMix = _scaleMix, shearMix = _shearMix; - Bone &target = *_target; - float ta = target._a, tb = target._b, tc = target._c, td = target._d; - float degRadReflect = ta * td - tb * tc > 0 ? MathUtil::Deg_Rad : -MathUtil::Deg_Rad; - float offsetRotation = _data._offsetRotation * degRadReflect, offsetShearY = _data._offsetShearY * degRadReflect; - for (size_t i = 0; i < _bones.size(); ++i) { - Bone *item = _bones[i]; - Bone &bone = *item; - - bool modified = false; - - if (rotateMix != 0) { - float a = bone._a, b = bone._b, c = bone._c, d = bone._d; - float r = MathUtil::atan2(tc, ta) + offsetRotation; - if (r > MathUtil::Pi) { - r -= MathUtil::Pi_2; - } else if (r < -MathUtil::Pi) { - r += MathUtil::Pi_2; - } - - r *= rotateMix; - float cos = MathUtil::cos(r), sin = MathUtil::sin(r); - bone._a = cos * a - sin * c; - bone._b = cos * b - sin * d; - bone._c = sin * a + cos * c; - bone._d = sin * b + cos * d; - modified = true; - } - - if (translateMix != 0) { - float tx, ty; - target.localToWorld(_data._offsetX, _data._offsetY, tx, ty); - bone._worldX += tx * translateMix; - bone._worldY += ty * translateMix; - modified = true; - } - - if (scaleMix > 0) { - float s = (MathUtil::sqrt(ta * ta + tc * tc) - 1 + _data._offsetScaleX) * scaleMix + 1; - bone._a *= s; - bone._c *= s; - s = (MathUtil::sqrt(tb * tb + td * td) - 1 + _data._offsetScaleY) * scaleMix + 1; - bone._b *= s; - bone._d *= s; - modified = true; - } - - if (shearMix > 0) { - float r = MathUtil::atan2(td, tb) - MathUtil::atan2(tc, ta); - if (r > MathUtil::Pi) { - r -= MathUtil::Pi_2; - } else if (r < -MathUtil::Pi) { - r += MathUtil::Pi_2; - } - - float b = bone._b, d = bone._d; - r = MathUtil::atan2(d, b) + (r - MathUtil::Pi / 2 + offsetShearY) * shearMix; - float s = MathUtil::sqrt(b * b + d * d); - bone._b = MathUtil::cos(r) * s; - bone._d = MathUtil::sin(r) * s; - modified = true; - } - - if (modified) { - bone._appliedValid = false; - } - } -} - -void TransformConstraint::applyAbsoluteLocal() { - float rotateMix = _rotateMix, translateMix = _translateMix, scaleMix = _scaleMix, shearMix = _shearMix; - Bone &target = *_target; - if (!target._appliedValid) { - target.updateAppliedTransform(); - } - - for (size_t i = 0; i < _bones.size(); ++i) { - Bone *item = _bones[i]; - Bone &bone = *item; - - if (!bone._appliedValid) { - bone.updateAppliedTransform(); - } - - float rotation = bone._arotation; - if (rotateMix != 0) { - float r = target._arotation - rotation + _data._offsetRotation; - r -= (16384 - (int) (16384.499999999996 - r / 360)) * 360; - rotation += r * rotateMix; - } - - float x = bone._ax, y = bone._ay; - if (translateMix != 0) { - x += (target._ax - x + _data._offsetX) * translateMix; - y += (target._ay - y + _data._offsetY) * translateMix; - } - - float scaleX = bone._ascaleX, scaleY = bone._ascaleY; - if (scaleMix != 0) { - if (scaleX > 0.00001f) { - scaleX = (scaleX + (target._ascaleX - scaleX + _data._offsetScaleX) * scaleMix) / scaleX; - } - - if (scaleY > 0.00001f) { - scaleY = (scaleY + (target._ascaleY - scaleY + _data._offsetScaleY) * scaleMix) / scaleY; - } - } - - float shearY = bone._ashearY; - if (shearMix != 0) { - float r = target._ashearY - shearY + _data._offsetShearY; - r -= (16384 - (int) (16384.499999999996 - r / 360)) * 360; - bone._shearY += r * shearMix; - } - - bone.updateWorldTransform(x, y, rotation, scaleX, scaleY, bone._ashearX, shearY); - } -} - -void TransformConstraint::applyRelativeLocal() { - float rotateMix = _rotateMix, translateMix = _translateMix, scaleMix = _scaleMix, shearMix = _shearMix; - Bone &target = *_target; - if (!target._appliedValid) { - target.updateAppliedTransform(); - } - - for (size_t i = 0; i < _bones.size(); ++i) { - Bone *item = _bones[i]; - Bone &bone = *item; - - if (!bone._appliedValid) { - bone.updateAppliedTransform(); - } - - float rotation = bone._arotation; - if (rotateMix != 0) { - rotation += (target._arotation + _data._offsetRotation) * rotateMix; - } - - float x = bone._ax, y = bone._ay; - if (translateMix != 0) { - x += (target._ax + _data._offsetX) * translateMix; - y += (target._ay + _data._offsetY) * translateMix; - } - - float scaleX = bone._ascaleX, scaleY = bone._ascaleY; - if (scaleMix != 0) { - if (scaleX > 0.00001f) { - scaleX *= ((target._ascaleX - 1 + _data._offsetScaleX) * scaleMix) + 1; - } - - if (scaleY > 0.00001f) { - scaleY *= ((target._ascaleY - 1 + _data._offsetScaleY) * scaleMix) + 1; - } - } - - float shearY = bone._ashearY; - if (shearMix != 0) { - shearY += (target._ashearY + _data._offsetShearY) * shearMix; - } - - bone.updateWorldTransform(x, y, rotation, scaleX, scaleY, bone._ashearX, shearY); - } -} diff --git a/native/cocos/editor-support/spine/TransformConstraint.h b/native/cocos/editor-support/spine/TransformConstraint.h deleted file mode 100644 index 3204fbaf8c..0000000000 --- a/native/cocos/editor-support/spine/TransformConstraint.h +++ /dev/null @@ -1,93 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_TransformConstraint_h -#define Spine_TransformConstraint_h - -#include - -#include - -namespace spine { - class TransformConstraintData; - class Skeleton; - class Bone; - - class SP_API TransformConstraint : public Constraint { - friend class Skeleton; - friend class TransformConstraintTimeline; - - RTTI_DECL - - public: - TransformConstraint(TransformConstraintData& data, Skeleton& skeleton); - - void apply(); - - virtual void update(); - - virtual int getOrder(); - - TransformConstraintData& getData(); - - Vector& getBones(); - - Bone* getTarget(); - void setTarget(Bone* inValue); - - float getRotateMix(); - void setRotateMix(float inValue); - - float getTranslateMix(); - void setTranslateMix(float inValue); - - float getScaleMix(); - void setScaleMix(float inValue); - - float getShearMix(); - void setShearMix(float inValue); - - private: - TransformConstraintData& _data; - Vector _bones; - Bone* _target; - float _rotateMix, _translateMix, _scaleMix, _shearMix; - - void applyAbsoluteWorld(); - - void applyRelativeWorld(); - - void applyAbsoluteLocal(); - - void applyRelativeLocal(); - }; -} - -#endif /* Spine_TransformConstraint_h */ diff --git a/native/cocos/editor-support/spine/TransformConstraintData.cpp b/native/cocos/editor-support/spine/TransformConstraintData.cpp deleted file mode 100644 index ccb3e42111..0000000000 --- a/native/cocos/editor-support/spine/TransformConstraintData.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include - -#include - -using namespace spine; -TransformConstraintData::TransformConstraintData(const String &name) : - _name(name), - _order(0), - _target(NULL), - _rotateMix(0), - _translateMix(0), - _scaleMix(0), - _shearMix(0), - _offsetRotation(0), - _offsetX(0), - _offsetY(0), - _offsetScaleX(0), - _offsetScaleY(0), - _offsetShearY(0), - _relative(false), - _local(false) { - assert(_name.length() > 0); -} - -const String &TransformConstraintData::getName() { - return _name; -} - -int TransformConstraintData::getOrder() { - return _order; -} - -Vector &TransformConstraintData::getBones() { - return _bones; -} - -BoneData *TransformConstraintData::getTarget() { - return _target; -} - -float TransformConstraintData::getRotateMix() { - return _rotateMix; -} - -float TransformConstraintData::getTranslateMix() { - return _translateMix; -} - -float TransformConstraintData::getScaleMix() { - return _scaleMix; -} - -float TransformConstraintData::getShearMix() { - return _shearMix; -} - -float TransformConstraintData::getOffsetRotation() { - return _offsetRotation; -} - -float TransformConstraintData::getOffsetX() { - return _offsetX; -} - -float TransformConstraintData::getOffsetY() { - return _offsetY; -} - -float TransformConstraintData::getOffsetScaleX() { - return _offsetScaleX; -} - -float TransformConstraintData::getOffsetScaleY() { - return _offsetScaleY; -} - -float TransformConstraintData::getOffsetShearY() { - return _offsetShearY; -} - -bool TransformConstraintData::isRelative() { - return _relative; -} - -bool TransformConstraintData::isLocal() { - return _local; -} diff --git a/native/cocos/editor-support/spine/TransformConstraintData.h b/native/cocos/editor-support/spine/TransformConstraintData.h deleted file mode 100644 index 37cc3aa636..0000000000 --- a/native/cocos/editor-support/spine/TransformConstraintData.h +++ /dev/null @@ -1,82 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_TransformConstraintData_h -#define Spine_TransformConstraintData_h - -#include -#include -#include - -namespace spine { - class BoneData; - - class SP_API TransformConstraintData : public SpineObject { - friend class SkeletonBinary; - friend class SkeletonJson; - - friend class TransformConstraint; - friend class Skeleton; - friend class TransformConstraintTimeline; - - public: - explicit TransformConstraintData(const String& name); - - const String& getName(); - int getOrder(); - Vector& getBones(); - BoneData* getTarget(); - float getRotateMix(); - float getTranslateMix(); - float getScaleMix(); - float getShearMix(); - - float getOffsetRotation(); - float getOffsetX(); - float getOffsetY(); - float getOffsetScaleX(); - float getOffsetScaleY(); - float getOffsetShearY(); - - bool isRelative(); - bool isLocal(); - - private: - const String _name; - int _order; - Vector _bones; - BoneData* _target; - float _rotateMix, _translateMix, _scaleMix, _shearMix; - float _offsetRotation, _offsetX, _offsetY, _offsetScaleX, _offsetScaleY, _offsetShearY; - bool _relative, _local; - }; -} - -#endif /* Spine_TransformConstraintData_h */ diff --git a/native/cocos/editor-support/spine/TransformConstraintTimeline.cpp b/native/cocos/editor-support/spine/TransformConstraintTimeline.cpp deleted file mode 100644 index c273b37222..0000000000 --- a/native/cocos/editor-support/spine/TransformConstraintTimeline.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -using namespace spine; - -RTTI_IMPL(TransformConstraintTimeline, CurveTimeline) - -const int TransformConstraintTimeline::ENTRIES = 5; -const int TransformConstraintTimeline::PREV_TIME = -5; -const int TransformConstraintTimeline::PREV_ROTATE = -4; -const int TransformConstraintTimeline::PREV_TRANSLATE = -3; -const int TransformConstraintTimeline::PREV_SCALE = -2; -const int TransformConstraintTimeline::PREV_SHEAR = -1; -const int TransformConstraintTimeline::ROTATE = 1; -const int TransformConstraintTimeline::TRANSLATE = 2; -const int TransformConstraintTimeline::SCALE = 3; -const int TransformConstraintTimeline::SHEAR = 4; - -TransformConstraintTimeline::TransformConstraintTimeline(int frameCount) : CurveTimeline(frameCount), - _transformConstraintIndex(0) { - _frames.setSize(frameCount * ENTRIES, 0); -} - -void TransformConstraintTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, - float alpha, MixBlend blend, MixDirection direction) { - SP_UNUSED(lastTime); - SP_UNUSED(pEvents); - SP_UNUSED(direction); - - TransformConstraint *constraintP = skeleton._transformConstraints[_transformConstraintIndex]; - TransformConstraint &constraint = *constraintP; - - if (time < _frames[0]) { - switch (blend) { - case MixBlend_Setup: - constraint._rotateMix = constraint._data._rotateMix; - constraint._translateMix = constraint._data._translateMix; - constraint._scaleMix = constraint._data._scaleMix; - constraint._shearMix = constraint._data._shearMix; - return; - case MixBlend_First: - constraint._rotateMix += (constraint._data._rotateMix - constraint._rotateMix) * alpha; - constraint._translateMix += (constraint._data._translateMix - constraint._translateMix) * alpha; - constraint._scaleMix += (constraint._data._scaleMix - constraint._scaleMix) * alpha; - constraint._shearMix += (constraint._data._shearMix - constraint._shearMix) * alpha; - return; - default: - return; - } - } - - float rotate, translate, scale, shear; - if (time >= _frames[_frames.size() - ENTRIES]) { - // Time is after last frame. - size_t i = _frames.size(); - rotate = _frames[i + PREV_ROTATE]; - translate = _frames[i + PREV_TRANSLATE]; - scale = _frames[i + PREV_SCALE]; - shear = _frames[i + PREV_SHEAR]; - } else { - // Interpolate between the previous frame and the current frame. - int frame = Animation::binarySearch(_frames, time, ENTRIES); - rotate = _frames[frame + PREV_ROTATE]; - translate = _frames[frame + PREV_TRANSLATE]; - scale = _frames[frame + PREV_SCALE]; - shear = _frames[frame + PREV_SHEAR]; - float frameTime = _frames[frame]; - float percent = getCurvePercent(frame / ENTRIES - 1, - 1 - (time - frameTime) / (_frames[frame + PREV_TIME] - frameTime)); - - rotate += (_frames[frame + ROTATE] - rotate) * percent; - translate += (_frames[frame + TRANSLATE] - translate) * percent; - scale += (_frames[frame + SCALE] - scale) * percent; - shear += (_frames[frame + SHEAR] - shear) * percent; - } - - if (blend == MixBlend_Setup) { - TransformConstraintData &data = constraint._data; - constraint._rotateMix = data._rotateMix + (rotate - data._rotateMix) * alpha; - constraint._translateMix = data._translateMix + (translate - data._translateMix) * alpha; - constraint._scaleMix = data._scaleMix + (scale - data._scaleMix) * alpha; - constraint._shearMix = data._shearMix + (shear - data._shearMix) * alpha; - } else { - constraint._rotateMix += (rotate - constraint._rotateMix) * alpha; - constraint._translateMix += (translate - constraint._translateMix) * alpha; - constraint._scaleMix += (scale - constraint._scaleMix) * alpha; - constraint._shearMix += (shear - constraint._shearMix) * alpha; - } -} - -int TransformConstraintTimeline::getPropertyId() { - return ((int) TimelineType_TransformConstraint << 24) + _transformConstraintIndex; -} - -void -TransformConstraintTimeline::setFrame(size_t frameIndex, float time, float rotateMix, float translateMix, float scaleMix, - float shearMix) { - frameIndex *= ENTRIES; - _frames[frameIndex] = time; - _frames[frameIndex + ROTATE] = rotateMix; - _frames[frameIndex + TRANSLATE] = translateMix; - _frames[frameIndex + SCALE] = scaleMix; - _frames[frameIndex + SHEAR] = shearMix; -} diff --git a/native/cocos/editor-support/spine/TransformConstraintTimeline.h b/native/cocos/editor-support/spine/TransformConstraintTimeline.h deleted file mode 100644 index 8d30700250..0000000000 --- a/native/cocos/editor-support/spine/TransformConstraintTimeline.h +++ /dev/null @@ -1,71 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_TransformConstraintTimeline_h -#define Spine_TransformConstraintTimeline_h - -#include - -namespace spine { - - class SP_API TransformConstraintTimeline : public CurveTimeline { - friend class SkeletonBinary; - friend class SkeletonJson; - - RTTI_DECL - - public: - static const int ENTRIES; - - explicit TransformConstraintTimeline(int frameCount); - - virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector* pEvents, float alpha, MixBlend blend, MixDirection direction); - - virtual int getPropertyId(); - - void setFrame(size_t frameIndex, float time, float rotateMix, float translateMix, float scaleMix, float shearMix); - - private: - static const int PREV_TIME; - static const int PREV_ROTATE; - static const int PREV_TRANSLATE; - static const int PREV_SCALE; - static const int PREV_SHEAR; - static const int ROTATE; - static const int TRANSLATE; - static const int SCALE; - static const int SHEAR; - - Vector _frames; - int _transformConstraintIndex; - }; -} - -#endif /* Spine_TransformConstraintTimeline_h */ diff --git a/native/cocos/editor-support/spine/TransformMode.h b/native/cocos/editor-support/spine/TransformMode.h deleted file mode 100644 index 27c4fd5c4d..0000000000 --- a/native/cocos/editor-support/spine/TransformMode.h +++ /dev/null @@ -1,45 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_TransformMode_h -#define Spine_TransformMode_h - -namespace spine { - enum TransformMode { - TransformMode_Normal = 0, - TransformMode_OnlyTranslation, - TransformMode_NoRotationOrReflection, - TransformMode_NoScale, - TransformMode_NoScaleOrReflection - }; -} - -#endif /* Spine_TransformMode_h */ - diff --git a/native/cocos/editor-support/spine/TranslateTimeline.cpp b/native/cocos/editor-support/spine/TranslateTimeline.cpp deleted file mode 100644 index 5f1894f69f..0000000000 --- a/native/cocos/editor-support/spine/TranslateTimeline.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include - -#include -#include -#include -#include - -using namespace spine; - -RTTI_IMPL(TranslateTimeline, CurveTimeline) - -const int TranslateTimeline::ENTRIES = 3; -const int TranslateTimeline::PREV_TIME = -3; -const int TranslateTimeline::PREV_X = -2; -const int TranslateTimeline::PREV_Y = -1; -const int TranslateTimeline::X = 1; -const int TranslateTimeline::Y = 2; - -TranslateTimeline::TranslateTimeline(int frameCount) : CurveTimeline(frameCount), _boneIndex(0) { - _frames.ensureCapacity(frameCount * ENTRIES); - _frames.setSize(frameCount * ENTRIES, 0); -} - -TranslateTimeline::~TranslateTimeline() { -} - -void TranslateTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, - MixBlend blend, MixDirection direction) { - SP_UNUSED(lastTime); - SP_UNUSED(pEvents); - SP_UNUSED(direction); - - Bone *boneP = skeleton._bones[_boneIndex]; - Bone &bone = *boneP; - - if (time < _frames[0]) { - switch (blend) { - case MixBlend_Setup: - bone._x = bone._data._x; - bone._y = bone._data._y; - return; - case MixBlend_First: - bone._x += (bone._data._x - bone._x) * alpha; - bone._y += (bone._data._y - bone._y) * alpha; - default: {} - } - return; - } - - float x, y; - if (time >= _frames[_frames.size() - ENTRIES]) { - // Time is after last frame. - x = _frames[_frames.size() + PREV_X]; - y = _frames[_frames.size() + PREV_Y]; - } else { - // Interpolate between the previous frame and the current frame. - int frame = Animation::binarySearch(_frames, time, ENTRIES); - x = _frames[frame + PREV_X]; - y = _frames[frame + PREV_Y]; - float frameTime = _frames[frame]; - float percent = getCurvePercent(frame / ENTRIES - 1, - 1 - (time - frameTime) / (_frames[frame + PREV_TIME] - frameTime)); - - x += (_frames[frame + X] - x) * percent; - y += (_frames[frame + Y] - y) * percent; - } - - switch (blend) { - case MixBlend_Setup: - bone._x = bone._data._x + x * alpha; - bone._y = bone._data._y + y * alpha; - break; - case MixBlend_First: - case MixBlend_Replace: - bone._x += (bone._data._x + x - bone._x) * alpha; - bone._y += (bone._data._y + y - bone._y) * alpha; - break; - case MixBlend_Add: - bone._x += x * alpha; - bone._y += y * alpha; - } -} - -int TranslateTimeline::getPropertyId() { - return ((int) TimelineType_Translate << 24) + _boneIndex; -} - -void TranslateTimeline::setFrame(int frameIndex, float time, float x, float y) { - frameIndex *= ENTRIES; - _frames[frameIndex] = time; - _frames[frameIndex + X] = x; - _frames[frameIndex + Y] = y; -} diff --git a/native/cocos/editor-support/spine/TranslateTimeline.h b/native/cocos/editor-support/spine/TranslateTimeline.h deleted file mode 100644 index b5f3a103d5..0000000000 --- a/native/cocos/editor-support/spine/TranslateTimeline.h +++ /dev/null @@ -1,73 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_TranslateTimeline_h -#define Spine_TranslateTimeline_h - -#include - -#include -#include - -namespace spine { - - class SP_API TranslateTimeline : public CurveTimeline { - friend class SkeletonBinary; - friend class SkeletonJson; - - RTTI_DECL - - public: - static const int ENTRIES; - - explicit TranslateTimeline(int frameCount); - - virtual ~TranslateTimeline(); - - virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector* pEvents, float alpha, MixBlend blend, MixDirection direction); - - virtual int getPropertyId(); - - /// Sets the time and value of the specified keyframe. - void setFrame(int frameIndex, float time, float x, float y); - - protected: - static const int PREV_TIME; - static const int PREV_X; - static const int PREV_Y; - static const int X; - static const int Y; - - Vector _frames; - int _boneIndex; - }; -} - -#endif /* Spine_TranslateTimeline_h */ diff --git a/native/cocos/editor-support/spine/Triangulator.cpp b/native/cocos/editor-support/spine/Triangulator.cpp deleted file mode 100644 index 57daf3ca4c..0000000000 --- a/native/cocos/editor-support/spine/Triangulator.cpp +++ /dev/null @@ -1,302 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include - -using namespace spine; - -Triangulator::~Triangulator() { - ContainerUtil::cleanUpVectorOfPointers(_convexPolygons); - ContainerUtil::cleanUpVectorOfPointers(_convexPolygonsIndices); -} - -Vector &Triangulator::triangulate(Vector &vertices) { - size_t vertexCount = vertices.size() >> 1; - - Vector &indices = _indices; - indices.clear(); - indices.ensureCapacity(vertexCount); - indices.setSize(vertexCount, 0); - for (size_t i = 0; i < vertexCount; ++i) { - indices[i] = i; - } - - Vector &isConcaveArray = _isConcaveArray; - isConcaveArray.ensureCapacity(vertexCount); - isConcaveArray.setSize(vertexCount, 0); - for (size_t i = 0, n = vertexCount; i < n; ++i) { - isConcaveArray[i] = isConcave(i, vertexCount, vertices, indices); - } - - Vector &triangles = _triangles; - triangles.clear(); - triangles.ensureCapacity(MathUtil::max((int)0, (int)vertexCount - 2) << 2); - - while (vertexCount > 3) { - // Find ear tip. - size_t previous = vertexCount - 1, i = 0, next = 1; - - // outer: - while (true) { - if (!isConcaveArray[i]) { - int p1 = indices[previous] << 1, p2 = indices[i] << 1, p3 = indices[next] << 1; - float p1x = vertices[p1], p1y = vertices[p1 + 1]; - float p2x = vertices[p2], p2y = vertices[p2 + 1]; - float p3x = vertices[p3], p3y = vertices[p3 + 1]; - for (size_t ii = (next + 1) % vertexCount; ii != previous; ii = (ii + 1) % vertexCount) { - if (!isConcaveArray[ii]) { - continue; - } - - int v = indices[ii] << 1; - float &vx = vertices[v], vy = vertices[v + 1]; - if (positiveArea(p3x, p3y, p1x, p1y, vx, vy)) { - if (positiveArea(p1x, p1y, p2x, p2y, vx, vy)) { - if (positiveArea(p2x, p2y, p3x, p3y, vx, vy)) { - goto break_outer; // break outer; - } - } - } - } - break; - } - break_outer: - - if (next == 0) { - do { - if (!isConcaveArray[i]) { - break; - } - i--; - } while (i > 0); - break; - } - - previous = i; - i = next; - next = (next + 1) % vertexCount; - } - - // Cut ear tip. - triangles.add(indices[(vertexCount + i - 1) % vertexCount]); - triangles.add(indices[i]); - triangles.add(indices[(i + 1) % vertexCount]); - indices.removeAt(i); - isConcaveArray.removeAt(i); - vertexCount--; - - int previousIndex = (vertexCount + i - 1) % vertexCount; - int nextIndex = i == vertexCount ? 0 : i; - isConcaveArray[previousIndex] = isConcave(previousIndex, vertexCount, vertices, indices); - isConcaveArray[nextIndex] = isConcave(nextIndex, vertexCount, vertices, indices); - } - - if (vertexCount == 3) { - triangles.add(indices[2]); - triangles.add(indices[0]); - triangles.add(indices[1]); - } - - return triangles; -} - -Vector *> &Triangulator::decompose(Vector &vertices, Vector &triangles) { - Vector *> &convexPolygons = _convexPolygons; - for (size_t i = 0, n = convexPolygons.size(); i < n; ++i) { - _polygonPool.free(convexPolygons[i]); - } - convexPolygons.clear(); - - Vector *> &convexPolygonsIndices = _convexPolygonsIndices; - for (size_t i = 0, n = convexPolygonsIndices.size(); i < n; ++i) { - _polygonIndicesPool.free(convexPolygonsIndices[i]); - } - convexPolygonsIndices.clear(); - - Vector *polygonIndices = _polygonIndicesPool.obtain(); - polygonIndices->clear(); - - Vector *polygon = _polygonPool.obtain(); - polygon->clear(); - - // Merge subsequent triangles if they form a triangle fan. - int fanBaseIndex = -1, lastwinding = 0; - for (size_t i = 0, n = triangles.size(); i < n; i += 3) { - int t1 = triangles[i] << 1, t2 = triangles[i + 1] << 1, t3 = triangles[i + 2] << 1; - float x1 = vertices[t1], y1 = vertices[t1 + 1]; - float x2 = vertices[t2], y2 = vertices[t2 + 1]; - float x3 = vertices[t3], y3 = vertices[t3 + 1]; - - // If the base of the last triangle is the same as this triangle, check if they form a convex polygon (triangle fan). - bool merged = false; - if (fanBaseIndex == t1) { - size_t o = polygon->size() - 4; - Vector &p = *polygon; - int winding1 = winding(p[o], p[o + 1], p[o + 2], p[o + 3], x3, y3); - int winding2 = winding(x3, y3, p[0], p[1], p[2], p[3]); - if (winding1 == lastwinding && winding2 == lastwinding) { - polygon->add(x3); - polygon->add(y3); - polygonIndices->add(t3); - merged = true; - } - } - - // Otherwise make this triangle the new base. - if (!merged) { - if (polygon->size() > 0) { - convexPolygons.add(polygon); - convexPolygonsIndices.add(polygonIndices); - } else { - _polygonPool.free(polygon); - _polygonIndicesPool.free(polygonIndices); - } - - polygon = _polygonPool.obtain(); - polygon->clear(); - polygon->add(x1); - polygon->add(y1); - polygon->add(x2); - polygon->add(y2); - polygon->add(x3); - polygon->add(y3); - polygonIndices = _polygonIndicesPool.obtain(); - polygonIndices->clear(); - polygonIndices->add(t1); - polygonIndices->add(t2); - polygonIndices->add(t3); - lastwinding = winding(x1, y1, x2, y2, x3, y3); - fanBaseIndex = t1; - } - } - - if (polygon->size() > 0) { - convexPolygons.add(polygon); - convexPolygonsIndices.add(polygonIndices); - } - - // Go through the list of polygons and try to merge the remaining triangles with the found triangle fans. - for (size_t i = 0, n = convexPolygons.size(); i < n; ++i) { - polygonIndices = convexPolygonsIndices[i]; - - if (polygonIndices->size() == 0) continue; - int firstIndex = (*polygonIndices)[0]; - int lastIndex = (*polygonIndices)[polygonIndices->size() - 1]; - - polygon = convexPolygons[i]; - size_t o = polygon->size() - 4; - Vector &p = *polygon; - float prevPrevX = p[o], prevPrevY = p[o + 1]; - float prevX = p[o + 2], prevY = p[o + 3]; - float firstX = p[0], firstY = p[1]; - float secondX = p[2], secondY = p[3]; - int winding0 = winding(prevPrevX, prevPrevY, prevX, prevY, firstX, firstY); - - for (size_t ii = 0; ii < n; ++ii) { - if (ii == i) { - continue; - } - - Vector *otherIndicesP = convexPolygonsIndices[ii]; - Vector &otherIndices = *otherIndicesP; - - if (otherIndices.size() != 3) { - continue; - } - - int otherFirstIndex = otherIndices[0]; - int otherSecondIndex = otherIndices[1]; - int otherLastIndex = otherIndices[2]; - - Vector *otherPolyP = convexPolygons[ii]; - Vector &otherPoly = *otherPolyP; - - float x3 = otherPoly[otherPoly.size() - 2], y3 = otherPoly[otherPoly.size() - 1]; - - if (otherFirstIndex != firstIndex || otherSecondIndex != lastIndex) { - continue; - } - - int winding1 = winding(prevPrevX, prevPrevY, prevX, prevY, x3, y3); - int winding2 = winding(x3, y3, firstX, firstY, secondX, secondY); - if (winding1 == winding0 && winding2 == winding0) { - otherPoly.clear(); - otherIndices.clear(); - polygon->add(x3); - polygon->add(y3); - polygonIndices->add(otherLastIndex); - prevPrevX = prevX; - prevPrevY = prevY; - prevX = x3; - prevY = y3; - ii = 0; - } - } - } - - // Remove empty polygons that resulted from the merge step above. - for (int i = (int)convexPolygons.size() - 1; i >= 0; --i) { - polygon = convexPolygons[i]; - if (polygon->size() == 0) { - convexPolygons.removeAt(i); - _polygonPool.free(polygon); - polygonIndices = convexPolygonsIndices[i]; - convexPolygonsIndices.removeAt(i); - _polygonIndicesPool.free(polygonIndices); - } - } - - return convexPolygons; -} - -bool Triangulator::isConcave(int index, int vertexCount, Vector &vertices, Vector &indices) { - int previous = indices[(vertexCount + index - 1) % vertexCount] << 1; - int current = indices[index] << 1; - int next = indices[(index + 1) % vertexCount] << 1; - - return !positiveArea(vertices[previous], vertices[previous + 1], vertices[current], vertices[current + 1], - vertices[next], vertices[next + 1]); -} - -bool Triangulator::positiveArea(float p1x, float p1y, float p2x, float p2y, float p3x, float p3y) { - return p1x * (p3y - p2y) + p2x * (p1y - p3y) + p3x * (p2y - p1y) >= 0; -} - -int Triangulator::winding(float p1x, float p1y, float p2x, float p2y, float p3x, float p3y) { - float px = p2x - p1x, py = p2y - p1y; - - return p3x * py - p3y * px + px * p1y - p1x * py >= 0 ? 1 : -1; -} diff --git a/native/cocos/editor-support/spine/Triangulator.h b/native/cocos/editor-support/spine/Triangulator.h deleted file mode 100644 index da12785cee..0000000000 --- a/native/cocos/editor-support/spine/Triangulator.h +++ /dev/null @@ -1,65 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_Triangulator_h -#define Spine_Triangulator_h - -#include -#include - -namespace spine { -class SP_API Triangulator : public SpineObject { -public: - ~Triangulator(); - - Vector &triangulate(Vector &vertices); - - Vector< Vector* > &decompose(Vector &vertices, Vector &triangles); - -private: - Vector* > _convexPolygons; - Vector* > _convexPolygonsIndices; - - Vector _indices; - Vector _isConcaveArray; - Vector _triangles; - - Pool > _polygonPool; - Pool > _polygonIndicesPool; - - static bool isConcave(int index, int vertexCount, Vector &vertices, Vector &indices); - - static bool positiveArea(float p1x, float p1y, float p2x, float p2y, float p3x, float p3y); - - static int winding(float p1x, float p1y, float p2x, float p2y, float p3x, float p3y); -}; -} - -#endif /* Spine_Triangulator_h */ diff --git a/native/cocos/editor-support/spine/TwoColorTimeline.cpp b/native/cocos/editor-support/spine/TwoColorTimeline.cpp deleted file mode 100644 index 3577f7eacb..0000000000 --- a/native/cocos/editor-support/spine/TwoColorTimeline.cpp +++ /dev/null @@ -1,181 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include -#include - -#include -#include -#include -#include - -using namespace spine; - -RTTI_IMPL(TwoColorTimeline, CurveTimeline) - -const int TwoColorTimeline::ENTRIES = 8; -const int TwoColorTimeline::PREV_TIME = -8; -const int TwoColorTimeline::PREV_R = -7; -const int TwoColorTimeline::PREV_G = -6; -const int TwoColorTimeline::PREV_B = -5; -const int TwoColorTimeline::PREV_A = -4; -const int TwoColorTimeline::PREV_R2 = -3; -const int TwoColorTimeline::PREV_G2 = -2; -const int TwoColorTimeline::PREV_B2 = -1; -const int TwoColorTimeline::R = 1; -const int TwoColorTimeline::G = 2; -const int TwoColorTimeline::B = 3; -const int TwoColorTimeline::A = 4; -const int TwoColorTimeline::R2 = 5; -const int TwoColorTimeline::G2 = 6; -const int TwoColorTimeline::B2 = 7; - -TwoColorTimeline::TwoColorTimeline(int frameCount) : CurveTimeline(frameCount), _slotIndex(0) { - _frames.ensureCapacity(frameCount * ENTRIES); - _frames.setSize(frameCount * ENTRIES, 0); -} - -void TwoColorTimeline::apply(Skeleton &skeleton, float lastTime, float time, Vector *pEvents, float alpha, - MixBlend blend, MixDirection direction) { - SP_UNUSED(lastTime); - SP_UNUSED(pEvents); - SP_UNUSED(direction); - - Slot *slotP = skeleton._slots[_slotIndex]; - Slot &slot = *slotP; - - if (time < _frames[0]) { - // Time is before first frame. - switch (blend) { - case MixBlend_Setup: - slot.getColor().set(slot.getData().getColor()); - slot.getDarkColor().set(slot.getData().getDarkColor()); - return; - case MixBlend_First: { - Color &color = slot.getColor(); - color.r += (color.r - slot._data.getColor().r) * alpha; - color.g += (color.g - slot._data.getColor().g) * alpha; - color.b += (color.b - slot._data.getColor().b) * alpha; - color.a += (color.a - slot._data.getColor().a) * alpha; - - Color &darkColor = slot.getDarkColor(); - darkColor.r += (darkColor.r - slot._data.getDarkColor().r) * alpha; - darkColor.g += (darkColor.g - slot._data.getDarkColor().g) * alpha; - darkColor.b += (darkColor.b - slot._data.getDarkColor().b) * alpha; - return; - } - default: - return; - } - } - - float r, g, b, a, r2, g2, b2; - if (time >= _frames[_frames.size() - ENTRIES]) { - // Time is after last frame. - size_t i = _frames.size(); - r = _frames[i + PREV_R]; - g = _frames[i + PREV_G]; - b = _frames[i + PREV_B]; - a = _frames[i + PREV_A]; - r2 = _frames[i + PREV_R2]; - g2 = _frames[i + PREV_G2]; - b2 = _frames[i + PREV_B2]; - } else { - // Interpolate between the previous frame and the current frame. - size_t frame = (size_t)Animation::binarySearch(_frames, time, ENTRIES); - r = _frames[frame + PREV_R]; - g = _frames[frame + PREV_G]; - b = _frames[frame + PREV_B]; - a = _frames[frame + PREV_A]; - r2 = _frames[frame + PREV_R2]; - g2 = _frames[frame + PREV_G2]; - b2 = _frames[frame + PREV_B2]; - float frameTime = _frames[frame]; - float percent = getCurvePercent(frame / ENTRIES - 1, - 1 - (time - frameTime) / (_frames[frame + PREV_TIME] - frameTime)); - - r += (_frames[frame + R] - r) * percent; - g += (_frames[frame + G] - g) * percent; - b += (_frames[frame + B] - b) * percent; - a += (_frames[frame + A] - a) * percent; - r2 += (_frames[frame + R2] - r2) * percent; - g2 += (_frames[frame + G2] - g2) * percent; - b2 += (_frames[frame + B2] - b2) * percent; - } - - if (alpha == 1) { - Color &color = slot.getColor(); - color.set(r, g, b, a); - - Color &darkColor = slot.getDarkColor(); - darkColor.set(r2, g2, b2, 1); - } else { - Color &light = slot._color; - Color &dark = slot._darkColor; - if (blend == MixBlend_Setup) { - light.set(slot._data._color); - dark.set(slot._data._darkColor); - } - light.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha); - dark.add((r2 - dark.r) * alpha, (g2 - dark.g) * alpha, (b2 - dark.b) * alpha, 0); - } -} - -int TwoColorTimeline::getPropertyId() { - return ((int) TimelineType_TwoColor << 24) + _slotIndex; -} - -void TwoColorTimeline::setFrame(int frameIndex, float time, float r, float g, float b, float a, float r2, float g2, - float b2) { - frameIndex *= ENTRIES; - _frames[frameIndex] = time; - _frames[frameIndex + R] = r; - _frames[frameIndex + G] = g; - _frames[frameIndex + B] = b; - _frames[frameIndex + A] = a; - _frames[frameIndex + R2] = r2; - _frames[frameIndex + G2] = g2; - _frames[frameIndex + B2] = b2; -} - -int TwoColorTimeline::getSlotIndex() { - return _slotIndex; -} - -void TwoColorTimeline::setSlotIndex(int inValue) { - assert(inValue >= 0); - _slotIndex = inValue; -} diff --git a/native/cocos/editor-support/spine/TwoColorTimeline.h b/native/cocos/editor-support/spine/TwoColorTimeline.h deleted file mode 100644 index 78249043bf..0000000000 --- a/native/cocos/editor-support/spine/TwoColorTimeline.h +++ /dev/null @@ -1,81 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_TwoColorTimeline_h -#define Spine_TwoColorTimeline_h - -#include - -namespace spine { - - class SP_API TwoColorTimeline : public CurveTimeline { - friend class SkeletonBinary; - friend class SkeletonJson; - - RTTI_DECL - - public: - static const int ENTRIES; - - explicit TwoColorTimeline(int frameCount); - - virtual void apply(Skeleton& skeleton, float lastTime, float time, Vector* pEvents, float alpha, MixBlend blend, MixDirection direction); - - virtual int getPropertyId(); - - /// Sets the time and value of the specified keyframe. - void setFrame(int frameIndex, float time, float r, float g, float b, float a, float r2, float g2, float b2); - - int getSlotIndex(); - void setSlotIndex(int inValue); - - private: - static const int PREV_TIME; - static const int PREV_R; - static const int PREV_G; - static const int PREV_B; - static const int PREV_A; - static const int PREV_R2; - static const int PREV_G2; - static const int PREV_B2; - static const int R; - static const int G; - static const int B; - static const int A; - static const int R2; - static const int G2; - static const int B2; - - Vector _frames; // time, r, g, b, a, r2, g2, b2, ... - int _slotIndex; - }; -} - -#endif /* Spine_TwoColorTimeline_h */ diff --git a/native/cocos/editor-support/spine/Updatable.cpp b/native/cocos/editor-support/spine/Updatable.cpp deleted file mode 100644 index 7c52d17494..0000000000 --- a/native/cocos/editor-support/spine/Updatable.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -using namespace spine; - -RTTI_IMPL_NOPARENT(Updatable) - -Updatable::Updatable() { -} - -Updatable::~Updatable() { -} diff --git a/native/cocos/editor-support/spine/Updatable.h b/native/cocos/editor-support/spine/Updatable.h deleted file mode 100644 index 9c50d64e5b..0000000000 --- a/native/cocos/editor-support/spine/Updatable.h +++ /dev/null @@ -1,50 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_Updatable_h -#define Spine_Updatable_h - -#include -#include - -namespace spine { -class SP_API Updatable : public SpineObject { -RTTI_DECL - -public: - Updatable(); - - virtual ~Updatable(); - - virtual void update() = 0; -}; -} - -#endif /* Spine_Updatable_h */ diff --git a/native/cocos/editor-support/spine/Vector.h b/native/cocos/editor-support/spine/Vector.h deleted file mode 100644 index a7806c42db..0000000000 --- a/native/cocos/editor-support/spine/Vector.h +++ /dev/null @@ -1,223 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_Vector_h -#define Spine_Vector_h - -#include -#include -#include -#include -#include -#include - -namespace spine { -template -class SP_API Vector : public SpineObject { -public: - Vector() : _size(0), _capacity(0), _buffer(NULL) { - } - - Vector(const Vector &inVector) : _size(inVector._size), _capacity(inVector._capacity), _buffer(NULL) { - if (_capacity > 0) { - _buffer = allocate(_capacity); - for (size_t i = 0; i < _size; ++i) { - construct(_buffer + i, inVector._buffer[i]); - } - } - } - - ~Vector() { - clear(); - deallocate(_buffer); - } - - inline void clear() { - for (size_t i = 0; i < _size; ++i) { - destroy(_buffer + (_size - 1 - i)); - } - - _size = 0; - } - - inline size_t getCapacity() const { - return _capacity; - } - - inline size_t size() const { - return _size; - } - - inline void setSize(size_t newSize, const T &defaultValue) { - assert(newSize >= 0); - size_t oldSize = _size; - _size = newSize; - if (_capacity < newSize) { - _capacity = (int) (_size * 1.75f); - if (_capacity < 8) _capacity = 8; - _buffer = spine::SpineExtension::realloc(_buffer, _capacity, __FILE__, __LINE__); - } - if (oldSize < _size) { - for (size_t i = oldSize; i < _size; i++) { - construct(_buffer + i, defaultValue); - } - } - } - - inline void ensureCapacity(size_t newCapacity = 0) { - if (_capacity >= newCapacity) return; - _capacity = newCapacity; - _buffer = SpineExtension::realloc(_buffer, newCapacity, __FILE__, __LINE__); - } - - inline void add(const T &inValue) { - if (_size == _capacity) { - // inValue might reference an element in this buffer - // When we reallocate, the reference becomes invalid. - // We thus need to create a defensive copy before - // reallocating. - T valueCopy = inValue; - _capacity = (int) (_size * 1.75f); - if (_capacity < 8) _capacity = 8; - _buffer = spine::SpineExtension::realloc(_buffer, _capacity, __FILE__, __LINE__); - construct(_buffer + _size++, valueCopy); - } else { - construct(_buffer + _size++, inValue); - } - } - - inline void addAll(Vector &inValue) { - ensureCapacity(this->size() + inValue.size()); - for (size_t i = 0; i < inValue.size(); i++) { - add(inValue[i]); - } - } - - inline void clearAndAddAll(Vector &inValue) { - this->clear(); - this->addAll(inValue); - } - - inline void removeAt(size_t inIndex) { - assert(inIndex < _size); - - --_size; - - if (inIndex != _size) { - for (size_t i = inIndex; i < _size; ++i) { - std::swap(_buffer[i], _buffer[i + 1]); - } - } - - destroy(_buffer + _size); - } - - inline bool contains(const T &inValue) { - for (size_t i = 0; i < _size; ++i) { - if (_buffer[i] == inValue) { - return true; - } - } - - return false; - } - - inline int indexOf(const T &inValue) { - for (size_t i = 0; i < _size; ++i) { - if (_buffer[i] == inValue) { - return (int)i; - } - } - - return -1; - } - - inline T &operator[](size_t inIndex) { - assert(inIndex < _size); - - return _buffer[inIndex]; - } - - inline friend bool operator==(Vector &lhs, Vector &rhs) { - if (lhs.size() != rhs.size()) { - return false; - } - - for (size_t i = 0, n = lhs.size(); i < n; ++i) { - if (lhs[i] != rhs[i]) { - return false; - } - } - - return true; - } - - inline friend bool operator!=(Vector &lhs, Vector &rhs) { - return !(lhs == rhs); - } - - inline T *buffer() { - return _buffer; - } - -private: - size_t _size; - size_t _capacity; - T *_buffer; - - inline T *allocate(size_t n) { - assert(n > 0); - - T *ptr = SpineExtension::calloc(n, __FILE__, __LINE__); - - assert(ptr); - - return ptr; - } - - inline void deallocate(T *buffer) { - if (_buffer) { - SpineExtension::free(buffer, __FILE__, __LINE__); - } - } - - inline void construct(T *buffer, const T &val) { - new(buffer) T(val); - } - - inline void destroy(T *buffer) { - buffer->~T(); - } - - // Vector &operator=(const Vector &inVector) {}; -}; -} - -#endif /* Spine_Vector_h */ diff --git a/native/cocos/editor-support/spine/VertexAttachment.cpp b/native/cocos/editor-support/spine/VertexAttachment.cpp deleted file mode 100644 index a5d0cea02f..0000000000 --- a/native/cocos/editor-support/spine/VertexAttachment.cpp +++ /dev/null @@ -1,163 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include - -#include - -#include -#include - -using namespace spine; - -RTTI_IMPL(VertexAttachment, Attachment) - -VertexAttachment::VertexAttachment(const String &name) : Attachment(name), _worldVerticesLength(0), _id(getNextID()) { -} - -VertexAttachment::~VertexAttachment() { -} - -void VertexAttachment::computeWorldVertices(Slot &slot, Vector &worldVertices) { - computeWorldVertices(slot, 0, _worldVerticesLength, worldVertices, 0); -} - -void VertexAttachment::computeWorldVertices(Slot &slot, float *worldVertices) { - computeWorldVertices(slot, 0, _worldVerticesLength, worldVertices, 0); -} - -void VertexAttachment::computeWorldVertices(Slot &slot, size_t start, size_t count, Vector &worldVertices, size_t offset, - size_t stride) { - computeWorldVertices(slot, start, count, worldVertices.buffer(), offset, stride); -} - -void VertexAttachment::computeWorldVertices(Slot &slot, size_t start, size_t count, float *worldVertices, size_t offset, - size_t stride) { - count = offset + (count >> 1) * stride; - Skeleton &skeleton = slot._bone._skeleton; - Vector *deformArray = &slot.getAttachmentVertices(); - Vector *vertices = &_vertices; - Vector &bones = _bones; - if (bones.size() == 0) { - if (deformArray->size() > 0) { - vertices = deformArray; - } - - Bone &bone = slot._bone; - float x = bone._worldX; - float y = bone._worldY; - float a = bone._a, b = bone._b, c = bone._c, d = bone._d; - for (size_t vv = start, w = offset; w < count; vv += 2, w += stride) { - float vx = (*vertices)[vv]; - float vy = (*vertices)[vv + 1]; - worldVertices[w] = vx * a + vy * b + x; - worldVertices[w + 1] = vx * c + vy * d + y; - } - return; - } - - int v = 0, skip = 0; - for (size_t i = 0; i < start; i += 2) { - int n = bones[v]; - v += n + 1; - skip += n; - } - - Vector &skeletonBones = skeleton.getBones(); - if (deformArray->size() == 0) { - for (size_t w = offset, b = skip * 3; w < count; w += stride) { - float wx = 0, wy = 0; - int n = bones[v++]; - n += v; - for (; v < n; v++, b += 3) { - Bone *boneP = skeletonBones[bones[v]]; - Bone &bone = *boneP; - float vx = (*vertices)[b]; - float vy = (*vertices)[b + 1]; - float weight = (*vertices)[b + 2]; - wx += (vx * bone._a + vy * bone._b + bone._worldX) * weight; - wy += (vx * bone._c + vy * bone._d + bone._worldY) * weight; - } - worldVertices[w] = wx; - worldVertices[w + 1] = wy; - } - } else { - for (size_t w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) { - float wx = 0, wy = 0; - int n = bones[v++]; - n += v; - for (; v < n; v++, b += 3, f += 2) { - Bone *boneP = skeletonBones[bones[v]]; - Bone &bone = *boneP; - float vx = (*vertices)[b] + (*deformArray)[f]; - float vy = (*vertices)[b + 1] + (*deformArray)[f + 1]; - float weight = (*vertices)[b + 2]; - wx += (vx * bone._a + vy * bone._b + bone._worldX) * weight; - wy += (vx * bone._c + vy * bone._d + bone._worldY) * weight; - } - worldVertices[w] = wx; - worldVertices[w + 1] = wy; - } - } -} - -bool VertexAttachment::applyDeform(VertexAttachment *sourceAttachment) { - return this == sourceAttachment; -} - -int VertexAttachment::getId() { - return _id; -} - -Vector &VertexAttachment::getBones() { - return _bones; -} - -Vector &VertexAttachment::getVertices() { - return _vertices; -} - -size_t VertexAttachment::getWorldVerticesLength() { - return _worldVerticesLength; -} - -void VertexAttachment::setWorldVerticesLength(size_t inValue) { - _worldVerticesLength = inValue; -} - -int VertexAttachment::getNextID() { - static int nextID = 0; - - return (nextID++ & 65535) << 11; -} diff --git a/native/cocos/editor-support/spine/VertexAttachment.h b/native/cocos/editor-support/spine/VertexAttachment.h deleted file mode 100644 index e1cc9d6b9f..0000000000 --- a/native/cocos/editor-support/spine/VertexAttachment.h +++ /dev/null @@ -1,91 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_VertexAttachment_h -#define Spine_VertexAttachment_h - -#include - -#include - -namespace spine { - class Slot; - - /// An attachment with vertices that are transformed by one or more bones and can be deformed by a slot's vertices. - class SP_API VertexAttachment : public Attachment { - friend class SkeletonBinary; - friend class SkeletonJson; - friend class DeformTimeline; - - RTTI_DECL - - public: - explicit VertexAttachment(const String& name); - - virtual ~VertexAttachment(); - - void computeWorldVertices(Slot& slot, float* worldVertices); - void computeWorldVertices(Slot& slot, Vector& worldVertices); - - /// Transforms local vertices to world coordinates. - /// @param start The index of the first Vertices value to transform. Each vertex has 2 values, x and y. - /// @param count The number of world vertex values to output. Must be less than or equal to WorldVerticesLength - start. - /// @param worldVertices The output world vertices. Must have a length greater than or equal to offset + count. - /// @param offset The worldVertices index to begin writing values. - /// @param stride The number of worldVertices entries between the value pairs written. - void computeWorldVertices(Slot& slot, size_t start, size_t count, float* worldVertices, size_t offset, size_t stride = 2); - void computeWorldVertices(Slot& slot, size_t start, size_t count, Vector& worldVertices, size_t offset, size_t stride = 2); - - /// @return true if a deform originally applied to the specified attachment should be applied to this attachment. - virtual bool applyDeform(VertexAttachment* sourceAttachment); - - /// Gets a unique ID for this attachment. - int getId(); - - Vector& getBones(); - - Vector& getVertices(); - - size_t getWorldVerticesLength(); - void setWorldVerticesLength(size_t inValue); - - protected: - Vector _bones; - Vector _vertices; - size_t _worldVerticesLength; - - private: - const int _id; - - static int getNextID(); - }; -} - -#endif /* Spine_VertexAttachment_h */ diff --git a/native/cocos/editor-support/spine/VertexEffect.cpp b/native/cocos/editor-support/spine/VertexEffect.cpp deleted file mode 100644 index 18bf150abb..0000000000 --- a/native/cocos/editor-support/spine/VertexEffect.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifdef SPINE_UE4 -#include "SpinePluginPrivatePCH.h" -#endif - -#include -#include -#include - -using namespace spine; - -JitterVertexEffect::JitterVertexEffect(float jitterX, float jitterY): _jitterX(jitterX), _jitterY(jitterY) { -} - -void JitterVertexEffect::begin(Skeleton &skeleton) { - SP_UNUSED(skeleton); -} - -void JitterVertexEffect::transform(float &x, float &y, float &u, float &v, Color &light, Color &dark) { - SP_UNUSED(u); - SP_UNUSED(v); - SP_UNUSED(light); - SP_UNUSED(dark); - float jitterX = _jitterX; - float jitterY = _jitterY; - x += MathUtil::randomTriangular(-jitterX, jitterX); - y += MathUtil::randomTriangular(-jitterX, jitterY); -} - -void JitterVertexEffect::end() { -} - -void JitterVertexEffect::setJitterX(float jitterX) { - _jitterX = jitterX; -} - -float JitterVertexEffect::getJitterX() { - return _jitterX; -} - -void JitterVertexEffect::setJitterY(float jitterY) { - _jitterY = jitterY; -} - -float JitterVertexEffect::getJitterY() { - return _jitterY; -} - -SwirlVertexEffect::SwirlVertexEffect(float radius, Interpolation &interpolation): - _centerX(0), - _centerY(0), - _radius(radius), - _angle(0), - _worldX(0), - _worldY(0), - _interpolation(interpolation) { -} - -void SwirlVertexEffect::begin(Skeleton &skeleton) { - _worldX = skeleton.getX() + _centerX; - _worldY = skeleton.getY() + _centerY; -} - -void SwirlVertexEffect::transform(float &positionX, float &positionY, float &u, float &v, Color &light, Color &dark) { - SP_UNUSED(u); - SP_UNUSED(v); - SP_UNUSED(light); - SP_UNUSED(dark); - - float x = positionX - _worldX; - float y = positionY - _worldY; - float dist = (float)MathUtil::sqrt(x * x + y * y); - if (dist < _radius) { - float theta = _interpolation.interpolate(0, _angle, (_radius - dist) / _radius); - float cos = MathUtil::cos(theta), sin = MathUtil::sin(theta); - positionX = cos * x - sin * y + _worldX; - positionY = sin * x + cos * y + _worldY; - } -} - -void SwirlVertexEffect::end() { - -} - -void SwirlVertexEffect::setCenterX(float centerX) { - _centerX = centerX; -} - -float SwirlVertexEffect::getCenterX() { - return _centerX; -} - -void SwirlVertexEffect::setCenterY(float centerY) { - _centerY = centerY; -} - -float SwirlVertexEffect::getCenterY() { - return _centerY; -} - -void SwirlVertexEffect::setRadius(float radius) { - _radius = radius; -} - -float SwirlVertexEffect::getRadius() { - return _radius; -} - -void SwirlVertexEffect::setAngle(float angle) { - _angle = angle * MathUtil::Deg_Rad; -} - -float SwirlVertexEffect::getAngle() { - return _angle; -} - -void SwirlVertexEffect::setWorldX(float worldX) { - _worldX = worldX; -} - -float SwirlVertexEffect::getWorldX() { - return _worldX; -} - -void SwirlVertexEffect::setWorldY(float worldY) { - _worldY = worldY; -} - -float SwirlVertexEffect::getWorldY() { - return _worldY; -} diff --git a/native/cocos/editor-support/spine/VertexEffect.h b/native/cocos/editor-support/spine/VertexEffect.h deleted file mode 100644 index 45fffe461c..0000000000 --- a/native/cocos/editor-support/spine/VertexEffect.h +++ /dev/null @@ -1,106 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_VertexEffect_h -#define Spine_VertexEffect_h - -#include -#include - -namespace spine { - -class Skeleton; -class Color; - -class SP_API VertexEffect: public SpineObject { -public: - virtual void begin(Skeleton& skeleton) = 0; - virtual void transform(float& x, float& y, float &u, float &v, Color &light, Color &dark) = 0; - virtual void end() = 0; -}; - -class SP_API JitterVertexEffect: public VertexEffect { -public: - JitterVertexEffect(float jitterX, float jitterY); - - void begin(Skeleton& skeleton); - void transform(float& x, float& y, float &u, float &v, Color &light, Color &dark); - void end(); - - void setJitterX(float jitterX); - float getJitterX(); - - void setJitterY(float jitterY); - float getJitterY(); - -protected: - float _jitterX; - float _jitterY; -}; - -class SP_API SwirlVertexEffect: public VertexEffect { -public: - SwirlVertexEffect(float radius, Interpolation &interpolation); - - void begin(Skeleton& skeleton); - void transform(float& x, float& y, float &u, float &v, Color &light, Color &dark); - void end(); - - void setCenterX(float centerX); - float getCenterX(); - - void setCenterY(float centerY); - float getCenterY(); - - void setRadius(float radius); - float getRadius(); - - void setAngle(float angle); - float getAngle(); - - void setWorldX(float worldX); - float getWorldX(); - - void setWorldY(float worldY); - float getWorldY(); - -protected: - float _centerX; - float _centerY; - float _radius; - float _angle; - float _worldX; - float _worldY; - - Interpolation& _interpolation; -}; -} - -#endif /* Spine_VertexEffect_h */ diff --git a/native/cocos/editor-support/spine/Vertices.h b/native/cocos/editor-support/spine/Vertices.h deleted file mode 100644 index 90b4b39c14..0000000000 --- a/native/cocos/editor-support/spine/Vertices.h +++ /dev/null @@ -1,44 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef Spine_Vertices_h -#define Spine_Vertices_h - -#include - -namespace spine { -class SP_API Vertices : public SpineObject { -public: - Vector _bones; - Vector _vertices; -}; -} - -#endif /* Spine_Vertices_h */ diff --git a/native/cocos/editor-support/spine/dll.h b/native/cocos/editor-support/spine/dll.h deleted file mode 100644 index caae941988..0000000000 --- a/native/cocos/editor-support/spine/dll.h +++ /dev/null @@ -1,52 +0,0 @@ -/****************************************************************************** -* Spine Runtimes Software License v2.5 -* -* Copyright (c) 2013-2016, Esoteric Software -* All rights reserved. -* -* You are granted a perpetual, non-exclusive, non-sublicensable, and -* non-transferable license to use, install, execute, and perform the Spine -* Runtimes software and derivative works solely for personal or internal -* use. Without the written permission of Esoteric Software (see Section 2 of -* the Spine Software License Agreement), you may not (a) modify, translate, -* adapt, or develop new applications using the Spine Runtimes or otherwise -* create derivative works or improvements of the Spine Runtimes or (b) remove, -* delete, alter, or obscure any trademarks or any copyright, trademark, patent, -* or other intellectual property or proprietary rights notices on or in the -* Software, including any copy thereof. Redistributions in binary or source -* form must include this license and terms. -* -* THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR -* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -* EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF -* USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. -*****************************************************************************/ - -#ifndef SPINE_SHAREDLIB_H -#define SPINE_SHAREDLIB_H - -#ifdef _WIN32 -#define DLLIMPORT __declspec(dllimport) -#define DLLEXPORT __declspec(dllexport) -#else -#ifndef DLLIMPORT -#define DLLIMPORT -#endif -#ifndef DLLEXPORT -#define DLLEXPORT -#endif -#endif - -#ifdef SPINEPLUGIN_API -#define SP_API SPINEPLUGIN_API -#else -#define SP_API -#endif - -#endif /* SPINE_SHAREDLIB_H */ diff --git a/native/cocos/editor-support/spine/spine.h b/native/cocos/editor-support/spine/spine.h deleted file mode 100644 index 00ab72c4cf..0000000000 --- a/native/cocos/editor-support/spine/spine.h +++ /dev/null @@ -1,114 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef SPINE_SPINE_H_ -#define SPINE_SPINE_H_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#endif diff --git a/native/cocos/renderer/Macro.h b/native/cocos/renderer/Macro.h deleted file mode 100644 index 93315d49e0..0000000000 --- a/native/cocos/renderer/Macro.h +++ /dev/null @@ -1,192 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#pragma once - -#include "platform/CCPlatformConfig.h" - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) -#include -#endif - -#ifndef RENDERER_BEGIN -#define RENDERER_BEGIN namespace cocos2d { namespace renderer { -#endif // RENDERER_BEGIN - -#ifndef RENDERER_END -#define RENDERER_END }} -#endif // RENDERER_END - -//#ifndef DISALLOW_COPY_ASSIGN_AND_MOVE - #define CC_DISALLOW_COPY_ASSIGN_AND_MOVE(type) \ - type(const type&) = delete; \ - type& operator =(const type&) = delete; \ - type(type &&) = delete; \ - type& operator =(const type &&) = delete; -//#endif // DISALLOW_COPY_ASSIGN_AND_MOVE - -#define RENDERER_LOG_TAG "renderer" -#define RENDERER_QUOTEME_(x) #x -#define RENDERER_QUOTEME(x) RENDERER_QUOTEME_(x) - -#if defined(COCOS2D_DEBUG) && COCOS2D_DEBUG > 0 -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) -#define RENDERER_LOGV(fmt, ...) __android_log_print(ANDROID_LOG_VERBOSE, RENDERER_LOG_TAG, " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__) -#else -#define RENDERER_LOGV(fmt, ...) printf("V/" RENDERER_LOG_TAG " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__) -#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) -#else -#define RENDERER_LOGV(fmt, ...) do {} while(false) -#endif // defined(COCOS2D_DEBUG) && COCOS2D_DEBUG > 0 - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) -#define RENDERER_LOGD(fmt, ...) __android_log_print(ANDROID_LOG_DEBUG, RENDERER_LOG_TAG, " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__) -#define RENDERER_LOGI(fmt, ...) __android_log_print(ANDROID_LOG_INFO, RENDERER_LOG_TAG, " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__) -#define RENDERER_LOGW(fmt, ...) __android_log_print(ANDROID_LOG_WARN, RENDERER_LOG_TAG, " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__) -#define RENDERER_LOGE(fmt, ...) __android_log_print(ANDROID_LOG_ERROR, RENDERER_LOG_TAG, " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__) -#else -#define RENDERER_LOGD(fmt, ...) printf("D/" RENDERER_LOG_TAG " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__) -#define RENDERER_LOGI(fmt, ...) printf("I/" RENDERER_LOG_TAG " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__) -#define RENDERER_LOGW(fmt, ...) printf("W/" RENDERER_LOG_TAG " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__) -#define RENDERER_LOGE(fmt, ...) printf("E/" RENDERER_LOG_TAG " (" RENDERER_QUOTEME(__LINE__) "): " fmt "\n", ##__VA_ARGS__) -#endif // (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) - - -#define RENDERER_DEBUG 1 // REFINE: remove this - -#define RENDERER_SAFE_RELEASE(p) do { if((p) != nullptr) (p)->release(); } while(false) -#define RENDERER_SAFE_RETAIN(p) do { if((p) != nullptr) (p)->retain(); } while(false) - -#define RENDERER_DEFINE_CREATE_METHOD_0(clsName, initMethod) \ -static clsName* create() \ -{ \ - clsName* ret = new (std::nothrow) clsName(); \ - if (ret && ret->initMethod()) \ - { \ - ret->autorelease(); \ - return ret; \ - } \ - delete ret; \ - return nullptr; \ -} - -#define RENDERER_DEFINE_CREATE_METHOD_1(clsName, initMethod, arg0Type) \ -static clsName* create(arg0Type arg0) \ -{ \ - clsName* ret = new (std::nothrow) clsName(); \ - if (ret && ret->initMethod(arg0)) \ - { \ - ret->autorelease(); \ - return ret; \ - } \ - delete ret; \ - return nullptr; \ -} - -#define RENDERER_DEFINE_CREATE_METHOD_2(clsName, initMethod, arg0Type, arg1Type) \ -static clsName* create(arg0Type arg0, arg1Type arg1) \ -{ \ - clsName* ret = new (std::nothrow) clsName(); \ - if (ret && ret->initMethod(arg0, arg1)) \ - { \ - ret->autorelease(); \ - return ret; \ - } \ - delete ret; \ - return nullptr; \ -} - -#define RENDERER_DEFINE_CREATE_METHOD_3(clsName, initMethod, arg0Type, arg1Type, arg2Type) \ -static clsName* create(arg0Type arg0, arg1Type arg1, arg2Type arg2) \ -{ \ - clsName* ret = new (std::nothrow) clsName(); \ - if (ret && ret->initMethod(arg0, arg1, arg2)) \ - { \ - ret->autorelease(); \ - return ret; \ - } \ - delete ret; \ - return nullptr; \ -} - -#define RENDERER_DEFINE_CREATE_METHOD_4(clsName, initMethod, arg0Type, arg1Type, arg2Type, arg3Type) \ -static clsName* create(arg0Type arg0, arg1Type arg1, arg2Type arg2, arg3Type arg3) \ -{ \ - clsName* ret = new (std::nothrow) clsName(); \ - if (ret && ret->initMethod(arg0, arg1, arg2, arg3)) \ - { \ - ret->autorelease(); \ - return ret; \ - } \ - delete ret; \ - return nullptr; \ -} - -#define RENDERER_DEFINE_CREATE_METHOD_5(clsName, initMethod, arg0Type, arg1Type, arg2Type, arg3Type, arg4Type) \ -static clsName* create(arg0Type arg0, arg1Type arg1, arg2Type arg2, arg3Type arg3, arg4Type arg4) \ -{ \ - clsName* ret = new (std::nothrow) clsName(); \ - if (ret && ret->initMethod(arg0, arg1, arg2, arg3, arg4)) \ - { \ - ret->autorelease(); \ - return ret; \ - } \ - delete ret; \ - return nullptr; \ -} - -#define RENDERER_DEFINE_CREATE_METHOD_6(clsName, initMethod, arg0Type, arg1Type, arg2Type, arg3Type, arg4Type, arg5Type) \ -static clsName* create(arg0Type arg0, arg1Type arg1, arg2Type arg2, arg3Type arg3, arg4Type arg4, arg5Type arg5) \ -{ \ - clsName* ret = new (std::nothrow) clsName(); \ - if (ret && ret->initMethod(arg0, arg1, arg2, arg3, arg4, arg5)) \ - { \ - ret->autorelease(); \ - return ret; \ - } \ - delete ret; \ - return nullptr; \ -} - -// enum class to GLENUM -#define ENUM_CLASS_TO_GLENUM(value) static_cast(value) - -#define _GL_CHECK(_call) \ - do { \ - _call; \ - GLenum gl_err = glGetError(); \ - if (0 != gl_err) \ - RENDERER_LOGE(#_call "; GL error 0x%x: %s:%s", gl_err, glEnumName(gl_err), __FUNCTION__); \ - } while(false) - - -#if COCOS2D_DEBUG > 0 -# define GL_CHECK(_call) _GL_CHECK(_call) -#else -# define GL_CHECK(_call) _call -#endif // BRENDERER_CONFIG_DEBUG - -#ifndef RENDERER_PI -#define RENDERER_PI 3.1415926535897932385f -#endif // RENDERER_PI diff --git a/native/cocos/renderer/Types.cpp b/native/cocos/renderer/Types.cpp deleted file mode 100644 index aa15505901..0000000000 --- a/native/cocos/renderer/Types.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "Types.h" - -RENDERER_BEGIN - -const char* ATTRIB_NAME_POSITION = "a_position"; -const char* ATTRIB_NAME_NORMAL = "a_normal"; -const char* ATTRIB_NAME_TANGENT = "a_tangent"; -const char* ATTRIB_NAME_BITANGENT = "a_bitangent"; -const char* ATTRIB_NAME_WEIGHTS = "a_weights"; -const char* ATTRIB_NAME_JOINTS = "a_joints"; -const char* ATTRIB_NAME_COLOR = "a_color"; -const char* ATTRIB_NAME_COLOR0 = "a_color0"; -const char* ATTRIB_NAME_COLOR1 = "a_color1"; -const char* ATTRIB_NAME_UV = "a_uv"; -const char* ATTRIB_NAME_UV0 = "a_uv0"; -const char* ATTRIB_NAME_UV1 = "a_uv1"; -const char* ATTRIB_NAME_UV2 = "a_uv2"; -const char* ATTRIB_NAME_UV3 = "a_uv3"; -const char* ATTRIB_NAME_UV4 = "a_uv4"; -const char* ATTRIB_NAME_UV5 = "a_uv5"; -const char* ATTRIB_NAME_UV6 = "a_uv6"; -const char* ATTRIB_NAME_UV7 = "a_uv7"; - -Rect Rect::ZERO; - -Rect::Rect() -{} - -Rect::Rect(float x, float y, float w, float h) -: x(x) -, y(y) -, w(w) -, h(h) -{} - -void Rect::set(float x, float y, float w, float h) -{ - this->x = x; - this->y = y; - this->w = w; - this->h = h; -} - -RENDERER_END diff --git a/native/cocos/renderer/Types.h b/native/cocos/renderer/Types.h deleted file mode 100644 index 0217bd7fd6..0000000000 --- a/native/cocos/renderer/Types.h +++ /dev/null @@ -1,203 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#pragma once - -#include -#include -#include -#include -#include -#include "base/CCValue.h" - -#include "Macro.h" -#include "platform/CCGL.h" - -RENDERER_BEGIN - -enum ClearFlag : uint8_t -{ - NONE = 0x00, // No clear flags. - COLOR = 0x01, // Clear color. - DEPTH = 0x02, // Clear depth. - STENCIL = 0x04 // Clear stencil. -}; - -enum class ComparisonFunc : uint16_t -{ - NEVER = GL_NEVER, - LESS = GL_LESS, - EQUAL = GL_EQUAL, - LESS_EQUAL = GL_LEQUAL, - GREATER = GL_GREATER, - NOT_EQUAL = GL_NOTEQUAL, - GREATOR_EQUAL = GL_GEQUAL, - ALWAYS = GL_ALWAYS -}; -typedef ComparisonFunc DepthFunc; -typedef ComparisonFunc StencilFunc; -typedef ComparisonFunc SamplerFunc; - -enum class StencilOp : uint16_t -{ - ZERO = GL_ZERO, - KEEP = GL_KEEP, - REPLACE = GL_REPLACE, - INCR = GL_INCR, - DECR = GL_DECR, - INVERT = GL_INVERT, - - // Does these two belongs to stencil operation? - INCR_WRAP = GL_INCR_WRAP, - DECR_WRAP = GL_DECR_WRAP -}; - -enum class BlendFactor : uint16_t -{ - ZERO = GL_ZERO, - ONE = GL_ONE, - SRC_COLOR = GL_SRC_COLOR, - ONE_MINUS_SRC_COLOR = GL_ONE_MINUS_SRC_COLOR, - SRC_ALPHA = GL_SRC_ALPHA, - ONE_MINUS_SRC_ALPHA = GL_ONE_MINUS_SRC_ALPHA, - DST_ALPHA = GL_DST_ALPHA, - ONE_MINUS_DST_ALPHA = GL_ONE_MINUS_DST_ALPHA, - DST_COLOR = GL_DST_COLOR, - ONE_MINUS_DST_COLOR = GL_ONE_MINUS_DST_COLOR, - SRC_ALPHA_SATURATE = GL_SRC_ALPHA_SATURATE, - - CONSTANT_COLOR = GL_CONSTANT_COLOR, - ONE_MINUS_CONSTANT_COLOR = GL_ONE_MINUS_CONSTANT_COLOR, - CONSTANT_ALPHA = GL_CONSTANT_ALPHA, - ONE_MINUS_CONSTANT_ALPHA = GL_ONE_MINUS_CONSTANT_ALPHA -}; -enum class BlendOp : uint16_t -{ - ADD = GL_FUNC_ADD, - SUBTRACT = GL_FUNC_SUBTRACT, - REVERSE_SUBTRACT = GL_FUNC_REVERSE_SUBTRACT -}; - -enum class CullMode : uint16_t -{ - NONE = GL_NONE, - BACK = GL_BACK, - FRONT = GL_FRONT, - FRONT_AND_BACK = GL_FRONT_AND_BACK -}; - -enum class PrimitiveType : uint16_t -{ - POINTS = GL_POINTS, - LINES = GL_LINES, - LINE_LOOP = GL_LINE_LOOP, - LINE_STRIP = GL_LINE_STRIP, - TRIANGLES = GL_TRIANGLES, - TRIANGLE_STRIP = GL_TRIANGLE_STRIP, - TRIANGLE_FAN = GL_TRIANGLE_FAN -}; - -enum class Usage : uint16_t -{ - STATIC = GL_STATIC_DRAW, - DYNAMIC = GL_DYNAMIC_DRAW, - STREAM = GL_STREAM_DRAW -}; - -enum class IndexFormat : uint16_t -{ - UINT8 = GL_UNSIGNED_BYTE, - UINT16 = GL_UNSIGNED_SHORT, - UINT32 = GL_UNSIGNED_INT// (OES_element_index_uint) -}; - -// vertex attribute semantic - -extern const char* ATTRIB_NAME_POSITION; -extern const char* ATTRIB_NAME_NORMAL; -extern const char* ATTRIB_NAME_TANGENT; -extern const char* ATTRIB_NAME_BITANGENT; -extern const char* ATTRIB_NAME_WEIGHTS; -extern const char* ATTRIB_NAME_JOINTS; -extern const char* ATTRIB_NAME_COLOR; -extern const char* ATTRIB_NAME_COLOR0; -extern const char* ATTRIB_NAME_COLOR1; -extern const char* ATTRIB_NAME_UV; -extern const char* ATTRIB_NAME_UV0; -extern const char* ATTRIB_NAME_UV1; -extern const char* ATTRIB_NAME_UV2; -extern const char* ATTRIB_NAME_UV3; -extern const char* ATTRIB_NAME_UV4; -extern const char* ATTRIB_NAME_UV5; -extern const char* ATTRIB_NAME_UV6; -extern const char* ATTRIB_NAME_UV7; - -// vertex attribute type -enum class AttribType : uint16_t -{ - INVALID = 0, - INT8 = GL_BYTE, - UINT8 = GL_UNSIGNED_BYTE, - INT16 = GL_SHORT, - UINT16 = GL_UNSIGNED_SHORT, - INT32 = GL_INT, - UINT32 = GL_UNSIGNED_INT, - FLOAT32 = GL_FLOAT -}; - -enum class UniformElementType : uint8_t -{ - FLOAT, - INT -}; - -enum class ProjectionType : uint8_t -{ - PERSPECTIVE, - ORTHOGRAPHIC -}; - -struct Define -{ - std::string key; - Value value; -}; -typedef std::vector DefineVector; - -struct Rect -{ - Rect(); - Rect(float x, float y, float w, float h); - - void set(float x, float y, float w, float h); - - float x = 0; - float y = 0; - float w = 0; - float h = 0; - - static Rect ZERO; -}; - -RENDERER_END diff --git a/native/cocos/renderer/core/Core.h b/native/cocos/renderer/core/Core.h new file mode 100644 index 0000000000..6bec6459d0 --- /dev/null +++ b/native/cocos/renderer/core/Core.h @@ -0,0 +1,27 @@ +#ifndef CC_CORE_CORE_H_ +#define CC_CORE_CORE_H_ + +#include "CoreStd.h" + +#include "Kernel/CachedArray.h" +#include "Util/StringUtil.h" + +#include "GFX/GFXDevice.h" +#include "GFX/GFXContext.h" +#include "GFX/GFXWindow.h" +#include "GFX/GFXBuffer.h" +#include "GFX/GFXTexture.h" +#include "GFX/GFXTextureView.h" +#include "GFX/GFXSampler.h" +#include "GFX/GFXShader.h" +#include "GFX/GFXInputAssembler.h" +#include "GFX/GFXRenderPass.h" +#include "GFX/GFXFramebuffer.h" +#include "GFX/GFXBindingLayout.h" +#include "GFX/GFXPipelineLayout.h" +#include "GFX/GFXPipelineState.h" +#include "GFX/GFXCommandAllocator.h" +#include "GFX/GFXCommandBuffer.h" +#include "GFX/GFXQueue.h" + +#endif // CC_CORE_CORE_H_ diff --git a/native/cocos/renderer/core/CoreDef.h b/native/cocos/renderer/core/CoreDef.h new file mode 100755 index 0000000000..c8b1483e0e --- /dev/null +++ b/native/cocos/renderer/core/CoreDef.h @@ -0,0 +1,344 @@ +#ifndef CC_CORE_CORE_DEF_H_ +#define CC_CORE_CORE_DEF_H_ + +// Initial compiler-related stuff to set. +#define CC_COMPILER_MSVC 1 +#define CC_COMPILER_CLANG 2 +#define CC_COMPILER_GNUC 3 + +// Initial platform stuff to set. +#define CC_PLATFORM_WINDOWS 1 +#define CC_PLATFORM_LINUX 2 +#define CC_PLATFORM_MAC_OSX 3 +#define CC_PLATFORM_MAC_IOS 4 +#define CC_PLATFORM_ANDROID 5 +#define CC_PLATFORM_NACL 6 + +// CPU Architecture +#define CC_CPU_UNKNOWN 0 +#define CC_CPU_X86 1 +#define CC_CPU_PPC 2 +#define CC_CPU_ARM 3 +#define CC_CPU_MIPS 4 + +// 32-bits or 64-bits CPU +#define CC_CPU_ARCH_32 1 +#define CC_CPU_ARCH_64 2 + +// Endian +#define CC_ENDIAN_LITTLE 1 +#define CC_ENDIAN_BIG 2 + +// Charset +#define CC_CHARSET_UNICODE 1 +#define CC_CHARSET_MULTIBYTE 2 + +// Precision +#define CC_PRECISION_FLOAT 1 +#define CC_PRECISION_DOUBLE 2 + +// Mode +#define CC_MODE_DEBUG 1 +#define CC_MODE_RELEASE 2 + +// Memory Allocator +#define CC_MEMORY_ALLOCATOR_STD 0 +#define CC_MEMORY_ALLOCATOR_NEDPOOLING 1 +#define CC_MEMORY_ALLOCATOR_JEMALLOC 2 + +// STL Memory Allocator +#define CC_STL_MEMORY_ALLOCATOR_STANDARD 1 +#define CC_STL_MEMORY_ALLOCATOR_CUSTOM 2 + +// Compiler type and version recognition +#if defined( _MSC_VER ) +# define CC_COMPILER CC_COMPILER_MSVC +# if _MSC_VER >= 1900 +# define CC_COMPILER_VERSION 130 +# elif _MSC_VER >= 1800 +# define CC_COMPILER_VERSION 120 +# elif _MSC_VER >= 1700 +# define CC_COMPILER_VERSION 110 +# elif _MSC_VER >= 1600 +# define CC_COMPILER_VERSION 100 +# elif _MSC_VER >= 1500 +# define CC_COMPILER_VERSION 90 +# elif _MSC_VER >= 1400 +# define CC_COMPILER_VERSION 80 +# elif _MSC_VER >= 1300 +# define CC_COMPILER_VERSION 70 +# endif +#elif defined( __clang__ ) +# define CC_COMPILER CC_COMPILER_CLANG +# define CC_COMPILER_VERSION (((__clang_major__)*100) + (__clang_minor__*10) + __clang_patchlevel__) +#elif defined( __GNUC__ ) +# define CC_COMPILER CC_COMPILER_GNUC +# define CC_COMPILER_VERSION (((__GNUC__)*100) + (__GNUC_MINOR__*10) + __GNUC_PATCHLEVEL__) +#else +# error "Unknown compiler. Abort!" +#endif + +// Platform recognition +#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(_WIN64) || defined(__WIN64__) || defined(WIN64) +# define CC_PLATFORM CC_PLATFORM_WINDOWS +#elif defined(__APPLE_CC__) +// Device Simulator +// Both requiring OS version 4.0 or greater +# if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 40000 || __IPHONE_OS_VERSION_MIN_REQUIRED >= 40000 +# define CC_PLATFORM CC_PLATFORM_MAC_IOS +# else +# define CC_PLATFORM CC_PLATFORM_MAC_OSX +# endif +#elif defined(__ANDROID__) +# define CC_PLATFORM CC_PLATFORM_ANDROID +#elif defined(linux) || defined(__linux) || defined(__linux__) +# define CC_PLATFORM CC_PLATFORM_LINUX +#elif defined(__native_client__) +# define CC_PLATFORM CC_PLATFORM_NACL +#else +# error "Couldn't recognize platform" +#endif + +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) +# define CC_ENDIAN CC_ENDIAN_LITTLE +#else +# include +# if __BYTE_ORDER == __LITTLE_ENDIAN +# define CC_ENDIAN CC_ENDIAN_LITTLE +# else +# define CC_ENDIAN CC_ENDIAN_BIG +# endif +#endif + +// CPU architecture type recognition +#if (defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))) ||(defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))) +# define CC_CPU CC_CPU_X86 +#elif CC_PLATFORM == CC_PLATFORM_MAC_OSX && CC_ENDIAN == CC_ENDIAN_BIG +# define CC_CPU CC_CPU_PPC +#elif CC_PLATFORM == CC_PLATFORM_MAC_OSX +# define COCOS_CPU CC_CPU_X86 +#elif CC_PLATFORM == CC_PLATFORM_MAC_IOS && (defined(__i386__) || defined(__x86_64__)) +# define CC_CPU CC_CPU_X86 +#elif defined(__arm__) || defined(_M_ARM) || defined(__arm64__) || defined(_aarch64_) +# define CC_CPU CC_CPU_ARM +#elif defined(__mips64) || defined(__mips64_) +# define CC_CPU CC_CPU_MIPS +#else +# define CC_CPU CC_CPU_UNKNOWN +#endif + +#if defined(__x86_64__) || defined(_M_X64) || defined(__powerpc64__) || defined(__alpha__) || defined(__ia64__) || defined(__s390__) || defined(__s390x__) || defined(__arm64__) || defined(_aarch64_) || defined(__mips64) || defined(__mips64_) +# define CC_CPU_ARCH CC_CPU_ARCH_64 +#else +# define CC_CPU_ARCH CC_CPU_ARCH_32 +#endif + +#if (__cplusplus >= 201103L) +# define CC_C11 +# define register +#endif + +// C11 features +#if (CC_COMPILER == CC_COMPILER_MSVC) +# if (_MSC_VER >= 1700) +# define CC_C11_TYPED_ENUMS +# endif +#elif (CC_COMPILER == CC_COMPILER_GNUC) +# if (__GNUC_MINOR__ >= 4) +# define CC_C11_TYPED_ENUMS +# endif +#endif + +// Disable MSVC warning +#if (CC_COMPILER == CC_COMPILER_MSVC) +# pragma warning(disable:4251 4275 4819) +# ifndef _CRT_SECURE_NO_DEPRECATE +# define _CRT_SECURE_NO_DEPRECATE +# endif +# ifndef _SCL_SECURE_NO_DEPRECATE +# define _SCL_SECURE_NO_DEPRECATE +# endif +#endif + +// Charset Settings +#if defined(_UNICODE) || defined(UNICODE) +# define CC_CHARSET CC_CHARSET_UNICODE +#else +# define CC_CHARSET CC_CHARSET_MULTIBYTE +#endif + +#if CC_COMPILER == CC_COMPILER_MSVC +# if CC_COMPILER_VERSION >= 120 +# define CC_INLINE __forceinline +# else +# define CC_INLINE inline +# endif +#elif defined(__MINGW32__) +# if !defined(CC_INLINE) +# define CC_INLINE __inline +# endif +#elif !defined(ANDROID) && (CC_COMPILER == CC_COMPILER_GNUC || CC_COMPILER == CC_COMPILER_CLANG) +# define CC_INLINE inline __attribute__((always_inline)) +#else +# define CC_INLINE __inline +#endif + +// Asserts expression is true at compile-time +#define CC_COMPILER_ASSERT(x) typedef int COMPILER_ASSERT_[!!(x)] + +#if (CC_COMPILER == CC_COMPILER_MSVC) +# define CC_RESTRICT __restrict //MSVC +#else +# define CC_RESTRICT __restrict__ //GCC... and others? +#endif + +#define CC_CACHELINE_SIZE 64 + +#if (CC_COMPILER == CC_COMPILER_MSVC) +# define CC_ALIGN(N) __declspec(align(N)) +# define CC_CACHE_ALIGN __declspec(align(CC_CACHELINE_SIZE)) +# define CC_PACKED_ALIGN(N) __declspec(align(N)) + +# define CC_ALIGNED_DECL(type, var, alignment) __declspec(align(alignment)) type var + +# define CC_READ_COMPILER_BARRIER() _ReadBarrier() +# define CC_WRITE_COMPILER_BARRIER() _WriteBarrier() +# define CC_COMPILER_BARRIER() _ReadWriteBarrier() + +# define CC_READ_MEMORY_BARRIER() MemoryBarrier() +# define CC_WRITE_MEMORY_BARRIER() MemoryBarrier() +# define CC_MEMORY_BARRIER() MemoryBarrier() + +# define CC_CPU_READ_MEMORY_BARRIER() do { __asm { lfence } } while (0) +# define CC_CPU_WRITE_MEMORY_BARRIER() do { __asm { sfence } } while (0) +# define CC_CPU_MEMORY_BARRIER() do { __asm { mfence } } while (0) + +#elif (CC_COMPILER == CC_COMPILER_GNUC) || (CC_COMPILER == CC_COMPILER_CLANG) +# define CC_ALIGN(N) __attribute__((__aligned__((N)))) +# define CC_CACHE_ALIGN __attribute__((__aligned__((CC_CACHELINE_SIZE)))) +# define CC_PACKED_ALIGN(N) __attribute__((packed, aligned(N))) + +# define CC_ALIGNED_DECL(type, var, alignment) type var __attribute__((__aligned__(alignment))) + +# define CC_READ_COMPILER_BARRIER() do { __asm__ __volatile__ ("" : : : "memory"); } while (0) +# define CC_WRITE_COMPILER_BARRIER() do { __asm__ __volatile__ ("" : : : "memory"); } while (0) +# define CC_COMPILER_BARRIER() do { __asm__ __volatile__ ("" : : : "memory"); } while (0) + +# define CC_READ_MEMORY_BARRIER() do { __sync_synchronize(); } while (0) +# define CC_WRITE_MEMORY_BARRIER() do { __sync_synchronize(); } while (0) +# define CC_MEMORY_BARRIER() do { __sync_synchronize(); } while (0) + +# define CC_CPU_READ_MEMORY_BARRIER() do { __asm__ __volatile__ ("lfence" : : : "memory"); } while (0) +# define CC_CPU_WRITE_MEMORY_BARRIER() do { __asm__ __volatile__ ("sfence" : : : "memory"); } while (0) +# define CC_CPU_MEMORY_BARRIER() do { __asm__ __volatile__ ("mfence" : : : "memory"); } while (0) + +#else +# error "Unsupported compiler!" +#endif + +#define CC_SIMD_ALIGNMENT 16 + +#if (CC_COMPILER == CC_COMPILER_MSVC) +# define CC_DECL_MALLOC __declspec(restrict) __declspec(noalias) +#else +# define CC_DECL_MALLOC __attribute__ ((malloc)) +#endif + +/* Stack-alignment +If macro __CC_SIMD_ALIGN_STACK defined, means there requests +special code to ensure stack align to a 16-bytes boundary. + +Note: + This macro can only guarantee callee stack pointer (esp) align + to a 16-bytes boundary, but not that for frame pointer (ebp). + Because most compiler might use frame pointer to access to stack + variables, so you need to wrap those alignment required functions + with extra function call. +*/ +#if defined(__INTEL_COMPILER) +// For intel's compiler, simply calling alloca seems to do the right +// thing. The size of the allocated block seems to be irrelevant. +# define CC_SIMD_ALIGN_STACK() _alloca(16) +# define CC_SIMD_ALIGN_ATTRIBUTE + +#elif (CC_CPU == CC_CPU_X86) && (CC_COMPILER == CC_COMPILER_GNUC || CC_COMPILER == CC_COMPILER_CLANG) && (CC_CPU_ARCH != CC_CPU_ARCH_64) +// mark functions with GCC attribute to force stack alignment to 16 bytes +# define CC_SIMD_ALIGN_ATTRIBUTE __attribute__((force_align_arg_pointer)) +#elif (CC_COMPILER == CC_COMPILER_MSVC) +// Fortunately, MSVC will align the stack automatically +# define CC_SIMD_ALIGN_ATTRIBUTE +#else +# define CC_SIMD_ALIGN_ATTRIBUTE +#endif + +#if defined (__GNUC__) +# define CC_FUNC ((const char*) (__PRETTY_FUNCTION__)) +#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 19901L +# define CC_FUNC ((const char*) (__func__)) +#else +# define CC_FUNC ((const char*) (__FUNCTION__)) +#endif + +// mode +#if (defined(_DEBUG) || defined(DEBUG)) && (CC_PLATFORM == CC_PLATFORM_WINDOWS) +# define CC_MODE CC_MODE_DEBUG +#else +# define CC_MODE CC_MODE_RELEASE +#endif + +// Engine Memory Management +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) +#if (CC_MODE == CC_MODE_DEBUG) +# define CC_MEMORY_TRACKER +#endif +#elif (CC_PLATFORM == CC_PLATFORM_ANDROID) +//# define CC_MEMORY_TRACKER +#else +#endif + +// use simd +//#define CC_USE_SIMD + +// Memory Allocator +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) +#if defined(CC_MEMORY_TRACKER) +# define CC_MEMORY_ALLOCATOR CC_MEMORY_ALLOCATOR_JEMALLOC +#else +# define CC_MEMORY_ALLOCATOR CC_MEMORY_ALLOCATOR_STD +#endif +#elif (CC_PLATFORM == CC_PLATFORM_ANDROID) +#if defined(CC_MEMORY_TRACKER) +# define CC_MEMORY_ALLOCATOR CC_MEMORY_ALLOCATOR_JEMALLOC +#else +# define CC_MEMORY_ALLOCATOR CC_MEMORY_ALLOCATOR_STD +#endif +#else +# define CC_MEMORY_ALLOCATOR CC_MEMORY_ALLOCATOR_STD +#endif + +// STL memory allocator +#if (CC_MEMORY_ALLOCATOR == CC_MEMORY_ALLOCATOR_STD) +#define CC_STL_MEMORY_ALLOCATOR CC_STL_MEMORY_ALLOCATOR_STANDARD +#else +#define CC_STL_MEMORY_ALLOCATOR CC_STL_MEMORY_ALLOCATOR_CUSTOM +#endif + +// Namespace define +#define CC_NAMESPACE_BEGIN namespace cc { +#define CC_NAMESPACE_END } +#define CC_USING_NAMESPACE using namespace cc; + +#define CC_UNUSED(a) (void)a +#define CC_TOSTR(s) #s + +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) +# ifdef CC_CORE_EXPORTS +# define CC_CORE_API __declspec(dllexport) +# else +# define CC_CORE_API __declspec(dllimport) +# endif +#else +# define CC_CORE_API +#endif + +#endif // CC_CORE_CORE_DEF_H_ diff --git a/native/cocos/renderer/core/CoreStd.cc b/native/cocos/renderer/core/CoreStd.cc new file mode 100644 index 0000000000..e2ad0208c0 --- /dev/null +++ b/native/cocos/renderer/core/CoreStd.cc @@ -0,0 +1 @@ +#include "CoreStd.h" diff --git a/native/cocos/renderer/core/CoreStd.h b/native/cocos/renderer/core/CoreStd.h new file mode 100644 index 0000000000..d999e613fd --- /dev/null +++ b/native/cocos/renderer/core/CoreStd.h @@ -0,0 +1,40 @@ +#ifndef CC_CORE_CORE_STD_H_ +#define CC_CORE_CORE_STD_H_ + +#include "CoreDef.h" + +// STD including +#include +#include +#include +#include +#include +#include +#include +#include + +// STL including +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "TypeDef.h" +#include "Kernel/Assertion.h" +#include "Memory/Memory.h" +#include "Math/CCMath.h" +#include "Kernel/Log.h" +#include "Kernel/Object.h" + +#endif // CC_CORE_CORE_STD_H_ diff --git a/native/cocos/renderer/core/TypeDef.h b/native/cocos/renderer/core/TypeDef.h new file mode 100755 index 0000000000..125fbb9900 --- /dev/null +++ b/native/cocos/renderer/core/TypeDef.h @@ -0,0 +1,19 @@ +#ifndef CC_CORE_TYPE_DEF_H_ +#define CC_CORE_TYPE_DEF_H_ + +typedef unsigned int uint; +typedef unsigned short ushort; +typedef unsigned long ulong; + +typedef unsigned int FlagBits; + +#define CC_ENUM_OPERATORS(type_) \ +CC_INLINE type_ operator | (type_ lhs, type_ rhs) { return (type_)(static_cast::type/**/>(lhs) | static_cast::type/**/>(rhs)); } \ +CC_INLINE void operator |= (type_& lhs, type_ rhs) { lhs = (type_)(static_cast::type/**/>(lhs) | static_cast::type/**/>(rhs)); } \ +CC_INLINE int operator & (type_ lhs, type_ rhs) { return (int)(static_cast::type/**/>(lhs) & static_cast::type/**/>(rhs)); } \ +CC_INLINE void operator &= (type_& lhs, type_ rhs) { lhs = (type_)(static_cast::type/**/>(lhs) & static_cast::type/**/>(rhs)); } \ +CC_INLINE bool operator || (type_ lhs, type_ rhs) { return (static_cast::type/**/>(lhs) || static_cast::type/**/>(rhs)); } \ +CC_INLINE bool operator && (type_ lhs, type_ rhs) { return (static_cast::type/**/>(lhs) && static_cast::type/**/>(rhs)); } + + +#endif // CC_CORE_TYPE_DEF_H_ diff --git a/native/cocos/renderer/core/gfx/GFXBindingLayout.cc b/native/cocos/renderer/core/gfx/GFXBindingLayout.cc new file mode 100755 index 0000000000..6802d962d7 --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXBindingLayout.cc @@ -0,0 +1,64 @@ +#include "CoreStd.h" +#include "GFXBindingLayout.h" + +CC_NAMESPACE_BEGIN + +GFXBindingLayout::GFXBindingLayout(GFXDevice* device) + : device_(device) { +} + +GFXBindingLayout::~GFXBindingLayout() { +} + +void GFXBindingLayout::BindBuffer(uint binding, GFXBuffer* buffer) { + for (size_t i = 0; i < binding_units_.size(); ++i) { + GFXBindingUnit& binding_unit = binding_units_[i]; + if (binding_unit.binding == binding) { + if (binding_unit.type == GFXBindingType::UNIFORM_BUFFER) { + if (binding_unit.buffer != buffer) { + binding_unit.buffer = buffer; + is_dirty_ = true; + } + } else { + CC_ASSERTS(false, "Setting binding is not GFXBindingType.UNIFORM_BUFFER.") + } + return; + } + } +} + +void GFXBindingLayout::BindTextureView(uint binding, GFXTextureView* tex_view) { + for (size_t i = 0; i < binding_units_.size(); ++i) { + GFXBindingUnit& binding_unit = binding_units_[i]; + if (binding_unit.binding == binding) { + if (binding_unit.type == GFXBindingType::SAMPLER) { + if (binding_unit.tex_view != tex_view) { + binding_unit.tex_view = tex_view; + is_dirty_ = true; + } + } else { + CC_ASSERTS(false, "Setting binding is not GFXBindingType.SAMPLER.") + } + return; + } + } +} + +void GFXBindingLayout::BindSampler(uint binding, GFXSampler* sampler) { + for (size_t i = 0; i < binding_units_.size(); ++i) { + GFXBindingUnit& binding_unit = binding_units_[i]; + if (binding_unit.binding == binding) { + if (binding_unit.type == GFXBindingType::SAMPLER) { + if (binding_unit.sampler != sampler) { + binding_unit.sampler = sampler; + is_dirty_ = true; + } + } else { + CC_ASSERTS(false, "Setting binding is not GFXBindingType.SAMPLER.") + } + return; + } + } +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/core/gfx/GFXBindingLayout.h b/native/cocos/renderer/core/gfx/GFXBindingLayout.h new file mode 100755 index 0000000000..cbae9710d5 --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXBindingLayout.h @@ -0,0 +1,33 @@ +#ifndef CC_CORE_GFX_BINDING_LAYOUT_H_ +#define CC_CORE_GFX_BINDING_LAYOUT_H_ + +#include "GFXDef.h" + +CC_NAMESPACE_BEGIN + +class CC_CORE_API GFXBindingLayout : public Object { + public: + GFXBindingLayout(GFXDevice* device); + virtual ~GFXBindingLayout(); + + public: + virtual bool Initialize(const GFXBindingLayoutInfo& info) = 0; + virtual void Destroy() = 0; + virtual void Update() = 0; + + void BindBuffer(uint binding, GFXBuffer* buffer); + void BindTextureView(uint binding, GFXTextureView* tex_view); + void BindSampler(uint binding, GFXSampler* sampler); + + CC_INLINE GFXDevice* device() const { return device_; } + CC_INLINE const GFXBindingUnitList& binding_units() const { return binding_units_; } + + protected: + GFXDevice* device_; + GFXBindingUnitList binding_units_; + bool is_dirty_; +}; + +CC_NAMESPACE_END + +#endif // CC_CORE_GFX_BINDING_LAYOUT_H_ diff --git a/native/cocos/renderer/core/gfx/GFXBuffer.cc b/native/cocos/renderer/core/gfx/GFXBuffer.cc new file mode 100755 index 0000000000..47228fbef5 --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXBuffer.cc @@ -0,0 +1,19 @@ +#include "CoreStd.h" +#include "GFXBuffer.h" + +CC_NAMESPACE_BEGIN + +GFXBuffer::GFXBuffer(GFXDevice* device) + : device_(device), + usage_(GFXBufferUsageBit::NONE), + mem_usage_(GFXMemoryUsageBit::NONE), + stride_(0), + count_(0), + size_(0), + flags_(GFXBufferFlagBit::NONE) { +} + +GFXBuffer::~GFXBuffer() { +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/core/gfx/GFXBuffer.h b/native/cocos/renderer/core/gfx/GFXBuffer.h new file mode 100755 index 0000000000..8b6e5d38fa --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXBuffer.h @@ -0,0 +1,41 @@ +#ifndef CC_CORE_GFX_BUFFER_H_ +#define CC_CORE_GFX_BUFFER_H_ + +#include "GFXDef.h" + +CC_NAMESPACE_BEGIN + +class CC_CORE_API GFXBuffer : public Object { + public: + GFXBuffer(GFXDevice* device); + virtual ~GFXBuffer(); + + public: + virtual bool Initialize(const GFXBufferInfo& info) = 0; + virtual void Destroy() = 0; + virtual void Resize(uint size) = 0; + virtual void Update(void* buffer, uint offset = 0, uint size = 0) = 0; + + CC_INLINE GFXDevice* device() const { return device_; } + CC_INLINE GFXBufferUsage usage() const { return usage_; } + CC_INLINE GFXMemoryUsage memUsage() const { return mem_usage_; } + CC_INLINE uint stride() const { return stride_; } + CC_INLINE uint count() const { return count_; } + CC_INLINE uint size() const { return size_; } + CC_INLINE GFXBufferFlags flags() const { return flags_; } + CC_INLINE uint8_t* buffer() const { return buffer_; } + + protected: + GFXDevice* device_; + GFXBufferUsage usage_; + GFXMemoryUsage mem_usage_; + uint stride_; + uint count_; + uint size_; + GFXBufferFlags flags_; + uint8_t* buffer_; +}; + +CC_NAMESPACE_END + +#endif // CC_CORE_GFX_BUFFER_H_ diff --git a/native/cocos/renderer/core/gfx/GFXCommandAllocator.cc b/native/cocos/renderer/core/gfx/GFXCommandAllocator.cc new file mode 100755 index 0000000000..349abdff65 --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXCommandAllocator.cc @@ -0,0 +1,13 @@ +#include "CoreStd.h" +#include "GFXCommandAllocator.h" + +CC_NAMESPACE_BEGIN + +GFXCommandAllocator::GFXCommandAllocator(GFXDevice* device) + : device_(device) { +} + +GFXCommandAllocator::~GFXCommandAllocator() { +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/core/gfx/GFXCommandAllocator.h b/native/cocos/renderer/core/gfx/GFXCommandAllocator.h new file mode 100755 index 0000000000..775bea81eb --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXCommandAllocator.h @@ -0,0 +1,26 @@ +#ifndef CC_CORE_GFX_COMMAND_ALLOCATOR_H_ +#define CC_CORE_GFX_COMMAND_ALLOCATOR_H_ + +#include "GFXDef.h" + +CC_NAMESPACE_BEGIN + +class CC_CORE_API GFXCommandAllocator : public Object { + public: + GFXCommandAllocator(GFXDevice* device); + virtual ~GFXCommandAllocator(); + +public: + virtual bool Initialize(const GFXCommandAllocatorInfo& info) = 0; + virtual void Destroy() = 0; + + CC_INLINE GFXDevice* device() const { return device_; } + +protected: + GFXDevice* device_; + +}; + +CC_NAMESPACE_END + +#endif // CC_CORE_GFX_COMMAND_ALLOCATOR_H_ diff --git a/native/cocos/renderer/core/gfx/GFXCommandBuffer.cc b/native/cocos/renderer/core/gfx/GFXCommandBuffer.cc new file mode 100755 index 0000000000..f20893f540 --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXCommandBuffer.cc @@ -0,0 +1,17 @@ +#include "CoreStd.h" +#include "GFXCommandBuffer.h" + +CC_NAMESPACE_BEGIN + +GFXCommandBuffer::GFXCommandBuffer(GFXDevice* device) + : device_(device), + allocator_(nullptr), + type_(GFXCommandBufferType::PRIMARY), + num_draw_calls_(0), + num_tris_(0) { +} + +GFXCommandBuffer::~GFXCommandBuffer() { +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/core/gfx/GFXCommandBuffer.h b/native/cocos/renderer/core/gfx/GFXCommandBuffer.h new file mode 100755 index 0000000000..99348fdf62 --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXCommandBuffer.h @@ -0,0 +1,52 @@ +#ifndef CC_CORE_GFX_COMMAND_BUFFER_H_ +#define CC_CORE_GFX_COMMAND_BUFFER_H_ + +#include "GFXDef.h" + +CC_NAMESPACE_BEGIN + +class CC_CORE_API GFXCommandBuffer : public Object { + public: + GFXCommandBuffer(GFXDevice* device); + virtual ~GFXCommandBuffer(); + +public: + virtual bool Initialize(const GFXCommandBufferInfo& info) = 0; + virtual void Destroy() = 0; + virtual void Begin() = 0; + virtual void End() = 0; + virtual void BeginRenderPass(GFXFramebuffer* fbo, const GFXRect& render_area, GFXClearFlags clear_flags, GFXColor* colors, uint count, float depth, int stencil) = 0; + virtual void EndRenderPass() = 0; + virtual void BindPipelineState(GFXPipelineState* pso) = 0; + virtual void BindBindingLayout(GFXBindingLayout* layout) = 0; + virtual void BindInputAssembler(GFXInputAssembler* ia) = 0; + virtual void SetViewport(const GFXViewport& vp) = 0; + virtual void SetScissor(const GFXRect& rect) = 0; + virtual void SetLineWidth(const float width) = 0; + virtual void SetDepthBias(float constant, float clamp, float slope) = 0; + virtual void SetBlendConstants(const GFXColor& constants) = 0; + virtual void SetDepthBounds(float min_bounds, float max_bounds) = 0; + virtual void SetStencilWriteMask(GFXStencilFace face, uint mask) = 0; + virtual void SetStencilCompareMask(GFXStencilFace face, int ref, uint mask) = 0; + virtual void Draw(GFXInputAssembler* ia) = 0; + virtual void UpdateBuffer(GFXBuffer* buff, void* data, uint size, uint offset = 0) = 0; + virtual void CopyBufferToTexture(GFXBuffer* src, GFXTexture* dst, GFXTextureLayout layout, GFXBufferTextureCopy* regions, uint count) = 0; + virtual void Execute(GFXCommandBuffer** cmd_buffs, uint count) = 0; + + CC_INLINE GFXDevice* device() const { return device_; } + CC_INLINE GFXCommandAllocator* allocator() const { return allocator_; } + CC_INLINE GFXCommandBufferType type() const { return type_; } + CC_INLINE uint num_draw_calls() const { return num_draw_calls_; } + CC_INLINE uint num_tris() const { return num_tris_; } + +protected: + GFXDevice* device_; + GFXCommandAllocator* allocator_; + GFXCommandBufferType type_; + uint num_draw_calls_; + uint num_tris_; +}; + +CC_NAMESPACE_END + +#endif // CC_CORE_GFX_COMMAND_ALLOCATOR_H_ diff --git a/native/cocos/renderer/core/gfx/GFXContext.cc b/native/cocos/renderer/core/gfx/GFXContext.cc new file mode 100755 index 0000000000..471597ae14 --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXContext.cc @@ -0,0 +1,18 @@ +#include "CoreStd.h" +#include "GFXContext.h" + +CC_NAMESPACE_BEGIN + +GFXContext::GFXContext(GFXDevice* device) + : device_(device), + window_handle_(0), + shared_ctx_(nullptr), + vsync_mode_(GFXVsyncMode::OFF), + color_fmt_(GFXFormat::UNKNOWN), + depth_stencil_fmt_(GFXFormat::UNKNOWN) { +} + +GFXContext::~GFXContext() { +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/core/gfx/GFXContext.h b/native/cocos/renderer/core/gfx/GFXContext.h new file mode 100755 index 0000000000..7d11b07361 --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXContext.h @@ -0,0 +1,35 @@ +#ifndef CC_CORE_GFX_CONTEXT_H_ +#define CC_CORE_GFX_CONTEXT_H_ + +#include "GFXDef.h" + +CC_NAMESPACE_BEGIN + +class CC_CORE_API GFXContext : public Object { + public: + GFXContext(GFXDevice* device); + virtual ~GFXContext(); + + public: + virtual bool Initialize(const GFXContextInfo& info) = 0; + virtual void Destroy() = 0; + virtual void Present() = 0; + + CC_INLINE GFXDevice* device() const { return device_; } + CC_INLINE GFXContext* shared_ctx() const { return shared_ctx_; } + CC_INLINE GFXVsyncMode vsync_mode() const { return vsync_mode_; } + CC_INLINE GFXFormat color_fmt() const { return color_fmt_; } + CC_INLINE GFXFormat depth_stencil_fmt() const { return depth_stencil_fmt_; } + + protected: + GFXDevice* device_; + intptr_t window_handle_; + GFXContext* shared_ctx_; + GFXVsyncMode vsync_mode_; + GFXFormat color_fmt_; + GFXFormat depth_stencil_fmt_; +}; + +CC_NAMESPACE_END + +#endif // CC_CORE_GFX_CONTEXT_H_ diff --git a/native/cocos/renderer/core/gfx/GFXDef.cc b/native/cocos/renderer/core/gfx/GFXDef.cc new file mode 100755 index 0000000000..77d76dbea9 --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXDef.cc @@ -0,0 +1,210 @@ +#include "CoreStd.h" +#include "GFXDef.h" + +CC_NAMESPACE_BEGIN + +const GFXFormatInfo GFX_FORMAT_INFOS[] = { + { "UNKNOWN", 0, 0, GFXFormatType::NONE, false, false, false, false}, + { "A8", 1, 1, GFXFormatType::UNORM, true, false, false, false}, + { "L8", 1, 1, GFXFormatType::UNORM, false, false, false, false}, + { "LA8", 1, 2, GFXFormatType::UNORM, false, false, false, false}, + + { "R8", 1, 1, GFXFormatType::UNORM, false, false, false, false}, + { "R8SN", 1, 1, GFXFormatType::SNORM, false, false, false, false}, + { "R8UI", 1, 1, GFXFormatType::UINT, false, false, false, false}, + { "R8I", 1, 1, GFXFormatType::INT, false, false, false, false}, + { "R16F", 2, 1, GFXFormatType::FLOAT, false, false, false, false}, + { "R16UI", 2, 1, GFXFormatType::UINT, false, false, false, false}, + { "R16I", 2, 1, GFXFormatType::INT, false, false, false, false}, + { "R32F", 4, 1, GFXFormatType::FLOAT, false, false, false, false}, + { "R32UI", 4, 1, GFXFormatType::UINT, false, false, false, false}, + { "R32I", 4, 1, GFXFormatType::INT, false, false, false, false}, + + { "RG8", 2, 2, GFXFormatType::UNORM, false, false, false, false}, + { "RG8SN", 2, 2, GFXFormatType::SNORM, false, false, false, false}, + { "RG8UI", 2, 2, GFXFormatType::UINT, false, false, false, false}, + { "RG8I", 2, 2, GFXFormatType::INT, false, false, false, false}, + { "RG16F", 4, 2, GFXFormatType::FLOAT, false, false, false, false}, + { "RG16UI", 4, 2, GFXFormatType::UINT, false, false, false, false}, + { "RG16I", 4, 2, GFXFormatType::INT, false, false, false, false}, + { "RG32F", 8, 2, GFXFormatType::FLOAT, false, false, false, false}, + { "RG32UI", 8, 2, GFXFormatType::UINT, false, false, false, false}, + { "RG32I", 8, 2, GFXFormatType::INT, false, false, false, false}, + + { "RGB8", 3, 3, GFXFormatType::UNORM, false, false, false, false}, + { "SRGB8", 3, 3, GFXFormatType::UNORM, false, false, false, false}, + { "RGB8SN", 3, 3, GFXFormatType::SNORM, false, false, false, false}, + { "RGB8UI", 3, 3, GFXFormatType::UINT, false, false, false, false}, + { "RGB8I", 3, 3, GFXFormatType::INT, false, false, false, false}, + { "RGB16F", 6, 3, GFXFormatType::FLOAT, false, false, false, false}, + { "RGB16UI", 6, 3, GFXFormatType::UINT, false, false, false, false}, + { "RGB16I", 6, 3, GFXFormatType::INT, false, false, false, false}, + { "RGB32F", 12, 3, GFXFormatType::FLOAT, false, false, false, false}, + { "RGB32UI", 12, 3, GFXFormatType::UINT, false, false, false, false}, + { "RGB32I", 12, 3, GFXFormatType::INT, false, false, false, false}, + + { "RGBA8", 4, 4, GFXFormatType::UNORM, true, false, false, false}, + { "SRGB8_A8", 4, 4, GFXFormatType::UNORM, true, false, false, false}, + { "RGBA8SN", 4, 4, GFXFormatType::SNORM, true, false, false, false}, + { "RGBA8UI", 4, 4, GFXFormatType::UINT, true, false, false, false}, + { "RGBA8I", 3, 3, GFXFormatType::INT, true, false, false, false}, + { "RGBA16F", 6, 3, GFXFormatType::FLOAT, true, false, false, false}, + { "RGBA16UI", 6, 3, GFXFormatType::UINT, true, false, false, false}, + { "RGBA16I", 6, 3, GFXFormatType::INT, true, false, false, false}, + { "RGBA32F", 12, 3, GFXFormatType::FLOAT, true, false, false, false}, + { "RGBA32UI", 12, 3, GFXFormatType::UINT, true, false, false, false}, + { "RGBA32I", 12, 3, GFXFormatType::INT, true, false, false, false}, + + { "R5G6B5", 2, 3, GFXFormatType::UNORM, false, false, false, false}, + { "R11G11B10F", 4, 3, GFXFormatType::FLOAT, false, false, false, false}, + { "RGB5A1", 2, 4, GFXFormatType::UNORM, true, false, false, false}, + { "RGBA4", 2, 4, GFXFormatType::UNORM, true, false, false, false}, + { "RGB10A2", 2, 4, GFXFormatType::UNORM, true, false, false, false}, + { "RGB10A2UI", 2, 4, GFXFormatType::UINT, true, false, false, false}, + { "RGB9E5", 2, 4, GFXFormatType::FLOAT, true, false, false, false}, + + { "D16", 2, 1, GFXFormatType::UINT, false, true, false, false}, + { "D16S8", 3, 1, GFXFormatType::UINT, false, true, true, false}, + { "D24", 3, 1, GFXFormatType::UINT, false, true, false, false}, + { "D24S8", 2, 1, GFXFormatType::UINT, false, true, true, false}, + { "D32F", 4, 1, GFXFormatType::FLOAT, false, true, false, false}, + { "D32FS8", 5, 2, GFXFormatType::FLOAT, false, true, true, false}, + + { "BC1", 1, 3, GFXFormatType::UNORM, false, false, false, true}, + { "BC1_ALPHA", 1, 4, GFXFormatType::UNORM, true, false, false, true}, + { "BC1_SRGB", 1, 3, GFXFormatType::UNORM, false, false, false, true}, + { "BC1_SRGB_ALPHA", 1, 4, GFXFormatType::UNORM, true, false, false, true}, + { "BC2", 1, 4, GFXFormatType::UNORM, true, false, false, true}, + { "BC2_SRGB", 1, 4, GFXFormatType::UNORM, true, false, false, true}, + { "BC3", 1, 4, GFXFormatType::UNORM, true, false, false, true}, + { "BC3_SRGB", 1, 4, GFXFormatType::UNORM, true, false, false, true}, + { "BC4", 1, 1, GFXFormatType::UNORM, false, false, false, true}, + { "BC4_SNORM", 1, 1, GFXFormatType::SNORM, false, false, false, true}, + { "BC5", 1, 2, GFXFormatType::UNORM, false, false, false, true}, + { "BC5_SNORM", 1, 2, GFXFormatType::SNORM, false, false, false, true}, + { "BC6H_UF16", 1, 3, GFXFormatType::UFLOAT, false, false, false, true}, + { "BC6H_SF16", 1, 3, GFXFormatType::FLOAT, false, false, false, true}, + { "BC7", 1, 4, GFXFormatType::UNORM, true, false, false, true}, + { "BC7_SRGB", 1, 4, GFXFormatType::UNORM, true, false, false, true}, + + { "ETC_RGB8", 1, 3, GFXFormatType::UNORM, false, false, false, true}, + { "ETC2_RGB8", 1, 3, GFXFormatType::UNORM, false, false, false, true}, + { "ETC2_SRGB8", 1, 3, GFXFormatType::UNORM, false, false, false, true}, + { "ETC2_RGB8_A1", 1, 4, GFXFormatType::UNORM, true, false, false, true}, + { "ETC2_SRGB8_A1", 1, 4, GFXFormatType::UNORM, true, false, false, true}, + { "EAC_R11", 1, 1, GFXFormatType::UNORM, false, false, false, true}, + { "EAC_R11SN", 1, 1, GFXFormatType::SNORM, false, false, false, true}, + { "EAC_RG11", 2, 2, GFXFormatType::UNORM, false, false, false, true}, + { "EAC_RG11SN", 2, 2, GFXFormatType::SNORM, false, false, false, true}, + + { "PVRTC_RGB2", 2, 3, GFXFormatType::UNORM, false, false, false, true}, + { "PVRTC_RGBA2", 2, 4, GFXFormatType::UNORM, true, false, false, true}, + { "PVRTC_RGB4", 2, 3, GFXFormatType::UNORM, false, false, false, true}, + { "PVRTC_RGBA4", 2, 4, GFXFormatType::UNORM, true, false, false, true}, + { "PVRTC2_2BPP", 2, 4, GFXFormatType::UNORM, true, false, false, true}, + { "PVRTC2_4BPP", 2, 4, GFXFormatType::UNORM, true, false, false, true}, +}; + +uint GFXFormatSize(GFXFormat format, uint width, uint height, uint depth) { + + if (!GFX_FORMAT_INFOS[(uint)format].is_compressed) { + return (width * height * depth * GFX_FORMAT_INFOS[(uint)format].size); + } else { + switch (format) { + case GFXFormat::BC1: + case GFXFormat::BC1_ALPHA: + case GFXFormat::BC1_SRGB: + case GFXFormat::BC1_SRGB_ALPHA: + return (uint)std::ceil(width / 4) * (uint)std::ceil(height / 4) * 8 * depth; + case GFXFormat::BC2: + case GFXFormat::BC2_SRGB: + case GFXFormat::BC3: + case GFXFormat::BC3_SRGB: + case GFXFormat::BC4: + case GFXFormat::BC4_SNORM: + case GFXFormat::BC6H_SF16: + case GFXFormat::BC6H_UF16: + case GFXFormat::BC7: + case GFXFormat::BC7_SRGB: + return (uint)std::ceil(width / 4) * (uint)std::ceil(height / 4) * 16 * depth; + case GFXFormat::BC5: + case GFXFormat::BC5_SNORM: + return (uint)std::ceil(width / 4) * (uint)std::ceil(height / 4) * 32 * depth; + + case GFXFormat::ETC_RGB8: + case GFXFormat::ETC2_RGB8: + case GFXFormat::ETC2_SRGB8: + case GFXFormat::ETC2_RGB8_A1: + case GFXFormat::ETC2_SRGB8_A1: + case GFXFormat::EAC_R11: + case GFXFormat::EAC_R11SN: + return (uint)std::ceil(width / 4) * (uint)std::ceil(height / 4) * 8 * depth; + case GFXFormat::EAC_RG11: + case GFXFormat::EAC_RG11SN: + return (uint)std::ceil(width / 4) * (uint)std::ceil(height / 4) * 16 * depth; + + case GFXFormat::PVRTC_RGB2: + case GFXFormat::PVRTC_RGBA2: + case GFXFormat::PVRTC2_2BPP: + return (uint)std::ceil(std::max(width, 16U) * std::max(height, 8U) / 4) * depth; + case GFXFormat::PVRTC_RGB4: + case GFXFormat::PVRTC_RGBA4: + case GFXFormat::PVRTC2_4BPP: + return (uint)std::ceil(std::max(width, 16U) * std::max(height, 8U) / 2) * depth; + default: { + return 0; + } + } + } +} + +const uint GFX_TYPE_SIZES[] = { + 0, // UNKNOWN + 4, // BOOL + 8, // BOOL2 + 12, // BOOL3 + 16, // BOOL4 + 4, // INT + 8, // INT2 + 12, // INT3 + 16, // INT4 + 4, // UINT + 8, // UINT2 + 12, // UINT3 + 16, // UINT4 + 4, // FLOAT + 8, // FLOAT2 + 12, // FLOAT3 + 16, // FLOAT4 + 16, // MAT2 + 24, // MAT2X3 + 32, // MAT2X4 + 24, // MAT3X2 + 36, // MAT3 + 48, // MAT3X4 + 32, // MAT4X2 + 48, // MAT4X3 + 64, // MAT4 + 4, // SAMPLER1D + 4, // SAMPLER1D_ARRAY + 4, // SAMPLER2D + 4, // SAMPLER2D_ARRAY + 4, // SAMPLER3D + 4, // SAMPLER_CUBE +}; + +uint GFXFormatSurfaceSize(GFXFormat format, uint width, uint height, uint depth, uint mips) { + + uint size = 0; + + for (uint i = 0; i < mips; ++i) { + size += GFXFormatSize(format, width, height, depth); + width = std::max(width >> 1, 1U); + height = std::max(height >> 1, 1U); + depth = std::max(depth >> 1, 1U); + } + + return size; +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/core/gfx/GFXDef.h b/native/cocos/renderer/core/gfx/GFXDef.h new file mode 100755 index 0000000000..d70b88d346 --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXDef.h @@ -0,0 +1,952 @@ +#ifndef CC_CORE_GFX_DEF_H_ +#define CC_CORE_GFX_DEF_H_ + +CC_NAMESPACE_BEGIN + +class GFXDevice; +class GFXBuffer; +class GFXTexture; +class GFXTextureView; +class GFXSampler; +class GFXShader; +class GFXInputAssembler; +class GFXRenderPass; +class GFXFramebuffer; +class GFXBindingLayout; +class GFXPipelineLayout; +class GFXPipelineState; +class GFXCommandAllocator; +class GFXCommandBuffer; +class GFXQueue; +class GFXWindow; +class GFXContext; + +#define GFX_MAX_VERTEX_ATTRIBUTES 16 +#define GFX_MAX_TEXTURE_UNITS 16 +#define GFX_MAX_ATTACHMENTS 4 +#define GFX_MAX_BUFFER_BINDINGS 24 +#define GFX_INVALID_BINDING ((uint8_t)-1) +#define GFX_INVALID_HANDLE ((uint)-1) + +enum class GFXAPI : uint8_t { + UNKNOWN, + GL, + GLES2, + GLES3, + METAL, + VULKAN, + DX12, + WEBGL, + WEBGL2, +}; + +enum class GFXFeature : uint8_t { + COLOR_FLOAT, + COLOR_HALF_FLOAT, + TEXTURE_FLOAT, + TEXTURE_HALF_FLOAT, + TEXTURE_FLOAT_LINEAR, + TEXTURE_HALF_FLOAT_LINEAR, + FORMAT_R11G11B10F, + FORMAT_D24S8, + FORMAT_ETC1, + FORMAT_ETC2, + FORMAT_DXT, + FORMAT_PVRTC, + FORMAT_ASTC, + MSAA, + COUNT, +}; + +enum class GFXFormat : uint { + + UNKNOWN, + + A8, + L8, + LA8, + + R8, + R8SN, + R8UI, + R8I, + R16F, + R16UI, + R16I, + R32F, + R32UI, + R32I, + + RG8, + RG8SN, + RG8UI, + RG8I, + RG16F, + RG16UI, + RG16I, + RG32F, + RG32UI, + RG32I, + + RGB8, + SRGB8, + RGB8SN, + RGB8UI, + RGB8I, + RGB16F, + RGB16UI, + RGB16I, + RGB32F, + RGB32UI, + RGB32I, + + RGBA8, + SRGB8_A8, + RGBA8SN, + RGBA8UI, + RGBA8I, + RGBA16F, + RGBA16UI, + RGBA16I, + RGBA32F, + RGBA32UI, + RGBA32I, + + // Special Format + R5G6B5, + R11G11B10F, + RGB5A1, + RGBA4, + RGB10A2, + RGB10A2UI, + RGB9E5, + + // Depth-Stencil Format + D16, + D16S8, + D24, + D24S8, + D32F, + D32F_S8, + + // Compressed Format + + // Block Compression Format, DDS (DirectDraw Surface) + // DXT1: 3 channels (5:6:5), 1/8 origianl size, with 0 or 1 bit of alpha + BC1, + BC1_ALPHA, + BC1_SRGB, + BC1_SRGB_ALPHA, + // DXT3: 4 channels (5:6:5), 1/4 origianl size, with 4 bits of alpha + BC2, + BC2_SRGB, + // DXT5: 4 channels (5:6:5), 1/4 origianl size, with 8 bits of alpha + BC3, + BC3_SRGB, + // 1 channel (8), 1/4 origianl size + BC4, + BC4_SNORM, + // 2 channels (8:8), 1/2 origianl size + BC5, + BC5_SNORM, + // 3 channels (16:16:16), half-floating point, 1/6 origianl size + // UF16: unsigned float, 5 exponent bits + 11 mantissa bits + // SF16: signed float, 1 signed bit + 5 exponent bits + 10 mantissa bits + BC6H_UF16, + BC6H_SF16, + // 4 channels (4~7 bits per channel) with 0 to 8 bits of alpha, 1/3 original size + BC7, + BC7_SRGB, + + // Ericsson Texture Compression Format + ETC_RGB8, + ETC2_RGB8, + ETC2_SRGB8, + ETC2_RGB8_A1, + ETC2_SRGB8_A1, + ETC2_RGBA8, + ETC2_SRGB8_A8, + EAC_R11, + EAC_R11SN, + EAC_RG11, + EAC_RG11SN, + + // PVRTC (PowerVR) + PVRTC_RGB2, + PVRTC_RGBA2, + PVRTC_RGB4, + PVRTC_RGBA4, + PVRTC2_2BPP, + PVRTC2_4BPP, + + // Total count + COUNT, +}; + +enum class GFXFormatType : uint8_t { + NONE, + UNORM, + SNORM, + UINT, + INT, + UFLOAT, + FLOAT, +}; + +enum class GFXType : uint8_t { + UNKNOWN, + BOOL, + BOOL2, + BOOL3, + BOOL4, + INT, + INT2, + INT3, + INT4, + UINT, + UINT2, + UINT3, + UINT4, + FLOAT, + FLOAT2, + FLOAT3, + FLOAT4, + MAT2, + MAT2X3, + MAT2X4, + MAT3X2, + MAT3, + MAT3X4, + MAT4X2, + MAT4X3, + MAT4, + SAMPLER1D, + SAMPLER1D_ARRAY, + SAMPLER2D, + SAMPLER2D_ARRAY, + SAMPLER3D, + SAMPLER_CUBE, + COUNT, +}; + +enum class GFXBufferUsageBit : FlagBits { + NONE = 0, + TRANSFER_SRC = 0x1, + TRANSFER_DST = 0x2, + INDEX = 0x4, + VERTEX = 0x8, + UNIFORM = 0x10, + STORAGE = 0x20, + INDIRECT = 0x40, +}; +typedef GFXBufferUsageBit GFXBufferUsage; +CC_ENUM_OPERATORS(GFXBufferUsageBit); + +enum class GFXBufferFlagBit : FlagBits { + NONE = 0, + BAKUP_BUFFER = 0x4, +}; +typedef GFXBufferFlagBit GFXBufferFlags; +CC_ENUM_OPERATORS(GFXBufferFlagBit); + +enum class GFXBufferAccessBit : FlagBits { + NONE = 0, + READ = 0x1, + WRITE = 0x2, +}; +typedef GFXBufferAccessBit GFXBufferAccess; +CC_ENUM_OPERATORS(GFXBufferAccessBit); + +enum class GFXMemoryUsageBit : FlagBits { + NONE = 0, + DEVICE = 0x1, + HOST = 0x2, +}; +typedef GFXMemoryUsageBit GFXMemoryUsage; +CC_ENUM_OPERATORS(GFXMemoryUsageBit); + +enum class GFXTextureType { + TEX1D, + TEX2D, + TEX3D, +}; + +enum class GFXTextureUsageBit : FlagBits { + NONE = 0, + TRANSFER_SRC = 0x1, + TRANSFER_DST = 0x2, + SAMPLED = 0x4, + STORAGE = 0x8, + COLOR_ATTACHMENT = 0x10, + DEPTH_STENCIL_ATTACHMENT = 0x20, + TRANSIENT_ATTACHMENT = 0x40, + INPUT_ATTACHMENT = 0x80, +}; +typedef GFXTextureUsageBit GFXTextureUsage; +CC_ENUM_OPERATORS(GFXTextureUsageBit); + +enum class GFXTextureFlagBit : FlagBits { + NONE = 0, + GEN_MIPMAP = 0x1, + CUBEMAP = 0x2, + BAKUP_BUFFER = 0x4, +}; +typedef GFXTextureFlagBit GFXTextureFlags; +CC_ENUM_OPERATORS(GFXTextureFlagBit); + +enum class GFXSampleCount : uint8_t { + X1, + X2, + X4, + X8, + X16, + X32, + X64, +}; + +enum class GFXTextureViewType : uint8_t { + TV1D, + TV2D, + TV3D, + CUBE, + TV1D_ARRAY, + TV2D_ARRAY, +}; + +enum class GFXFilter : uint8_t { + NONE, + POINT, + LINEAR, + ANISOTROPIC, +}; + +enum class GFXAddress : uint8_t { + WRAP, + MIRROR, + CLAMP, + BORDER, +}; + +enum class GFXComparisonFunc : uint8_t { + NEVER, + LESS, + EQUAL, + LESS_EQUAL, + GREATER, + NOT_EQUAL, + GREATER_EQUAL, + ALWAYS, +}; + +enum class GFXStencilOp : uint8_t { + ZERO, + KEEP, + REPLACE, + INCR, + DECR, + INVERT, + INCR_WRAP, + DECR_WRAP, +}; + +enum class GFXBlendFactor : uint8_t { + ZERO, + ONE, + SRC_ALPHA, + DST_ALPHA, + ONE_MINUS_SRC_ALPHA, + ONE_MINUS_DST_ALPHA, + SRC_COLOR, + DST_COLOR, + ONE_MINUS_SRC_COLOR, + ONE_MINUS_DST_COLOR, + SRC_ALPHA_SATURATE, + CONSTANT_COLOR, + ONE_MINUS_CONSTANT_COLOR, + CONSTANT_ALPHA, + ONE_MINUS_CONSTANT_ALPHA, +}; + +enum class GFXBlendOp : uint8_t { + ADD, + SUB, + REV_SUB, + MIN, + MAX, +}; + +enum class GFXColorMask : uint8_t { + NONE = 0x0, + R = 0x1, + G = 0x2, + B = 0x4, + A = 0x8, + ALL = R | G | B | A, +}; +CC_ENUM_OPERATORS(GFXColorMask); + +enum class GFXShaderType : uint8_t { + VERTEX, + CONTROL, + EVALUATION, + GEOMETRY, + FRAGMENT, + COMPUTE, + COUNT, +}; + +enum class GFXLoadOp : uint8_t { + LOAD, // Load the contents from the fbo from previous + CLEAR, // Clear the fbo + DISCARD, // Ignore writing to the fbo and keep old data +}; + +enum class GFXStoreOp : uint8_t { + STORE, // Write the source to the destination + DISCARD, // Don't write the source to the destination +}; + +enum class GFXTextureLayout : uint8_t { + UNDEFINED, + GENERAL, + COLOR_ATTACHMENT_OPTIMAL, + DEPTH_STENCIL_ATTACHMENT_OPTIMAL, + DEPTH_STENCIL_READONLY_OPTIMAL, + SHADER_READONLY_OPTIMAL, + TRANSFER_SRC_OPTIMAL, + TRANSFER_DST_OPTIMAL, + PREINITIALIZED, + PRESENT_SRC, +}; + +enum class GFXPipelineBindPoint : uint8_t { + GRAPHICS, + COMPUTE, + RAY_TRACING, +}; + +enum class GFXPrimitiveMode : uint8_t { + POINT_LIST, + LINE_LIST, + LINE_STRIP, + LINE_LOOP, + LINE_LIST_ADJACENCY, + LINE_STRIP_ADJACENCY, + ISO_LINE_LIST, + // raycast detectable: + TRIANGLE_LIST, + TRIANGLE_STRIP, + TRIANGLE_FAN, + TRIANGLE_LIST_ADJACENCY, + TRIANGLE_STRIP_ADJACENCY, + TRIANGLE_PATCH_ADJACENCY, + QUAD_PATCH_LIST, +}; + +enum class GFXPolygonMode : uint8_t { + FILL, + POINT, + LINE, +}; + +enum class GFXShadeModel : uint8_t { + GOURAND, + FLAT, +}; + +enum class GFXCullMode : uint8_t { + NONE, + FRONT, + BACK, +}; + +enum class GFXDynamicState : uint8_t { + VIEWPORT, + SCISSOR, + LINE_WIDTH, + DEPTH_BIAS, + BLEND_CONSTANTS, + DEPTH_BOUNDS, + STENCIL_WRITE_MASK, + STENCIL_COMPARE_MASK, +}; + +typedef vector::type GFXDynamicStateList; + +enum class GFXStencilFace : uint8_t { + FRONT, + BACK, + ALL, +}; + +enum class GFXBindingType : uint8_t { + UNKNOWN, + UNIFORM_BUFFER, + SAMPLER, + STORAGE_BUFFER, +}; + +enum class GFXQueueType : uint8_t { + GRAPHICS, + COMPUTE, + TRANSFER, +}; + +enum class GFXCommandBufferType : uint8_t { + PRIMARY, + SECONDARY, +}; + +enum class GFXClearFlagBit : uint8_t { + NONE = 0, + COLOR = 0x1, + DEPTH = 0x2, + STENCIL = 0x4, + DEPTH_STENCIL = DEPTH | STENCIL, + ALL = COLOR | DEPTH | STENCIL, +}; +typedef GFXClearFlagBit GFXClearFlags; +CC_ENUM_OPERATORS(GFXClearFlags); + +enum class GFXVsyncMode : uint8_t { + // The application does not synchronizes with the vertical sync. If application renders faster than the display refreshes, frames are wasted and tearing may be observed. FPS is uncapped. Maximum power consumption. If unsupported, "ON" value will be used instead. Minimum latency. + OFF, + // The application is always synchronized with the vertical sync. Tearing does not happen. FPS is capped to the display's refresh rate. For fast applications, battery life is improved. Always supported. + ON, + // The application synchronizes with the vertical sync, but only if the application rendering speed is greater than refresh rate. Compared to OFF, there is no tearing. Compared to ON, the FPS will be improved for "slower" applications. If unsupported, "ON" value will be used instead. Recommended for most applications. Default if supported. + RELAXED, + // The presentation engine will always use the latest fully rendered image. Compared to OFF, no tearing will be observed. Compared to ON, battery power will be worse, especially for faster applications. If unsupported, "OFF" will be attempted next. + MAILBOX, + // The application is capped to using half the vertical sync time. FPS artificially capped to Half the display speed (usually 30fps) to maintain battery. Best possible battery savings. Worst possibly performance. Recommended for specific applications where battery saving is critical. + HALF, +}; + +struct GFXOffset { + int x; + int y; + int z; +}; + +struct GFXRect { + int x; + int y; + uint width; + uint height; +}; + +struct GFXExtent { + uint width; + uint height; + uint depth; +}; + +struct GFXTextureSubres { + uint base_mip_level = 0; + uint level_count = 1; + uint base_array_layer = 0; + uint layer_count = 1; +}; + +struct GFXTextureCopy { + GFXTextureSubres src_subres; + GFXOffset src_offset = { 0 }; + GFXTextureSubres dst_subres; + GFXOffset dst_offset = { 0 }; + GFXExtent extent = { 0 }; +}; + +struct GFXBufferTextureCopy { + uint buff_offset = 0; + uint buff_stride = 0; + uint buff_tex_height = 0; + GFXOffset tex_offset = { 0 }; + GFXExtent tex_extent = { 0 }; + GFXTextureSubres tex_subres; +}; +typedef vector::type GFXBufferTextureCopyList; + +struct GFXViewport { + int left = 0; + int top = 0; + uint width = 0; + uint height = 0; + float minDepth = 0.0f; + float maxDepth = 0.0f; +}; + +#pragma pack(push, 1) +struct GFXColor { + float r = 0.0f; + float g = 0.0f; + float b = 0.0f; + float a = 0.0f; +}; +#pragma pack(pop) + +struct GFXDeviceInfo { + intptr_t window_handle = 0; + uint width = 0; + uint height = 0; + uint native_width = 0; + uint native_height = 0; + GFXContext* shared_ctx = nullptr; +}; + +struct GFXWindowInfo { + String title; + int left = 0; + int top = 0; + uint width = 800; + uint height = 600; + GFXFormat color_fmt = GFXFormat::UNKNOWN; + GFXFormat depth_stencil_fmt = GFXFormat::UNKNOWN; + bool is_offscreen = false; + bool is_fullscreen = false; + GFXVsyncMode vsync_mode = GFXVsyncMode::OFF; + intptr_t window_handle = 0; +}; + +struct GFXContextInfo { + intptr_t window_handle = 0; + GFXContext* shared_ctx = nullptr; + GFXVsyncMode vsync_mode = GFXVsyncMode::OFF; +}; + +struct GFXBufferInfo { + GFXBufferUsage usage = GFXBufferUsage::NONE; + GFXMemoryUsage mem_usage = GFXMemoryUsage::NONE; + uint stride = 1; + uint size = 0; + GFXBufferFlags flags = GFXBufferFlagBit::NONE; +}; + +#pragma pack(push, 1) +struct GFXDrawInfo { + uint vertex_count = 0; + uint first_vertex = 0; + uint index_count = 0; + uint first_index = 0; + uint vertex_offset = 0; + uint instance_count = 0; + uint first_instance = 0; +}; +#pragma pack(pop) + +typedef vector::type GFXDrawInfoList; + +struct GFXIndirectBuffer { + GFXDrawInfoList draws; +}; + +struct GFXTextureInfo { + GFXTextureType type = GFXTextureType::TEX2D; + GFXTextureUsage usage = GFXTextureUsageBit::NONE; + GFXFormat format = GFXFormat::UNKNOWN; + uint width = 0; + uint height = 0; + uint depth = 1; + uint array_layer = 1; + uint mip_level = 1; + GFXSampleCount samples = GFXSampleCount::X1; + GFXTextureFlags flags = GFXTextureFlagBit::NONE; +}; + +struct GFXTextureViewInfo { + GFXTexture* texture = nullptr; + GFXTextureViewType type = GFXTextureViewType::TV2D; + GFXFormat format = GFXFormat::UNKNOWN; + uint base_level = 0; + uint level_count = 1; + uint base_layer = 0; + uint layer_count = 1; +}; + +struct GFXSamplerInfo { + String name; + GFXFilter min_filter = GFXFilter::LINEAR; + GFXFilter mag_filter = GFXFilter::LINEAR; + GFXFilter mip_filter = GFXFilter::NONE; + GFXAddress address_u = GFXAddress::WRAP; + GFXAddress address_v = GFXAddress::WRAP; + GFXAddress address_w = GFXAddress::WRAP; + uint max_anisotropy = 16; + GFXComparisonFunc cmp_func = GFXComparisonFunc::NEVER; + GFXColor border_color; + uint min_lod = 0; + uint max_lod = 1000; + float mip_lod_bias = 0.0f; +}; + +struct GFXShaderMacro { + String macro; + String value; +}; + +typedef vector::type GFXShaderMacroList; + +struct GFXUniform { + String name; + GFXType type; + uint count; +}; + +typedef vector::type GFXUniformList; + +struct GFXUniformBlock { + uint binding; + String name; + GFXUniformList uniforms; +}; + +typedef vector::type GFXUniformBlockList; + +struct GFXUniformSampler { + uint binding; + String name; + GFXType type; + uint count; +}; + +typedef vector::type GFXUniformSamplerList; + +struct GFXShaderStage { + GFXShaderType type; + String source; + GFXShaderMacroList macros; +}; + +typedef vector::type GFXShaderStageList; + +struct GFXShaderInfo { + String name; + GFXShaderStageList stages; + GFXUniformBlockList blocks; + GFXUniformSamplerList samplers; +}; + +struct GFXAttribute { + String name; + GFXFormat format = GFXFormat::UNKNOWN; + bool is_normalized = false; + uint stream = 0; + bool is_instanced = false; +}; + +typedef vector::type GFXAttributeList; +typedef vector::type GFXBufferList; + +struct GFXInputAssemblerInfo { + GFXAttributeList attributes; + GFXBufferList vertex_buffers; + GFXBuffer* index_buffer = nullptr; + GFXBuffer* indirect_buffer = nullptr; +}; + +struct GFXColorAttachment { + GFXFormat format = GFXFormat::UNKNOWN; + GFXLoadOp load_op = GFXLoadOp::CLEAR; + GFXStoreOp store_op = GFXStoreOp::STORE; + uint sample_count = 1; + GFXTextureLayout begin_layout = GFXTextureLayout::COLOR_ATTACHMENT_OPTIMAL; + GFXTextureLayout end_layout = GFXTextureLayout::COLOR_ATTACHMENT_OPTIMAL; +}; + +typedef vector::type GFXColorAttachmentList; + +struct GFXDepthStencilAttachment { + GFXFormat format = GFXFormat::UNKNOWN; + GFXLoadOp depth_load_op = GFXLoadOp::CLEAR; + GFXStoreOp depth_store_op = GFXStoreOp::STORE; + GFXLoadOp stencil_load_op = GFXLoadOp::CLEAR; + GFXStoreOp stencil_store_op = GFXStoreOp::STORE; + uint sample_count = 1; + GFXTextureLayout begin_layout = GFXTextureLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL; + GFXTextureLayout end_layout = GFXTextureLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL; +}; + +struct GFXSubPass { + GFXPipelineBindPoint bind_point; + uint8_t inputs[GFX_MAX_ATTACHMENTS]; + uint8_t colors[GFX_MAX_ATTACHMENTS]; + uint8_t resolves[GFX_MAX_ATTACHMENTS]; + uint8_t depth_stencil; + uint8_t preserves[GFX_MAX_ATTACHMENTS]; + + GFXSubPass() + : bind_point(GFXPipelineBindPoint::GRAPHICS), + depth_stencil(GFX_INVALID_BINDING) { + memset(inputs, -1, sizeof(inputs)); + memset(colors, -1, sizeof(colors)); + memset(resolves, -1, sizeof(resolves)); + memset(preserves, -1, sizeof(preserves)); + } +}; + +typedef vector::type GFXSubPassList; + +struct GFXRenderPassInfo { + GFXColorAttachmentList color_attachments; + GFXDepthStencilAttachment depth_stencil_attachment; + GFXSubPassList sub_passes; +}; + +typedef vector::type GFXTextureViewList; + +struct GFXFramebufferInfo { + GFXRenderPass* render_pass = nullptr; + GFXTextureViewList color_views; + GFXTextureView* depth_stencil_view = nullptr; + bool is_offscreen = true; +}; + +struct GFXBinding { + uint binding; + GFXBindingType type; + String name; +}; + +typedef vector::type GFXBindingList; + +struct GFXBindingLayoutInfo { + GFXBindingList bindings; +}; + +struct GFXBindingUnit { + uint binding; + GFXBindingType type; + String name; + GFXBuffer* buffer; + GFXTextureView* tex_view; + GFXSampler* sampler; +}; + +typedef vector::type GFXBindingUnitList; + +struct GFXPushConstantRange { + GFXShaderType shader_type; + uint offset; + uint count; +}; + +typedef vector::type GFXPushConstantRangeList; +typedef vector::type GFXBindingLayoutList; + +struct GFXPipelineLayoutInfo { + GFXPushConstantRangeList push_constant_ranges; + GFXBindingLayoutList layouts; +}; + +struct GFXInputState { + GFXAttributeList attributes; +}; + +struct GFXRasterizerState { + bool is_discard = false; + GFXPolygonMode polygon_mode = GFXPolygonMode::FILL; + GFXShadeModel shade_model = GFXShadeModel::GOURAND; + GFXCullMode cull_mode = GFXCullMode::BACK; + bool is_front_face_ccw = true; + float depth_bias = 0.0f; + float depth_bias_clamp = 0.0f; + float depth_bias_slope = 0.0f; + bool is_depth_clip = true; + bool is_multisample = false; + float line_width = 1.0f; +}; + +struct GFXDepthStencilState { + bool depth_test = true; + bool depth_write = true; + GFXComparisonFunc depth_func = GFXComparisonFunc::LESS; + bool stencil_test_front = false; + GFXComparisonFunc stencil_func_front = GFXComparisonFunc::ALWAYS; + uint stencil_read_mask_front = 0xffffffff; + uint stencil_write_mask_front = 0xffffffff; + GFXStencilOp stencil_fail_op_front = GFXStencilOp::KEEP; + GFXStencilOp stencil_z_fail_op_front = GFXStencilOp::KEEP; + GFXStencilOp stencil_pass_op_front = GFXStencilOp::KEEP; + uint stencil_ref_front = 1; + bool stencil_test_back = false; + GFXComparisonFunc stencil_func_back = GFXComparisonFunc::ALWAYS; + uint stencil_read_mask_back = 0xffffffff; + uint stencil_write_mask_back = 0xffffffff; + GFXStencilOp stencil_fail_op_back = GFXStencilOp::KEEP; + GFXStencilOp stencil_z_fail_op_back = GFXStencilOp::KEEP; + GFXStencilOp stencil_pass_op_back = GFXStencilOp::KEEP; + uint stencil_ref_back = 1; +}; + +struct GFXBlendTarget { + bool is_blend = false; + GFXBlendFactor blend_src = GFXBlendFactor::ONE; + GFXBlendFactor blend_dst = GFXBlendFactor::ZERO; + GFXBlendOp blend_eq = GFXBlendOp::ADD; + GFXBlendFactor blend_src_alpha = GFXBlendFactor::ONE; + GFXBlendFactor blend_dst_alpha = GFXBlendFactor::ZERO; + GFXBlendOp blend_alpha_eq = GFXBlendOp::ADD; + GFXColorMask blend_color_mask = GFXColorMask::ALL; +}; + +typedef vector::type GFXBlendTargetList; + +struct GFXBlendState { + bool is_a2c = false; + bool is_independ = false; + GFXColor blend_color; + GFXBlendTargetList targets; + + GFXBlendState() { + targets.emplace_back(GFXBlendTarget()); + } +}; + +struct GFXPipelineStateInfo { + GFXPrimitiveMode primitive; + GFXShader* shader = nullptr; + GFXInputState is; + GFXRasterizerState rs; + GFXDepthStencilState dss; + GFXBlendState bs; + GFXDynamicStateList dynamic_states; + GFXPipelineLayout* layout = nullptr; + GFXRenderPass* render_pass = nullptr; +}; + +struct GFXCommandAllocatorInfo { +}; + +struct GFXCommandBufferInfo { + GFXCommandAllocator* allocator = nullptr; + GFXCommandBufferType type; +}; + +struct GFXQueueInfo { + GFXQueueType type; +}; + +struct GFXFormatInfo { + String name; + uint size; + uint count; + GFXFormatType type; + bool has_alpha; + bool has_depth; + bool has_stencil; + bool is_compressed; +}; + +extern CC_CORE_API const GFXFormatInfo GFX_FORMAT_INFOS[]; +extern CC_CORE_API const uint GFX_TYPE_SIZES[]; + +struct GFXMemoryStatus { + uint buffer_size = 0; + uint texture_size = 0; +}; + +extern CC_CORE_API uint GFXFormatSize(GFXFormat format, uint width, uint height, uint depth); + +extern CC_CORE_API uint GFXFormatSurfaceSize(GFXFormat format, uint width, uint height, uint depth, uint mips); + +CC_NAMESPACE_END + +#endif // CC_CORE_GFX_DEF_H_ diff --git a/native/cocos/renderer/core/gfx/GFXDevice.cc b/native/cocos/renderer/core/gfx/GFXDevice.cc new file mode 100755 index 0000000000..b83fe143e2 --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXDevice.cc @@ -0,0 +1,25 @@ +#include "CoreStd.h" +#include "GFXDevice.h" + +CC_NAMESPACE_BEGIN + +GFXDevice::GFXDevice() + : api_(GFXAPI::UNKNOWN), + width_(0), + height_(0), + native_width_(0), + native_height_(0), + window_handle_(0), + context_(nullptr), + window_(nullptr), + queue_(nullptr), + cmd_allocator_(nullptr), + num_draw_calls_(0), + num_tris_(0) { + memset(features_, 0, sizeof(features_)); +} + +GFXDevice::~GFXDevice() { +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/core/gfx/GFXDevice.h b/native/cocos/renderer/core/gfx/GFXDevice.h new file mode 100755 index 0000000000..e07366ff15 --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXDevice.h @@ -0,0 +1,67 @@ +#ifndef CC_CORE_GFX_DEVICE_H_ +#define CC_CORE_GFX_DEVICE_H_ + +#include "GFXDef.h" + +CC_NAMESPACE_BEGIN + +class CC_CORE_API GFXDevice : public Object { + public: + GFXDevice(); + virtual ~GFXDevice(); + + public: + virtual bool Initialize(const GFXDeviceInfo& info) = 0; + virtual void Destroy() = 0; + virtual void Resize(uint width, uint height) = 0; + virtual void Present() = 0; + virtual GFXWindow* CreateGFXWindow(const GFXWindowInfo& info) = 0; + virtual GFXQueue* CreateGFXQueue(const GFXQueueInfo& info) = 0; + virtual GFXCommandAllocator* CreateGFXCommandAllocator(const GFXCommandAllocatorInfo& info) = 0; + virtual GFXCommandBuffer* CreateGFXCommandBuffer(const GFXCommandBufferInfo& info) = 0; + virtual GFXBuffer* CreateGFXBuffer(const GFXBufferInfo& info) = 0; + virtual GFXTexture* CreateGFXTexture(const GFXTextureInfo& info) = 0; + virtual GFXTextureView* CreateGFXTextureView(const GFXTextureViewInfo& info) = 0; + virtual GFXSampler* CreateGFXSampler(const GFXSamplerInfo& info) = 0; + virtual GFXShader* CreateGFXShader(const GFXShaderInfo& info) = 0; + virtual GFXInputAssembler* CreateGFXInputAssembler(const GFXInputAssemblerInfo& info) = 0; + virtual GFXRenderPass* CreateGFXRenderPass(const GFXRenderPassInfo& info) = 0; + virtual GFXFramebuffer* CreateGFXFramebuffer(const GFXFramebufferInfo& info) = 0; + virtual GFXBindingLayout* CreateGFXBindingLayout(const GFXBindingLayoutInfo& info) = 0; + + CC_INLINE GFXAPI api() const { return api_; } + CC_INLINE GFXMemoryStatus& mem_status() { return mem_status_; } + CC_INLINE uint width() { return width_; } + CC_INLINE uint height() { return height_; } + CC_INLINE const GFXMemoryStatus& mem_status() const { return mem_status_; } + CC_INLINE GFXContext* context() const { return context_; } + CC_INLINE GFXWindow* window() const { return window_; } + CC_INLINE GFXQueue* queue() const { return queue_; } + CC_INLINE GFXCommandAllocator* cmd_allocator() const { return cmd_allocator_; } + + CC_INLINE bool HasFeature(GFXFeature feature) const { return features_[(int)feature]; } + + protected: + GFXAPI api_; + String device_name_; + String renderer_; + String vendor_; + String version_; + bool features_[(int)GFXFeature::COUNT]; + uint width_; + uint height_; + uint native_width_; + uint native_height_; + GFXMemoryStatus mem_status_; + intptr_t window_handle_; + GFXContext* context_; + GFXWindow* window_; + GFXQueue* queue_; + GFXCommandAllocator* cmd_allocator_; + uint num_draw_calls_; + uint num_tris_; +}; + +CC_NAMESPACE_END + +#endif // CC_CORE_GFX_DEVICE_H_ diff --git a/native/cocos/renderer/core/gfx/GFXFramebuffer.cc b/native/cocos/renderer/core/gfx/GFXFramebuffer.cc new file mode 100755 index 0000000000..132a1502b1 --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXFramebuffer.cc @@ -0,0 +1,16 @@ +#include "CoreStd.h" +#include "GFXFramebuffer.h" + +CC_NAMESPACE_BEGIN + +GFXFramebuffer::GFXFramebuffer(GFXDevice* device) + : device_(device), + render_pass_(nullptr), + depth_stencil_view_(nullptr), + is_offscreen_(true) { +} + +GFXFramebuffer::~GFXFramebuffer() { +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/core/gfx/GFXFramebuffer.h b/native/cocos/renderer/core/gfx/GFXFramebuffer.h new file mode 100755 index 0000000000..a9fc4a762e --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXFramebuffer.h @@ -0,0 +1,33 @@ +#ifndef CC_CORE_GFX_FRAME_BUFFER_H_ +#define CC_CORE_GFX_FRAME_BUFFER_H_ + +#include "GFXDef.h" + +CC_NAMESPACE_BEGIN + +class CC_CORE_API GFXFramebuffer : public Object { + public: + GFXFramebuffer(GFXDevice* device); + virtual ~GFXFramebuffer(); + + public: + virtual bool Initialize(const GFXFramebufferInfo& info) = 0; + virtual void Destroy() = 0; + + CC_INLINE GFXDevice* device() const { return device_; } + CC_INLINE GFXRenderPass* render_pass() const { return render_pass_; } + CC_INLINE const GFXTextureViewList& color_views() const { return color_views_; } + CC_INLINE GFXTextureView* depth_stencil_view() const { return depth_stencil_view_; } + CC_INLINE bool is_offscreen() const { return is_offscreen_; } + + protected: + GFXDevice* device_; + GFXRenderPass* render_pass_; + GFXTextureViewList color_views_; + GFXTextureView* depth_stencil_view_; + bool is_offscreen_; +}; + +CC_NAMESPACE_END + +#endif // CC_CORE_GFX_FRAME_BUFFER_H_ diff --git a/native/cocos/renderer/core/gfx/GFXInputAssembler.cc b/native/cocos/renderer/core/gfx/GFXInputAssembler.cc new file mode 100755 index 0000000000..88b258a582 --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXInputAssembler.cc @@ -0,0 +1,22 @@ +#include "CoreStd.h" +#include "GFXInputAssembler.h" + +CC_NAMESPACE_BEGIN + +GFXInputAssembler::GFXInputAssembler(GFXDevice* device) + : device_(device), + index_buffer_(nullptr), + indirect_buffer_(nullptr), + vertex_count_(0), + first_vertex_(0), + index_count_(0), + first_index_(0), + vertex_offset_(0), + instance_count_(0), + first_instance_(0) { +} + +GFXInputAssembler::~GFXInputAssembler() { +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/core/gfx/GFXInputAssembler.h b/native/cocos/renderer/core/gfx/GFXInputAssembler.h new file mode 100755 index 0000000000..11c668809a --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXInputAssembler.h @@ -0,0 +1,55 @@ +#ifndef CC_CORE_GFX_INPUT_ASSEMBLER_H_ +#define CC_CORE_GFX_INPUT_ASSEMBLER_H_ + +#include "GFXDef.h" + +CC_NAMESPACE_BEGIN + +class CC_CORE_API GFXInputAssembler : public Object { + public: + GFXInputAssembler(GFXDevice* device); + virtual ~GFXInputAssembler(); + + public: + virtual bool Initialize(const GFXInputAssemblerInfo& info) = 0; + virtual void Destroy() = 0; + + CC_INLINE GFXDevice* device() const { return device_; } + CC_INLINE const GFXAttributeList& attributes() const { return attributes_; } + CC_INLINE const GFXBufferList& vertex_buffers() const { return vertex_buffers_; } + CC_INLINE GFXBuffer* index_buffer() const { return index_buffer_; } + CC_INLINE GFXBuffer* indirect_buffer() const { return indirect_buffer_; } + CC_INLINE uint vertex_count() const { return vertex_count_; } + CC_INLINE uint first_vertex() const { return first_vertex_; } + CC_INLINE uint index_count() const { return index_count_; } + CC_INLINE uint first_index() const { return first_index_; } + CC_INLINE uint vertex_offset() const { return vertex_offset_; } + CC_INLINE uint instance_count() const { return instance_count_; } + CC_INLINE uint first_instance() const { return first_instance_; } + + CC_INLINE void set_vertex_count(uint count) { vertex_count_ = count; } + CC_INLINE void set_first_vertex(uint first) { first_vertex_ = first; } + CC_INLINE void set_index_count(uint count) { index_count_ = count; } + CC_INLINE void set_first_index(uint first) { first_index_ = first; } + CC_INLINE void set_vertex_offset(uint offset) { vertex_offset_ = offset; } + CC_INLINE void set_instance_count(uint count) { instance_count_ = count; } + CC_INLINE void set_first_instance(uint first) { first_instance_ = first; } + + protected: + GFXDevice* device_; + GFXAttributeList attributes_; + GFXBufferList vertex_buffers_; + GFXBuffer* index_buffer_; + GFXBuffer* indirect_buffer_; + uint vertex_count_; + uint first_vertex_; + uint index_count_; + uint first_index_; + uint vertex_offset_; + uint instance_count_; + uint first_instance_; +}; + +CC_NAMESPACE_END + +#endif // CC_CORE_GFX_INPUT_ASSEMBLER_H_ diff --git a/native/cocos/renderer/core/gfx/GFXPipelineLayout.cc b/native/cocos/renderer/core/gfx/GFXPipelineLayout.cc new file mode 100755 index 0000000000..827d370c79 --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXPipelineLayout.cc @@ -0,0 +1,13 @@ +#include "CoreStd.h" +#include "GFXPipelineLayout.h" + +CC_NAMESPACE_BEGIN + +GFXPipelineLayout::GFXPipelineLayout(GFXDevice* device) + : device_(device) { +} + +GFXPipelineLayout::~GFXPipelineLayout() { +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/core/gfx/GFXPipelineLayout.h b/native/cocos/renderer/core/gfx/GFXPipelineLayout.h new file mode 100755 index 0000000000..d1953cd3a3 --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXPipelineLayout.h @@ -0,0 +1,29 @@ +#ifndef CC_CORE_GFX_PIPELINE_LAYOUT_H_ +#define CC_CORE_GFX_PIPELINE_LAYOUT_H_ + +#include "GFXDef.h" + +CC_NAMESPACE_BEGIN + +class CC_CORE_API GFXPipelineLayout : public Object { + public: + GFXPipelineLayout(GFXDevice* device); + virtual ~GFXPipelineLayout(); + +public: + virtual bool Initialize(const GFXPipelineLayoutInfo& info) = 0; + virtual void Destroy() = 0; + + CC_INLINE GFXDevice* device() const { return device_; } + CC_INLINE const GFXPushConstantRangeList& push_constant_ranges() const { return push_constant_ranges_; } + CC_INLINE const GFXBindingLayoutList& layouts() const { return layouts_; } + +protected: + GFXDevice* device_; + GFXPushConstantRangeList push_constant_ranges_; + GFXBindingLayoutList layouts_; +}; + +CC_NAMESPACE_END + +#endif // CC_CORE_GFX_PIPELINE_LAYOUT_H_ diff --git a/native/cocos/renderer/core/gfx/GFXPipelineState.cc b/native/cocos/renderer/core/gfx/GFXPipelineState.cc new file mode 100755 index 0000000000..75c9a572e5 --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXPipelineState.cc @@ -0,0 +1,17 @@ +#include "CoreStd.h" +#include "GFXPipelineState.h" + +CC_NAMESPACE_BEGIN + +GFXPipelineState::GFXPipelineState(GFXDevice* device) + : device_(device), + shader_(nullptr), + primitive_(GFXPrimitiveMode::TRIANGLE_LIST), + layout_(nullptr), + render_pass_(nullptr) { +} + +GFXPipelineState::~GFXPipelineState() { +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/core/gfx/GFXPipelineState.h b/native/cocos/renderer/core/gfx/GFXPipelineState.h new file mode 100755 index 0000000000..438bf7126a --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXPipelineState.h @@ -0,0 +1,43 @@ +#ifndef CC_CORE_GFX_PIPELINE_STATE_H_ +#define CC_CORE_GFX_PIPELINE_STATE_H_ + +#include "GFXDef.h" + +CC_NAMESPACE_BEGIN + +class CC_CORE_API GFXPipelineState : public Object { + public: + GFXPipelineState(GFXDevice* device); + virtual ~GFXPipelineState(); + +public: + virtual bool Initialize(const GFXPipelineStateInfo& info) = 0; + virtual void Destroy() = 0; + + CC_INLINE GFXDevice* device() const { return device_; } + CC_INLINE GFXShader* shader() const { return shader_; } + CC_INLINE GFXPrimitiveMode primitive() const { return primitive_; } + CC_INLINE const GFXInputState& is() const { return is_; } + CC_INLINE const GFXRasterizerState& rs() const { return rs_; } + CC_INLINE const GFXDepthStencilState& dss() const { return dss_; } + CC_INLINE const GFXBlendState& bs() const { return bs_; } + CC_INLINE const GFXDynamicStateList& dynamic_states() const { return dynamic_states_; } + CC_INLINE const GFXPipelineLayout* layout() const { return layout_; } + CC_INLINE const GFXRenderPass* render_pass() const { return render_pass_; } + +protected: + GFXDevice* device_; + GFXShader* shader_; + GFXPrimitiveMode primitive_; + GFXInputState is_; + GFXRasterizerState rs_; + GFXDepthStencilState dss_; + GFXBlendState bs_; + GFXDynamicStateList dynamic_states_; + GFXPipelineLayout* layout_; + GFXRenderPass* render_pass_; +}; + +CC_NAMESPACE_END + +#endif // CC_CORE_GFX_PIPELINE_STATE_H_ diff --git a/native/cocos/renderer/core/gfx/GFXQueue.cc b/native/cocos/renderer/core/gfx/GFXQueue.cc new file mode 100755 index 0000000000..1888a1ffd5 --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXQueue.cc @@ -0,0 +1,13 @@ +#include "CoreStd.h" +#include "GFXQueue.h" + +CC_NAMESPACE_BEGIN + +GFXQueue::GFXQueue(GFXDevice* device) + : device_(device) { +} + +GFXQueue::~GFXQueue() { +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/core/gfx/GFXQueue.h b/native/cocos/renderer/core/gfx/GFXQueue.h new file mode 100755 index 0000000000..cc02529a62 --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXQueue.h @@ -0,0 +1,28 @@ +#ifndef CC_CORE_GFX_QUEUE_H_ +#define CC_CORE_GFX_QUEUE_H_ + +#include "GFXDef.h" + +CC_NAMESPACE_BEGIN + +class CC_CORE_API GFXQueue : public Object { + public: + GFXQueue(GFXDevice* device); + virtual ~GFXQueue(); + +public: + virtual bool Initialize(const GFXQueueInfo& info) = 0; + virtual void Destroy() = 0; + virtual void submit(GFXCommandBuffer** cmd_buffs, uint count) = 0; + + CC_INLINE GFXDevice* device() const { return device_; } + CC_INLINE GFXQueueType type() const { return type_; } + +protected: + GFXDevice* device_; + GFXQueueType type_; +}; + +CC_NAMESPACE_END + +#endif // CC_CORE_GFX_QUEUE_H_ diff --git a/native/cocos/renderer/core/gfx/GFXRenderPass.cc b/native/cocos/renderer/core/gfx/GFXRenderPass.cc new file mode 100755 index 0000000000..2e22218153 --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXRenderPass.cc @@ -0,0 +1,13 @@ +#include "CoreStd.h" +#include "GFXRenderPass.h" + +CC_NAMESPACE_BEGIN + +GFXRenderPass::GFXRenderPass(GFXDevice* device) + : device_(device) { +} + +GFXRenderPass::~GFXRenderPass() { +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/core/gfx/GFXRenderPass.h b/native/cocos/renderer/core/gfx/GFXRenderPass.h new file mode 100755 index 0000000000..2c3db20b03 --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXRenderPass.h @@ -0,0 +1,31 @@ +#ifndef CC_CORE_GFX_RENDER_PASS_H_ +#define CC_CORE_GFX_RENDER_PASS_H_ + +#include "GFXDef.h" + +CC_NAMESPACE_BEGIN + +class CC_CORE_API GFXRenderPass : public Object { + public: + GFXRenderPass(GFXDevice* device); + virtual ~GFXRenderPass(); + + public: + virtual bool Initialize(const GFXRenderPassInfo& info) = 0; + virtual void Destroy() = 0; + + CC_INLINE GFXDevice* device() const { return device_; } + CC_INLINE const GFXColorAttachmentList& color_attachments() const { return color_attachments_; } + CC_INLINE const GFXDepthStencilAttachment& depth_stencil_attachment() const { return depth_stencil_attachment_; } + CC_INLINE const GFXSubPassList& sub_passes() const { return sub_passes_; } + + protected: + GFXDevice* device_; + GFXColorAttachmentList color_attachments_; + GFXDepthStencilAttachment depth_stencil_attachment_; + GFXSubPassList sub_passes_; +}; + +CC_NAMESPACE_END + +#endif // CC_CORE_GFX_RENDER_PASS_H_ diff --git a/native/cocos/renderer/core/gfx/GFXSampler.cc b/native/cocos/renderer/core/gfx/GFXSampler.cc new file mode 100755 index 0000000000..e156628a7e --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXSampler.cc @@ -0,0 +1,28 @@ +#include "CoreStd.h" +#include "GFXSampler.h" + +CC_NAMESPACE_BEGIN + +GFXSampler::GFXSampler(GFXDevice* device) + : device_(device), + min_filter_(GFXFilter::NONE), + mag_filter_(GFXFilter::NONE), + mip_filter_(GFXFilter::NONE), + address_u_(GFXAddress::WRAP), + address_v_(GFXAddress::WRAP), + address_w_(GFXAddress::WRAP), + max_anisotropy_(0), + cmp_func_(GFXComparisonFunc::ALWAYS), + min_lod_(0), + max_lod_(0), + mip_lod_bias_(0.0f) { + border_color_.r = 0.0f; + border_color_.g = 0.0f; + border_color_.b = 0.0f; + border_color_.a = 0.0f; +} + +GFXSampler::~GFXSampler() { +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/core/gfx/GFXSampler.h b/native/cocos/renderer/core/gfx/GFXSampler.h new file mode 100755 index 0000000000..66ab580c67 --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXSampler.h @@ -0,0 +1,51 @@ +#ifndef CC_CORE_GFX_SAMPLER_H_ +#define CC_CORE_GFX_SAMPLER_H_ + +#include "GFXDef.h" + +CC_NAMESPACE_BEGIN + +class CC_CORE_API GFXSampler : public Object { + public: + GFXSampler(GFXDevice* device); + virtual ~GFXSampler(); + + public: + virtual bool Initialize(const GFXSamplerInfo& info) = 0; + virtual void Destroy() = 0; + + CC_INLINE GFXDevice* device() const { return device_; } + CC_INLINE const String& name() const { return name_; } + CC_INLINE GFXFilter min_filter() const { return min_filter_; } + CC_INLINE GFXFilter mag_filter() const { return mag_filter_; } + CC_INLINE GFXFilter mip_filter() const { return mip_filter_; } + CC_INLINE GFXAddress address_u() const { return address_u_; } + CC_INLINE GFXAddress address_v() const { return address_v_; } + CC_INLINE GFXAddress address_w() const { return address_w_; } + CC_INLINE uint max_anisotropy() const { return max_anisotropy_; } + CC_INLINE GFXComparisonFunc cmp_func() const { return cmp_func_; } + CC_INLINE const GFXColor& border_color() const { return border_color_; } + CC_INLINE uint min_lod() const { return min_lod_; } + CC_INLINE uint max_lod() const { return max_lod_; } + CC_INLINE float mip_lod_bias() const { return mip_lod_bias_; } + + protected: + GFXDevice* device_; + String name_; + GFXFilter min_filter_; + GFXFilter mag_filter_; + GFXFilter mip_filter_; + GFXAddress address_u_; + GFXAddress address_v_; + GFXAddress address_w_; + uint max_anisotropy_; + GFXComparisonFunc cmp_func_; + GFXColor border_color_; + uint min_lod_; + uint max_lod_; + float mip_lod_bias_; +}; + +CC_NAMESPACE_END + +#endif // CC_CORE_GFX_SAMPLER_H_ diff --git a/native/cocos/renderer/core/gfx/GFXShader.cc b/native/cocos/renderer/core/gfx/GFXShader.cc new file mode 100755 index 0000000000..ab8994f84b --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXShader.cc @@ -0,0 +1,14 @@ +#include "CoreStd.h" +#include "GFXShader.h" + +CC_NAMESPACE_BEGIN + +GFXShader::GFXShader(GFXDevice* device) + : device_(device), + hash_(0) { +} + +GFXShader::~GFXShader() { +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/core/gfx/GFXShader.h b/native/cocos/renderer/core/gfx/GFXShader.h new file mode 100755 index 0000000000..73241d69cc --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXShader.h @@ -0,0 +1,35 @@ +#ifndef CC_CORE_GFX_SHADER_H_ +#define CC_CORE_GFX_SHADER_H_ + +#include "GFXDef.h" + +CC_NAMESPACE_BEGIN + +class CC_CORE_API GFXShader : public Object { + public: + GFXShader(GFXDevice* device); + virtual ~GFXShader(); + + public: + virtual bool Initialize(const GFXShaderInfo& info) = 0; + virtual void Destroy() = 0; + + CC_INLINE GFXDevice* device() const { return device_; } + CC_INLINE uint hash() const { return hash_; } + CC_INLINE const String& name() const { return name_; } + CC_INLINE const GFXShaderStageList& stages() const { return stages_; } + CC_INLINE const GFXUniformBlockList& blocks() const { return blocks_; } + CC_INLINE const GFXUniformSamplerList& samplers() const { return samplers_; } + + protected: + GFXDevice* device_; + uint hash_; + String name_; + GFXShaderStageList stages_; + GFXUniformBlockList blocks_; + GFXUniformSamplerList samplers_; +}; + +CC_NAMESPACE_END + +#endif // CC_CORE_GFX_TEXTURE_VIEW_H_ diff --git a/native/cocos/renderer/core/gfx/GFXTexture.cc b/native/cocos/renderer/core/gfx/GFXTexture.cc new file mode 100755 index 0000000000..bc204107cd --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXTexture.cc @@ -0,0 +1,25 @@ +#include "CoreStd.h" +#include "GFXTexture.h" + +CC_NAMESPACE_BEGIN + +GFXTexture::GFXTexture(GFXDevice* device) + : device_(device), + type_(GFXTextureType::TEX2D), + usage_(GFXTextureUsageBit::NONE), + format_(GFXFormat::UNKNOWN), + width_(0), + height_(0), + depth_(1), + array_layer_(1), + mip_level_(1), + size_(0), + samples_(GFXSampleCount::X1), + flags_(GFXTextureFlagBit::NONE), + buffer_(nullptr) { +} + +GFXTexture::~GFXTexture() { +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/core/gfx/GFXTexture.h b/native/cocos/renderer/core/gfx/GFXTexture.h new file mode 100755 index 0000000000..9117848a42 --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXTexture.h @@ -0,0 +1,49 @@ +#ifndef CC_CORE_GFX_TEXTURE_H_ +#define CC_CORE_GFX_TEXTURE_H_ + +#include "GFXDef.h" + +CC_NAMESPACE_BEGIN + +class CC_CORE_API GFXTexture : public Object { + public: + GFXTexture(GFXDevice* device); + virtual ~GFXTexture(); + + public: + virtual bool Initialize(const GFXTextureInfo& info) = 0; + virtual void Destroy() = 0; + virtual void Resize(uint width, uint height) = 0; + + CC_INLINE GFXTextureType type() const { return type_; } + CC_INLINE GFXTextureUsage usage() const { return usage_; } + CC_INLINE GFXFormat format() const { return format_; } + CC_INLINE uint width() const { return width_; } + CC_INLINE uint height() const { return height_; } + CC_INLINE uint depth() const { return depth_; } + CC_INLINE uint array_layer() const { return array_layer_; } + CC_INLINE uint mip_level() const { return mip_level_; } + CC_INLINE uint size() const { return size_; } + CC_INLINE GFXSampleCount samples() const { return samples_; } + CC_INLINE GFXTextureFlags flags() const { return flags_; } + CC_INLINE uint8_t* buffer() const { return buffer_; } + + protected: + GFXDevice* device_; + GFXTextureType type_; + GFXTextureUsage usage_; + GFXFormat format_; + uint width_; + uint height_; + uint depth_; + uint array_layer_; + uint mip_level_; + uint size_; + GFXSampleCount samples_; + GFXTextureFlags flags_; + uint8_t* buffer_; +}; + +CC_NAMESPACE_END + +#endif // CC_CORE_GFX_TEXTURE_H_ diff --git a/native/cocos/renderer/core/gfx/GFXTextureView.cc b/native/cocos/renderer/core/gfx/GFXTextureView.cc new file mode 100755 index 0000000000..043d033dcb --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXTextureView.cc @@ -0,0 +1,20 @@ +#include "CoreStd.h" +#include "GFXTextureView.h" + +CC_NAMESPACE_BEGIN + +GFXTextureView::GFXTextureView(GFXDevice* device) + : device_(device), + texture_(nullptr), + type_(GFXTextureViewType::TV2D), + format_(GFXFormat::UNKNOWN), + base_level_(0), + level_count_(1), + base_layer_(0), + layer_count_(1) { +} + +GFXTextureView::~GFXTextureView() { +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/core/gfx/GFXTextureView.h b/native/cocos/renderer/core/gfx/GFXTextureView.h new file mode 100755 index 0000000000..f9027e26bd --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXTextureView.h @@ -0,0 +1,39 @@ +#ifndef CC_CORE_GFX_TEXTURE_VIEW_H_ +#define CC_CORE_GFX_TEXTURE_VIEW_H_ + +#include "GFXDef.h" + +CC_NAMESPACE_BEGIN + +class CC_CORE_API GFXTextureView : public Object { + public: + GFXTextureView(GFXDevice* device); + virtual ~GFXTextureView(); + + public: + virtual bool Initialize(const GFXTextureViewInfo& info) = 0; + virtual void Destroy() = 0; + + CC_INLINE GFXDevice* device() const { return device_; } + CC_INLINE GFXTexture* texture() const { return texture_; } + CC_INLINE GFXTextureViewType type() const { return type_; } + CC_INLINE GFXFormat format() const { return format_; } + CC_INLINE uint base_level() const { return base_level_; } + CC_INLINE uint level_count() const { return level_count_; } + CC_INLINE uint base_layer() const { return base_layer_; } + CC_INLINE uint layer_count() const { return layer_count_; } + + protected: + GFXDevice* device_; + GFXTexture* texture_; + GFXTextureViewType type_; + GFXFormat format_; + uint base_level_; + uint level_count_; + uint base_layer_; + uint layer_count_; +}; + +CC_NAMESPACE_END + +#endif // CC_CORE_GFX_TEXTURE_VIEW_H_ diff --git a/native/cocos/renderer/core/gfx/GFXWindow.cc b/native/cocos/renderer/core/gfx/GFXWindow.cc new file mode 100755 index 0000000000..8145cbc96c --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXWindow.cc @@ -0,0 +1,29 @@ +#include "CoreStd.h" +#include "GFXWindow.h" + +CC_NAMESPACE_BEGIN + +GFXWindow::GFXWindow(GFXDevice* device) + : device_(device), + left_(0), + top_(0), + width_(1024), + height_(768), + native_width_(0), + native_height_(0), + color_fmt_(GFXFormat::UNKNOWN), + depth_stencil_fmt_(GFXFormat::UNKNOWN), + is_offscreen_(false), + is_fullscreen_(false), + render_pass_(nullptr), + color_texture_(nullptr), + color_tex_view_(nullptr), + depth_stencil_texture_(nullptr), + depth_stencil_tex_view_(nullptr), + framebuffer_(nullptr) { +} + +GFXWindow::~GFXWindow() { +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/core/gfx/GFXWindow.h b/native/cocos/renderer/core/gfx/GFXWindow.h new file mode 100755 index 0000000000..b7430dc277 --- /dev/null +++ b/native/cocos/renderer/core/gfx/GFXWindow.h @@ -0,0 +1,59 @@ +#ifndef CC_CORE_GFX_WINDOW_H_ +#define CC_CORE_GFX_WINDOW_H_ + +#include "GFXDef.h" + +CC_NAMESPACE_BEGIN + +class CC_CORE_API GFXWindow : public Object { + public: + GFXWindow(GFXDevice* device); + virtual ~GFXWindow(); + + public: + virtual bool Initialize(const GFXWindowInfo& info) = 0; + virtual void Destroy() = 0; + virtual void Resize(uint width, uint height) = 0; + + CC_INLINE GFXDevice* device() const { return device_; } + CC_INLINE const String& title() const { return title_; } + CC_INLINE int left() const { return left_; } + CC_INLINE int top() const { return top_; } + CC_INLINE uint width() const { return width_; } + CC_INLINE uint height() const { return height_; } + CC_INLINE uint native_width() const { return native_width_; } + CC_INLINE uint native_height() const { return native_height_; } + CC_INLINE GFXFormat color_fmt() const { return color_fmt_; } + CC_INLINE GFXFormat depth_stencil_fmt() const { return depth_stencil_fmt_; } + CC_INLINE bool is_offscreen() const { return is_offscreen_; } + CC_INLINE GFXRenderPass* render_pass() const { return render_pass_; } + CC_INLINE GFXTexture* color_texture() const { return color_texture_; } + CC_INLINE GFXTextureView* color_tex_view() const { return color_tex_view_; } + CC_INLINE GFXTexture* depth_stencil_texture() const { return depth_stencil_texture_; } + CC_INLINE GFXTextureView* depth_stencil_tex_view() const { return depth_stencil_tex_view_; } + CC_INLINE GFXFramebuffer* framebuffer() const { return framebuffer_; } + + protected: + GFXDevice* device_; + String title_; + int left_; + int top_; + uint width_; + uint height_; + uint native_width_; + uint native_height_; + GFXFormat color_fmt_; + GFXFormat depth_stencil_fmt_; + bool is_offscreen_; + bool is_fullscreen_; + GFXRenderPass* render_pass_; + GFXTexture* color_texture_; + GFXTextureView* color_tex_view_; + GFXTexture* depth_stencil_texture_; + GFXTextureView* depth_stencil_tex_view_; + GFXFramebuffer* framebuffer_; +}; + +CC_NAMESPACE_END + +#endif // CC_CORE_GFX_TEXTURE_VIEW_H_ diff --git a/native/cocos/renderer/core/kernel/Assertion.cc b/native/cocos/renderer/core/kernel/Assertion.cc new file mode 100755 index 0000000000..c32383320c --- /dev/null +++ b/native/cocos/renderer/core/kernel/Assertion.cc @@ -0,0 +1,154 @@ +#include "CoreStd.h" +#include "Assertion.h" + +// Platform head file including +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +# endif +# define _CRT_SECURE_NO_WARNINGS +# include +# undef _T +# include +#define snprintf _snprintf_s +#elif (CC_PLATFORM == CC_PLATFORM_ANDROID) +# include +#endif + +CC_NAMESPACE_BEGIN + +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) + +enum ErrRet { + ERRRET_IGNORE = 0, + ERRRET_BREAKPOINT, + ERRRET_EXIT +}; + +LRESULT __stdcall CBTHookProc(long nCode, WPARAM wParam, LPARAM lParam) { + if (nCode == HCBT_ACTIVATE) { + SetDlgItemText((HWND)wParam, IDRETRY, "&Debug"); + SetDlgItemText((HWND)wParam, IDIGNORE, "&Ignore"); + SetDlgItemText((HWND)wParam, IDABORT, "&Exit"); + } + return 0; +} + +ErrRet _DisplayError(const char* title, const char* content, const char* desc, const char* fileName, int lineNum) { + const int MODULE_NAME_SIZE = 255; + char moduleName[MODULE_NAME_SIZE]; + + // attempt to get the module name + if (!GetModuleFileName(NULL, moduleName, MODULE_NAME_SIZE)) + { + char *msg = ""; + _tcscpy_s(moduleName, _tcsclen(msg), msg); + } + + // build a collosal string containing the entire asster message + const int MAX_BUFFER_SIZE = 4096; + char buffer[MAX_BUFFER_SIZE]; + + _sntprintf_s(buffer, + MAX_BUFFER_SIZE, + "%s\n\nProgram : %s\nFile : %s\nLine : %d\nError: %s\nComment: %s\n", + title, + moduleName, + fileName, + lineNum, + content, + desc); + + + // place a copy of the message into the clipboard + if (OpenClipboard(NULL)) { + size_t bufferLength = _tcsclen(buffer); + HGLOBAL hMem = GlobalAlloc(GHND|GMEM_DDESHARE, bufferLength+1); + + if (hMem) { + uint8_t* pMem = (uint8_t*)GlobalLock(hMem); + memcpy(pMem, buffer, bufferLength); + GlobalUnlock(hMem); + EmptyClipboard(); + SetClipboardData(CF_TEXT, hMem); + } + + CloseClipboard(); + } + + // find the top most window of the current application + HWND hWndParent = GetActiveWindow(); + if (NULL != hWndParent) { + hWndParent = GetLastActivePopup(hWndParent); + } + + HHOOK hHook = SetWindowsHookEx(WH_CBT, (HOOKPROC)CBTHookProc, GetModuleHandle(NULL), GetCurrentThreadId()); + // put up a message box with the error + int iRet = MessageBox ( hWndParent, + buffer, + _T("ERROR NOTIFICATION..."), + MB_TASKMODAL|MB_SETFOREGROUND|MB_ABORTRETRYIGNORE|MB_ICONERROR); + UnhookWindowsHookEx(hHook); + + if (iRet == IDRETRY) + { + // ignore this error and continue + return ERRRET_BREAKPOINT; + } + else if (iRet == IDIGNORE) + { + // ignore this error and continue, + // plus never stop on this error again (handled by the caller) + return (ERRRET_IGNORE); + } + else + { + return ERRRET_EXIT; + } +} + +int _ExecAssert(const char* condition, const char* filename, int line, const char* formats, ...) +{ + char buffer[4096]; + va_list args; + va_start(args, formats); + vsnprintf(buffer, sizeof(buffer) - 1, formats, args); + va_end(args); + + ErrRet ret = _DisplayError("Assert Failed!", condition, buffer, filename, line); + if (ret == ERRRET_BREAKPOINT) { + return 1; + } + else if (ret == ERRRET_EXIT) { + ExitProcess((UINT)-1); + } + return 0; +} +#else +int _ExecAssert(const char* condition, const char* filename, int line, const char* formats, ...) +{ + char buffer[4096]; + va_list args; + va_start(args, formats); + vsnprintf(buffer, sizeof(buffer) - 1, formats, args); + va_end(args); + + _ExecAssertOutput(condition, filename, line, buffer); + return 0; +} +#endif + +void _ExecAssertOutput(const char* condition, const char* filename, int line, const char* msg) { + char buffer[4096]; + snprintf(buffer, sizeof(buffer) - 1, "[ASSERT] %s (%s:%d) %s", condition, filename, line, msg); + +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) + OutputDebugStringA(buffer); +#elif (CC_PLATFORM == CC_PLATFORM_ANDROID) + __android_log_write(ANDROID_LOG_FATAL, "Cocos", buffer); +#else + fputs(buffer, stdout); +#endif +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/core/kernel/CachedArray.h b/native/cocos/renderer/core/kernel/CachedArray.h new file mode 100755 index 0000000000..1bef1753c2 --- /dev/null +++ b/native/cocos/renderer/core/kernel/CachedArray.h @@ -0,0 +1,77 @@ +#ifndef CC_CORE_KERNEL_CACHED_ARRAY_H_ +#define CC_CORE_KERNEL_CACHED_ARRAY_H_ + +CC_NAMESPACE_BEGIN + +template +class CachedArray { + public: + CachedArray(uint size = 1) { + size_ = 0; + capacity_ = std::max(size, 1U); + array_ = new T[capacity_]; + } + + ~CachedArray() { + delete [] (array_); + } + + T& operator [] (int index) { + return array_[index]; + } + + const T& operator [] (int index) const { + return array_[index]; + } + + void Clear() { + // memset(array_, 0, size_ * sizeof(T)); + size_ = 0; + } + + void Push(T item) { + if (size_ >= capacity_) { + T* temp = array_; + array_ = new T[capacity_*2]; + for (uint i = 0; i < capacity_; ++i) { + array_[i] = temp[i]; + } + capacity_ *= 2; + delete [] (temp); + } + array_[size_++] = item; + } + + T Pop() { + return array_[size_--]; + } + + uint Size() const { + return size_; + } + + void Concat(const CachedArray& array) { + if (size_ + array.Size() >= capacity_) { + T* temp = array_; + uint size = std::max(capacity_*2, size_ + array.Size()); + array_ = new T[size]; + for (uint i = 0; i < capacity_; ++i) { + array_[i] = temp[i]; + } + capacity_ = size; + delete [] (temp); + } + for (uint i = 0; i < array.Size(); ++i) { + array_[size_++] = array[i]; + } + } + + private: + uint size_ = 0; + uint capacity_ = 0; + T* array_ = nullptr; +}; + +CC_NAMESPACE_END + +#endif // CC_CORE_KERNEL_CACHED_ARRAY_H_ diff --git a/native/cocos/renderer/core/kernel/Log.cc b/native/cocos/renderer/core/kernel/Log.cc new file mode 100755 index 0000000000..1731a10206 --- /dev/null +++ b/native/cocos/renderer/core/kernel/Log.cc @@ -0,0 +1,145 @@ +#include "CoreStd.h" +#include "Log.h" +#include "UTFString.h" +#include "Util/StringUtil.h" + +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +# endif +# include + +#define COLOR_FATAL FOREGROUND_INTENSITY | FOREGROUND_RED +#define COLOR_ERROR FOREGROUND_RED +#define COLOR_WARN 6 +#define COLOR_INFO FOREGROUND_GREEN | FOREGROUND_BLUE +#define COLOR_DEBUG 7 +#define COLOR_NORMAL 8 +#define SET_CONSOLE_TEXT_COLOR(color) SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color) + +#elif (CC_PLATFORM == CC_PLATFORM_ANDROID) +# include +#endif + +CC_NAMESPACE_BEGIN + +#define LOG_USE_TIMESTAMP +LogLevel Log::log_level = LogLevel::DEBUG; +FILE* Log::log_file_ = nullptr; +const char* LOG_LEVEL_DESCS[] = { "FATAL", "ERROR", "WARN", "INFO", "DEBUG" }; + +void Log::set_log_file(const String& filename) { +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) + if (log_file_) { + fclose(log_file_); + } + + log_file_ = fopen(filename.c_str(), "w"); + + if (log_file_) { + String msg; + msg += "------------------------------------------------------\n"; + + struct tm* tm_time; + time_t ct_time; + time(&ct_time); + tm_time = localtime(&ct_time); + + msg += StringUtil::Format("LOG DATE: %04d-%02d-%02d %02d:%02d:%02d\n", + tm_time->tm_year + 1900, + tm_time->tm_mon + 1, + tm_time->tm_mday, + tm_time->tm_hour, + tm_time->tm_min, + tm_time->tm_sec); + + msg += "------------------------------------------------------\n"; + + fputs(msg.c_str(), log_file_); + fflush(log_file_); + } +#endif +} + +void Log::Close() { + if (log_file_) { + fclose(log_file_); + log_file_ = nullptr; + } +} + +void Log::LogMessage(LogType type, LogLevel level, const char* formats, ...) { + char buff[4096]; + char* p = buff; + char* last = buff + sizeof(buff) - 3; + +#if defined(LOG_USE_TIMESTAMP) + struct tm* tm_time; + time_t ct_time; + time(&ct_time); + tm_time = localtime(&ct_time); + + p += sprintf(p, "%02d:%02d:%02d ", tm_time->tm_hour, tm_time->tm_min, tm_time->tm_sec); +#endif + + p += sprintf(p, "[%s]: ", LOG_LEVEL_DESCS[(int)level]); + + va_list args; + va_start(args, formats); + // p += StringUtil::VPrintf(p, last, formats, args); + + int count = (int)(last - p); + int ret = vsnprintf(p, count, formats, args); + if (ret >= count - 1) { + p += (count - 1); + } else if (ret >= 0) { + p += ret; + } + + va_end(args); + + *p++ = '\n'; + *p = 0; + + if (log_file_) + { + fputs(buff, log_file_); + fflush(log_file_); + } + +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) + UTFString utfstr(buff); + const wchar_t* ustr = utfstr.asWStr_c_str(); + + WORD color; + switch (level) { + case LogLevel::DEBUG: color = COLOR_DEBUG; break; + case LogLevel::INFO: color = COLOR_INFO; break; + case LogLevel::WARN: color = COLOR_WARN; break; + case LogLevel::ERR: color = COLOR_ERROR; break; + case LogLevel::FATAL: color = COLOR_FATAL; break; + default: color = COLOR_INFO; + } + SET_CONSOLE_TEXT_COLOR(color); + wprintf(L"%s", ustr); + SET_CONSOLE_TEXT_COLOR(COLOR_NORMAL); + + OutputDebugStringW(ustr); +#elif (CC_PLATFORM == CC_PLATFORM_ANDROID) + android_LogPriority priority; + switch (level) { + case LogLevel::DEBUG: priority = ANDROID_LOG_DEBUG; break; + case LogLevel::INFO: priority = ANDROID_LOG_INFO; break; + case LogLevel::WARN: priority = ANDROID_LOG_WARN; break; + case LogLevel::ERROR: priority = ANDROID_LOG_ERROR; break; + case LogLevel::FATAL: priority = ANDROID_LOG_FATAL; break; + default: priority = ANDROID_LOG_INFO; + } + + __android_log_write(priority, (type == LogType::KERNEL? "Cocos" : "CocosScript"), buff); +#else + fputs(buff, stdout); +#endif +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/core/kernel/Log.h b/native/cocos/renderer/core/kernel/Log.h new file mode 100755 index 0000000000..81e837545f --- /dev/null +++ b/native/cocos/renderer/core/kernel/Log.h @@ -0,0 +1,43 @@ +#ifndef CC_CORE_KERNEL_LOG_H_ +#define CC_CORE_KERNEL_LOG_H_ + +CC_NAMESPACE_BEGIN + +enum class LogType: uint8_t { + KERNEL, + SCRIPT, + COUNT, +}; + +enum class LogLevel: uint8_t { + FATAL, + ERR, + WARN, + INFO, + DEBUG, + COUNT, +}; + +class CC_CORE_API Log { + public: + static LogLevel log_level; // for read only + + static CC_INLINE void set_log_level(LogLevel level) { log_level = level; } + static CC_INLINE FILE* log_file() { return log_file_; } + static void set_log_file(const String& filename); + static void Close(); + static void LogMessage(LogType type, LogLevel level, const char* formats, ...); + + private: + static FILE* log_file_; +}; + +CC_NAMESPACE_END + +#define CC_LOG_DEBUG(formats, ...) if(cc::Log::log_level >= cc::LogLevel::DEBUG) cc::Log::LogMessage(cc::LogType::KERNEL, cc::LogLevel::DEBUG, formats, ##__VA_ARGS__) +#define CC_LOG_INFO(formats, ...) if(cc::Log::log_level >= cc::LogLevel::INFO) cc::Log::LogMessage(cc::LogType::KERNEL, cc::LogLevel::INFO, formats, ##__VA_ARGS__) +#define CC_LOG_WARNING(formats, ...) if(cc::Log::log_level >= cc::LogLevel::WARN) cc::Log::LogMessage(cc::LogType::KERNEL, cc::LogLevel::WARN, formats, ##__VA_ARGS__) +#define CC_LOG_ERROR(formats, ...) if(cc::Log::log_level >= cc::LogLevel::ERR) cc::Log::LogMessage(cc::LogType::KERNEL, cc::LogLevel::ERR, formats, ##__VA_ARGS__) +#define CC_LOG_FATAL(formats, ...) if(cc::Log::m_logLevel >= cc::LogLevel::FATAL) cc::Log::LogMessage(cc::LogType::KERNEL, cc::LogLevel::FATAL, formats, ##__VA_ARGS__) + +#endif // CC_CORE_KERNEL_LOG_H_ diff --git a/native/cocos/renderer/core/kernel/Object.h b/native/cocos/renderer/core/kernel/Object.h new file mode 100755 index 0000000000..36bec72a3a --- /dev/null +++ b/native/cocos/renderer/core/kernel/Object.h @@ -0,0 +1,11 @@ +#ifndef CC_CORE_KERNEL_OBJECT_H_ +#define CC_CORE_KERNEL_OBJECT_H_ + +CC_NAMESPACE_BEGIN + +// Now define all the base classes for each allocation +typedef AllocatedObject Object; + +CC_NAMESPACE_END + +#endif // CC_CORE_KERNEL_OBJECT_H_ diff --git a/native/cocos/renderer/core/kernel/UTFString.cc b/native/cocos/renderer/core/kernel/UTFString.cc new file mode 100755 index 0000000000..a7cab55865 --- /dev/null +++ b/native/cocos/renderer/core/kernel/UTFString.cc @@ -0,0 +1,591 @@ +#include "CoreStd.h" +#include "UTFString.h" + +CC_NAMESPACE_BEGIN + +UTFString::unicode_char UTFString::_base_iterator::_getCharacter() const { + return string_->getChar(_get_index()); +} + +int UTFString::_base_iterator::_setCharacter(unicode_char uc) { + size_type current_index = _get_index(); + int change = string_->setChar( current_index, uc ); + _jump_to( current_index ); + return change; +} + +void UTFString::_base_iterator::_moveNext() { + _seekFwd( 1 ); // move 1 code point forward + if ( _test_end() ) return; // exit if we hit the end + if ( _utf16_surrogate_follow( iter_[0] ) ) { + // landing on a follow code point means we might be part of a bigger character + // so we test for that + code_point lead_half = 0; + //NB: we can't possibly be at the beginning here, so no need to test + lead_half = iter_[-1]; // check the previous code point to see if we're part of a surrogate pair + if ( _utf16_surrogate_lead( lead_half ) ) { + _seekFwd( 1 ); // if so, then advance 1 more code point + } + } +} + +void UTFString::_base_iterator::_movePrev() { + _seekRev( 1 ); // move 1 code point backwards + if ( _test_begin() ) return; // exit if we hit the beginning + if ( _utf16_surrogate_follow( iter_[0] ) ) { + // landing on a follow code point means we might be part of a bigger character + // so we test for that + code_point lead_half = 0; + lead_half = iter_[-1]; // check the previous character to see if we're part of a surrogate pair + if ( _utf16_surrogate_lead( lead_half ) ) { + _seekRev( 1 ); // if so, then rewind 1 more code point + } + } +} + +////////////////////////////////////////////////////////////////////////// + +UTFString::unicode_char UTFString::getChar( size_type loc ) const { + const code_point* ptr = c_str(); + unicode_char uc; + size_t l = _utf16_char_length( ptr[loc] ); + code_point cp[2] = { /* blame the code beautifier */ + 0, 0 + }; + cp[0] = ptr[loc]; + + if ( l == 2 && ( loc + 1 ) < m_data.length() ) { + cp[1] = ptr[loc+1]; + } + _utf16_to_utf32( cp, uc ); + return uc; +} + +int UTFString::setChar( size_type loc, unicode_char ch ) { + code_point cp[2] = { /* blame the code beautifier */ + 0, 0 + }; + size_t l = _utf32_to_utf16( ch, cp ); + unicode_char existingChar = getChar( loc ); + size_t existingSize = _utf16_char_length( existingChar ); + size_t newSize = _utf16_char_length( ch ); + + if ( newSize > existingSize ) { + at( loc ) = cp[0]; + insert( loc + 1, 1, cp[1] ); + return 1; + } + if ( newSize < existingSize ) { + erase( loc, 1 ); + at( loc ) = cp[0]; + return -1; + } + + // newSize == existingSize + at( loc ) = cp[0]; + if ( l == 2 ) at( loc + 1 ) = cp[1]; + return 0; +} + + +UTFString& UTFString::assign( const String& str ) { + size_type len = _verifyUTF8( str ); + clear(); // empty our contents, if there are any + if (len == 0) + { + return *this; + } + + reserve( len ); // best guess bulk capacity growth + + // This is a 3 step process, converting each byte in the UTF-8 stream to UTF-32, + // then converting it to UTF-16, then finally appending the data buffer + + unicode_char uc = 0; // temporary Unicode character buffer + unsigned char utf8buf[7]; // temporary UTF-8 buffer + utf8buf[6] = 0; + size_t utf8len; // UTF-8 length + code_point utf16buff[3]; // temporary UTF-16 buffer + utf16buff[2] = 0; + size_t utf16len; // UTF-16 length + + String::const_iterator i, ie = str.end(); + for ( i = str.begin(); i != ie; i++ ) { + utf8len = _utf8_char_length( static_cast( *i ) ); // estimate bytes to load + for ( size_t j = 0; j < utf8len; j++ ) { // load the needed UTF-8 bytes + utf8buf[j] = ( static_cast( *( i + j ) ) ); // we don't increment 'i' here just in case the estimate is wrong (shouldn't happen, but we're being careful) + } + utf8buf[utf8len] = 0; // nul terminate so we throw an exception before running off the end of the buffer + utf8len = _utf8_to_utf32( utf8buf, uc ); // do the UTF-8 -> UTF-32 conversion + i += utf8len - 1; // we subtract 1 for the increment of the 'for' loop + + utf16len = _utf32_to_utf16( uc, utf16buff ); // UTF-32 -> UTF-16 conversion + append( utf16buff, utf16len ); // append the characters to the string + } + return *this; +} + +UTFString& UTFString::assign( const WString& wstr ) +{ + m_data.clear(); + m_data.reserve( wstr.length() ); // best guess bulk allocate +#ifdef WCHAR_UTF16 // if we're already working in UTF-16, this is easy + code_point tmp; + WString::const_iterator i, ie = wstr.end(); + for ( i = wstr.begin(); i != ie; i++ ) { + tmp = static_cast( *i ); + m_data.push_back( tmp ); + } +#else // otherwise we do it the safe way (which is still 100% safe to pass UTF-16 through, just slower) + code_point cp[3] = {0, 0, 0}; + unicode_char tmp; + WString::const_iterator i, ie = wstr.end(); + for ( i = wstr.begin(); i != ie; i++ ) { + tmp = static_cast( *i ); + size_t l = _utf32_to_utf16( tmp, cp ); + if ( l > 0 ) m_data.push_back( cp[0] ); + if ( l > 1 ) m_data.push_back( cp[1] ); + } +#endif + return *this; +} + +UTFString& UTFString::append( size_type num, unicode_char ch ) +{ + code_point cp[2] = {0, 0}; + if ( _utf32_to_utf16( ch, cp ) == 2 ) { + for ( size_type i = 0; i < num; i++ ) { + append( 1, cp[0] ); + append( 1, cp[1] ); + } + } else { + for ( size_type i = 0; i < num; i++ ) { + append( 1, cp[0] ); + } + } + return *this; +} + +UTFString& UTFString::insert( size_type index, size_type num, unicode_char ch ) +{ + code_point cp[3] = {0, 0, 0}; + size_t l = _utf32_to_utf16( ch, cp ); + if ( l == 1 ) { + return insert( index, num, cp[0] ); + } + for ( size_type c = 0; c < num; c++ ) { + // insert in reverse order to preserve ordering after insert + insert( index, 1, cp[1] ); + insert( index, 1, cp[0] ); + } + return *this; +} + +void UTFString::insert( iterator i, size_type num, const unicode_char& ch ) +{ + code_point cp[3] = {0, 0, 0}; + size_t l = _utf32_to_utf16( ch, cp ); + if ( l == 1 ) { + insert( i, num, cp[0] ); + } else { + for ( size_type c = 0; c < num; c++ ) { + // insert in reverse order to preserve ordering after insert + insert( i, 1, cp[1] ); + insert( i, 1, cp[0] ); + } + } +} + +UTFString::size_type UTFString::find_first_of( const UTFString &str, size_type index /*= 0*/, size_type num /*= npos */ ) const +{ + size_type i = 0; + const size_type len = length(); + while ( i < num && ( index + i ) < len ) { + unicode_char ch = getChar( index + i ); + if ( str.inString( ch ) ) + return index + i; + i += _utf16_char_length( ch ); // increment by the Unicode character length + } + return npos; +} + +UTFString::size_type UTFString::find_first_not_of( const UTFString& str, size_type index /*= 0*/, size_type num /*= npos */ ) const +{ + size_type i = 0; + const size_type len = length(); + while ( i < num && ( index + i ) < len ) { + unicode_char ch = getChar( index + i ); + if ( !str.inString( ch ) ) + return index + i; + i += _utf16_char_length( ch ); // increment by the Unicode character length + } + return npos; +} + +UTFString::size_type UTFString::find_last_of( const UTFString& str, size_type index /*= npos*/, size_type num /*= npos */ ) const +{ + size_type i = 0; + const size_type len = length(); + if ( index > len ) index = len - 1; + + while ( i < num && ( index - i ) != npos ) { + size_type j = index - i; + // careful to step full Unicode characters + if ( j != 0 && _utf16_surrogate_follow( at( j ) ) && _utf16_surrogate_lead( at( j - 1 ) ) ) { + j = index - ++i; + } + // and back to the usual dull test + unicode_char ch = getChar( j ); + if ( str.inString( ch ) ) + return j; + i++; + } + return npos; +} + +UTFString::size_type UTFString::find_last_not_of( const UTFString& str, size_type index /*= npos*/, size_type num /*= npos */ ) const +{ + size_type i = 0; + const size_type len = length(); + if ( index > len ) index = len - 1; + + while ( i < num && ( index - i ) != npos ) { + size_type j = index - i; + // careful to step full Unicode characters + if ( j != 0 && _utf16_surrogate_follow( at( j ) ) && _utf16_surrogate_lead( at( j - 1 ) ) ) { + j = index - ++i; + } + // and back to the usual dull test + unicode_char ch = getChar( j ); + if ( !str.inString( ch ) ) + return j; + i++; + } + return npos; +} + +size_t UTFString::_utf16_to_utf32( const code_point in_cp[2], unicode_char& out_uc ) +{ + const code_point& cp1 = in_cp[0]; + const code_point& cp2 = in_cp[1]; + bool wordPair = false; + + // does it look like a surrogate pair? + if ( 0xD800 <= cp1 && cp1 <= 0xDBFF ) { + // looks like one, but does the other half match the algorithm as well? + if ( 0xDC00 <= cp2 && cp2 <= 0xDFFF ) + wordPair = true; // yep! + } + + if ( !wordPair ) { // if we aren't a 100% authentic surrogate pair, then just copy the value + out_uc = cp1; + return 1; + } + + unsigned short cU = cp1, cL = cp2; // copy upper and lower words of surrogate pair to writable buffers + cU -= 0xD800; // remove the encoding markers + cL -= 0xDC00; + + out_uc = ( cU & 0x03FF ) << 10; // grab the 10 upper bits and set them in their proper location + out_uc |= ( cL & 0x03FF ); // combine in the lower 10 bits + out_uc += 0x10000; // add back in the value offset + + return 2; // this whole operation takes to words, so that's what we'll return +} + +size_t UTFString::_utf32_to_utf16( const unicode_char& in_uc, code_point out_cp[2] ) +{ + if ( in_uc <= 0xFFFF ) { // we blindly preserve sentinel values because our decoder understands them + out_cp[0] = static_cast(in_uc); + return 1; + } + unicode_char uc = in_uc; // copy to writable buffer + unsigned short tmp; // single code point buffer + uc -= 0x10000; // subtract value offset + + //process upper word + tmp = static_cast(( uc >> 10 ) & 0x03FF); // grab the upper 10 bits + tmp += 0xD800; // add encoding offset + out_cp[0] = tmp; // write + + // process lower word + tmp = static_cast(uc & 0x03FF); // grab the lower 10 bits + tmp += 0xDC00; // add encoding offset + out_cp[1] = tmp; // write + + return 2; // return used word count (2 for surrogate pairs) +} + +size_t UTFString::_utf8_char_length( unsigned char cp ) +{ + if ( !( cp & 0x80 ) ) return 1; + if (( cp & ~_lead1_mask ) == _lead1 ) return 2; + if (( cp & ~_lead2_mask ) == _lead2 ) return 3; + if (( cp & ~_lead3_mask ) == _lead3 ) return 4; + if (( cp & ~_lead4_mask ) == _lead4 ) return 5; + if (( cp & ~_lead5_mask ) == _lead5 ) return 6; + + CC_ASSERTS(0, "invalid UTF-8 sequence header value"); + return 1; +} + +size_t UTFString::_utf8_char_length( unicode_char uc ) { + /* + 7 bit: U-00000000 - U-0000007F: 0xxxxxxx + 11 bit: U-00000080 - U-000007FF: 110xxxxx 10xxxxxx + 16 bit: U-00000800 - U-0000FFFF: 1110xxxx 10xxxxxx 10xxxxxx + 21 bit: U-00010000 - U-001FFFFF: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx + 26 bit: U-00200000 - U-03FFFFFF: 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx + 31 bit: U-04000000 - U-7FFFFFFF: 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx + */ + if ( !( uc & ~0x0000007F ) ) return 1; + if ( !( uc & ~0x000007FF ) ) return 2; + if ( !( uc & ~0x0000FFFF ) ) return 3; + if ( !( uc & ~0x001FFFFF ) ) return 4; + if ( !( uc & ~0x03FFFFFF ) ) return 5; + if ( !( uc & ~0x7FFFFFFF ) ) return 6; + + CC_ASSERTS(0, "invalid UTF-32 value"); + return 1; +} + +size_t UTFString::_utf8_to_utf32( const unsigned char in_cp[6], unicode_char& out_uc ) +{ + size_t len = _utf8_char_length( in_cp[0] ); + if ( len == 1 ) { // if we are only 1 byte long, then just grab it and exit + out_uc = in_cp[0]; + return 1; + } + + unicode_char c = 0; // temporary buffer + size_t i = 0; + switch ( len ) { // load header byte + case 6: + c = in_cp[i] & _lead5_mask; + break; + case 5: + c = in_cp[i] & _lead4_mask; + break; + case 4: + c = in_cp[i] & _lead3_mask; + break; + case 3: + c = in_cp[i] & _lead2_mask; + break; + case 2: + c = in_cp[i] & _lead1_mask; + break; + } + + for ( ++i; i < len; i++ ) { // load each continuation byte + if ((in_cp[i] & ~_cont_mask) != _cont) { + CC_ASSERTS(0, "bad UTF-8 continuation byte"); + break; + } + c <<= 6; + c |= ( in_cp[i] & _cont_mask ); + } + + out_uc = c; // write the final value and return the used byte length + return len; +} + +size_t UTFString::_utf32_to_utf8( const unicode_char& in_uc, unsigned char out_cp[6] ) { + size_t len = _utf8_char_length( in_uc ); // predict byte length of sequence + unicode_char c = in_uc; // copy to temp buffer + + //stuff all of the lower bits + for ( size_t i = len - 1; i > 0; i-- ) { + out_cp[i] = static_cast((( c ) & _cont_mask ) | _cont); + c >>= 6; + } + + //now write the header byte + switch ( len ) { + case 6: + out_cp[0] = static_cast((( c ) & _lead5_mask ) | _lead5); + break; + case 5: + out_cp[0] = static_cast((( c ) & _lead4_mask ) | _lead4); + break; + case 4: + out_cp[0] = static_cast((( c ) & _lead3_mask ) | _lead3); + break; + case 3: + out_cp[0] = static_cast((( c ) & _lead2_mask ) | _lead2); + break; + case 2: + out_cp[0] = static_cast((( c ) & _lead1_mask ) | _lead1); + break; + case 1: + default: + out_cp[0] = static_cast(( c ) & 0x7F); + break; + } + + // return the byte length of the sequence + return len; +} + +UTFString::size_type UTFString::_verifyUTF8(const String& str) { + String::const_iterator i, ie = str.end(); + i = str.begin(); + size_type length = 0; + + while ( i != ie ) { + // characters pass until we find an extended sequence + if (( *i ) & 0x80 ) { + unsigned char c = ( *i ); + size_t contBytes = 0; + + // get continuation byte count and test for overlong sequences + if (( c & ~_lead1_mask ) == _lead1 ) { // 1 additional byte + if (c == _lead1) + { + CC_ASSERTS(0, "overlong UTF-8 sequence"); + return 0; + } + contBytes = 1; + + } else if (( c & ~_lead2_mask ) == _lead2 ) { // 2 additional bytes + contBytes = 2; + if ( c == _lead2 ) { // possible overlong UTF-8 sequence + c = ( *( i + 1 ) ); // look ahead to next byte in sequence + if (( c & _lead2 ) == _cont ) + { + CC_ASSERTS(0, "overlong UTF-8 sequence"); + return 0; + } + } + + } else if (( c & ~_lead3_mask ) == _lead3 ) { // 3 additional bytes + contBytes = 3; + if ( c == _lead3 ) { // possible overlong UTF-8 sequence + c = ( *( i + 1 ) ); // look ahead to next byte in sequence + if (( c & _lead3 ) == _cont ) + { + CC_ASSERTS(0, "overlong UTF-8 sequence"); + return 0; + } + } + + } else if (( c & ~_lead4_mask ) == _lead4 ) { // 4 additional bytes + contBytes = 4; + if ( c == _lead4 ) { // possible overlong UTF-8 sequence + c = ( *( i + 1 ) ); // look ahead to next byte in sequence + if (( c & _lead4 ) == _cont ) + { + CC_ASSERTS(0, "overlong UTF-8 sequence"); + return 0; + } + } + + } else if (( c & ~_lead5_mask ) == _lead5 ) { // 5 additional bytes + contBytes = 5; + if ( c == _lead5 ) { // possible overlong UTF-8 sequence + c = ( *( i + 1 ) ); // look ahead to next byte in sequence + if (( c & _lead5 ) == _cont ) + { + CC_ASSERTS(0, "overlong UTF-8 sequence"); + return 0; + } + } + } + + // check remaining continuation bytes for + while ( contBytes-- ) { + c = ( *( ++i ) ); // get next byte in sequence + if (( c & ~_cont_mask ) != _cont ) { + CC_ASSERTS(0, "bad UTF-8 continuation byte"); + return 0; + } + } + } + length++; + i++; + } + return length; +} + +void UTFString::_cleanBuffer() const { + if ( m_buff.m_voidBuff != 0 ) { + switch ( m_buffType ) { + case BT_STR: + CC_DELETE_T(m_buff.m_strBuff, String); + break; + case BT_WSTR: + CC_DELETE_T(m_buff.m_wstrBuff, WString); + break; + case BT_NONE: // under the worse of circumstances, this is all we can do, and hope it works out + default: + //delete mBuffer.mVoidBuffer; + // delete void* is undefined, don't do that + CC_ASSERTS(0, "This should never happen - mVoidBuffer should never contain something if we " + "don't know the type"); + break; + } + m_buff.m_voidBuff = 0; + m_buffSize = 0; + m_buffType = BT_NONE; + } +} + +void UTFString::_getBufferStr() const { + if ( m_buffType != BT_STR ) { + _cleanBuffer(); + m_buff.m_strBuff = CC_NEW_T(String); + m_buffType = BT_STR; + } + m_buff.m_strBuff->clear(); +} + +void UTFString::_getBufferWStr() const { + if ( m_buffType != BT_WSTR ) { + _cleanBuffer(); + m_buff.m_wstrBuff = CC_NEW_T(WString); + m_buffType = BT_WSTR; + } + m_buff.m_wstrBuff->clear(); +} + +void UTFString::_load_buffer_UTF8() const { + _getBufferStr(); + String& buffer = ( *m_buff.m_strBuff ); + buffer.reserve( length() ); + + unsigned char utf8buf[6] = ""; + char* charbuf = ( char* )utf8buf; + unicode_char c; + size_t len; + + const_iterator i, ie = end(); + for ( i = begin(); i != ie; i.moveNext() ) + { + c = i.getCharacter(); + len = _utf32_to_utf8( c, utf8buf ); + size_t j = 0; + while ( j < len ) + buffer.push_back( charbuf[j++] ); + } +} + +void UTFString::_load_buffer_WStr() const { + _getBufferWStr(); + WString& buffer = ( *m_buff.m_wstrBuff ); + buffer.reserve( length() ); // may over reserve, but should be close enough +#ifdef WCHAR_UTF16 // wchar_t matches UTF-16 + const_iterator i, ie = end(); + for ( i = begin(); i != ie; ++i ) { + buffer.push_back(( wchar_t )( *i ) ); + } +#else // wchar_t fits UTF-32 + unicode_char c; + const_iterator i, ie = end(); + for ( i = begin(); i != ie; i.moveNext() ) { + c = i.getCharacter(); + buffer.push_back(( wchar_t )c ); + } +#endif +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/core/kernel/UTFString.h b/native/cocos/renderer/core/kernel/UTFString.h new file mode 100755 index 0000000000..377da87c11 --- /dev/null +++ b/native/cocos/renderer/core/kernel/UTFString.h @@ -0,0 +1,1565 @@ +#ifndef CC_CORE_KERNEL_UTF_STRING_H_ +#define CC_CORE_KERNEL_UTF_STRING_H_ + +#if (CC_COMPILER == CC_COMPILER_MSVC && (CC_COMPILER_VERSION >= 70 && CC_COMPILER_VERSION < 100)) + +# if defined(_DLL_CPPLIB) +namespace std { + template class _CRTIMP2 basic_string, + allocator >; + + template class _CRTIMP2 basic_string<__wchar_t, char_traits<__wchar_t>, + allocator<__wchar_t> >; +} +# endif // defined(_DLL_CPPLIB) + +#endif + +#include "Memory/StlAlloc.h" + +CC_NAMESPACE_BEGIN + +/* READ THIS NOTICE BEFORE USING IN YOUR OWN APPLICATIONS + =NOTICE= + This class is not a complete Unicode solution. It purposefully does not + provide certain functionality, such as proper lexical sorting for + Unicode values. It does provide comparison operators for the sole purpose + of using UTFString as an index with std::map and other operator< sorted + containers, but it should NOT be relied upon for meaningful lexical + operations, such as alphabetical sorts. If you need this type of + functionality, look into using ICU instead (http://icu.sourceforge.net/). + + =REQUIREMENTS= + There are a few requirements for proper operation. They are fairly small, + and shouldn't restrict usage on any reasonable target. + * Compiler must support unsigned 16-bit integer types + * Compiler must support signed 32-bit integer types + * wchar_t must be either UTF-16 or UTF-32 encoding, and specified as such + using the WCHAR_UTF16 macro as outlined below. + * You must include , , and . Probably more, but + these are the most obvious. + + =REQUIRED PREPROCESSOR MACROS= + This class requires two preprocessor macros to be defined in order to + work as advertised. + INT32 - must be mapped to a signed 32 bit integer (ex. #define INT32 int) + UINT16 - must be mapped to an unsigned 16 bit integer (ex. #define UINT32 unsigned short) + + Additionally, a third macro should be defined to control the evaluation of wchar_t: + WCHAR_UTF16 - should be defined when wchar_t represents UTF-16 code points, + such as in Windows. Otherwise it is assumed that wchar_t is a 32-bit + integer representing UTF-32 code points. + */ + +// THIS IS A VERY BRIEF AUTO DETECTION. YOU MAY NEED TO TWEAK THIS +#ifdef __STDC_ISO_10646__ +// for any compiler that provides this, wchar_t is guaranteed to hold any Unicode value with a single code point (32-bit or larger) +// so we can safely skip the rest of the testing +#else // #ifdef __STDC_ISO_10646__ +# if (CC_PLATFORM == CC_PLATFORM_WINDOWS) || (CC_PLATFORM != CC_PLATFORM_ANDROID) +# define WCHAR_UTF16 // All currently known Windows platforms utilize UTF-16 encoding in wchar_t +# endif +#endif // #ifdef __STDC_ISO_10646__ + +// OGRE_IS_NATIVE_WCHAR_T means that wchar_t isn't a typedef of +// uint16 or uint32. +#if CC_COMPILER == CC_COMPILER_MSVC + +// Don't define wchar_t related functions since it'll duplicate +// with UTFString::code_point related functions when compile +// without /Zc:wchar_t, because in this case both of them are +// a typedef of uint16. +# if defined(_NATIVE_WCHAR_T_DEFINED) +# define CC_IS_NATIVE_WCHAR_T 0 +# else +# define CC_IS_NATIVE_WCHAR_T 0 +# endif +#else +// Assumed wchar_t is natively for other compilers +# define CC_IS_NATIVE_WCHAR_T 1 +#endif // CC_COMPILER == CC_COMPILER_MSVC + +//! A UTF-16 string with implicit conversion to/from std::string and std::wstring +/*! This class provides a complete 1 to 1 map of most std::string functions (at least to my + knowledge). Implicit conversions allow this string class to work with all common C++ string + formats, with specialty functions defined where implicit conversion would cause potential + problems or is otherwise unavailable. + + Some additional functionality is present to assist in working with characters using the + 32-bit UTF-32 encoding. (Which is guaranteed to fit any Unicode character into a single + code point.) \b Note: Reverse iterators do not have this functionality due to the + ambiguity that surrounds working with UTF-16 in reverse. (Such as, where should an + iterator point to represent the beginning of a surrogate pair?) + + + \par Supported Input Types + The supported string types for input, and their assumed encoding schemes, are: + - std::string (UTF-8) + - char* (UTF-8) + - std::wstring (autodetected UTF-16 / UTF-32 based on compiler) + - wchar_t* (autodetected UTF-16 / UTF-32 based on compiler) + + + \see + - For additional information on UTF-16 encoding: http://en.wikipedia.org/wiki/UTF-16 + - For additional information on UTF-8 encoding: http://en.wikipedia.org/wiki/UTF-8 + - For additional information on UTF-32 encoding: http://en.wikipedia.org/wiki/UTF-32 + */ + +class CC_CORE_API UTFString +{ + // constants used in UTF-8 conversions + static const unsigned char _lead1 = 0xC0; //110xxxxx + static const unsigned char _lead1_mask = 0x1F; //00011111 + static const unsigned char _lead2 = 0xE0; //1110xxxx + static const unsigned char _lead2_mask = 0x0F; //00001111 + static const unsigned char _lead3 = 0xF0; //11110xxx + static const unsigned char _lead3_mask = 0x07; //00000111 + static const unsigned char _lead4 = 0xF8; //111110xx + static const unsigned char _lead4_mask = 0x03; //00000011 + static const unsigned char _lead5 = 0xFC; //1111110x + static const unsigned char _lead5_mask = 0x01; //00000001 + static const unsigned char _cont = 0x80; //10xxxxxx + static const unsigned char _cont_mask = 0x3F; //00111111 + +public: + //! size type used to indicate string size and character positions within the string + typedef size_t size_type; + //! the usual constant representing: not found, no limit, etc + static const size_type npos = static_cast(~0); + + //! a single 32-bit Unicode character + typedef uint32_t unicode_char; + + //! a single UTF-16 code point + typedef char16_t code_point; + + //! value type typedef for use in iterators + typedef code_point value_type; + +#if (CC_STL_MEMORY_ALLOCATOR == CC_STL_MEMORY_ALLOCATOR_CUSTOM) + typedef std::basic_string, SA > dstring; // data string +#else + typedef std::basic_string dstring; // data string +#endif + //! base iterator class for UTFString + class CC_CORE_API _base_iterator: public std::iterator { + friend class UTFString; + protected: + _base_iterator() { string_ = 0; } + + inline void _seekFwd( size_type c ) { iter_ += c; } + inline void _seekRev( size_type c ) { iter_ -= c; } + inline void _become( const _base_iterator& i ) { iter_ = i.iter_; string_ = i.string_; } + inline bool _test_begin() const { return iter_ == string_->m_data.begin(); } + inline bool _test_end() const { return iter_ == string_->m_data.end(); } + inline size_type _get_index() const { return iter_ - string_->m_data.begin(); } + inline void _jump_to( size_type index ) { iter_ = string_->m_data.begin() + index; } + + unicode_char _getCharacter() const; + int _setCharacter( unicode_char uc ); + void _moveNext(); + void _movePrev(); + + dstring::iterator iter_; + UTFString* string_; + }; + + ////////////////////////////////////////////////////////////////////////// + // FORWARD ITERATORS + + class _const_fwd_iterator; // forward declaration + + //! forward iterator for UTFString + class CC_CORE_API _fwd_iterator: public _base_iterator + { + friend class _const_fwd_iterator; + public: + _fwd_iterator() {} + _fwd_iterator( const _fwd_iterator& i ) { _become( i ); } + + //! pre-increment + inline _fwd_iterator& operator++() + { + _seekFwd( 1 ); + return *this; + } + + //! post-increment + inline _fwd_iterator operator++( int ) + { + _fwd_iterator tmp( *this ); + _seekFwd( 1 ); + return tmp; + } + + //! pre-decrement + inline _fwd_iterator& operator--() + { + _seekRev( 1 ); + return *this; + } + + //! post-decrement + inline _fwd_iterator operator--( int ) + { + _fwd_iterator tmp( *this ); + _seekRev( 1 ); + return tmp; + } + + //! addition operator + inline _fwd_iterator operator+( difference_type n ) + { + _fwd_iterator tmp( *this ); + if ( n < 0 ) + tmp._seekRev( -n ); + else + tmp._seekFwd( n ); + return tmp; + } + + //! subtraction operator + inline _fwd_iterator operator-( difference_type n ) + { + _fwd_iterator tmp( *this ); + if ( n < 0 ) + tmp._seekFwd( -n ); + else + tmp._seekRev( n ); + return tmp; + } + + //! addition assignment operator + inline _fwd_iterator& operator+=( difference_type n ) + { + if ( n < 0 ) + _seekRev( -n ); + else + _seekFwd( n ); + return *this; + } + + //! subtraction assignment operator + inline _fwd_iterator& operator-=( difference_type n ) + { + if ( n < 0 ) + _seekFwd( -n ); + else + _seekRev( n ); + return *this; + } + + //! dereference operator + inline value_type& operator*() const { return *iter_; } + + //! dereference at offset operator + inline value_type& operator[]( difference_type n ) const + { + _fwd_iterator tmp( *this ); + tmp += n; + return *tmp; + } + + //! advances to the next Unicode character, honoring surrogate pairs in the UTF-16 stream + inline _fwd_iterator& moveNext() + { + _moveNext(); + return *this; + } + + //! rewinds to the previous Unicode character, honoring surrogate pairs in the UTF-16 stream + inline _fwd_iterator& movePrev() + { + _movePrev(); + return *this; + } + + //! Returns the Unicode value of the character at the current position (decodes surrogate pairs if needed) + inline unicode_char getCharacter() const { return _getCharacter(); } + //! Sets the Unicode value of the character at the current position (adding a surrogate pair if needed); returns the amount of string length change caused by the operation + inline int setCharacter( unicode_char uc ) { return _setCharacter( uc ); } + }; + + ////////////////////////////////////////////////////////////////////////// + //! const forward iterator for UTFString + class CC_CORE_API _const_fwd_iterator: public _base_iterator + { + public: + _const_fwd_iterator() {} + _const_fwd_iterator( const _const_fwd_iterator& i ) { _become( i ); } + _const_fwd_iterator( const _fwd_iterator& i ) { _become( i ); } + + //! pre-increment + inline _const_fwd_iterator& operator++() + { + _seekFwd( 1 ); + return *this; + } + + //! post-increment + inline _const_fwd_iterator operator++( int ) + { + _const_fwd_iterator tmp( *this ); + _seekFwd( 1 ); + return tmp; + } + + //! pre-decrement + inline _const_fwd_iterator& operator--() + { + _seekRev( 1 ); + return *this; + } + + //! post-decrement + inline _const_fwd_iterator operator--( int ) + { + _const_fwd_iterator tmp( *this ); + _seekRev( 1 ); + return tmp; + } + + //! addition operator + inline _const_fwd_iterator operator+( difference_type n ) + { + _const_fwd_iterator tmp( *this ); + if ( n < 0 ) + tmp._seekRev( -n ); + else + tmp._seekFwd( n ); + return tmp; + } + + //! subtraction operator + inline _const_fwd_iterator operator-( difference_type n ) + { + _const_fwd_iterator tmp( *this ); + if ( n < 0 ) + tmp._seekFwd( -n ); + else + tmp._seekRev( n ); + return tmp; + } + + //! addition assignment operator + inline _const_fwd_iterator& operator+=( difference_type n ) + { + if ( n < 0 ) + _seekRev( -n ); + else + _seekFwd( n ); + return *this; + } + + //! subtraction assignment operator + inline _const_fwd_iterator& operator-=( difference_type n ) + { + if ( n < 0 ) + _seekFwd( -n ); + else + _seekRev( n ); + return *this; + } + + //! dereference operator + inline const value_type& operator*() const { return *iter_; } + + //! dereference at offset operator + inline const value_type& operator[]( difference_type n ) const + { + _const_fwd_iterator tmp( *this ); + tmp += n; + return *tmp; + } + + //! advances to the next Unicode character, honoring surrogate pairs in the UTF-16 stream + inline _const_fwd_iterator& moveNext() + { + _moveNext(); + return *this; + } + + //! rewinds to the previous Unicode character, honoring surrogate pairs in the UTF-16 stream + inline _const_fwd_iterator& movePrev() + { + _movePrev(); + return *this; + } + + //! Returns the Unicode value of the character at the current position (decodes surrogate pairs if needed) + inline unicode_char getCharacter() const { return _getCharacter(); } + + //! difference operator + friend size_type operator-( const _const_fwd_iterator& left, const _const_fwd_iterator& right ); + //! equality operator + friend bool operator==( const _const_fwd_iterator& left, const _const_fwd_iterator& right ); + //! inequality operator + friend bool operator!=( const _const_fwd_iterator& left, const _const_fwd_iterator& right ); + //! less than + friend bool operator<( const _const_fwd_iterator& left, const _const_fwd_iterator& right ); + //! less than or equal + friend bool operator<=( const _const_fwd_iterator& left, const _const_fwd_iterator& right ); + //! greater than + friend bool operator>( const _const_fwd_iterator& left, const _const_fwd_iterator& right ); + //! greater than or equal + friend bool operator>=( const _const_fwd_iterator& left, const _const_fwd_iterator& right ); + }; + + ////////////////////////////////////////////////////////////////////////// + // REVERSE ITERATORS + + class _const_rev_iterator; // forward declaration + //! forward iterator for UTFString + class CC_CORE_API _rev_iterator: public _base_iterator + { + friend class _const_rev_iterator; + public: + _rev_iterator() {} + _rev_iterator( const _rev_iterator& i ) { _become( i ); } + + //! pre-increment + inline _rev_iterator& operator++() + { + _seekRev( 1 ); + return *this; + } + + //! post-increment + inline _rev_iterator operator++( int ) + { + _rev_iterator tmp( *this ); + _seekRev( 1 ); + return tmp; + } + + //! pre-decrement + inline _rev_iterator& operator--() + { + _seekFwd( 1 ); + return *this; + } + + //! post-decrement + inline _rev_iterator operator--( int ) + { + _rev_iterator tmp( *this ); + _seekFwd( 1 ); + return tmp; + } + + //! addition operator + inline _rev_iterator operator+( difference_type n ) + { + _rev_iterator tmp( *this ); + if ( n < 0 ) + tmp._seekFwd( -n ); + else + tmp._seekRev( n ); + return tmp; + } + + //! subtraction operator + inline _rev_iterator operator-( difference_type n ) + { + _rev_iterator tmp( *this ); + if ( n < 0 ) + tmp._seekRev( -n ); + else + tmp._seekFwd( n ); + return tmp; + } + + //! addition assignment operator + inline _rev_iterator& operator+=( difference_type n ) + { + if ( n < 0 ) + _seekFwd( -n ); + else + _seekRev( n ); + return *this; + } + + //! subtraction assignment operator + inline _rev_iterator& operator-=( difference_type n ) + { + if ( n < 0 ) + _seekRev( -n ); + else + _seekFwd( n ); + return *this; + } + + //! dereference operator + inline value_type& operator*() const { return iter_[-1]; } + + //! dereference at offset operator + inline value_type& operator[]( difference_type n ) const + { + _rev_iterator tmp( *this ); + tmp -= n; + return *tmp; + } + }; + + ////////////////////////////////////////////////////////////////////////// + //! const reverse iterator for UTFString + + class CC_CORE_API _const_rev_iterator: public _base_iterator + { + public: + _const_rev_iterator() {} + _const_rev_iterator( const _const_rev_iterator& i ) { _become( i ); } + _const_rev_iterator( const _rev_iterator& i ) { _become( i ); } + + //! pre-increment + inline _const_rev_iterator& operator++() + { + _seekRev( 1 ); + return *this; + } + + //! post-increment + inline _const_rev_iterator operator++( int ) + { + _const_rev_iterator tmp( *this ); + _seekRev( 1 ); + return tmp; + } + + //! pre-decrement + inline _const_rev_iterator& operator--() + { + _seekFwd( 1 ); + return *this; + } + + //! post-decrement + inline _const_rev_iterator operator--( int ) + { + _const_rev_iterator tmp( *this ); + _seekFwd( 1 ); + return tmp; + } + + //! addition operator + inline _const_rev_iterator operator+( difference_type n ) + { + _const_rev_iterator tmp( *this ); + if ( n < 0 ) + tmp._seekFwd( -n ); + else + tmp._seekRev( n ); + return tmp; + } + + //! subtraction operator + inline _const_rev_iterator operator-( difference_type n ) + { + _const_rev_iterator tmp( *this ); + if ( n < 0 ) + tmp._seekRev( -n ); + else + tmp._seekFwd( n ); + return tmp; + } + + //! addition assignment operator + inline _const_rev_iterator& operator+=( difference_type n ) + { + if ( n < 0 ) + _seekFwd( -n ); + else + _seekRev( n ); + return *this; + } + + //! subtraction assignment operator + inline _const_rev_iterator& operator-=( difference_type n ) + { + if ( n < 0 ) + _seekRev( -n ); + else + _seekFwd( n ); + return *this; + } + + //! dereference operator + inline const value_type& operator*() const { return iter_[-1]; } + + //! dereference at offset operator + inline const value_type& operator[]( difference_type n ) const + { + _const_rev_iterator tmp( *this ); + tmp -= n; + return *tmp; + } + + //! difference operator + friend size_type operator-( const _const_rev_iterator& left, const _const_rev_iterator& right ); + //! equality operator + friend bool operator==( const _const_rev_iterator& left, const _const_rev_iterator& right ); + //! inequality operator + friend bool operator!=( const _const_rev_iterator& left, const _const_rev_iterator& right ); + //! less than + friend bool operator<( const _const_rev_iterator& left, const _const_rev_iterator& right ); + //! less than or equal + friend bool operator<=( const _const_rev_iterator& left, const _const_rev_iterator& right ); + //! greater than + friend bool operator>( const _const_rev_iterator& left, const _const_rev_iterator& right ); + //! greater than or equal + friend bool operator>=( const _const_rev_iterator& left, const _const_rev_iterator& right ); + }; + + ////////////////////////////////////////////////////////////////////////// + + typedef _fwd_iterator iterator; //!< iterator + typedef _rev_iterator reverse_iterator; //!< reverse iterator + typedef _const_fwd_iterator const_iterator; //!< const iterator + typedef _const_rev_iterator const_reverse_iterator; //!< const reverse iterator + + //!\name Constructors/Destructor + //@{ + //! default constructor, creates an empty string + UTFString() { _init(); } + //! copy constructor + UTFString(const UTFString& copy) { _init(); m_data = copy.m_data; } + //! \a length copies of \a ch + UTFString(size_type length, const code_point& ch) { _init(); assign( length, ch ); } + //! duplicate of nul-terminated sequence \a str + UTFString(const code_point* str) { _init(); assign( str ); } + //! duplicate of \a str, \a length code points long + UTFString(const code_point* str, size_type length) { _init(); assign( str, length ); } + //! substring of \a str starting at \a index and \a length code points long + UTFString(const UTFString& str, size_type index, size_type length) { _init(); assign( str, index, length ); } +#if CC_IS_NATIVE_WCHAR_T + //! duplicate of nul-terminated \c wchar_t array + UTFString(const wchar_t* w_str) { _init(); assign( w_str ); } + //! duplicate of \a w_str, \a length characters long + UTFString(const wchar_t* w_str, size_type length) { _init(); assign( w_str, length ); } +#endif + + //! duplicate of nul-terminated C-string \a c_str (UTF-8 encoding) + UTFString(const char* c_str) { _init(); assign( c_str ); } + //! duplicate of \a c_str, \a length characters long (UTF-8 encoding) + UTFString(const char* c_str, size_type length) { _init(); assign( c_str, length ); } + //! duplicate of \a str (UTF-8 encoding) + UTFString(const String& str) { _init(); assign(str); } + //! duplicate of \a wstr + UTFString(const WString& wstr) { _init(); assign(wstr); } + + //! destructor + ~UTFString() { _cleanBuffer(); } + + ////////////////////////////////////////////////////////////////////////// + // Utility functions + + //! Returns the number of code points in the current string + inline size_type size() const { return m_data.size(); } + //! Returns the number of code points in the current string + inline size_type length() const { return size(); } + //! Returns the number of Unicode characters in the string + /*! Executes in linear time. */ + inline size_type length_Characters() const { + const_iterator i = begin(), ie = end(); + size_type c = 0; + while ( i != ie ) { + i.moveNext(); + ++c; + } + return c; + } + //! returns the maximum number of UTF-16 code points that the string can hold + inline size_type max_size() const { return m_data.max_size(); } + //! sets the capacity of the string to at least \a size code points + inline void reserve( size_type size ) { m_data.reserve( size ); } + //! changes the size of the string to \a size, filling in any new area with \a val + inline void resize( size_type num, const code_point& val = 0 ) { m_data.resize( num, val ); } + //! exchanges the elements of the current string with those of \a from + inline void swap( UTFString& from ) { m_data.swap( from.m_data ); } + //! returns \c true if the string has no elements, \c false otherwise + inline bool empty() const { return m_data.empty(); } + //! returns a pointer to the first character in the current string + inline const code_point* c_str() const { return m_data.c_str(); } + //! returns a pointer to the first character in the current string + inline const code_point* data() const { return c_str(); } + //! returns the number of elements that the string can hold before it will need to allocate more space + inline size_type capacity() const { return m_data.capacity(); } + //! deletes all of the elements in the string + inline void clear() { m_data.clear(); } + //! returns a substring of the current string, starting at \a index, and \a num characters long. + /*! If \a num is omitted, it will default to \c UTFString::npos, and the substr() function will simply return the remainder of the string starting at \a index. */ + inline UTFString substr(size_type index, size_type num = npos) const { + // this could avoid the extra copy if we used a private specialty constructor + dstring tmpData = m_data.substr( index, num ); + UTFString tmp; + tmp.m_data.swap( tmpData ); + return tmp; + } + //! appends \a val to the end of the string + inline void push_back(unicode_char val) { + code_point cp[2] = { 0, 0 }; + size_t c = _utf32_to_utf16( val, cp ); + if ( c > 0 ) push_back( cp[0] ); + if ( c > 1 ) push_back( cp[1] ); + } +#if CC_IS_NATIVE_WCHAR_T + //! appends \a val to the end of the string + inline void push_back(wchar_t val) { + // we do this because the Unicode method still preserves UTF-16 code points + m_data.push_back(static_cast(val)); + } +#endif + //! appends \a val to the end of the string + /*! This can be used to push surrogate pair code points, you'll just need to push them + one after the other. */ + inline void push_back(code_point val) { m_data.push_back( val ); } + //! appends \a val to the end of the string + /*! Limited to characters under the 127 value barrier. */ + inline void push_back(char val) { m_data.push_back( static_cast( val ) ); } + //! returns \c true if the given Unicode character \a ch is in this string + inline bool inString(unicode_char ch) const { + const_iterator i, ie = end(); + for ( i = begin(); i != ie; i.moveNext() ) { + if ( i.getCharacter() == ch ) + return true; + } + return false; + } + + ////////////////////////////////////////////////////////////////////////// + // Stream variations + + //! returns the current string in UTF-8 form within a std::string + inline const String& asUTF8() const + { + _load_buffer_UTF8(); + return *m_buff.m_strBuff; + } + + //! returns the current string in UTF-8 form as a nul-terminated char array + inline const char* asUTF8_c_str() const + { + _load_buffer_UTF8(); + return m_buff.m_strBuff->c_str(); + } + + //! returns the current string in the native form of std::wstring + inline const WString& asWStr() const + { + _load_buffer_WStr(); + return *m_buff.m_wstrBuff; + } + + //! returns the current string in the native form of a nul-terminated wchar_t array + inline const wchar_t* asWStr_c_str() const + { + _load_buffer_WStr(); + return m_buff.m_wstrBuff->c_str(); + } + + ////////////////////////////////////////////////////////////////////////// + // Single Character Access + + //! returns a reference to the element in the string at index \c loc + inline code_point& at( size_type loc ) { return m_data.at( loc ); } + //! returns a reference to the element in the string at index \c loc + inline const code_point& at( size_type loc ) const { return m_data.at( loc ); } + //! returns the data point \a loc evaluated as a UTF-32 value + /*! This function will will only properly decode surrogate pairs when \a loc points to the index + of a lead code point that is followed by a trailing code point. Evaluating the trailing code point + itself, or pointing to a code point that is a sentinel value (part of a broken pair) will return + the value of just that code point (not a valid Unicode value, but useful as a sentinel value). */ + unicode_char getChar( size_type loc ) const; + + //! sets the value of the character at \a loc to the Unicode value \a ch (UTF-32) + /*! Providing sentinel values (values between U+D800-U+DFFF) are accepted, but you should be aware + that you can also unwittingly create a valid surrogate pair if you don't pay attention to what you + are doing. @note This operation may also lengthen the string if a surrogate pair is needed to + represent the value given, but one is not available to replace; or alternatively shorten the string + if an existing surrogate pair is replaced with a character that is representable without a surrogate + pair. The return value will signify any lengthening or shortening performed, returning 0 if no change + was made, -1 if the string was shortened, or 1 if the string was lengthened. Any single call can + only change the string length by + or - 1. */ + int setChar( size_type loc, unicode_char ch ); + + ////////////////////////////////////////////////////////////////////////// + // iterator acquisition + + //! returns an iterator to the first element of the string + inline iterator begin() + { + iterator i; + i.iter_ = m_data.begin(); + i.string_ = this; + return i; + } + //! returns an iterator to the first element of the string + inline const_iterator begin() const + { + const_iterator i; + i.iter_ = const_cast(this)->m_data.begin(); + i.string_ = const_cast(this); + return i; + } + //! returns an iterator just past the end of the string + inline iterator end() + { + iterator i; + i.iter_ = m_data.end(); + i.string_ = this; + return i; + } + //! returns an iterator just past the end of the string + inline const_iterator end() const + { + const_iterator i; + i.iter_ = const_cast(this)->m_data.end(); + i.string_ = const_cast(this); + return i; + } + //! returns a reverse iterator to the last element of the string + inline reverse_iterator rbegin() + { + reverse_iterator i; + i.iter_ = m_data.end(); + i.string_ = this; + return i; + } + //! returns a reverse iterator to the last element of the string + inline const_reverse_iterator rbegin() const + { + const_reverse_iterator i; + i.iter_ = const_cast(this)->m_data.end(); + i.string_ = const_cast(this); + return i; + } + //! returns a reverse iterator just past the beginning of the string + inline reverse_iterator rend() + { + reverse_iterator i; + i.iter_ = m_data.begin(); + i.string_ = this; + return i; + } + //! returns a reverse iterator just past the beginning of the string + inline const_reverse_iterator rend() const { + const_reverse_iterator i; + i.iter_ = const_cast(this)->m_data.begin(); + i.string_ = const_cast(this); + return i; + } + + ////////////////////////////////////////////////////////////////////////// + // assign + + //! gives the current string the values from \a start to \a end + inline UTFString& assign( iterator start, iterator end ) { + m_data.assign(start.iter_, end.iter_); + return *this; + } + + //! assign \a str to the current string + inline UTFString& assign( const UTFString& str ) { + m_data.assign(str.m_data); + return *this; + } + + //! assign the nul-terminated \a str to the current string + inline UTFString& assign( const code_point* str ) { + m_data.assign( str ); + return *this; + } + + //! assign the first \a num characters of \a str to the current string + inline UTFString& assign( const code_point* str, size_type num ) { + m_data.assign( str, num ); + return *this; + } + + //! assign \a len entries from \a str to the current string, starting at \a index + inline UTFString& assign( const UTFString& str, size_type index, size_type len ) { + m_data.assign( str.m_data, index, len ); + return *this; + } + + //! assign \a num copies of \a ch to the current string + inline UTFString& assign(size_type num, const code_point& ch) { + m_data.assign(num, ch); + return *this; + } + + //! assign \a str to the current string (\a str is treated as a UTF-8 stream) + UTFString& assign(const String& str); + //! assign \a wstr to the current string (\a wstr is treated as a UTF-16 stream) + UTFString& assign(const WString& wstr); + +#if CC_IS_NATIVE_WCHAR_T + //! assign \a w_str to the current string + inline UTFString& assign(const wchar_t* w_str) { + WString tmp(w_str); + return assign( tmp ); + } + + //! assign the first \a num characters of \a w_str to the current string + inline UTFString& assign(const wchar_t* w_str, size_type num) { + WString tmp(w_str, num); + return assign( tmp ); + } +#endif + + //! assign \a c_str to the current string (\a c_str is treated as a UTF-8 stream) + inline UTFString& assign( const char* c_str ) { + String tmp( c_str ); + return assign( tmp ); + } + + //! assign the first \a num characters of \a c_str to the current string (\a c_str is treated as a UTF-8 stream) + inline UTFString& assign( const char* c_str, size_type num ) { + String tmp(c_str, num); + return assign( tmp ); + } + + ////////////////////////////////////////////////////////////////////////// + // append + + //! appends \a str on to the end of the current string + inline UTFString& append(const UTFString& str) { m_data.append(str.m_data); return *this; } + //! appends \a str on to the end of the current string + inline UTFString& append(const code_point* str) { m_data.append(str); return *this; } + //! appends a substring of \a str starting at \a index that is \a len characters long on to the end of the current string + inline UTFString& append(const UTFString& str, size_type index, size_type len) { m_data.append( str.m_data, index, len ); return *this; } + //! appends \a num characters of \a str on to the end of the current string + inline UTFString& append(const code_point* str, size_type num) { m_data.append( str, num ); return *this; } + //! appends \a num repetitions of \a ch on to the end of the current string + inline UTFString& append(size_type num, code_point ch) { m_data.append( num, ch ); return *this; } + //! appends the sequence denoted by \a start and \a end on to the end of the current string + inline UTFString& append(iterator start, iterator end) { m_data.append( start.iter_, end.iter_ ); return *this; } +#if CC_IS_NATIVE_WCHAR_T + //! appends \a num characters of \a str on to the end of the current string + inline UTFString& append(const wchar_t* w_str, size_type num) { WString tmp( w_str, num ); return append( tmp ); } + //! appends \a num repetitions of \a ch on to the end of the current string + inline UTFString& append(size_type num, wchar_t ch) { return append( num, static_cast( ch ) ); } +#endif + //! appends \a num characters of \a str on to the end of the current string (UTF-8 encoding) + inline UTFString& append(const char* c_str, size_type num) { + UTFString tmp( c_str, num ); + append( tmp ); + return *this; + } + + //! appends \a num repetitions of \a ch on to the end of the current string (Unicode values less than 128) + inline UTFString& append(size_type num, char ch) { + append( num, static_cast( ch ) ); + return *this; + } + + //! appends \a num repetitions of \a ch on to the end of the current string (Full Unicode spectrum) + UTFString& append( size_type num, unicode_char ch ); + + ////////////////////////////////////////////////////////////////////////// + // insert + + //! inserts \a ch before the code point denoted by \a i + inline iterator insert(iterator i, const code_point& ch) { + iterator ret; + ret.iter_ = m_data.insert(i.iter_, ch); + ret.string_ = this; + return ret; + } + + //! inserts \a str into the current string, at location \a index + inline UTFString& insert(size_type index, const UTFString& str) { + m_data.insert( index, str.m_data ); + return *this; + } + + //! inserts \a str into the current string, at location \a index + inline UTFString& insert(size_type index, const code_point* str) { + m_data.insert( index, str ); + return *this; + } + //! inserts a substring of \a str (starting at \a index2 and \a num code points long) into the current string, at location \a index1 + inline UTFString& insert(size_type index1, const UTFString& str, size_type index2, size_type num) { + m_data.insert( index1, str.m_data, index2, num ); + return *this; + } + + //! inserts the code points denoted by \a start and \a end into the current string, before the code point specified by \a i + inline void insert(iterator i, iterator start, iterator end) { m_data.insert( i.iter_, start.iter_, end.iter_ ); } + + //! inserts \a num code points of \a str into the current string, at location \a index + inline UTFString& insert(size_type index, const code_point* str, size_type num) { + m_data.insert(index, str, num); + return *this; + } + +#if CC_IS_NATIVE_WCHAR_T + //! inserts \a num code points of \a str into the current string, at location \a index + inline UTFString& insert(size_type index, const wchar_t* w_str, size_type num) { + UTFString tmp(w_str, num); + insert(index, tmp); + return *this; + } +#endif + //! inserts \a num code points of \a str into the current string, at location \a index + inline UTFString& insert(size_type index, const char* c_str, size_type num) { + UTFString tmp(c_str, num); + insert(index, tmp); + return *this; + } + + //! inserts \a num copies of \a ch into the current string, at location \a index + inline UTFString& insert(size_type index, size_type num, code_point ch) { + m_data.insert( index, num, ch ); + return *this; + } + +#if CC_IS_NATIVE_WCHAR_T + //! inserts \a num copies of \a ch into the current string, at location \a index + inline UTFString& insert(size_type index, size_type num, wchar_t ch) { + insert( index, num, static_cast( ch ) ); + return *this; + } +#endif + //! inserts \a num copies of \a ch into the current string, at location \a index + inline UTFString& insert( size_type index, size_type num, char ch ) + { + insert( index, num, static_cast( ch ) ); + return *this; + } + + //! inserts \a num copies of \a ch into the current string, at location \a index + UTFString& insert( size_type index, size_type num, unicode_char ch ); + + //! inserts \a num copies of \a ch into the current string, before the code point denoted by \a i + inline void insert(iterator i, size_type num, const code_point& ch) { m_data.insert(i.iter_, num, ch ); } + +#if CC_IS_NATIVE_WCHAR_T + //! inserts \a num copies of \a ch into the current string, before the code point denoted by \a i + inline void insert(iterator i, size_type num, const wchar_t& ch) { insert(i, num, static_cast(ch)); } +#endif + + //! inserts \a num copies of \a ch into the current string, before the code point denoted by \a i + inline void insert(iterator i, size_type num, const char& ch) { insert( i, num, static_cast(ch)); } + //! inserts \a num copies of \a ch into the current string, before the code point denoted by \a i + void insert(iterator i, size_type num, const unicode_char& ch); + + ////////////////////////////////////////////////////////////////////////// + // erase + + //! removes the code point pointed to by \a loc, returning an iterator to the next character + inline iterator erase( iterator loc ) { + iterator ret; + ret.iter_ = m_data.erase(loc.iter_); + ret.string_ = this; + return ret; + } + //! removes the code points between \a start and \a end (including the one at \a start but not the one at \a end), returning an iterator to the code point after the last code point removed + inline iterator erase(iterator start, iterator last) { + iterator ret; + ret.iter_ = m_data.erase(start.iter_, last.iter_); + ret.string_ = this; + return ret; + } + //! removes \a num code points from the current string, starting at \a index + inline UTFString& erase(size_type index = 0, size_type num = npos) { + if (num == npos) + m_data.erase(index); + else + m_data.erase(index, num); + return *this; + } + + ////////////////////////////////////////////////////////////////////////// + // replace + + //! replaces up to \a num1 code points of the current string (starting at \a index1) with \a str + inline UTFString& replace(size_type index1, size_type num1, const UTFString& str) { + m_data.replace(index1, num1, str.m_data, 0, npos); + return *this; + } + + //! replaces up to \a num1 code points of the current string (starting at \a index1) with up to \a num2 code points from \a str + inline UTFString& replace(size_type index1, size_type num1, const UTFString& str, size_type num2) { + m_data.replace(index1, num1, str.m_data, 0, num2); + return *this; + } + + //! replaces up to \a num1 code points of the current string (starting at \a index1) with up to \a num2 code points from \a str beginning at \a index2 + inline UTFString& replace(size_type index1, size_type num1, const UTFString& str, size_type index2, size_type num2) { + m_data.replace(index1, num1, str.m_data, index2, num2); + return *this; + } + + //! replaces code points in the current string from \a start to \a end with \a num code points from \a str + inline UTFString& replace(iterator start, iterator end, const UTFString& str, size_type num = npos) { + _const_fwd_iterator st(start); //Work around for gcc, allow it to find correct overload + + size_type index1 = begin() - st; + size_type num1 = end - st; + return replace( index1, num1, str, 0, num ); + } + + //! replaces up to \a num1 code points in the current string (beginning at \a index) with \c num2 copies of \c ch + inline UTFString& replace(size_type index, size_type num1, size_type num2, code_point ch) { + m_data.replace( index, num1, num2, ch ); + return *this; + } + + //! replaces the code points in the current string from \a start to \a end with \a num copies of \a ch + inline UTFString& replace(iterator start, iterator end, size_type num, code_point ch) { + _const_fwd_iterator st(start); //Work around for gcc, allow it to find correct overload + size_type index1 = begin() - st; + size_type num1 = end - st; + return replace( index1, num1, num, ch ); + } + + ////////////////////////////////////////////////////////////////////////// + // compare + + //! compare \a str to the current string + inline int compare(const UTFString& str) const { return m_data.compare( str.m_data ); } + //! compare \a str to the current string + inline int compare(const code_point* str) const { return m_data.compare( str ); } + //! compare \a str to a substring of the current string, starting at \a index for \a length characters + inline int compare(size_type index, size_type length, const UTFString& str) const { return m_data.compare( index, length, str.m_data ); } + //! compare a substring of \a str to a substring of the current string, where \a index2 and \a length2 refer to \a str and \a index and \a length refer to the current string + inline int compare(size_type index, size_type length, const UTFString& str, size_type index2, size_type length2) const { return m_data.compare( index, length, str.m_data, index2, length2 ); } + //! compare a substring of \a str to a substring of the current string, where the substring of \a str begins at zero and is \a length2 characters long, and the substring of the current string begins at \a index and is \a length characters long + inline int compare(size_type index, size_type length, const code_point* str, size_type length2) const { return m_data.compare( index, length, str, length2 ); } +#if CC_IS_NATIVE_WCHAR_T + //! compare a substring of \a str to a substring of the current string, where the substring of \a str begins at zero and is \a length2 elements long, and the substring of the current string begins at \a index and is \a length characters long + inline int compare(size_type index, size_type length, const wchar_t* w_str, size_type length2) const { + UTFString tmp(w_str, length2); + return compare( index, length, tmp ); + } +#endif + //! compare a substring of \a str to a substring of the current string, where the substring of \a str begins at zero and is \a length2 UTF-8 code points long, and the substring of the current string begins at \a index and is \a length characters long + inline int compare(size_type index, size_type length, const char* c_str, size_type length2) const { + UTFString tmp(c_str, length2); + return compare(index, length, tmp); + } + + ////////////////////////////////////////////////////////////////////////// + // find & rfind + + //! returns the index of the first occurrence of \a str within the current string, starting at \a index; returns \c UTFString::npos if nothing is found + /*! \a str is a UTF-16 encoded string, but through implicit casting can also be a UTF-8 encoded string (const char* or std::string) */ + inline size_type find(const UTFString& str, size_type index = 0) const { return m_data.find(str.c_str(), index); } + //! returns the index of the first occurrence of \a str within the current string and within \a length code points, starting at \a index; returns \c UTFString::npos if nothing is found + /*! \a cp_str is a UTF-16 encoded string */ + inline size_type find(const code_point* cp_str, size_type index, size_type length) const { + UTFString tmp( cp_str ); + return m_data.find( tmp.c_str(), index, length ); + } + //! returns the index of the first occurrence of \a str within the current string and within \a length code points, starting at \a index; returns \c UTFString::npos if nothing is found + /*! \a cp_str is a UTF-8 encoded string */ + inline size_type find(const char* c_str, size_type index, size_type length) const { + UTFString tmp( c_str ); + return m_data.find( tmp.c_str(), index, length ); + } +#if CC_IS_NATIVE_WCHAR_T + //! returns the index of the first occurrence of \a str within the current string and within \a length code points, starting at \a index; returns \c UTFString::npos if nothing is found + /*! \a cp_str is a UTF-16 encoded string */ + inline size_type find(const wchar_t* w_str, size_type index, size_type length) const { + UTFString tmp( w_str ); + return m_data.find( tmp.c_str(), index, length ); + } +#endif + //! returns the index of the first occurrence \a ch within the current string, starting at \a index; returns \c UTFString::npos if nothing is found + /*! \a ch is only capable of representing Unicode values up to U+007F (127) */ + inline size_type find( char ch, size_type index = 0 ) const { return find( static_cast( ch ), index ); } + //! returns the index of the first occurrence \a ch within the current string, starting at \a index; returns \c UTFString::npos if nothing is found + /*! \a ch is only capable of representing Unicode values up to U+FFFF (65535) */ + inline size_type find(code_point ch, size_type index = 0) const { return m_data.find( ch, index ); } +#if CC_IS_NATIVE_WCHAR_T + //! returns the index of the first occurrence \a ch within the current string, starting at \a index; returns \c UTFString::npos if nothing is found + /*! \a ch is only capable of representing Unicode values up to U+FFFF (65535) */ + inline size_type find(wchar_t ch, size_type index = 0) const { return find( static_cast( ch ), index ); } +#endif + //! returns the index of the first occurrence \a ch within the current string, starting at \a index; returns \c UTFString::npos if nothing is found + /*! \a ch can fully represent any Unicode character */ + inline size_type find(unicode_char ch, size_type index = 0) const { + code_point cp[3] = {0, 0, 0}; + size_t l = _utf32_to_utf16( ch, cp ); + return find( UTFString( cp, l ), index ); + } + + //! returns the location of the first occurrence of \a str in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found + inline size_type rfind(const UTFString& str, size_type index = 0) const { return m_data.rfind( str.c_str(), index ); } + //! returns the location of the first occurrence of \a str in the current string, doing a reverse search from \a index, searching at most \a num characters; returns \c UTFString::npos if nothing is found + inline size_type rfind(const code_point* cp_str, size_type index, size_type num) const { + UTFString tmp( cp_str ); + return m_data.rfind( tmp.c_str(), index, num ); + } + //! returns the location of the first occurrence of \a str in the current string, doing a reverse search from \a index, searching at most \a num characters; returns \c UTFString::npos if nothing is found + inline size_type rfind(const char* c_str, size_type index, size_type num) const { + UTFString tmp(c_str); + return m_data.rfind(tmp.c_str(), index, num); + } +#if CC_IS_NATIVE_WCHAR_T + //! returns the location of the first occurrence of \a str in the current string, doing a reverse search from \a index, searching at most \a num characters; returns \c UTFString::npos if nothing is found + inline size_type rfind(const wchar_t* w_str, size_type index, size_type num) const { + UTFString tmp( w_str ); + return m_data.rfind( tmp.c_str(), index, num ); + } +#endif + //! returns the location of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found + inline size_type rfind(char ch, size_type index = 0) const { return rfind( static_cast(ch), index); } + //! returns the location of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found + inline size_type rfind(code_point ch, size_type index) const { return m_data.rfind(ch, index); } +#if CC_IS_NATIVE_WCHAR_T + //! returns the location of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found + inline size_type rfind(wchar_t ch, size_type index = 0) const { return rfind( static_cast( ch ), index ); } +#endif + //! returns the location of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found + inline size_type rfind(unicode_char ch, size_type index = 0) const { + code_point cp[3] = {0, 0, 0}; + size_t l = _utf32_to_utf16( ch, cp ); + return rfind( UTFString( cp, l ), index ); + } + + ////////////////////////////////////////////////////////////////////////// + //! find_first/last_(not)_of + + //! Returns the index of the first character within the current string that matches \b any character in \a str, beginning the search at \a index and searching at most \a num characters; returns \c UTFString::npos if nothing is found + size_type find_first_of(const UTFString &str, size_type index = 0, size_type num = npos) const; + //! returns the index of the first occurrence of \a ch in the current string, starting the search at \a index; returns \c UTFString::npos if nothing is found + inline size_type find_first_of(code_point ch, size_type index = 0) const { + UTFString tmp; + tmp.assign( 1, ch ); + return find_first_of( tmp, index ); + } + //! returns the index of the first occurrence of \a ch in the current string, starting the search at \a index; returns \c UTFString::npos if nothing is found + inline size_type find_first_of(char ch, size_type index = 0) const { return find_first_of( static_cast( ch ), index ); } +#if CC_IS_NATIVE_WCHAR_T + //! returns the index of the first occurrence of \a ch in the current string, starting the search at \a index; returns \c UTFString::npos if nothing is found + inline size_type find_first_of(wchar_t ch, size_type index = 0) const { return find_first_of( static_cast( ch ), index ); } +#endif + //! returns the index of the first occurrence of \a ch in the current string, starting the search at \a index; returns \c UTFString::npos if nothing is found + inline size_type find_first_of( unicode_char ch, size_type index = 0 ) const + { + code_point cp[3] = {0, 0, 0}; + size_t l = _utf32_to_utf16( ch, cp ); + return find_first_of( UTFString( cp, l ), index ); + } + + //! returns the index of the first character within the current string that does not match any character in \a str, beginning the search at \a index and searching at most \a num characters; returns \c UTFString::npos if nothing is found + size_type find_first_not_of(const UTFString& str, size_type index = 0, size_type num = npos) const; + //! returns the index of the first character within the current string that does not match \a ch, starting the search at \a index; returns \c UTFString::npos if nothing is found + inline size_type find_first_not_of(code_point ch, size_type index = 0) const + { + UTFString tmp; + tmp.assign( 1, ch ); + return find_first_not_of(tmp, index); + } + //! returns the index of the first character within the current string that does not match \a ch, starting the search at \a index; returns \c UTFString::npos if nothing is found + inline size_type find_first_not_of(char ch, size_type index = 0) const { return find_first_not_of( static_cast( ch ), index ); } +#if CC_IS_NATIVE_WCHAR_T + //! returns the index of the first character within the current string that does not match \a ch, starting the search at \a index; returns \c UTFString::npos if nothing is found + inline size_type find_first_not_of(wchar_t ch, size_type index = 0) const { return find_first_not_of( static_cast( ch ), index ); } +#endif + //! returns the index of the first character within the current string that does not match \a ch, starting the search at \a index; returns \c UTFString::npos if nothing is found + inline size_type find_first_not_of(unicode_char ch, size_type index = 0) const + { + code_point cp[3] = {0, 0, 0}; + size_t l = _utf32_to_utf16( ch, cp ); + return find_first_not_of( UTFString( cp, l ), index ); + } + + //! returns the index of the first character within the current string that matches any character in \a str, doing a reverse search from \a index and searching at most \a num characters; returns \c UTFString::npos if nothing is found + size_type find_last_of(const UTFString& str, size_type index = npos, size_type num = npos) const; + + //! returns the index of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found + inline size_type find_last_of(code_point ch, size_type index = npos) const + { + UTFString tmp; + tmp.assign( 1, ch ); + return find_last_of(tmp, index); + } + + //! returns the index of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found + inline size_type find_last_of(char ch, size_type index = npos) const { return find_last_of( static_cast( ch ), index ); } + +#if CC_IS_NATIVE_WCHAR_T + //! returns the index of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found + inline size_type find_last_of( wchar_t ch, size_type index = npos ) const { return find_last_of( static_cast( ch ), index ); } +#endif + //! returns the index of the first occurrence of \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found + inline size_type find_last_of( unicode_char ch, size_type index = npos ) const { + code_point cp[3] = {0, 0, 0}; + size_t l = _utf32_to_utf16( ch, cp ); + return find_last_of( UTFString( cp, l ), index ); + } + + //! returns the index of the last character within the current string that does not match any character in \a str, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found + size_type find_last_not_of(const UTFString& str, size_type index = npos, size_type num = npos) const; + + //! returns the index of the last occurrence of a character that does not match \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found + inline size_type find_last_not_of(code_point ch, size_type index = npos) const { + UTFString tmp; + tmp.assign( 1, ch ); + return find_last_not_of( tmp, index ); + } + + //! returns the index of the last occurrence of a character that does not match \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found + inline size_type find_last_not_of(char ch, size_type index = npos) const { return find_last_not_of( static_cast( ch ), index ); } + +#if CC_IS_NATIVE_WCHAR_T + //! returns the index of the last occurrence of a character that does not match \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found + inline size_type find_last_not_of(wchar_t ch, size_type index = npos) const { return find_last_not_of( static_cast( ch ), index ); } +#endif + //! returns the index of the last occurrence of a character that does not match \a ch in the current string, doing a reverse search from \a index; returns \c UTFString::npos if nothing is found + inline size_type find_last_not_of(unicode_char ch, size_type index = npos) const { + code_point cp[3] = {0, 0, 0}; + size_t l = _utf32_to_utf16( ch, cp ); + return find_last_not_of( UTFString( cp, l ), index ); + } + + ////////////////////////////////////////////////////////////////////////// + // Operators + + //! less than operator + inline bool operator<( const UTFString& right ) const { return compare( right ) < 0; } + //! less than or equal operator + inline bool operator<=( const UTFString& right ) const { return compare( right ) <= 0; } + //! greater than operator + inline bool operator>( const UTFString& right ) const { return compare( right ) > 0; } + //! greater than or equal operator + inline bool operator>=( const UTFString& right ) const { return compare( right ) >= 0; } + //! equality operator + inline bool operator==( const UTFString& right ) const { return compare( right ) == 0; } + //! inequality operator + inline bool operator!=( const UTFString& right ) const { return !operator==( right ); } + //! assignment operator, implicitly casts all compatible types + inline UTFString& operator=( const UTFString& s ) { return assign( s ); } + //! assignment operator + inline UTFString& operator=( code_point ch ) { + clear(); + return append( 1, ch ); + } + //! assignment operator + inline UTFString& operator=( char ch ) { + clear(); + return append( 1, ch ); + } +#if CC_IS_NATIVE_WCHAR_T + //! assignment operator + inline UTFString& operator=( wchar_t ch ) { + clear(); + return append( 1, ch ); + } +#endif + //! assignment operator + inline UTFString& operator=( unicode_char ch ) { + clear(); + return append( 1, ch ); + } + //! code point dereference operator + inline code_point& operator[]( size_type index ) { return at( index ); } + //! code point dereference operator + inline const code_point& operator[]( size_type index ) const{ return at( index ); } + + ////////////////////////////////////////////////////////////////////////// + // Implicit Cast Operators + + //! implicit cast to string + inline operator String() const { return String(asUTF8()); } + //! implicit cast to wstring + inline operator WString() const { return WString(asWStr()); } + + ////////////////////////////////////////////////////////////////////////// + // UTF-16 character encoding/decoding + + //! returns \c true if \a cp does not match the signature for the lead of follow code point of a surrogate pair in a UTF-16 sequence + inline static bool _utf16_independent_char( code_point cp ) { + /* + if ( 0xD800 <= cp && cp <= 0xDFFF ) // tests if the cp is within the surrogate pair range + return false; // it matches a surrogate pair signature + return true; // everything else is a standalone code point + */ + return ( 0xD800 > cp || cp > 0xDFFF ); + } + + //! returns \c true if \a cp matches the signature of a surrogate pair lead character + inline static bool _utf16_surrogate_lead( code_point cp ) { + /* + if ( 0xD800 <= cp && cp <= 0xDBFF ) // tests if the cp is within the 2nd word of a surrogate pair + return true; // it is a 1st word + return false; // it isn't + */ + + return ( 0xD800 <= cp && cp <= 0xDBFF ); + } + + //! returns \c true if \a cp matches the signature of a surrogate pair following character + inline static bool _utf16_surrogate_follow( code_point cp ) { + /* + if ( 0xDC00 <= cp && cp <= 0xDFFF ) // tests if the cp is within the 2nd word of a surrogate pair + return true; // it is a 2nd word + return false; // everything else isn't + */ + + return ( 0xDC00 <= cp && cp <= 0xDFFF ); + } + + //! estimates the number of UTF-16 code points in the sequence starting with \a cp + inline static size_t _utf16_char_length( code_point cp ) { + /* + if ( 0xD800 <= cp && cp <= 0xDBFF ) // test if cp is the beginning of a surrogate pair + return 2; // if it is, then we are 2 words long + return 1; // otherwise we are only 1 word long + */ + + return ( 0xD800 <= cp && cp <= 0xDBFF )? 2 : 1; + } + + //! returns the number of UTF-16 code points needed to represent the given UTF-32 character \a cp + inline static size_t _utf16_char_length( unicode_char uc ) { + /* + if ( uc > 0xFFFF ) // test if uc is greater than the single word maximum + return 2; // if so, we need a surrogate pair + return 1; // otherwise we can stuff it into a single word + */ + + return ( uc > 0xFFFF ? 2 : 1); + } + + //! converts the given UTF-16 character buffer \a in_cp to a single UTF-32 Unicode character \a out_uc, returns the number of code points used to create the output character (2 for surrogate pairs, otherwise 1) + /*! This function does it's best to prevent error conditions, verifying complete + surrogate pairs before applying the algorithm. In the event that half of a pair + is found it will happily generate a value in the 0xD800 - 0xDFFF range, which is + normally an invalid Unicode value but we preserve them for use as sentinel values. */ + static size_t _utf16_to_utf32( const code_point in_cp[2], unicode_char& out_uc ); + + //! writes the given UTF-32 \a uc_in to the buffer location \a out_cp using UTF-16 encoding, returns the number of code points used to encode the input (always 1 or 2) + /*! This function, like its counterpart, will happily create invalid UTF-16 surrogate pairs. These + invalid entries will be created for any value of \c in_uc that falls in the range U+D800 - U+DFFF. + These are generally useful as sentinel values to represent various program specific conditions. + @note This function will also pass through any single UTF-16 code point without modification, + making it a safe method of ensuring a stream that is unknown UTF-32 or UTF-16 is truly UTF-16.*/ + static size_t _utf32_to_utf16( const unicode_char& in_uc, code_point out_cp[2] ); + + ////////////////////////////////////////////////////////////////////////// + // UTF-8 character encoding/decoding + + //! returns \c true if \a cp is the beginning of a UTF-8 sequence + inline static bool _utf8_start_char( unsigned char cp ) { return ( cp & ~_cont_mask ) != _cont; } + + //! estimates the number of UTF-8 code points in the sequence starting with \a cp + static size_t _utf8_char_length( unsigned char cp ); + //! returns the number of UTF-8 code points needed to represent the given UTF-32 character \a cp + static size_t _utf8_char_length( unicode_char uc ); + + //! converts the given UTF-8 character buffer to a single UTF-32 Unicode character, returns the number of bytes used to create the output character (maximum of 6) + static size_t _utf8_to_utf32( const unsigned char in_cp[6], unicode_char& out_uc ); + //! writes the given UTF-32 \a uc_in to the buffer location \a out_cp using UTF-8 encoding, returns the number of bytes used to encode the input + static size_t _utf32_to_utf8( const unicode_char& in_uc, unsigned char out_cp[6] ); + + //! verifies a UTF-8 stream, returning the total number of Unicode characters found + inline static size_type _verifyUTF8( const unsigned char* c_str ) + { + String tmp( reinterpret_cast( c_str ) ); + return _verifyUTF8( tmp ); + } + + //! verifies a UTF-8 stream, returning the total number of Unicode characters found + static size_type _verifyUTF8( const String& str ); + +private: + //template friend class _iterator; + dstring m_data; + + //! buffer data type identifier + enum BufferType + { + BT_NONE, + BT_STR, + BT_WSTR, + }; + + //! common constructor operations + inline void _init() + { + m_buff.m_voidBuff = 0; + m_buffType = BT_NONE; + m_buffSize = 0; + } + + /////////////////////////////////////////////////////////////////////// + // Scratch buffer + //! auto cleans the scratch buffer using the proper delete for the stored type + void _cleanBuffer() const; + + //! create a std::string in the scratch buffer area + void _getBufferStr() const; + //! create a std::wstring in the scratch buffer area + void _getBufferWStr() const; + + void _load_buffer_UTF8() const; + void _load_buffer_WStr() const; + void _load_buffer_UTF32() const; + + mutable BufferType m_buffType; // identifies the data type held in mBuffer + mutable size_t m_buffSize; // size of the CString buffer + + // multi-purpose buffer used everywhere we need a throw-away buffer + union + { + mutable void* m_voidBuff; + mutable String* m_strBuff; + mutable WString* m_wstrBuff; + } m_buff; +}; + +////////////////////////////////////////////////////////////////////////// + +//! string addition operator \relates UTFString +inline UTFString operator+( const UTFString& s1, const UTFString& s2 ) { return UTFString( s1 ).append( s2 ); } +//! string addition operator \relates UTFString +inline UTFString operator+( const UTFString& s1, UTFString::code_point c ) { return UTFString( s1 ).append( 1, c ); } +//! string addition operator \relates UTFString +inline UTFString operator+( const UTFString& s1, UTFString::unicode_char c ) { return UTFString( s1 ).append( 1, c ); } +//! string addition operator \relates UTFString +inline UTFString operator+( const UTFString& s1, char c ) { return UTFString( s1 ).append( 1, c ); } + +#if CC_IS_NATIVE_WCHAR_T +//! string addition operator \relates UTFString +inline UTFString operator+( const UTFString& s1, wchar_t c ) { return UTFString( s1 ).append( 1, c ); } +#endif + +//! string addition operator \relates UTFString +inline UTFString operator+( UTFString::code_point c, const UTFString& s2 ) { return UTFString().append( 1, c ).append( s2 ); } +//! string addition operator \relates UTFString +inline UTFString operator+( UTFString::unicode_char c, const UTFString& s2 ) { return UTFString().append( 1, c ).append( s2 ); } +//! string addition operator \relates UTFString +inline UTFString operator+( char c, const UTFString& s2 ) { return UTFString().append( 1, c ).append( s2 ); } + +#if CC_IS_NATIVE_WCHAR_T +//! string addition operator \relates UTFString +inline UTFString operator+( wchar_t c, const UTFString& s2 ) { return UTFString().append( 1, c ).append( s2 ); } +#endif + +// (const) forward iterator common operators +inline UTFString::size_type operator-( const UTFString::_const_fwd_iterator& left, const UTFString::_const_fwd_iterator& right ) { return ( left.iter_ - right.iter_ ); } +inline bool operator==( const UTFString::_const_fwd_iterator& left, const UTFString::_const_fwd_iterator& right ) { return left.iter_ == right.iter_; } +inline bool operator!=( const UTFString::_const_fwd_iterator& left, const UTFString::_const_fwd_iterator& right ) { return left.iter_ != right.iter_; } +inline bool operator<( const UTFString::_const_fwd_iterator& left, const UTFString::_const_fwd_iterator& right ) { return left.iter_ < right.iter_; } +inline bool operator<=( const UTFString::_const_fwd_iterator& left, const UTFString::_const_fwd_iterator& right ) { return left.iter_ <= right.iter_; } +inline bool operator>( const UTFString::_const_fwd_iterator& left, const UTFString::_const_fwd_iterator& right ) { return left.iter_ > right.iter_; } +inline bool operator>=( const UTFString::_const_fwd_iterator& left, const UTFString::_const_fwd_iterator& right ) { return left.iter_ >= right.iter_; } + +// (const) reverse iterator common operators +// NB: many of these operations are evaluated in reverse because this is a reverse iterator wrapping a forward iterator +inline UTFString::size_type operator-( const UTFString::_const_rev_iterator& left, const UTFString::_const_rev_iterator& right ) { return ( right.iter_ - left.iter_ ); } +inline bool operator==( const UTFString::_const_rev_iterator& left, const UTFString::_const_rev_iterator& right ) { return left.iter_ == right.iter_; } +inline bool operator!=( const UTFString::_const_rev_iterator& left, const UTFString::_const_rev_iterator& right ) { return left.iter_ != right.iter_; } +inline bool operator<( const UTFString::_const_rev_iterator& left, const UTFString::_const_rev_iterator& right ) { return right.iter_ < left.iter_; } +inline bool operator<=( const UTFString::_const_rev_iterator& left, const UTFString::_const_rev_iterator& right ) { return right.iter_ <= left.iter_; } +inline bool operator>( const UTFString::_const_rev_iterator& left, const UTFString::_const_rev_iterator& right ) { return right.iter_ > left.iter_; } +inline bool operator>=( const UTFString::_const_rev_iterator& left, const UTFString::_const_rev_iterator& right ) { return right.iter_ >= left.iter_; } + +CC_NAMESPACE_END + +#endif // CC_CORE_KERNEL_UTF_STRING_H_ diff --git a/native/cocos/renderer/core/kernel/assertion.h b/native/cocos/renderer/core/kernel/assertion.h new file mode 100755 index 0000000000..25d6e19c6b --- /dev/null +++ b/native/cocos/renderer/core/kernel/assertion.h @@ -0,0 +1,32 @@ +#ifndef CC_CORE_KERNEL_ASSERTION_H_ +#define CC_CORE_KERNEL_ASSERTION_H_ + +CC_NAMESPACE_BEGIN + +//#if defined(__GNUC__) +#if 0 +#define LIKELY(x) (__builtin_expect(!!(x), 1)) +#define UNLIKELY(x) (__builtin_expect(!!(x), 0)) +#else +#define LIKELY(x) (x) +#define UNLIKELY(x) (x) +#endif + +CC_CORE_API int _ExecAssert(const char *condition, const char *fileName, int lineNumber, const char *formats, ...); +CC_CORE_API void _ExecAssertOutput(const char *condition, const char *fileName, int lineNumber, const char* msg); + +#if (CC_MODE == CC_MODE_DEBUG) +# if (CC_PLATFORM == CC_PLATFORM_WINDOWS) +# define CC_ASSERTS(x, formats, ...) if(UNLIKELY(!(x))) {if(cc::_ExecAssert(#x, __FILE__, __LINE__, formats, ##__VA_ARGS__)) __debugbreak();} +# else +# define CC_ASSERTS(x, formats, ...) if(UNLIKELY(!(x))) {cc::_ExecAssert(#x, __FILE__, __LINE__, formats, ##__VA_ARGS__); assert(x);} +# endif +#else +# define CC_ASSERTS(x, formats, ...) if(UNLIKELY(!(x))) {cc::_ExecAssertOutput(#x, __FILE__, __LINE__, "");} +#endif + +#define CC_ASSERT(x) CC_ASSERTS(x, "%s", "") + +CC_NAMESPACE_END + +#endif // CC_CORE_KERNEL_ASSERTION_H_ diff --git a/native/cocos/renderer/core/math/CCMath.cc b/native/cocos/renderer/core/math/CCMath.cc new file mode 100755 index 0000000000..ecafe6d493 --- /dev/null +++ b/native/cocos/renderer/core/math/CCMath.cc @@ -0,0 +1,156 @@ +#include "CoreStd.h" +#include "CCMath.h" + +CC_MATH_NAMESPACE_BEGIN + +const float PI = (float)(3.14159265358979323846264338327950288419716939937511);; +const float PI_2 = math::PI * 2.0f; +const float PI_DIV2 = math::PI * 0.5f; +const float PI_DIV3 = math::PI / 3.0f; +const float PI_DIV4 = math::PI / 4.0f; +const float PI_DIV5 = math::PI / 5.0f; +const float PI_DIV6 = math::PI / 6.0f; +const float PI_DIV8 = math::PI / 8.0f; +const float PI_SQR = (float)(9.86960440108935861883449099987615113531369940724079); +const float PI_INV = (float)(0.31830988618379067153776752674502872406891929148091); +const float EPSILON = std::numeric_limits::epsilon(); +const float LOW_EPSILON = (float)(1e-04); +const float POS_INFINITY = std::numeric_limits::infinity(); +const float NEG_INFINITY = -std::numeric_limits::infinity();; +const float LN2 = std::log(2.0f); +const float LN10 = std::log(10.0f); +const float LN2_INV = 1.0f / LN2; +const float LN10_INV = 1.0f / LN10; +const float DEG_TO_RAD = (float)0.01745329; +const float RAD_TO_DEG = (float)57.29577; +const float MIN_FLOAT = 1.175494351e-38F; +const float MAX_FLOAT = 3.402823466e+38F; + +const uint16_t CRC16_TABLE[256] = { + 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, + 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, + 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, + 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, + 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, + 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, + 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, + 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, + 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, + 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, + 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, + 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, + 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, + 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, + 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, + 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, + 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, + 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, + 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, + 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, + 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, + 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, + 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, + 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, + 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, + 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, + 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, + 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, + 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, + 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, + 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, + 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0 +}; + +const uint32_t CRC32_TABLE[] = { + 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, + 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, + 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, + 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, + 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, + 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, + 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, + 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, + 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, + 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A, + 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, + 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, + 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, + 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, + 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E, + 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, + 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, + 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, + 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, + 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, + 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, + 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, + 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010, + 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, + 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, + 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, + 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, + 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, + 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344, + 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, + 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, + 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, + 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, + 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C, + 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, + 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, + 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, + 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, + 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C, + 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, + 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, + 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242, + 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, + 0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, + 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278, + 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, + 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, + 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, + 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, + 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, + 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, + 0x2D02EF8D +}; + +CC_INLINE void CRCUpdateB(uint32_t& crc, uint8_t b) { + crc = CRC32_TABLE[(crc ^ b) & 0xFF] ^ (crc >> 8); +} + +uint32_t CRC32(const char* str) { + uint32_t crc = 0xFFFFFFFF; + size_t length = strlen(str); + + for (size_t i = 0; i < length; ++i) { + CRCUpdateB(crc, (uint8_t)str[i]); + } + + CRCUpdateB(crc, (uint8_t)length); + return crc; +} + +uint32_t CRC32NoCase(const char* str) { + uint32_t crc = 0xFFFFFFFF; + size_t length = strlen(str); + + for (size_t i = 0; i < length; ++i) { + CRCUpdateB(crc, (uint8_t)tolower((char)str[i])); + } + + CRCUpdateB(crc, (uint8_t)length); + return crc; +} + +uint16_t CRC16(const char* str) { + size_t length = strlen(str); + uint16_t crc = 0; + for (size_t i = 0; i < length; ++i) { + crc = (crc << 8) ^ CRC16_TABLE[((crc >> 8) ^ *str++) & 0x00FF]; + } + return crc; +} + +CC_MATH_NAMESPACE_END diff --git a/native/cocos/renderer/core/math/CCMath.h b/native/cocos/renderer/core/math/CCMath.h new file mode 100755 index 0000000000..16c4aa9f75 --- /dev/null +++ b/native/cocos/renderer/core/math/CCMath.h @@ -0,0 +1,66 @@ +#ifndef CC_CORE_MATH_CC_MATH_H_ +#define CC_CORE_MATH_CC_MATH_H_ + +#define CC_MATH_NAMESPACE_BEGIN namespace cc { namespace math { +#define CC_MATH_NAMESPACE_END }} + +CC_MATH_NAMESPACE_BEGIN + +extern CC_CORE_API const float PI; +extern CC_CORE_API const float PI_2; +extern CC_CORE_API const float PI_DIV2; +extern CC_CORE_API const float PI_DIV3; +extern CC_CORE_API const float PI_DIV4; +extern CC_CORE_API const float PI_DIV5; +extern CC_CORE_API const float PI_DIV6; +extern CC_CORE_API const float PI_DIV8; +extern CC_CORE_API const float PI_SQR; +extern CC_CORE_API const float PI_INV; +extern CC_CORE_API const float EPSILON; +extern CC_CORE_API const float LOW_EPSILON; +extern CC_CORE_API const float POS_INFINITY; +extern CC_CORE_API const float NEG_INFINITY; +extern CC_CORE_API const float LN2; +extern CC_CORE_API const float LN10; +extern CC_CORE_API const float LN2_INV; +extern CC_CORE_API const float LN10_INV; +extern CC_CORE_API const float DEG_TO_RAD; +extern CC_CORE_API const float RAD_TO_DEG; +extern CC_CORE_API const float MIN_FLOAT; +extern CC_CORE_API const float MAX_FLOAT; + +uint16_t CRC16(const char* str); +uint32_t CRC32(const char* str); +uint32_t CRC32NoCase(const char* str); + +template +inline T Abs(T x) { + return x > 0 ? x : -x; +} + +template +inline T Sgn(T x) { + return (x < T(0) ? T(-1) : (x > T(0) ? T(1) : T(0))); +} + +template +inline T Sqr(T x) { + return x * x; +} + +template +inline bool IsPowerOfTwo(T n) { + return (n & (n-1)) == 0; +} + +CC_INLINE bool IsEqualF(float lhs, float rhs, float precision = 0.000001f) { + return (Abs(lhs - rhs) < precision); +} + +CC_INLINE bool IsNotEqualF(float lhs, float rhs, float precision = 0.000001f) { + return (Abs(lhs - rhs) > precision); +} + +CC_MATH_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/core/memory/AllocatedObj.cc b/native/cocos/renderer/core/memory/AllocatedObj.cc new file mode 100755 index 0000000000..8edad15fa9 --- /dev/null +++ b/native/cocos/renderer/core/memory/AllocatedObj.cc @@ -0,0 +1,15 @@ +#include "CoreStd.h" +#include "MemDef.h" +#include "AllocatedObj.h" + +CC_NAMESPACE_BEGIN + +/* + The problem is that operator new/delete are *implicitly* static. We have to + instantiate them for each combination exactly once throughout all the compilation + units that are linked together, and this appears to be the only way to do it. + */ + +template class AllocatedObject; + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/core/memory/AllocatedObj.h b/native/cocos/renderer/core/memory/AllocatedObj.h new file mode 100755 index 0000000000..0f742a203a --- /dev/null +++ b/native/cocos/renderer/core/memory/AllocatedObj.h @@ -0,0 +1,79 @@ +#ifndef CC_CORE_ALLOCATED_OBJ_H_ +#define CC_CORE_ALLOCATED_OBJ_H_ + +// Anything that has done a #define new will screw operator new definitions up +// so undefine +#ifdef new +# undef new +#endif +#ifdef delete +# undef delete +#endif + +CC_NAMESPACE_BEGIN + +/** Superclass for all objects that wish to use custom memory allocators + when their new / delete operators are called. + Requires a template parameter identifying the memory allocator policy + to use (e.g. see StdAllocPolicy). + */ +template +class CC_CORE_API AllocatedObject +{ + public: + explicit AllocatedObject() {} + ~AllocatedObject() {} + + // operator new, with debug line info + void* operator new(size_t sz, const char *file, int line, const char *func) { + return Alloc::AllocateBytes(sz, file, line, func); + } + + /// array operator new, with debug line info + void* operator new[] ( size_t sz, const char *file, int line, const char *func ) { + return Alloc::AllocateBytes(sz, file, line, func); + } + + /// placement operator new + void* operator new(size_t sz, void *ptr) { + (void)sz; + return ptr; + } + +#if 1 + void* operator new(size_t sz) { + return Alloc::AllocateBytes(sz); + } + + void* operator new[]( size_t sz ) { + return Alloc::AllocateBytes(sz); + } +#endif + + void operator delete(void* ptr) { + Alloc::DeallocateBytes(ptr); + } + + // Corresponding operator for placement delete (second param same as the first) + void operator delete(void* ptr, void*) { + Alloc::DeallocateBytes(ptr); + } + + // only called if there is an exception in corresponding 'new' + void operator delete(void* ptr, const char*, int , const char*) { + Alloc::DeallocateBytes(ptr); + } + + void operator delete[](void *ptr) { + Alloc::DeallocateBytes(ptr); + } + + + void operator delete[](void* ptr, const char*, int, const char*) { + Alloc::DeallocateBytes(ptr); + } +}; + +CC_NAMESPACE_END + +#endif // CC_CORE_ALLOCATED_OBJ_H_ diff --git a/native/cocos/renderer/core/memory/JeAlloc.cc b/native/cocos/renderer/core/memory/JeAlloc.cc new file mode 100755 index 0000000000..99f7ff48c1 --- /dev/null +++ b/native/cocos/renderer/core/memory/JeAlloc.cc @@ -0,0 +1,153 @@ +#include "CoreStd.h" +#include "JeAlloc.h" +#include "MemTracker.h" + +#if (CC_MEMORY_ALLOCATOR == CC_MEMORY_ALLOCATOR_JEMALLOC) + +#include "jemalloc/jemalloc.h" +extern const char* je_malloc_conf = "narenas:4"; + +CC_NAMESPACE_BEGIN + +#ifdef CC_MEMORY_TRACKER +#define MEM_CHECKTAG_SIZE 4 +#define MEM_CHECKTAG 0x20170719 + +CC_INLINE static void CheckOverflowAlloc(void* ptr) { + size_t size = je_malloc_usable_size(ptr); + char* p = (char*)ptr + size - MEM_CHECKTAG_SIZE; + uint tag = MEM_CHECKTAG; + memcpy(p, &tag, MEM_CHECKTAG_SIZE); +} + +CC_INLINE static void CheckOverflowFree(void* ptr) { + size_t size = je_malloc_usable_size(ptr); + char* p = (char*)ptr + size - MEM_CHECKTAG_SIZE; + uint tag; + memcpy(&tag, p, MEM_CHECKTAG_SIZE); + CC_ASSERT(tag == MEM_CHECKTAG); +} + +#else +#define MEM_CHECKTAG_SIZE 0 +#endif + +CC_DECL_MALLOC void* JeAllocImpl::AllocBytes(size_t count, const char* file, int line, const char* func) { + void* ptr = je_malloc(count + MEM_CHECKTAG_SIZE); +#ifdef CC_MEMORY_TRACKER + CheckOverflowAlloc(ptr); + MemTracker::Instance()->RecordAlloc(ptr, count, file, line, func); +#else + // avoid unused params warning + (void)file; + (void)line; + (void)func; +#endif + return ptr; +} + +CC_DECL_MALLOC void* JeAllocImpl::ReallocBytes(void* ptr, size_t count, const char* file, int line, const char* func) { +#ifdef CC_MEMORY_TRACKER + if (ptr) + { + if(count == 0) { + CheckOverflowFree(ptr); + MemTracker::Instance()->RecordFree(ptr); + je_free(ptr); + return nullptr; + } else { + size_t oldsz = je_malloc_usable_size(ptr) - MEM_CHECKTAG_SIZE; + if (oldsz > count) oldsz = count; + + void* nptr = je_malloc(count + MEM_CHECKTAG_SIZE); + memcpy(nptr, ptr, oldsz); + CheckOverflowAlloc(nptr); + MemTracker::Instance()->RecordAlloc(nptr, count, file, line, func); + + CheckOverflowFree(ptr); + MemTracker::Instance()->RecordFree(ptr); + je_free(ptr); + return nptr; + } + } else { + if (count) { + ptr = je_malloc(count + MEM_CHECKTAG_SIZE); + CheckOverflowAlloc(ptr); + MemTracker::Instance()->RecordAlloc(ptr, count, file, line, func); + return ptr; + } else { + return nullptr; + } + } +#else + // avoid unused params warning + (void)file; + (void)line; + (void)func; + return je_realloc(ptr, count); +#endif +} + +CC_DECL_MALLOC void* JeAllocImpl::AllocBytesAligned(size_t align, size_t count, const char* file, int line, const char* func) { + // default to platform SIMD alignment if none specified + void* ptr = je_aligned_alloc(align, count + MEM_CHECKTAG_SIZE); +#ifdef COCOS_MEMORY_TRACKER + CheckOverflowAlloc(ptr); + MemTracker::Instance()->RecordAlloc(ptr, count, file, line, func); +#else + // avoid unused params warning + (void)file; + (void)line; + (void)func; +#endif + return ptr; +} + +void JeAllocImpl::DeallocBytes(void* ptr) { + // deal with null + if (!ptr) + return; +#ifdef CC_MEMORY_TRACKER + CheckOverflowFree(ptr); + MemTracker::Instance()->RecordFree(ptr); +#endif + je_free(ptr); +} + +struct JeDumpData { + char* buf; + int size; +}; + +static void JeStatsPrint(void* param, const char* msg) { + JeDumpData* jd = (JeDumpData*)param; + if (jd->size == 0) return; + + int len = (int)strlen(msg); + if (len > jd->size) len = jd->size; + memcpy(jd->buf, msg, len); + jd->buf[len] = 0; + jd->buf += len; + jd->size -= len; +} + +void JeAllocImpl::DumpStats(char* buf, int bufsize) { + JeDumpData jd; + jd.buf = buf; + jd.size = bufsize - 1; + je_malloc_stats_print(JeStatsPrint, &jd, "ma"); +} + +void JeAllocImpl::TrimAlloc() { + int narenas = 0; + size_t sz = sizeof(narenas); + je_mallctl("arenas.narenas", (void *)&narenas, &sz, nullptr, 0); + char buf[24]; + sprintf(buf, "arena.%d.purge", narenas); + printf("jemalloc trim: %s\n", buf); + je_mallctl(buf, NULL, NULL, NULL, 0); +} + +CC_NAMESPACE_END + +#endif // end - #ifdef CC_MEMORY_ALLOCATOR_JEMALLOC diff --git a/native/cocos/renderer/core/memory/JeAlloc.h b/native/cocos/renderer/core/memory/JeAlloc.h new file mode 100755 index 0000000000..5f90cc9ae1 --- /dev/null +++ b/native/cocos/renderer/core/memory/JeAlloc.h @@ -0,0 +1,60 @@ +#ifndef CC_JE_ALLOC_H_ +#define CC_JE_ALLOC_H_ + +#if (CC_MEMORY_ALLOCATOR == CC_MEMORY_ALLOCATOR_JEMALLOC) + +CC_NAMESPACE_BEGIN + +//Non-templated utility class just to hide jemalloc. +class CC_CORE_API JeAllocImpl { + public: + static CC_DECL_MALLOC void* AllocBytes(size_t count, const char* file, int line, const char* func); + static CC_DECL_MALLOC void* ReallocBytes(void* ptr, size_t count, const char* file, int line, const char *func); + static CC_DECL_MALLOC void* AllocBytesAligned(size_t align, size_t count, const char* file, int line, const char* func); + static void DeallocBytes(void* ptr); + static void DumpStats(char* buf, int bufsize); + static void TrimAlloc(); +}; + +/** An allocation policy for use with AllocatedObject and + STLAllocator. This is the class that actually does the allocation + and deallocation of physical memory, and is what you will want to + provide a custom version of if you wish to change how memory is allocated. + */ +class CC_CORE_API JeAllocPolicy { + public: + static CC_INLINE CC_DECL_MALLOC void* AllocateBytes(size_t count, const char* file = nullptr, int line = 0, const char* func = nullptr) { + return JeAllocImpl::AllocBytes(count, file, line, func); + } + + static CC_INLINE CC_DECL_MALLOC void* ReallocateBytes(void* ptr, size_t count, const char* file = nullptr, int line = 0, const char* func = nullptr) { + return JeAllocImpl::ReallocBytes(ptr, count, file, line, func); + } + + static CC_INLINE void DeallocateBytes(void* ptr) { + JeAllocImpl::DeallocBytes(ptr); + } + + static CC_INLINE CC_DECL_MALLOC void* AllocateBytesAligned(size_t alignment, size_t count, const char* file = nullptr, int line = 0, const char* func = nullptr) { + return JeAllocImpl::AllocBytesAligned(alignment, count, file, line, func); + } + + static CC_INLINE void DeallocateBytesAligned(void* ptr) { + JeAllocImpl::DeallocBytes(ptr); + } + + // Get the maximum size of a single allocation + static CC_INLINE size_t GetMaxAllocationSize() { + return (std::numeric_limits::max)(); + } + + private: + // No instantiation + JeAllocPolicy() {} +}; + +CC_NAMESPACE_END + +#endif // end - #ifdef COCOS_MEMORY_ALLOCATOR_JEMALLOC + +#endif // CC_JE_ALLOC_H_ diff --git a/native/cocos/renderer/core/memory/MemDef.h b/native/cocos/renderer/core/memory/MemDef.h new file mode 100755 index 0000000000..5320f1fe52 --- /dev/null +++ b/native/cocos/renderer/core/memory/MemDef.h @@ -0,0 +1,177 @@ +#ifndef CC_MEM_DEF_H_ +#define CC_MEM_DEF_H_ + +#include "AllocatedObj.h" +#include "StdAlloc.h" +#include "NedPooling.h" +#include "JeAlloc.h" + +CC_NAMESPACE_BEGIN + +#if (CC_MEMORY_ALLOCATOR == CC_MEMORY_ALLOCATOR_STD) + +// configure default allocators based on the options above +// notice how we're not using the memory categories here but still roughing them out +// in your allocators you might choose to create different policies per category + +// configurable category, for general malloc +// notice how we ignore the category here, you could specialize +class CategorisedAllocPolicy : public StdAllocPolicy {}; + +#elif (CC_MEMORY_ALLOCATOR == CC_MEMORY_ALLOCATOR_NEDPOOLING) + +// configure default allocators based on the options above +// notice how we're not using the memory categories here but still roughing them out +// in your allocators you might choose to create different policies per category + +// configurable category, for general malloc +// notice how we ignore the category here, you could specialize +class CategorisedAllocPolicy : public NedPoolingAllocPolicy {}; + +#elif (CC_MEMORY_ALLOCATOR == CC_MEMORY_ALLOCATOR_JEMALLOC) + +class CategorisedAllocPolicy : public JeAllocPolicy {}; + +#endif + + +// Useful shortcuts +typedef CategorisedAllocPolicy GAP; +typedef CategorisedAllocPolicy STLAP; + +// Containers (by-value only) +// Will be of the form: +// typedef STLAllocator TAlloc; +// for use in vector::type + +////////////////////////////////////////////////////////////////////////// + +/** Utility function for constructing an array of objects with placement new, + without using new[] (which allocates an undocumented amount of extra memory + and so isn't appropriate for custom allocators). +*/ +template +T* ConstructN(T* basePtr, size_t count) { + for (size_t i = 0; i < count; ++i) { + new ((void*)(basePtr+i)) T(); + } + return basePtr; +} + +CC_NAMESPACE_END + +#ifdef CC_MEMORY_TRACKER + +/// Allocate a block of raw memory. +# define _CC_MALLOC(bytes) ::cc::CategorisedAllocPolicy::AllocateBytes(bytes, __FILE__, __LINE__, __FUNCTION__) +/// Reallocate a block of raw memory. +# define _CC_REALLOC(ptr, bytes) ::cc::CategorisedAllocPolicy::ReallocateBytes(ptr, bytes, __FILE__, __LINE__, __FUNCTION__) +/// Allocate a block of memory for a primitive type. +# define _CC_ALLOC_T(T, count) static_cast(::cc::CategorisedAllocPolicy::AllocateBytes(sizeof(T)*(count), __FILE__, __LINE__, __FUNCTION__)) +/// Free the memory allocated with _CC_MALLOC or _CC_ALLOC_T. +# define _CC_FREE(ptr) ::cc::CategorisedAllocPolicy::DeallocateBytes((void*)ptr) + +/// Allocate space for one primitive type, external type or non-virtual type with constructor parameters +# define _CC_NEW_T(T) new (::cc::CategorisedAllocPolicy::AllocateBytes(sizeof(T), __FILE__, __LINE__, __FUNCTION__)) T +/// Allocate a block of memory for 'count' primitive types - do not use for classes that inherit from AllocatedObject +# define _CC_NEW_ARRAY_T(T, count) ::cc::ConstructN(static_cast(::cc::CategorisedAllocPolicy::AllocateBytes(sizeof(T)*(count), __FILE__, __LINE__, __FUNCTION__)), count) +/// Free the memory allocated with _CC_NEW_T. +# define _CC_DELETE_T(ptr, T) if(ptr){(ptr)->~T(); ::cc::CategorisedAllocPolicy::DeallocateBytes((void*)ptr);} +/// Free the memory allocated with _CC_NEW_ARRAY_T. +# define _CC_DELETE_ARRAY_T(ptr, T, count) if(ptr){for (size_t b = 0; b < (size_t)count; ++b) {(ptr)[b].~T();} ::cc::CategorisedAllocPolicy::DeallocateBytes((void*)ptr);} + +// aligned allocation +/// Allocate a block of raw memory aligned to user defined boundaries. +# define _CC_MALLOC_ALIGN(bytes, align) ::cc::CategorisedAllocPolicy::AllocateBytesAligned(align, bytes, __FILE__, __LINE__, __FUNCTION__) +/// Allocate a block of memory for a primitive type aligned to user defined boundaries. +# define _CC_ALLOC_T_ALIGN(T, count, align) static_cast(::cc::CategorisedAllocPolicy::AllocateBytesAligned(align, sizeof(T)*(count), __FILE__, __LINE__, __FUNCTION__)) +/// Free the memory allocated with either _CC_MALLOC_ALIGN or _CC_ALLOC_T_ALIGN. +# define _CC_FREE_ALIGN(ptr, align) ::cc::CategorisedAllocPolicy::DeallocateBytesAligned(ptr) +/// Allocate a block of raw memory aligned to SIMD boundaries. +# define _CC_MALLOC_SIMD(bytes) _CC_MALLOC_ALIGN(bytes, CC_SIMD_ALIGNMENT) +/// Allocate a block of memory for a primitive type aligned to SIMD boundaries. +# define _CC_ALLOC_T_SIMD(T, count) _CC_ALLOC_T_ALIGN(T, count, CC_SIMD_ALIGNMENT) +/// Free the memory allocated with either _CC_MALLOC_SIMD or _CC_ALLOC_T_SIMD. +# define _CC_FREE_SIMD(ptr) _CC_FREE_ALIGN(ptr, CC_SIMD_ALIGNMENT) + +/// Allocate space for one primitive type, external type or non-virtual type aligned to user defined boundaries +# define _CC_NEW_T_ALIGN(T, align) new (::cc::CategorisedAllocPolicy::AllocateBytesAligned(align, sizeof(T), __FILE__, __LINE__, __FUNCTION__)) T +/// Allocate a block of memory for 'count' primitive types aligned to user defined boundaries - do not use for classes that inherit from AllocatedObject +# define _CC_NEW_ARRAY_T_ALIGN(T, count, align) ::cc::ConstructN(static_cast(::cc::CategorisedAllocPolicy::AllocateBytesAligned(align, sizeof(T)*(count), __FILE__, __LINE__, __FUNCTION__)), count) +/// Free the memory allocated with _CC_NEW_T_ALIGN. +# define _CC_DELETE_T_ALIGN(ptr, T, align) if(ptr){(ptr)->~T(); ::cc::CategorisedAllocPolicy::DeallocateBytesAligned(ptr);} +/// Free the memory allocated with _CC_NEW_ARRAY_T_ALIGN. +# define _CC_DELETE_ARRAY_T_ALIGN(ptr, T, count, align) if(ptr){for (size_t _b = 0; _b < (size_t)count; ++_b) {(ptr)[_b].~T();} ::cc::CategorisedAllocPolicy::DeallocateBytesAligned(ptr);} +/// Allocate space for one primitive type, external type or non-virtual type aligned to SIMD boundaries +# define _CC_NEW_T_SIMD(T) _CC_NEW_T_ALIGN(T, CC_SIMD_ALIGNMENT) +/// Allocate a block of memory for 'count' primitive types aligned to SIMD boundaries - do not use for classes that inherit from AllocatedObject +# define _CC_NEW_ARRAY_T_SIMD(T, count) _CC_NEW_ARRAY_T_ALIGN(T, count, CC_SIMD_ALIGNMENT) +/// Free the memory allocated with _CC_NEW_T_SIMD. +# define _CC_DELETE_T_SIMD(ptr, T) _CC_DELETE_T_ALIGN(ptr, T, CC_SIMD_ALIGNMENT) +/// Free the memory allocated with _CC_NEW_ARRAY_T_SIMD. +# define _CC_DELETE_ARRAY_T_SIMD(ptr, T, count) _CC_DELETE_ARRAY_T_ALIGN(ptr, T, CC_SIMD_ALIGNMENT) + +// new / delete for classes deriving from AllocatedObject (alignment determined by per-class policy) +// Also hooks up the file/line/function params +// Can only be used with classes that derive from AllocatedObject since customized new/delete needed +# define _CC_NEW new (__FILE__, __LINE__, __FUNCTION__) +# define _CC_DELETE delete + +#else + +/// Allocate a block of raw memory. +# define _CC_MALLOC(bytes) ::cc::CategorisedAllocPolicy::AllocateBytes(bytes) +/// Reallocate a block of raw memory. +# define _CC_REALLOC(ptr, bytes) ::cc::CategorisedAllocPolicy::ReallocateBytes(ptr, bytes) +/// Allocate a block of memory for a primitive type. +# define _CC_ALLOC_T(T, count) static_cast(::cc::CategorisedAllocPolicy::AllocateBytes(sizeof(T)*(count))) +/// Free the memory allocated with _CC_MALLOC or _CC_ALLOC_T. Category is required to be restated to ensure the matching policy is used +# define _CC_FREE(ptr) ::cc::CategorisedAllocPolicy::DeallocateBytes((void*)ptr) + +/// Allocate space for one primitive type, external type or non-virtual type with constructor parameters +# define _CC_NEW_T(T) new (::cc::CategorisedAllocPolicy::AllocateBytes(sizeof(T))) T +/// Allocate a block of memory for 'count' primitive types - do not use for classes that inherit from AllocatedObject +# define _CC_NEW_ARRAY_T(T, count) ::cc::ConstructN(static_cast(::cc::CategorisedAllocPolicy::AllocateBytes(sizeof(T)*(count))), count) +/// Free the memory allocated with _CC_NEW_T. +# define _CC_DELETE_T(ptr, T) if(ptr){(ptr)->~T(); ::cc::CategorisedAllocPolicy::DeallocateBytes((void*)ptr);} +/// Free the memory allocated with _CC_NEW_ARRAY_T. +# define _CC_DELETE_ARRAY_T(ptr, T, count) if(ptr){for (size_t b = 0; b < (size_t)count; ++b) {(ptr)[b].~T();} ::cc::CategorisedAllocPolicy::DeallocateBytes((void*)ptr);} + +// aligned allocation +/// Allocate a block of raw memory aligned to user defined boundaries. +# define _CC_MALLOC_ALIGN(bytes, align) ::cc::CategorisedAllocPolicy::AllocateBytesAligned(align, bytes) +/// Allocate a block of memory for a primitive type aligned to user defined boundaries. +# define _CC_ALLOC_T_ALIGN(T, count, align) static_cast(::cc::CategorisedAllocPolicy::AllocateBytesAligned(align, sizeof(T)*(count))) +/// Free the memory allocated with either _CC_MALLOC_ALIGN or _CC_ALLOC_T_ALIGN. +# define _CC_FREE_ALIGN(ptr, align) ::cc::CategorisedAllocPolicy::DeallocateBytesAligned((void*)ptr) +/// Allocate a block of raw memory aligned to SIMD boundaries. +# define _CC_MALLOC_SIMD(bytes) _CC_MALLOC_ALIGN(bytes, CC_SIMD_ALIGNMENT) +/// Allocate a block of memory for a primitive type aligned to SIMD boundaries. +# define _CC_ALLOC_T_SIMD(T, count) _CC_ALLOC_T_ALIGN(T, count, CC_SIMD_ALIGNMENT) +/// Free the memory allocated with either _CC_MALLOC_SIMD or _CC_ALLOC_T_SIMD. +# define _CC_FREE_SIMD(ptr) _CC_FREE_ALIGN(ptr, CC_SIMD_ALIGNMENT) + +/// Allocate space for one primitive type, external type or non-virtual type aligned to user defined boundaries +# define _CC_NEW_T_ALIGN(T, align) new (::cc::CategorisedAllocPolicy::AllocateBytesAligned(align, sizeof(T))) T +/// Allocate a block of memory for 'count' primitive types aligned to user defined boundaries - do not use for classes that inherit from AllocatedObject +# define _CC_NEW_ARRAY_T_ALIGN(T, count, align) ::cc::ConstructN(static_cast(::cc::CategorisedAllocPolicy::AllocateBytesAligned(align, sizeof(T)*(count))), count) +/// Free the memory allocated with _CC_NEW_T_ALIGN. +# define _CC_DELETE_T_ALIGN(ptr, T, align) if(ptr){(ptr)->~T(); ::cc::CategorisedAllocPolicy::DeallocateBytesAligned((void*)ptr);} +/// Free the memory allocated with _CC_NEW_ARRAY_T_ALIGN. +# define _CC_DELETE_ARRAY_T_ALIGN(ptr, T, count, align) if(ptr){for (size_t _b = 0; _b < (size_t)count; ++_b) { (ptr)[_b].~T();} ::cc::CategorisedAllocPolicy::DeallocateBytesAligned((void*)ptr);} +/// Allocate space for one primitive type, external type or non-virtual type aligned to SIMD boundaries +# define _CC_NEW_T_SIMD(T) _CC_NEW_T_ALIGN(T, CC_SIMD_ALIGNMENT) +/// Allocate a block of memory for 'count' primitive types aligned to SIMD boundaries - do not use for classes that inherit from AllocatedObject +# define _CC_NEW_ARRAY_T_SIMD(T, count) _CC_NEW_ARRAY_T_ALIGN(T, count, CC_SIMD_ALIGNMENT) +/// Free the memory allocated with _CC_NEW_T_SIMD. +# define _CC_DELETE_T_SIMD(ptr, T) _CC_DELETE_T_ALIGN(ptr, T, CC_SIMD_ALIGNMENT) +/// Free the memory allocated with _CC_NEW_ARRAY_T_SIMD. +# define _CC_DELETE_ARRAY_T_SIMD(ptr, T, count) _CC_DELETE_ARRAY_T_ALIGN(ptr, T, count, CC_SIMD_ALIGNMENT) + +// new / delete for classes deriving from AllocatedObject (alignment determined by per-class policy) +# define _CC_NEW new +# define _CC_DELETE delete + +#endif + +#endif // CC_MEM_DEF_H_ diff --git a/native/cocos/renderer/core/memory/MemTracker.cc b/native/cocos/renderer/core/memory/MemTracker.cc new file mode 100755 index 0000000000..19726e28e6 --- /dev/null +++ b/native/cocos/renderer/core/memory/MemTracker.cc @@ -0,0 +1,268 @@ +#include "CoreStd.h" +#include "MemTracker.h" +#include "Util/StringUtil.h" + +#if (CC_PLATFORM == CC_PLATFORM_ANDROID) +# include +#endif + +#ifdef CC_MEMORY_TRACKER + +extern "C" +{ +#include +} + +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) + +#ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +#endif +#if !defined(NOMINMAX) && defined(_MSC_VER) +# define NOMINMAX // required to stop windows.h messing up std::min +#endif +# include + +# define CC_OUTPUT_STR(str) ::OutputDebugStringA(str) +#else +# define CC_OUTPUT_STR(str) fputs(str, stdout) +#endif + +#define LEAK_FILENAME "MemoryLeaks.log" + +CC_NAMESPACE_BEGIN + +struct AllocHashNode { + tommy_hashdyn_node node; + void* key; + unsigned int bytes; + const char* filename; + const char* function; + unsigned int line; +}; + +struct AllocListParam { + char* buf; + char* last; +}; + +struct AllocDumpParam { + std::map allocMap; +}; + +CC_INLINE static void FreeHashNode(AllocHashNode *n) { + free(n); +} + +static int HashNodeCompare(const void* arg, const void* obj) { + return ((AllocHashNode*)obj)->key != (void*)arg; +} + +static void HashNodeListAndFree(void *arg, void *obj) { + AllocHashNode* node = (AllocHashNode*)obj; + AllocListParam* param = (AllocListParam*)arg; + int len = StringUtil::Printf(param->buf, param->last, "%s(%u): {%u bytes} functions: %s\n", (node->filename ? node->filename : "(unknown source)"), + node->line, node->bytes, (node->function ? node->function : "")); + param->buf += len; + FreeHashNode(node); +} + +static void HashNodeListAndDump(void *arg, void *obj) { + AllocHashNode* node = (AllocHashNode*)obj; + AllocDumpParam* param = (AllocDumpParam*)arg; + const char* key = node->filename ? node->filename : "null"; + std::map::iterator ptr = param->allocMap.find(key); + if (ptr == param->allocMap.end()) { + param->allocMap[key] = node->bytes; + } else { + ptr->second += node->bytes; + } + //char tmpbuf[1024]; + //sprintf(tmpbuf, "%s|%s|%u\n", node->filename, node->function, node->bytes); + //fputs(tmpbuf, param); +} + +///////////////////////////////////////////////////////// + +MemTracker::MemTracker() + : total_memory_allocated_(0) { + allocations_ = malloc(sizeof(tommy_hashdyn)); + tommy_hashdyn_init((tommy_hashdyn*)allocations_); +} + +MemTracker::~MemTracker() { + ReportLeaks(); + tommy_hashdyn_done((tommy_hashdyn*)allocations_); + free(allocations_); +} + +void MemTracker::RecordAlloc(void *ptr, size_t sz, const char *file, size_t ln, const char *func) { + tommy_hash_t hash = tommy_inthash_u32((tommy_uint32_t)reinterpret_cast(ptr)); + + mutex_.lock(); + + AllocHashNode* node = (AllocHashNode*)tommy_hashdyn_search((tommy_hashdyn*)allocations_, HashNodeCompare, ptr, hash); + if (node) { + CC_ASSERTS(0, "Double allocation with same address - this probably means you have a mismatched allocation / deallocation style."); + } else { + node = (AllocHashNode*)malloc(sizeof(AllocHashNode)); + node->key = ptr; + node->bytes = (unsigned int)sz; + node->filename = file; + node->function = func; + node->line = (unsigned int)ln; + tommy_hashdyn_insert((tommy_hashdyn*)allocations_, &node->node, node, hash); + total_memory_allocated_ += sz; + } + + mutex_.unlock(); +} + +void MemTracker::RecordReAlloc(void* oldptr, void* ptr, size_t sz, const char* file, size_t ln, const char* func) { + if (oldptr != ptr) { + if (oldptr) RecordFree(oldptr); + RecordAlloc(ptr, sz, file, ln, func); + return; + } + + if (sz == 0) { + RecordFree(oldptr); + return; + } + + tommy_hash_t hash = tommy_inthash_u32((tommy_uint32_t)reinterpret_cast(ptr)); + + mutex_.lock(); + + AllocHashNode* node = (AllocHashNode*)tommy_hashdyn_search((tommy_hashdyn*)allocations_, HashNodeCompare, ptr, hash); + if (node) { + int oldsize = (int)node->bytes; + node->bytes = (unsigned int)sz; + node->filename = file; + node->function = func; + node->line = (unsigned int)ln; + total_memory_allocated_ += ((int)sz - oldsize); + } else { + CC_ASSERTS(0, "Reallocation address not found."); + } + + mutex_.unlock(); +} + +void MemTracker::RecordFree(void* ptr) +{ + // deal cleanly with null pointers + if (!ptr) + return; + + tommy_hash_t hash = tommy_inthash_u32((tommy_uint32_t)reinterpret_cast(ptr)); + + mutex_.lock(); + + AllocHashNode* node = (AllocHashNode*)tommy_hashdyn_remove((tommy_hashdyn*)allocations_, HashNodeCompare, ptr, hash); + if (node) + { + total_memory_allocated_ -= node->bytes; + FreeHashNode(node); + } + else + { + CC_ASSERTS(0, "Unable to locate allocation unit - this probably means you have a mismatched allocation / deallocation style."); + } + + mutex_.unlock(); +} + +int MemTracker::GetAllocSize(void* ptr) { + int sz = -1; + tommy_hash_t hash = tommy_inthash_u32((tommy_uint32_t)reinterpret_cast(ptr)); + + mutex_.lock(); + AllocHashNode* node = (AllocHashNode*)tommy_hashdyn_search((tommy_hashdyn*)allocations_, HashNodeCompare, ptr, hash); + if (node) { + sz = (int)node->bytes; + } + mutex_.unlock(); + return sz; +} + +void MemTracker::ReportLeaks() { + char* buffer; + + unsigned int count = (unsigned int)tommy_hashdyn_count((tommy_hashdyn*)allocations_); + if (count == 0) { + buffer = (char*)malloc(256); + strcpy(buffer, "MemoryTracker: No memory leaks.\n"); + } else { + int len = 768 * 1024; + buffer = (char*)malloc(len); + char* last = buffer + len - 3; + char* buf = buffer; + buf += sprintf(buffer, "MemoryTracker: Detected memory leaks !!!\n" + "MemoryTracker: (%u) Allocation(s) with total %u bytes.\n" + "MemoryTracker: Dumping allocations ->\n", count, (unsigned int)total_memory_allocated_); + + AllocListParam param; + param.buf = buf; + param.last = last; + tommy_hashdyn_foreach_arg((tommy_hashdyn*)allocations_, HashNodeListAndFree, ¶m); + } + + FILE* f = fopen(LEAK_FILENAME, "w"); + if (f) { + fputs(buffer, f); + fclose(f); + } + CC_OUTPUT_STR(buffer); + free(buffer); +} + +struct AllocDumpNode { + std::string name; + unsigned int bytes; +}; + +bool operator < (const AllocDumpNode& a, const AllocDumpNode& b) { + return a.bytes < b.bytes; +} + +void MemTracker::DumpMemoryAllocation() { + AllocDumpParam param; + tommy_hashdyn_foreach_arg((tommy_hashdyn*)allocations_, HashNodeListAndDump, ¶m); + std::priority_queue q; + for (std::map::iterator ptr = param.allocMap.begin(); ptr != param.allocMap.end(); ++ptr) { + AllocDumpNode node; + node.name = ptr->first; + node.bytes = ptr->second; + q.push(std::move(node)); + } + + unsigned int total = 0; + char tmpbuf[1024]; + sprintf(tmpbuf, "total memory: %u\n", (unsigned int)total_memory_allocated_); + std::string str = tmpbuf; + while (!q.empty()) { + const AllocDumpNode& n = q.top(); + sprintf(tmpbuf, "%s:%u\n", n.name.c_str(), n.bytes); + str += tmpbuf; + total += n.bytes; + q.pop(); + } + sprintf(tmpbuf, "calc total memory: %u\n", total); + str += tmpbuf; + +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) + FILE* f = fopen("MemDump.txt", "w"); + if (f) { + fputs(str.c_str(), f); + fclose(f); + } +#elif (CC_PLATFORM == CC_PLATFORM_ANDROID) + __android_log_write(ANDROID_LOG_WARN, "Tao", str.c_str()); +#else + fputs(str.c_str(), stdout); +#endif +} + +CC_NAMESPACE_END +#endif diff --git a/native/cocos/renderer/core/memory/MemTracker.h b/native/cocos/renderer/core/memory/MemTracker.h new file mode 100755 index 0000000000..85aabd22b9 --- /dev/null +++ b/native/cocos/renderer/core/memory/MemTracker.h @@ -0,0 +1,64 @@ +#ifndef CC_CORE_MEM_TRACKER_H_ +#define CC_CORE_MEM_TRACKER_H_ + +#ifdef CC_MEMORY_TRACKER + +CC_NAMESPACE_BEGIN + +/** This class tracks the allocations and deallocations made, and +is able to report memory statistics and leaks. +@note +This class is only available in debug builds. +*/ +class CC_CORE_API MemTracker { + public: + ~MemTracker(); + private: + // protected ctor + MemTracker(); + + public: + // Get the total amount of memory allocated currently. + CC_INLINE size_t total_memory_allocated() const { return total_memory_allocated_; } + + void DumpMemoryAllocation(); + + /** Record an allocation that has been made. Only to be called by + the memory management subsystem. + @param ptr The pointer to the memory + @param sz The size of the memory in bytes + @param pool The memory pool this allocation is occurring from + @param file The file in which the allocation is being made + @param ln The line on which the allocation is being made + @param func The function in which the allocation is being made + */ + void RecordAlloc(void* ptr, size_t sz, + const char* file = nullptr, size_t ln = 0, const char* func = nullptr); + // Record the deallocation of memory. + void RecordFree(void* ptr); + void RecordReAlloc(void* oldptr, void* ptr, size_t sz, + const char *file = nullptr, size_t ln = 0, const char *func = nullptr); + + int GetAllocSize(void *ptr); + + // Static utility method to get the memory tracker instance + CC_INLINE static MemTracker* Instance() { + static MemTracker tracker; + return &tracker; + } + + private: + void ReportLeaks(); + + private: + std::mutex mutex_; + size_t total_memory_allocated_; + //tommy_hashdyn m_allocations; + void* allocations_; +}; + +CC_NAMESPACE_END + +#endif + +#endif // CC_CORE_MEM_TRACKER_H_ diff --git a/native/cocos/renderer/core/memory/Memory.cc b/native/cocos/renderer/core/memory/Memory.cc new file mode 100755 index 0000000000..17786b5d6b --- /dev/null +++ b/native/cocos/renderer/core/memory/Memory.cc @@ -0,0 +1,13 @@ +#include "CoreStd.h" +#include "Memory.h" +#include "StlAlloc.h" + +CC_NAMESPACE_BEGIN +CC_CORE_API SA stl_char_allocator; +CC_NAMESPACE_END + +#if 0 +CC_CORE_API void* BareNewErroneouslyCalled(size_t sz) { + return malloc(sz); +} +#endif diff --git a/native/cocos/renderer/core/memory/Memory.h b/native/cocos/renderer/core/memory/Memory.h new file mode 100755 index 0000000000..e1c32d70d5 --- /dev/null +++ b/native/cocos/renderer/core/memory/Memory.h @@ -0,0 +1,51 @@ +#pragma once + +#include "MemTracker.h" +#include "MemDef.h" +#include "StlAlloc.h" +#include "AllocatedObj.h" + +// Global Interface Definitions + +#define CC_NEW(T) _CC_NEW T +#define CC_NEW_ARRAY(T, count) _CC_NEW T[count] +#define CC_DELETE(ptr) _CC_DELETE (ptr) +#define CC_DELETE_ARRAY(ptr) _CC_DELETE[] (ptr) +#define CC_SAFE_DELETE(ptr) if(ptr) { CC_DELETE(ptr); (ptr) = nullptr; } +#define CC_SAFE_DELETE_ARRAY(ptr) if(ptr) { CC_DELETE_ARRAY(ptr); (ptr) = nullptr; } +#define CC_UNSAFE_DELETE(ptr) if(ptr) { CC_DELETE(ptr); } +#define CC_UNSAFE_DELETE_ARRAY(ptr) if(ptr) { CC_DELETE_ARRAY(ptr); } + +#define CC_NEW_T(T) _CC_NEW_T(T) +#define CC_NEW_ARRAY_T(T, count) _CC_NEW_ARRAY_T(T, count) +#define CC_DELETE_T(ptr, T) _CC_DELETE_T(ptr, T) +#define CC_DELETE_ARRAY_T(ptr, T, count) _CC_DELETE_ARRAY_T(ptr, T, count) +#define CC_SAFE_DELETE_T(ptr, T) if(ptr) { CC_DELETE_T(ptr, T); (ptr) = nullptr; } +#define CC_SAFE_DELETE_ARRAY_T(ptr, T, count) if(ptr) { CC_DELETE_ARRAY_T(ptr, T, count); (ptr) = nullptr; } +#define CC_UNSAFE_DELETE_T(ptr, T) if(ptr) { CC_DELETE_T(ptr, T); } +#define CC_UNSAFE_DELETE_ARRAY_T(ptr, T, count) if(ptr) { CC_DELETE_ARRAY_T(ptr, T, count); } + +#define CC_MALLOC(bytes) _CC_MALLOC(bytes) +#define CC_REALLOC(ptr, bytes) _CC_REALLOC(ptr, bytes) +#define CC_ALLOC(T, count) _CC_ALLOC_T(T, count) +#define CC_FREE(ptr) _CC_FREE(ptr) +#define CC_SAFE_FREE(ptr) if(ptr) { CC_FREE(ptr); (ptr) = nullptr; } +#define CC_UNSAFE_FREE(ptr) if(ptr) { CC_FREE(ptr); } + +#define CC_MALLOC_SIMD(bytes) _CC_MALLOC_SIMD(bytes) +#define CC_FREE_SIMD(ptr) _CC_FREE_SIMD(ptr) + +#define CC_DESTROY(ptr) { (ptr)->Destroy(); CC_DELETE(ptr); } +#define CC_SAFE_DESTROY(ptr) if (ptr) { (ptr)->Destroy(); CC_DELETE(ptr); ptr = nullptr; } +#define CC_UNSAFE_DESTROY(ptr) if (ptr) { (ptr)->Destroy(); CC_DELETE(ptr); } + +#define CC_SAFE_RELEASE_REF(ptr) if (ptr) { (ptr)->ReleaseRef(); ptr = nullptr; } +#define CC_UNSAFE_RELEASE_REF(ptr) if (ptr) { (ptr)->ReleaseRef(); } + +#if 0 +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) && (CC_MODE == CC_MODE_DEBUG) +CC_CORE_API void* BareNewErroneouslyCalled(size_t sz); +CC_INLINE void* operator new(size_t sz) { return BareNewErroneouslyCalled(sz); } +CC_INLINE void operator delete(void* ptr) throw() { free(ptr); } +#endif +#endif \ No newline at end of file diff --git a/native/cocos/renderer/core/memory/NedPooling.cc b/native/cocos/renderer/core/memory/NedPooling.cc new file mode 100755 index 0000000000..1c007e9925 --- /dev/null +++ b/native/cocos/renderer/core/memory/NedPooling.cc @@ -0,0 +1,203 @@ +#include "CoreStd.h" +#include "NedPooling.h" +#include "MemTracker.h" + +#if (CC_MEMORY_ALLOCATOR == CC_MEMORY_ALLOCATOR_NEDPOOLING) + +// include Ned implementation +#if (CC_COMPILER == CC_COMPILER_MSVC) +# pragma warning(disable: 4005 4189 4267 4565 4702 4706) +#endif + +#define USE_LOCKS 1 +#define INSECURE 1 +#include + +CC_NAMESPACE_BEGIN + +namespace nedPoolingIntern { + +const size_t ned_poolCount = 14; // Needs to be greater than 4 +#if (CC_CPU_ARCH == CC_CPU_ARCH_32) + void* ned_poolFootprint = reinterpret_cast(0xBB1AA45A); +#else + void* ned_poolFootprint = reinterpret_cast((ui64)0xBB1AA45A); +#endif +nedalloc::nedpool *ned_pools[ned_poolCount + 1] = { 0 }; +nedalloc::nedpool *ned_poolsAligned[ned_poolCount + 1] = { 0 }; + +size_t PoolIDFromSize(size_t a_reqSize) { + // Requests size 16 or smaller are allocated at a 4 byte granularity. + // Requests size 17 or larger are allocated at a 16 byte granularity. + // With a ned_poolCount of 14, requests size 177 or larger go in the default pool. + + // spreadsheet style =IF(B35<=16; FLOOR((B35-1)/4;1); MIN(FLOOR((B35-1)/16; 1) + 3; 14)) + + size_t poolID = 0; + + if (a_reqSize > 0) { + if (a_reqSize <= 16) { + poolID = (a_reqSize - 1) >> 2; + } else { + poolID = std::min(((a_reqSize - 1) >> 4) + 3, ned_poolCount); + } + } + + return poolID; +} + +CC_DECL_MALLOC void* InternalAlloc(size_t a_reqSize) { + size_t poolID = PoolIDFromSize(a_reqSize); + nedalloc::nedpool* pool(0); // A pool pointer of 0 means the default pool. + + if (poolID < ned_poolCount) { + if (ned_pools[poolID] == 0) { + // Init pool if first use + + ned_pools[poolID] = nedalloc::nedcreatepool(0, 8); + nedalloc::nedpsetvalue(ned_pools[poolID], ned_poolFootprint); // All pools are stamped with a footprint + } + + pool = ned_pools[poolID]; + } + + return nedalloc::nedpmalloc(pool, a_reqSize); +} + + CC_DECL_MALLOC void* InternalRealloc(void* ptr, size_t a_reqSize) { + size_t poolID = PoolIDFromSize(a_reqSize); + nedalloc::nedpool* pool(0); // A pool pointer of 0 means the default pool. + + if (poolID < ned_poolCount) { + if (ned_pools[poolID] == 0) { + // Init pool if first use + + ned_pools[poolID] = nedalloc::nedcreatepool(0, 8); + nedalloc::nedpsetvalue(ned_pools[poolID], ned_poolFootprint); // All pools are stamped with a footprint + } + + pool = ned_pools[poolID]; + } + + return nedalloc::nedprealloc(pool, ptr, a_reqSize); + } + +CC_DECL_MALLOC void* InternalAllocAligned(size_t a_align, size_t a_reqSize) { + size_t poolID = PoolIDFromSize(a_reqSize); + nedalloc::nedpool* pool(0); // A pool pointer of 0 means the default pool. + + if (poolID < ned_poolCount) { + if (ned_poolsAligned[poolID] == 0) { + // Init pool if first use + + ned_poolsAligned[poolID] = nedalloc::nedcreatepool(0, 8); + nedalloc::nedpsetvalue(ned_poolsAligned[poolID], ned_poolFootprint); // All pools are stamped with a footprint + } + + pool = ned_poolsAligned[poolID]; + } + + return nedalloc::nedpmemalign(pool, a_align, a_reqSize); +} + +void InternalFree(void* a_mem) { + if (a_mem) { + nedalloc::nedpool* pool(0); + + // nedalloc lets us get the pool pointer from the memory pointer + void* footprint = nedalloc::nedgetvalue(&pool, a_mem); + + // Check footprint + if (footprint == ned_poolFootprint) { + // If we allocated the pool, deallocate from this pool... + nedalloc::nedpfree(pool, a_mem); + } else { + // ...otherwise let nedalloc handle it. + nedalloc::nedfree(a_mem); + } + } +} + +} // end - namespace:nedPoolingIntern + +////////////////////////////////////////////////////////////////////////// + +CC_DECL_MALLOC void* NedPoolingImpl::AllocBytes(size_t count, const char* file, int line, const char* func) +{ + void* ptr = nedPoolingIntern::InternalAlloc(count); +#ifdef CC_MEMORY_TRACKER + MemTracker::Instance()->RecordAlloc(ptr, count, file, line, func); +#else + // avoid unused params warning + (void)file; + (void)line; + (void)func; +#endif + return ptr; +} + +CC_DECL_MALLOC void* NedPoolingImpl::ReallocBytes(void* ptr, size_t count, const char* file, int line, const char* func) { +#ifdef CC_MEMORY_TRACKER + if (ptr) { + if (count == 0) { + MemTracker::Instance()->RecordFree(ptr); + nedPoolingIntern::InternalFree(ptr); + return nullptr; + } else { + int oldsz = MemTracker::Instance()->GetAllocSize(ptr); + if (oldsz < 0) { + CC_ASSERTS(false, "ned realloc: get old size of ptr fail!"); + return realloc(ptr, count); + } else { + if (oldsz >(int)count) oldsz = (int)count; + } + + void* nptr = nedPoolingIntern::InternalAlloc(count); + memcpy(nptr, ptr, oldsz); + MemTracker::Instance()->RecordAlloc(nptr, count, file, line, func); + MemTracker::Instance()->RecordFree(ptr); + nedPoolingIntern::InternalFree(ptr); + return nptr; + } + } else { + if (count) { + ptr = nedPoolingIntern::InternalAlloc(count); + MemTracker::Instance()->RecordAlloc(ptr, count, file, line, func); + return ptr; + } else { + return nullptr; + } + } +#else + return nedPoolingIntern::InternalRealloc(ptr, count); +#endif +} + +CC_DECL_MALLOC void* NedPoolingImpl::AllocBytesAligned(size_t align, size_t count, const char* file, int line, const char* func) { + // default to platform SIMD alignment if none specified + void* ptr = nedPoolingIntern::InternalAllocAligned(align, count); +#ifdef CC_MEMORY_TRACKER + MemTracker::Instance()->RecordAlloc(ptr, count, file, line, func); +#else + // avoid unused params warning + (void)file; + (void)line; + (void)func; +#endif + return ptr; +} + +void NedPoolingImpl::DeallocBytes(void* ptr) { + // deal with null + if (!ptr) { + return; + } +#ifdef CC_MEMORY_TRACKER + MemTracker::Instance()->RecordFree(ptr); +#endif + nedPoolingIntern::InternalFree(ptr); +} + +CC_NAMESPACE_END + +#endif // end - #ifdef CC_MEMORY_ALLOCATOR_NEDPOOLING diff --git a/native/cocos/renderer/core/memory/NedPooling.h b/native/cocos/renderer/core/memory/NedPooling.h new file mode 100755 index 0000000000..86105efb46 --- /dev/null +++ b/native/cocos/renderer/core/memory/NedPooling.h @@ -0,0 +1,57 @@ +#ifndef CC_CORE_NED_POOLING_H_ +#define CC_CORE_NED_POOLING_H_ + +#if (CC_MEMORY_ALLOCATOR == CC_MEMORY_ALLOCATOR_NEDPOOLING) + +CC_NAMESPACE_BEGIN + +//Non-templated utility class just to hide nedmalloc. +class CC_CORE_API NedPoolingImpl +{ +public: + static CC_DECL_MALLOC void* AllocBytes(size_t count, const char* file, int line, const char* func); + static CC_DECL_MALLOC void* ReallocBytes(void* ptr, size_t count, const char* file, int line, const char* func); + static CC_DECL_MALLOC void* AllocBytesAligned(size_t align, size_t count, const char* file, int line, const char* func); + static void DeallocBytes(void* ptr); +}; + +/** An allocation policy for use with AllocatedObject and + STLAllocator. This is the class that actually does the allocation + and deallocation of physical memory, and is what you will want to + provide a custom version of if you wish to change how memory is allocated. + @par + This allocation policy uses nedmalloc (http://nedprod.com/programs/portable/nedmalloc/index.html). + */ +class CC_CORE_API NedPoolingAllocPolicy { + public: + static CC_INLINE CC_DECL_MALLOC void* AllocateBytes(size_t count, const char* file = nullptr, int line = 0, const char* func = nullptr) { + return NedPoolingImpl::AllocBytes(count, file, line, func); + } + static CC_INLINE CC_DECL_MALLOC void* ReallocateBytes(void* ptr, size_t count, const char* file = nullptr, int line = 0, const char* func = nullptr) { + return NedPoolingImpl::ReallocBytes(ptr, count, file, line, func); + } + static CC_INLINE void DeallocateBytes(void* ptr) { + NedPoolingImpl::DeallocBytes(ptr); + } + static CC_INLINE CC_DECL_MALLOC void* AllocateBytesAligned(size_t alignment, size_t count, const char *file = nullptr, int line = 0, const char *func = nullptr) { + return NedPoolingImpl::AllocBytesAligned(alignment, count, file, line, func); + } + static CC_INLINE void DeallocateBytesAligned(void *ptr) { + NedPoolingImpl::DeallocBytes(ptr); + } + + // Get the maximum size of a single allocation + static CC_INLINE size_t getMaxAllocationSize() { + return (std::numeric_limits::max)(); + } + +private: + // No instantiation + NedPoolingAllocPolicy() {} +}; + +CC_NAMESPACE_END + +#endif // end - #ifdef CC_MEMORY_ALLOCATOR_NEDPOOLING + +#endif // CC_CORE_NED_POOLING_H_ diff --git a/native/cocos/renderer/core/memory/StdAlloc.h b/native/cocos/renderer/core/memory/StdAlloc.h new file mode 100755 index 0000000000..ea51dc4564 --- /dev/null +++ b/native/cocos/renderer/core/memory/StdAlloc.h @@ -0,0 +1,142 @@ +#ifndef CC_CORE_STD_ALLOC_H_ +#define CC_CORE_STD_ALLOC_H_ + +#if (CC_MEMORY_ALLOCATOR == CC_MEMORY_ALLOCATOR_STD) + +CC_NAMESPACE_BEGIN + +/** A "standard" allocation policy for use with AllocatedObject and + STLAllocator. This is the class that actually does the allocation + and deallocation of physical memory, and is what you will want to + provide a custom version of if you wish to change how memory is allocated. + @par + This class just delegates to the global malloc/free. +*/ +class CC_CORE_API StdAllocPolicy { + public: + static CC_INLINE CC_DECL_MALLOC void* AllocateBytes(size_t count, +#ifdef CC_MEMORY_TRACKER + const char* file = nullptr, int line = 0, const char* func = nullptr +#else + const char* = nullptr, int = 0, const char* = nullptr +#endif + ) { + void* ptr = malloc(count); +#ifdef CC_MEMORY_TRACKER + MemTracker::Instance()->RecordAlloc(ptr, count, file, line, func); +#endif + return ptr; + } + + static CC_INLINE CC_DECL_MALLOC void* ReallocateBytes(void* ptr, size_t count, +#ifdef CC_MEMORY_TRACKER + const char* file = nullptr, int line = 0, const char* func = nullptr +#else + const char* = nullptr, int = 0, const char* = nullptr +#endif + ) { +#ifdef CC_MEMORY_TRACKER + if (ptr) { + if (count == 0) { + MemTracker::Instance()->RecordFree(ptr); + free(ptr); + return NULL; + } else { + int oldsz = MemTracker::Instance()->GetAllocSize(ptr); + if (oldsz < 0) { + printf("realloc: get old size of ptr fail!\n"); + assert(0); + return realloc(ptr, count); + } else { + if (oldsz >(int)count) oldsz = (int)count; + } + + void* nptr = malloc(count); + memcpy(nptr, ptr, oldsz); + MemTracker::Instance()->RecordAlloc(nptr, count, file, line, func); + MemTracker::Instance()->RecordFree(ptr); + free(ptr); + return nptr; + } + } else { + if (count) { + ptr = malloc(count); + MemTracker::Instance()->RecordAlloc(ptr, count, file, line, func); + return ptr; + } else { + return nullptr; + } + } +#else + return realloc(ptr, count); +#endif + } + + static CC_INLINE void DeallocateBytes(void* ptr) { +#ifdef CC_MEMORY_TRACKER + MemTracker::Instance()->RecordFree(ptr); +#endif + free(ptr); + } + + static CC_INLINE CC_DECL_MALLOC void* AllocateBytesAligned(size_t alignment, size_t count, +#ifdef CC_MEMORY_TRACKER + const char* file = NULL, int line = 0, const char* func = NULL +#else + const char* = NULL, int = 0, const char* = NULL +#endif + ) { +#ifdef _MSC_VER + void* ptr = _aligned_malloc(count, alignment); +#elif defined(__ANDROID__) + //void* ptr = memalign(alignment, count); + unsigned char* p = (unsigned char*)malloc(count + alignment); + size_t offset = alignment - (size_t(p) & (alignment - 1)); + unsigned char* ptr = p + offset; + ptr[-1] = (unsigned char)offset; +#else + void* ptr = NULL; + posix_memalign(&ptr, alignment, count); +#endif + +#ifdef CC_MEMORY_TRACKER + MemTracker::Instance()->RecordAlloc(ptr, count, file, line, func); +#endif + return ptr; + } + + static CC_INLINE void DeallocateBytesAligned(void *ptr) + { +#ifdef CC_MEMORY_TRACKER + MemTracker::Instance()->RecordFree(ptr); +#endif + +#ifdef _MSC_VER + _aligned_free(ptr); +#elif defined(__ANDROID__) + if (ptr) + { + unsigned char* mem = (unsigned char*)ptr; + mem = mem - mem[-1]; + free(mem); + } +#else + free(ptr); +#endif + } + + // Get the maximum size of a single allocation + static CC_INLINE size_t getMaxAllocationSize() { + return (std::numeric_limits::max)(); + } + + private: + // No instantiation + StdAllocPolicy() {} +}; + +CC_NAMESPACE_END + +#endif + +#endif // CC_CORE_STD_ALLOC_H_ diff --git a/native/cocos/renderer/core/memory/StlAlloc.h b/native/cocos/renderer/core/memory/StlAlloc.h new file mode 100755 index 0000000000..c017e914bb --- /dev/null +++ b/native/cocos/renderer/core/memory/StlAlloc.h @@ -0,0 +1,345 @@ +#ifndef CC_CORE_STL_ALLOC_H_ +#define CC_CORE_STL_ALLOC_H_ + +#include "MemDef.h" + +CC_NAMESPACE_BEGIN + +// Base STL allocator class. +template +struct STLAllocatorBase { + // base class for generic allocators + typedef T value_type; +}; + +// Base STL allocator class. (const T version). +template +struct STLAllocatorBase { + // base class for generic allocators for const T + typedef T value_type; +}; + +template +class SA : public STLAllocatorBase { + public: + /// define our types, as per ISO C++ + typedef STLAllocatorBase Base; + typedef typename Base::value_type value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; + typedef std::size_t size_type; + typedef std::ptrdiff_t difference_type; + + + /// the standard rebind mechanism + template + struct rebind { + typedef SA other; + }; + + /// ctor + inline explicit SA() {} + + /// dtor + virtual ~SA() {} + + /// copy ctor - done component wise + inline SA(SA const&) {} + + /// cast + template + inline SA(SA const&) {} + + /// cast + template + inline SA(SA const&) {} + + inline pointer allocate(size_type count, typename std::allocator::const_pointer ptr = 0) { + (void)ptr; + + // convert request to bytes + register size_type sz = count * sizeof(T); + return static_cast(AllocPolicy::AllocateBytes(sz)); + } + + inline void deallocate(pointer ptr, size_type) { + AllocPolicy::DeallocateBytes(ptr); + } + + pointer address(reference x) const { + return &x; + } + + const_pointer address(const_reference x) const { + return &x; + } + + size_type max_size() const throw() { + return size_t(-1) / sizeof(T); + } + +#if __cplusplus >= 201103L + template + void construct(Up* p, Args&&... args) { + ::new((void *)p) Up(std::forward(args)...); + } + + template + void destroy(Up* p) { + p->~Up(); + } +#else + void construct(pointer p, const T& val) { + // call placement new + ::new((void *)p) T(val); + } + + void destroy(pointer p) { + // do we have to protect against non-classes here? + // some articles suggest yes, some no + p->~T(); + } +#endif +}; + +/// determine equality, can memory from another allocator +/// be released by this allocator, (ISO C++) +template +inline bool operator ==(SA const&, SA const&) { + // same alloc policy (P), memory can be freed + return true; +} + +/// determine equality, can memory from another allocator +/// be released by this allocator, (ISO C++) +template +inline bool operator ==(SA const&, OtherAllocator const&) { + return false; +} +/// determine equality, can memory from another allocator +/// be released by this allocator, (ISO C++) +template +inline bool operator!=(SA const&, SA const&) { + // same alloc policy (P), memory can be freed + return false; +} + +/// determine equality, can memory from another allocator +/// be released by this allocator, (ISO C++) +template +inline bool operator!=(SA const&, OtherAllocator const&) { + return true; +} + +//////////////////////////////////////////////////////////////////// +extern CC_CORE_API SA stl_char_allocator; + +// for stl containers. +template > +struct vector { +#if (CC_STL_MEMORY_ALLOCATOR == CC_STL_MEMORY_ALLOCATOR_CUSTOM) + typedef typename std::vector type; + typedef typename std::vector::iterator iterator; + typedef typename std::vector::const_iterator const_iterator; +#else + typedef typename std::vector type; + typedef typename std::vector::iterator iterator; + typedef typename std::vector::const_iterator const_iterator; +#endif +}; + +template > +struct list { +#if (CC_STL_MEMORY_ALLOCATOR == CC_STL_MEMORY_ALLOCATOR_CUSTOM) + typedef typename std::list type; + typedef typename std::list::iterator iterator; + typedef typename std::list::const_iterator const_iterator; +#else + typedef typename std::list type; + typedef typename std::list::iterator iterator; + typedef typename std::list::const_iterator const_iterator; +#endif +}; + +template > +struct queue { +#if (CC_STL_MEMORY_ALLOCATOR == CC_STL_MEMORY_ALLOCATOR_CUSTOM) + typedef typename std::queue type; + typedef typename std::queue::iterator iterator; + typedef typename std::queue::const_iterator const_iterator; +#else + typedef typename std::queue type; + typedef typename std::queue::iterator iterator; + typedef typename std::queue::const_iterator const_iterator; +#endif +}; + +template ::type, typename P = std::less> +struct priority_queue { +#if (CC_STL_MEMORY_ALLOCATOR == CC_STL_MEMORY_ALLOCATOR_CUSTOM) + typedef typename std::priority_queue type; +#else + typedef typename std::priority_queue type; +#endif +}; + +template > +struct deque { +#if (CC_STL_MEMORY_ALLOCATOR == CC_STL_MEMORY_ALLOCATOR_CUSTOM) + typedef typename std::deque type; + typedef typename std::deque::iterator iterator; + typedef typename std::deque::const_iterator const_iterator; +#else + typedef typename std::deque type; + typedef typename std::deque::iterator iterator; + typedef typename std::deque::const_iterator const_iterator; +#endif +}; + +template , typename A = SA> +struct set { +#if (CC_STL_MEMORY_ALLOCATOR == CC_STL_MEMORY_ALLOCATOR_CUSTOM) + typedef typename std::set type; + typedef typename std::set::iterator iterator; + typedef typename std::set::const_iterator const_iterator; +#else + typedef typename std::set type; + typedef typename std::set::iterator iterator; + typedef typename std::set::const_iterator const_iterator; +#endif +}; + +template , typename A = SA, STLAP> > +struct map { +#if (CC_STL_MEMORY_ALLOCATOR == CC_STL_MEMORY_ALLOCATOR_CUSTOM) + typedef typename std::map type; + typedef typename std::map::iterator iterator; + typedef typename std::map::const_iterator const_iterator; +#else + typedef typename std::map type; + typedef typename std::map::iterator iterator; + typedef typename std::map::const_iterator const_iterator; +#endif +}; + +template , typename A = SA, STLAP> > +struct multimap { +#if (CC_STL_MEMORY_ALLOCATOR == CC_STL_MEMORY_ALLOCATOR_CUSTOM) + typedef typename std::multimap type; + typedef typename std::multimap::iterator iterator; + typedef typename std::multimap::const_iterator const_iterator; +#else + typedef typename std::multimap type; + typedef typename std::multimap::iterator iterator; + typedef typename std::multimap::const_iterator const_iterator; +#endif +}; + +template , typename P = std::equal_to, typename A = SA, STLAP>> +struct unordered_map { +#if (CC_STL_MEMORY_ALLOCATOR == CC_STL_MEMORY_ALLOCATOR_CUSTOM) + typedef typename std::unordered_map type; + typedef typename std::unordered_map::iterator iterator; + typedef typename std::unordered_map::const_iterator const_iterator; +#else + typedef typename std::unordered_map type; + typedef typename std::unordered_map::iterator iterator; + typedef typename std::unordered_map::const_iterator const_iterator; +#endif +}; + +#define StdStringT(T) std::basic_string, std::allocator > +#define CustomMemoryStringT(T) std::basic_string, SA > + +template +bool operator <(const CustomMemoryStringT(T)& l, const StdStringT(T)& o) { + return l.compare(0,l.length(), o.c_str(), o.length()) < 0; +} +template +bool operator <(const StdStringT(T)& l, const CustomMemoryStringT(T)& o) { + return l.compare(0,l.length(), o.c_str(), o.length()) < 0; +} +template +bool operator <=(const CustomMemoryStringT(T)& l, const StdStringT(T)& o) { + return l.compare(0, l.length(), o.c_str(),o.length()) <= 0; +} +template +bool operator <=(const StdStringT(T)& l, const CustomMemoryStringT(T)& o) { + return l.compare(0, l.length(), o.c_str(), o.length()) <= 0; +} +template +bool operator >(const CustomMemoryStringT(T)& l, const StdStringT(T)& o) { + return l.compare(0, l.length(), o.c_str(), o.length()) > 0; +} +template +bool operator >(const StdStringT(T)& l, const CustomMemoryStringT(T)& o) { + return l.compare(0, l.length(), o.c_str(), o.length()) > 0; +} +template +bool operator >=(const CustomMemoryStringT(T)& l, const StdStringT(T)& o) { + return l.compare(0, l.length(), o.c_str(), o.length()) >= 0; +} +template +bool operator >=(const StdStringT(T)& l, const CustomMemoryStringT(T)& o) { + return l.compare(0, l.length(), o.c_str(), o.length()) >= 0; +} + +template +bool operator ==(const CustomMemoryStringT(T)& l, const StdStringT(T)& o) { + return l.compare(0, l.length(), o.c_str(), o.length()) == 0; +} +template bool operator ==(const StdStringT(T)& l, const CustomMemoryStringT(T)& o) { + return l.compare(0, l.length(), o.c_str(), o.length()) == 0; +} + +template +bool operator !=(const CustomMemoryStringT(T)& l, const StdStringT(T)& o) { + return l.compare(0, l.length(), o.c_str(), o.length())!=0; +} +template +bool operator !=(const StdStringT(T)& l, const CustomMemoryStringT(T)& o) { + return l.compare(0, l.length(), o.c_str(), o.length()) != 0; +} + +template +CustomMemoryStringT(T) operator +=(const CustomMemoryStringT(T)& l, const StdStringT(T)& o) { + return CustomMemoryStringT(T)(l) += o.c_str(); +} +template +CustomMemoryStringT(T) operator +=(const StdStringT(T)& l, const CustomMemoryStringT(T)& o) { + return CustomMemoryStringT(T)(l.c_str()) += o.c_str(); +} + +template +CustomMemoryStringT(T) operator +(const CustomMemoryStringT(T)& l, const StdStringT(T)& o) { + return CustomMemoryStringT(T)(l) += o.c_str(); +} + +template +CustomMemoryStringT(T) operator +(const StdStringT(T)& l, const CustomMemoryStringT(T)& o) { + return CustomMemoryStringT(T)(l.c_str()) += o.c_str(); +} + +template +CustomMemoryStringT(T) operator +(const T* l, const CustomMemoryStringT(T)& o) { + return CustomMemoryStringT(T)(l) += o; +} + +#undef StdStringT +#undef CustomMemoryStringT + +#if (CC_STL_MEMORY_ALLOCATOR == CC_STL_MEMORY_ALLOCATOR_CUSTOM) +typedef std::basic_string, SA> String; +typedef std::basic_string, SA> WString; +#else +typedef std::string String; +typedef std::wstring WString; +#endif + +typedef vector::type StringArray; + +CC_NAMESPACE_END + +#endif // CC_CORE_STL_ALLOC_H_ diff --git a/native/cocos/renderer/core/util/StringUtil.cc b/native/cocos/renderer/core/util/StringUtil.cc new file mode 100755 index 0000000000..a79ceea3ca --- /dev/null +++ b/native/cocos/renderer/core/util/StringUtil.cc @@ -0,0 +1,96 @@ +#include "CoreStd.h" +#include "StringUtil.h" + +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +# endif +# include +#endif + +CC_NAMESPACE_BEGIN + +#if defined(_WIN32) +int StringUtil::VPrintf(char* buf, char* last, const char* fmt, va_list args) { + if (last <= buf) return 0; + + int count = (int)(last - buf); + int ret = _vsnprintf_s(buf, count, _TRUNCATE, fmt, args); + if (ret < 0) { + if (errno == 0) { + return count - 1; + } else { + return 0; + } + } else { + return ret; + } +} +#else +int StringUtil::VPrintf(char* buf, char* last, const char* fmt, va_list args) { + if (last <= buf) return 0; + + int count = (int)(last - buf); + int ret = vsnprintf(buf, count, fmt, args); + if (ret >= count - 1) { + return count - 1; + } else if (ret < 0) { + return 0; + } + return ret; +} +#endif + +int StringUtil::Printf(char* buf, char* last, const char* fmt, ...) { + va_list args; + va_start(args, fmt); + int ret = VPrintf(buf, last, fmt, args); + va_end(args); + return ret; +} + +String StringUtil::Format(const char* fmt, ...) { + char sz[4096]; + va_list args; + va_start(args, fmt); + VPrintf(sz, sz + sizeof(sz) - 1, fmt, args); + va_end(args); + return sz; +} + +StringArray StringUtil::Split(const String &str, const String &delims, uint max_splits) { + StringArray strs; + if (str.empty()) + return strs; + + // Pre-allocate some space for performance + strs.reserve(max_splits ? max_splits + 1 : 16); // 16 is guessed capacity for most case + + uint num_splits = 0; + + // Use STL methods + size_t start, pos; + start = 0; + do { + pos = str.find_first_of(delims, start); + if (pos == start) { + // Do nothing + start = pos + 1; + } else if (pos == String::npos || (max_splits && num_splits == max_splits)) { + // Copy the rest of the string + strs.push_back(str.substr(start)); + break; + } else { + // Copy up to delimiter + strs.push_back(str.substr(start, pos - start)); + start = pos + 1; + } + // parse up to next real data + start = str.find_first_not_of(delims, start); + ++num_splits; + } while (pos != String::npos); + + return strs; +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/core/util/StringUtil.h b/native/cocos/renderer/core/util/StringUtil.h new file mode 100755 index 0000000000..c6af9d3531 --- /dev/null +++ b/native/cocos/renderer/core/util/StringUtil.h @@ -0,0 +1,16 @@ +#ifndef CC_CORE_KERNEL_UTIL_STRING_UTIL_H_ +#define CC_CORE_KERNEL_UTIL_STRING_UTIL_H_ + +CC_NAMESPACE_BEGIN + +class CC_CORE_API StringUtil { + public: + static int VPrintf(char* buf, char* last, const char* fmt, va_list args); + static int Printf(char* buf, char* last, const char* fmt, ...); + static String Format(const char* fmt, ...); + static StringArray Split(const String &str, const String &delims, uint max_splits = 0); +}; + +CC_NAMESPACE_END + +#endif // CC_CORE_KERNEL_UTIL_STRING_UTIL_H_ diff --git a/native/cocos/renderer/gfx-gl/GLStd.cpp b/native/cocos/renderer/gfx-gl/GLStd.cpp new file mode 100644 index 0000000000..15785f7e25 --- /dev/null +++ b/native/cocos/renderer/gfx-gl/GLStd.cpp @@ -0,0 +1 @@ +#include "GLStd.h" \ No newline at end of file diff --git a/native/cocos/renderer/gfx-gl/GLStd.h b/native/cocos/renderer/gfx-gl/GLStd.h new file mode 100644 index 0000000000..1c895b2cf4 --- /dev/null +++ b/native/cocos/renderer/gfx-gl/GLStd.h @@ -0,0 +1,16 @@ +#ifndef __CC_GLSTD_H__ +#define __CC_GLSTD_H__ + +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) +# ifdef CC_GL_EXPORTS +# define CC_GL_API __declspec(dllexport) +# else +# define CC_GL_API __declspec(dllimport) +# endif + +# include "gl/glew.h" +#else +# define CC_GL_API +#endif + +#endif \ No newline at end of file diff --git a/native/cocos/renderer/gfx-gl/gl/glew.h b/native/cocos/renderer/gfx-gl/gl/glew.h new file mode 100644 index 0000000000..51a29ef8b9 --- /dev/null +++ b/native/cocos/renderer/gfx-gl/gl/glew.h @@ -0,0 +1,18062 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* + * Mesa 3-D graphics library + * Version: 7.0 + * + * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* +** Copyright (c) 2007 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#ifndef __glew_h__ +#define __glew_h__ +#define __GLEW_H__ + +#if defined(__gl_h_) || defined(__GL_H__) || defined(__X_GL_H) +#error gl.h included before glew.h +#endif +#if defined(__gl2_h_) +#error gl2.h included before glew.h +#endif +#if defined(__gltypes_h_) +#error gltypes.h included before glew.h +#endif +#if defined(__REGAL_H__) +#error Regal.h included before glew.h +#endif +#if defined(__glext_h_) || defined(__GLEXT_H_) +#error glext.h included before glew.h +#endif +#if defined(__gl_ATI_h_) +#error glATI.h included before glew.h +#endif + +#define __gl_h_ +#define __gl2_h_ +#define __GL_H__ +#define __gltypes_h_ +#define __REGAL_H__ +#define __X_GL_H +#define __glext_h_ +#define __GLEXT_H_ +#define __gl_ATI_h_ + +#if defined(_WIN32) + +/* + * GLEW does not include to avoid name space pollution. + * GL needs GLAPI and GLAPIENTRY, GLU needs APIENTRY, CALLBACK, and wchar_t + * defined properly. + */ +/* */ +#ifndef APIENTRY +#define GLEW_APIENTRY_DEFINED +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define APIENTRY __stdcall +# elif (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) +# define APIENTRY __stdcall +# else +# define APIENTRY +# endif +#endif +#ifndef GLAPI +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define GLAPI extern +# endif +#endif +/* */ +#ifndef CALLBACK +#define GLEW_CALLBACK_DEFINED +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define CALLBACK __attribute__ ((__stdcall__)) +# elif (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) +# define CALLBACK __stdcall +# else +# define CALLBACK +# endif +#endif +/* and */ +#ifndef WINGDIAPI +#define GLEW_WINGDIAPI_DEFINED +#define WINGDIAPI __declspec(dllimport) +#endif +/* */ +#if (defined(_MSC_VER) || defined(__BORLANDC__)) && !defined(_WCHAR_T_DEFINED) +typedef unsigned short wchar_t; +# define _WCHAR_T_DEFINED +#endif +/* */ +#if !defined(_W64) +# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && defined(_MSC_VER) && _MSC_VER >= 1300 +# define _W64 __w64 +# else +# define _W64 +# endif +#endif +#if !defined(_PTRDIFF_T_DEFINED) && !defined(_PTRDIFF_T_) && !defined(__MINGW64__) +# ifdef _WIN64 +typedef __int64 ptrdiff_t; +# else +typedef _W64 int ptrdiff_t; +# endif +# define _PTRDIFF_T_DEFINED +# define _PTRDIFF_T_ +#endif + +#ifndef GLAPI +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define GLAPI extern +# else +# define GLAPI WINGDIAPI +# endif +#endif + +#ifndef GLAPIENTRY +#define GLAPIENTRY APIENTRY +#endif + +#ifndef GLEWAPIENTRY +#define GLEWAPIENTRY APIENTRY +#endif + +/* + * GLEW_STATIC is defined for static library. + * GLEW_BUILD is defined for building the DLL library. + */ + +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# ifdef GLEW_BUILD +# define GLEWAPI extern __declspec(dllexport) +# else +# define GLEWAPI extern __declspec(dllimport) +# endif +#endif + +#else /* _UNIX */ + +/* + * Needed for ptrdiff_t in turn needed by VBO. This is defined by ISO + * C. On my system, this amounts to _3 lines_ of included code, all of + * them pretty much harmless. If you know of a way of detecting 32 vs + * 64 _targets_ at compile time you are free to replace this with + * something that's portable. For now, _this_ is the portable solution. + * (mem, 2004-01-04) + */ + +#include + +/* SGI MIPSPro doesn't like stdint.h in C++ mode */ +/* ID: 3376260 Solaris 9 has inttypes.h, but not stdint.h */ + +#if (defined(__sgi) || defined(__sun)) && !defined(__GNUC__) +#include +#else +#include +#endif + +#define GLEW_APIENTRY_DEFINED +#define APIENTRY + +/* + * GLEW_STATIC is defined for static library. + */ + +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# if defined(__GNUC__) && __GNUC__>=4 +# define GLEWAPI extern __attribute__ ((visibility("default"))) +# elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# define GLEWAPI extern __global +# else +# define GLEWAPI extern +# endif +#endif + +/* */ +#ifndef GLAPI +#define GLAPI extern +#endif + +#ifndef GLAPIENTRY +#define GLAPIENTRY +#endif + +#ifndef GLEWAPIENTRY +#define GLEWAPIENTRY +#endif + +#endif /* _WIN32 */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* ----------------------------- GL_VERSION_1_1 ---------------------------- */ + +#ifndef GL_VERSION_1_1 +#define GL_VERSION_1_1 1 + +typedef unsigned int GLenum; +typedef unsigned int GLbitfield; +typedef unsigned int GLuint; +typedef int GLint; +typedef int GLsizei; +typedef unsigned char GLboolean; +typedef signed char GLbyte; +typedef short GLshort; +typedef unsigned char GLubyte; +typedef unsigned short GLushort; +typedef unsigned long GLulong; +typedef float GLfloat; +typedef float GLclampf; +typedef double GLdouble; +typedef double GLclampd; +typedef void GLvoid; +#if defined(_MSC_VER) && _MSC_VER < 1400 +typedef __int64 GLint64EXT; +typedef unsigned __int64 GLuint64EXT; +#elif defined(_MSC_VER) || defined(__BORLANDC__) +typedef signed long long GLint64EXT; +typedef unsigned long long GLuint64EXT; +#else +# if defined(__MINGW32__) || defined(__CYGWIN__) +#include +# endif +typedef int64_t GLint64EXT; +typedef uint64_t GLuint64EXT; +#endif +typedef GLint64EXT GLint64; +typedef GLuint64EXT GLuint64; +typedef struct __GLsync *GLsync; + +typedef char GLchar; + +#define GL_ZERO 0 +#define GL_FALSE 0 +#define GL_LOGIC_OP 0x0BF1 +#define GL_NONE 0 +#define GL_TEXTURE_COMPONENTS 0x1003 +#define GL_NO_ERROR 0 +#define GL_POINTS 0x0000 +#define GL_CURRENT_BIT 0x00000001 +#define GL_TRUE 1 +#define GL_ONE 1 +#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_POINT_BIT 0x00000002 +#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 +#define GL_LINE_STRIP 0x0003 +#define GL_LINE_BIT 0x00000004 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 +#define GL_QUADS 0x0007 +#define GL_QUAD_STRIP 0x0008 +#define GL_POLYGON_BIT 0x00000008 +#define GL_POLYGON 0x0009 +#define GL_POLYGON_STIPPLE_BIT 0x00000010 +#define GL_PIXEL_MODE_BIT 0x00000020 +#define GL_LIGHTING_BIT 0x00000040 +#define GL_FOG_BIT 0x00000080 +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_ACCUM 0x0100 +#define GL_LOAD 0x0101 +#define GL_RETURN 0x0102 +#define GL_MULT 0x0103 +#define GL_ADD 0x0104 +#define GL_NEVER 0x0200 +#define GL_ACCUM_BUFFER_BIT 0x00000200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_FRONT_LEFT 0x0400 +#define GL_FRONT_RIGHT 0x0401 +#define GL_BACK_LEFT 0x0402 +#define GL_BACK_RIGHT 0x0403 +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_LEFT 0x0406 +#define GL_RIGHT 0x0407 +#define GL_FRONT_AND_BACK 0x0408 +#define GL_AUX0 0x0409 +#define GL_AUX1 0x040A +#define GL_AUX2 0x040B +#define GL_AUX3 0x040C +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_OUT_OF_MEMORY 0x0505 +#define GL_2D 0x0600 +#define GL_3D 0x0601 +#define GL_3D_COLOR 0x0602 +#define GL_3D_COLOR_TEXTURE 0x0603 +#define GL_4D_COLOR_TEXTURE 0x0604 +#define GL_PASS_THROUGH_TOKEN 0x0700 +#define GL_POINT_TOKEN 0x0701 +#define GL_LINE_TOKEN 0x0702 +#define GL_POLYGON_TOKEN 0x0703 +#define GL_BITMAP_TOKEN 0x0704 +#define GL_DRAW_PIXEL_TOKEN 0x0705 +#define GL_COPY_PIXEL_TOKEN 0x0706 +#define GL_LINE_RESET_TOKEN 0x0707 +#define GL_EXP 0x0800 +#define GL_VIEWPORT_BIT 0x00000800 +#define GL_EXP2 0x0801 +#define GL_CW 0x0900 +#define GL_CCW 0x0901 +#define GL_COEFF 0x0A00 +#define GL_ORDER 0x0A01 +#define GL_DOMAIN 0x0A02 +#define GL_CURRENT_COLOR 0x0B00 +#define GL_CURRENT_INDEX 0x0B01 +#define GL_CURRENT_NORMAL 0x0B02 +#define GL_CURRENT_TEXTURE_COORDS 0x0B03 +#define GL_CURRENT_RASTER_COLOR 0x0B04 +#define GL_CURRENT_RASTER_INDEX 0x0B05 +#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 +#define GL_CURRENT_RASTER_POSITION 0x0B07 +#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 +#define GL_CURRENT_RASTER_DISTANCE 0x0B09 +#define GL_POINT_SMOOTH 0x0B10 +#define GL_POINT_SIZE 0x0B11 +#define GL_POINT_SIZE_RANGE 0x0B12 +#define GL_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_LINE_SMOOTH 0x0B20 +#define GL_LINE_WIDTH 0x0B21 +#define GL_LINE_WIDTH_RANGE 0x0B22 +#define GL_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_LINE_STIPPLE 0x0B24 +#define GL_LINE_STIPPLE_PATTERN 0x0B25 +#define GL_LINE_STIPPLE_REPEAT 0x0B26 +#define GL_LIST_MODE 0x0B30 +#define GL_MAX_LIST_NESTING 0x0B31 +#define GL_LIST_BASE 0x0B32 +#define GL_LIST_INDEX 0x0B33 +#define GL_POLYGON_MODE 0x0B40 +#define GL_POLYGON_SMOOTH 0x0B41 +#define GL_POLYGON_STIPPLE 0x0B42 +#define GL_EDGE_FLAG 0x0B43 +#define GL_CULL_FACE 0x0B44 +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_LIGHTING 0x0B50 +#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 +#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 +#define GL_LIGHT_MODEL_AMBIENT 0x0B53 +#define GL_SHADE_MODEL 0x0B54 +#define GL_COLOR_MATERIAL_FACE 0x0B55 +#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 +#define GL_COLOR_MATERIAL 0x0B57 +#define GL_FOG 0x0B60 +#define GL_FOG_INDEX 0x0B61 +#define GL_FOG_DENSITY 0x0B62 +#define GL_FOG_START 0x0B63 +#define GL_FOG_END 0x0B64 +#define GL_FOG_MODE 0x0B65 +#define GL_FOG_COLOR 0x0B66 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_TEST 0x0B71 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_ACCUM_CLEAR_VALUE 0x0B80 +#define GL_STENCIL_TEST 0x0B90 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_MATRIX_MODE 0x0BA0 +#define GL_NORMALIZE 0x0BA1 +#define GL_VIEWPORT 0x0BA2 +#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 +#define GL_PROJECTION_STACK_DEPTH 0x0BA4 +#define GL_TEXTURE_STACK_DEPTH 0x0BA5 +#define GL_MODELVIEW_MATRIX 0x0BA6 +#define GL_PROJECTION_MATRIX 0x0BA7 +#define GL_TEXTURE_MATRIX 0x0BA8 +#define GL_ATTRIB_STACK_DEPTH 0x0BB0 +#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 +#define GL_ALPHA_TEST 0x0BC0 +#define GL_ALPHA_TEST_FUNC 0x0BC1 +#define GL_ALPHA_TEST_REF 0x0BC2 +#define GL_DITHER 0x0BD0 +#define GL_BLEND_DST 0x0BE0 +#define GL_BLEND_SRC 0x0BE1 +#define GL_BLEND 0x0BE2 +#define GL_LOGIC_OP_MODE 0x0BF0 +#define GL_INDEX_LOGIC_OP 0x0BF1 +#define GL_COLOR_LOGIC_OP 0x0BF2 +#define GL_AUX_BUFFERS 0x0C00 +#define GL_DRAW_BUFFER 0x0C01 +#define GL_READ_BUFFER 0x0C02 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_INDEX_CLEAR_VALUE 0x0C20 +#define GL_INDEX_WRITEMASK 0x0C21 +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_INDEX_MODE 0x0C30 +#define GL_RGBA_MODE 0x0C31 +#define GL_DOUBLEBUFFER 0x0C32 +#define GL_STEREO 0x0C33 +#define GL_RENDER_MODE 0x0C40 +#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 +#define GL_POINT_SMOOTH_HINT 0x0C51 +#define GL_LINE_SMOOTH_HINT 0x0C52 +#define GL_POLYGON_SMOOTH_HINT 0x0C53 +#define GL_FOG_HINT 0x0C54 +#define GL_TEXTURE_GEN_S 0x0C60 +#define GL_TEXTURE_GEN_T 0x0C61 +#define GL_TEXTURE_GEN_R 0x0C62 +#define GL_TEXTURE_GEN_Q 0x0C63 +#define GL_PIXEL_MAP_I_TO_I 0x0C70 +#define GL_PIXEL_MAP_S_TO_S 0x0C71 +#define GL_PIXEL_MAP_I_TO_R 0x0C72 +#define GL_PIXEL_MAP_I_TO_G 0x0C73 +#define GL_PIXEL_MAP_I_TO_B 0x0C74 +#define GL_PIXEL_MAP_I_TO_A 0x0C75 +#define GL_PIXEL_MAP_R_TO_R 0x0C76 +#define GL_PIXEL_MAP_G_TO_G 0x0C77 +#define GL_PIXEL_MAP_B_TO_B 0x0C78 +#define GL_PIXEL_MAP_A_TO_A 0x0C79 +#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 +#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 +#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 +#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 +#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 +#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 +#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 +#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 +#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 +#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 +#define GL_UNPACK_SWAP_BYTES 0x0CF0 +#define GL_UNPACK_LSB_FIRST 0x0CF1 +#define GL_UNPACK_ROW_LENGTH 0x0CF2 +#define GL_UNPACK_SKIP_ROWS 0x0CF3 +#define GL_UNPACK_SKIP_PIXELS 0x0CF4 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_SWAP_BYTES 0x0D00 +#define GL_PACK_LSB_FIRST 0x0D01 +#define GL_PACK_ROW_LENGTH 0x0D02 +#define GL_PACK_SKIP_ROWS 0x0D03 +#define GL_PACK_SKIP_PIXELS 0x0D04 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_MAP_COLOR 0x0D10 +#define GL_MAP_STENCIL 0x0D11 +#define GL_INDEX_SHIFT 0x0D12 +#define GL_INDEX_OFFSET 0x0D13 +#define GL_RED_SCALE 0x0D14 +#define GL_RED_BIAS 0x0D15 +#define GL_ZOOM_X 0x0D16 +#define GL_ZOOM_Y 0x0D17 +#define GL_GREEN_SCALE 0x0D18 +#define GL_GREEN_BIAS 0x0D19 +#define GL_BLUE_SCALE 0x0D1A +#define GL_BLUE_BIAS 0x0D1B +#define GL_ALPHA_SCALE 0x0D1C +#define GL_ALPHA_BIAS 0x0D1D +#define GL_DEPTH_SCALE 0x0D1E +#define GL_DEPTH_BIAS 0x0D1F +#define GL_MAX_EVAL_ORDER 0x0D30 +#define GL_MAX_LIGHTS 0x0D31 +#define GL_MAX_CLIP_PLANES 0x0D32 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 +#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 +#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 +#define GL_MAX_NAME_STACK_DEPTH 0x0D37 +#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 +#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_INDEX_BITS 0x0D51 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_ALPHA_BITS 0x0D55 +#define GL_DEPTH_BITS 0x0D56 +#define GL_STENCIL_BITS 0x0D57 +#define GL_ACCUM_RED_BITS 0x0D58 +#define GL_ACCUM_GREEN_BITS 0x0D59 +#define GL_ACCUM_BLUE_BITS 0x0D5A +#define GL_ACCUM_ALPHA_BITS 0x0D5B +#define GL_NAME_STACK_DEPTH 0x0D70 +#define GL_AUTO_NORMAL 0x0D80 +#define GL_MAP1_COLOR_4 0x0D90 +#define GL_MAP1_INDEX 0x0D91 +#define GL_MAP1_NORMAL 0x0D92 +#define GL_MAP1_TEXTURE_COORD_1 0x0D93 +#define GL_MAP1_TEXTURE_COORD_2 0x0D94 +#define GL_MAP1_TEXTURE_COORD_3 0x0D95 +#define GL_MAP1_TEXTURE_COORD_4 0x0D96 +#define GL_MAP1_VERTEX_3 0x0D97 +#define GL_MAP1_VERTEX_4 0x0D98 +#define GL_MAP2_COLOR_4 0x0DB0 +#define GL_MAP2_INDEX 0x0DB1 +#define GL_MAP2_NORMAL 0x0DB2 +#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 +#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 +#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 +#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 +#define GL_MAP2_VERTEX_3 0x0DB7 +#define GL_MAP2_VERTEX_4 0x0DB8 +#define GL_MAP1_GRID_DOMAIN 0x0DD0 +#define GL_MAP1_GRID_SEGMENTS 0x0DD1 +#define GL_MAP2_GRID_DOMAIN 0x0DD2 +#define GL_MAP2_GRID_SEGMENTS 0x0DD3 +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 +#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 +#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 +#define GL_SELECTION_BUFFER_POINTER 0x0DF3 +#define GL_SELECTION_BUFFER_SIZE 0x0DF4 +#define GL_TEXTURE_WIDTH 0x1000 +#define GL_TRANSFORM_BIT 0x00001000 +#define GL_TEXTURE_HEIGHT 0x1001 +#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 +#define GL_TEXTURE_BORDER_COLOR 0x1004 +#define GL_TEXTURE_BORDER 0x1005 +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 +#define GL_AMBIENT 0x1200 +#define GL_DIFFUSE 0x1201 +#define GL_SPECULAR 0x1202 +#define GL_POSITION 0x1203 +#define GL_SPOT_DIRECTION 0x1204 +#define GL_SPOT_EXPONENT 0x1205 +#define GL_SPOT_CUTOFF 0x1206 +#define GL_CONSTANT_ATTENUATION 0x1207 +#define GL_LINEAR_ATTENUATION 0x1208 +#define GL_QUADRATIC_ATTENUATION 0x1209 +#define GL_COMPILE 0x1300 +#define GL_COMPILE_AND_EXECUTE 0x1301 +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_INT 0x1404 +#define GL_UNSIGNED_INT 0x1405 +#define GL_FLOAT 0x1406 +#define GL_2_BYTES 0x1407 +#define GL_3_BYTES 0x1408 +#define GL_4_BYTES 0x1409 +#define GL_DOUBLE 0x140A +#define GL_CLEAR 0x1500 +#define GL_AND 0x1501 +#define GL_AND_REVERSE 0x1502 +#define GL_COPY 0x1503 +#define GL_AND_INVERTED 0x1504 +#define GL_NOOP 0x1505 +#define GL_XOR 0x1506 +#define GL_OR 0x1507 +#define GL_NOR 0x1508 +#define GL_EQUIV 0x1509 +#define GL_INVERT 0x150A +#define GL_OR_REVERSE 0x150B +#define GL_COPY_INVERTED 0x150C +#define GL_OR_INVERTED 0x150D +#define GL_NAND 0x150E +#define GL_SET 0x150F +#define GL_EMISSION 0x1600 +#define GL_SHININESS 0x1601 +#define GL_AMBIENT_AND_DIFFUSE 0x1602 +#define GL_COLOR_INDEXES 0x1603 +#define GL_MODELVIEW 0x1700 +#define GL_PROJECTION 0x1701 +#define GL_TEXTURE 0x1702 +#define GL_COLOR 0x1800 +#define GL_DEPTH 0x1801 +#define GL_STENCIL 0x1802 +#define GL_COLOR_INDEX 0x1900 +#define GL_STENCIL_INDEX 0x1901 +#define GL_DEPTH_COMPONENT 0x1902 +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A +#define GL_BITMAP 0x1A00 +#define GL_POINT 0x1B00 +#define GL_LINE 0x1B01 +#define GL_FILL 0x1B02 +#define GL_RENDER 0x1C00 +#define GL_FEEDBACK 0x1C01 +#define GL_SELECT 0x1C02 +#define GL_FLAT 0x1D00 +#define GL_SMOOTH 0x1D01 +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 +#define GL_S 0x2000 +#define GL_ENABLE_BIT 0x00002000 +#define GL_T 0x2001 +#define GL_R 0x2002 +#define GL_Q 0x2003 +#define GL_MODULATE 0x2100 +#define GL_DECAL 0x2101 +#define GL_TEXTURE_ENV_MODE 0x2200 +#define GL_TEXTURE_ENV_COLOR 0x2201 +#define GL_TEXTURE_ENV 0x2300 +#define GL_EYE_LINEAR 0x2400 +#define GL_OBJECT_LINEAR 0x2401 +#define GL_SPHERE_MAP 0x2402 +#define GL_TEXTURE_GEN_MODE 0x2500 +#define GL_OBJECT_PLANE 0x2501 +#define GL_EYE_PLANE 0x2502 +#define GL_NEAREST 0x2600 +#define GL_LINEAR 0x2601 +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 +#define GL_CLAMP 0x2900 +#define GL_REPEAT 0x2901 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#define GL_POLYGON_OFFSET_POINT 0x2A01 +#define GL_POLYGON_OFFSET_LINE 0x2A02 +#define GL_R3_G3_B2 0x2A10 +#define GL_V2F 0x2A20 +#define GL_V3F 0x2A21 +#define GL_C4UB_V2F 0x2A22 +#define GL_C4UB_V3F 0x2A23 +#define GL_C3F_V3F 0x2A24 +#define GL_N3F_V3F 0x2A25 +#define GL_C4F_N3F_V3F 0x2A26 +#define GL_T2F_V3F 0x2A27 +#define GL_T4F_V4F 0x2A28 +#define GL_T2F_C4UB_V3F 0x2A29 +#define GL_T2F_C3F_V3F 0x2A2A +#define GL_T2F_N3F_V3F 0x2A2B +#define GL_T2F_C4F_N3F_V3F 0x2A2C +#define GL_T4F_C4F_N3F_V4F 0x2A2D +#define GL_CLIP_PLANE0 0x3000 +#define GL_CLIP_PLANE1 0x3001 +#define GL_CLIP_PLANE2 0x3002 +#define GL_CLIP_PLANE3 0x3003 +#define GL_CLIP_PLANE4 0x3004 +#define GL_CLIP_PLANE5 0x3005 +#define GL_LIGHT0 0x4000 +#define GL_COLOR_BUFFER_BIT 0x00004000 +#define GL_LIGHT1 0x4001 +#define GL_LIGHT2 0x4002 +#define GL_LIGHT3 0x4003 +#define GL_LIGHT4 0x4004 +#define GL_LIGHT5 0x4005 +#define GL_LIGHT6 0x4006 +#define GL_LIGHT7 0x4007 +#define GL_HINT_BIT 0x00008000 +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_ALPHA4 0x803B +#define GL_ALPHA8 0x803C +#define GL_ALPHA12 0x803D +#define GL_ALPHA16 0x803E +#define GL_LUMINANCE4 0x803F +#define GL_LUMINANCE8 0x8040 +#define GL_LUMINANCE12 0x8041 +#define GL_LUMINANCE16 0x8042 +#define GL_LUMINANCE4_ALPHA4 0x8043 +#define GL_LUMINANCE6_ALPHA2 0x8044 +#define GL_LUMINANCE8_ALPHA8 0x8045 +#define GL_LUMINANCE12_ALPHA4 0x8046 +#define GL_LUMINANCE12_ALPHA12 0x8047 +#define GL_LUMINANCE16_ALPHA16 0x8048 +#define GL_INTENSITY 0x8049 +#define GL_INTENSITY4 0x804A +#define GL_INTENSITY8 0x804B +#define GL_INTENSITY12 0x804C +#define GL_INTENSITY16 0x804D +#define GL_RGB4 0x804F +#define GL_RGB5 0x8050 +#define GL_RGB8 0x8051 +#define GL_RGB10 0x8052 +#define GL_RGB12 0x8053 +#define GL_RGB16 0x8054 +#define GL_RGBA2 0x8055 +#define GL_RGBA4 0x8056 +#define GL_RGB5_A1 0x8057 +#define GL_RGBA8 0x8058 +#define GL_RGB10_A2 0x8059 +#define GL_RGBA12 0x805A +#define GL_RGBA16 0x805B +#define GL_TEXTURE_RED_SIZE 0x805C +#define GL_TEXTURE_GREEN_SIZE 0x805D +#define GL_TEXTURE_BLUE_SIZE 0x805E +#define GL_TEXTURE_ALPHA_SIZE 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE 0x8061 +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_TEXTURE_PRIORITY 0x8066 +#define GL_TEXTURE_RESIDENT 0x8067 +#define GL_TEXTURE_BINDING_1D 0x8068 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_VERTEX_ARRAY 0x8074 +#define GL_NORMAL_ARRAY 0x8075 +#define GL_COLOR_ARRAY 0x8076 +#define GL_INDEX_ARRAY 0x8077 +#define GL_TEXTURE_COORD_ARRAY 0x8078 +#define GL_EDGE_FLAG_ARRAY 0x8079 +#define GL_VERTEX_ARRAY_SIZE 0x807A +#define GL_VERTEX_ARRAY_TYPE 0x807B +#define GL_VERTEX_ARRAY_STRIDE 0x807C +#define GL_NORMAL_ARRAY_TYPE 0x807E +#define GL_NORMAL_ARRAY_STRIDE 0x807F +#define GL_COLOR_ARRAY_SIZE 0x8081 +#define GL_COLOR_ARRAY_TYPE 0x8082 +#define GL_COLOR_ARRAY_STRIDE 0x8083 +#define GL_INDEX_ARRAY_TYPE 0x8085 +#define GL_INDEX_ARRAY_STRIDE 0x8086 +#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A +#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C +#define GL_VERTEX_ARRAY_POINTER 0x808E +#define GL_NORMAL_ARRAY_POINTER 0x808F +#define GL_COLOR_ARRAY_POINTER 0x8090 +#define GL_INDEX_ARRAY_POINTER 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_EVAL_BIT 0x00010000 +#define GL_LIST_BIT 0x00020000 +#define GL_TEXTURE_BIT 0x00040000 +#define GL_SCISSOR_BIT 0x00080000 +#define GL_ALL_ATTRIB_BITS 0x000fffff +#define GL_CLIENT_ALL_ATTRIB_BITS 0xffffffff + +GLAPI void GLAPIENTRY glAccum (GLenum op, GLfloat value); +GLAPI void GLAPIENTRY glAlphaFunc (GLenum func, GLclampf ref); +GLAPI GLboolean GLAPIENTRY glAreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences); +GLAPI void GLAPIENTRY glArrayElement (GLint i); +GLAPI void GLAPIENTRY glBegin (GLenum mode); +GLAPI void GLAPIENTRY glBindTexture (GLenum target, GLuint texture); +GLAPI void GLAPIENTRY glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); +GLAPI void GLAPIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); +GLAPI void GLAPIENTRY glCallList (GLuint list); +GLAPI void GLAPIENTRY glCallLists (GLsizei n, GLenum type, const GLvoid *lists); +GLAPI void GLAPIENTRY glClear (GLbitfield mask); +GLAPI void GLAPIENTRY glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void GLAPIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +GLAPI void GLAPIENTRY glClearDepth (GLclampd depth); +GLAPI void GLAPIENTRY glClearIndex (GLfloat c); +GLAPI void GLAPIENTRY glClearStencil (GLint s); +GLAPI void GLAPIENTRY glClipPlane (GLenum plane, const GLdouble *equation); +GLAPI void GLAPIENTRY glColor3b (GLbyte red, GLbyte green, GLbyte blue); +GLAPI void GLAPIENTRY glColor3bv (const GLbyte *v); +GLAPI void GLAPIENTRY glColor3d (GLdouble red, GLdouble green, GLdouble blue); +GLAPI void GLAPIENTRY glColor3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glColor3f (GLfloat red, GLfloat green, GLfloat blue); +GLAPI void GLAPIENTRY glColor3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glColor3i (GLint red, GLint green, GLint blue); +GLAPI void GLAPIENTRY glColor3iv (const GLint *v); +GLAPI void GLAPIENTRY glColor3s (GLshort red, GLshort green, GLshort blue); +GLAPI void GLAPIENTRY glColor3sv (const GLshort *v); +GLAPI void GLAPIENTRY glColor3ub (GLubyte red, GLubyte green, GLubyte blue); +GLAPI void GLAPIENTRY glColor3ubv (const GLubyte *v); +GLAPI void GLAPIENTRY glColor3ui (GLuint red, GLuint green, GLuint blue); +GLAPI void GLAPIENTRY glColor3uiv (const GLuint *v); +GLAPI void GLAPIENTRY glColor3us (GLushort red, GLushort green, GLushort blue); +GLAPI void GLAPIENTRY glColor3usv (const GLushort *v); +GLAPI void GLAPIENTRY glColor4b (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); +GLAPI void GLAPIENTRY glColor4bv (const GLbyte *v); +GLAPI void GLAPIENTRY glColor4d (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); +GLAPI void GLAPIENTRY glColor4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void GLAPIENTRY glColor4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glColor4i (GLint red, GLint green, GLint blue, GLint alpha); +GLAPI void GLAPIENTRY glColor4iv (const GLint *v); +GLAPI void GLAPIENTRY glColor4s (GLshort red, GLshort green, GLshort blue, GLshort alpha); +GLAPI void GLAPIENTRY glColor4sv (const GLshort *v); +GLAPI void GLAPIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); +GLAPI void GLAPIENTRY glColor4ubv (const GLubyte *v); +GLAPI void GLAPIENTRY glColor4ui (GLuint red, GLuint green, GLuint blue, GLuint alpha); +GLAPI void GLAPIENTRY glColor4uiv (const GLuint *v); +GLAPI void GLAPIENTRY glColor4us (GLushort red, GLushort green, GLushort blue, GLushort alpha); +GLAPI void GLAPIENTRY glColor4usv (const GLushort *v); +GLAPI void GLAPIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +GLAPI void GLAPIENTRY glColorMaterial (GLenum face, GLenum mode); +GLAPI void GLAPIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); +GLAPI void GLAPIENTRY glCopyTexImage1D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void GLAPIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void GLAPIENTRY glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void GLAPIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void GLAPIENTRY glCullFace (GLenum mode); +GLAPI void GLAPIENTRY glDeleteLists (GLuint list, GLsizei range); +GLAPI void GLAPIENTRY glDeleteTextures (GLsizei n, const GLuint *textures); +GLAPI void GLAPIENTRY glDepthFunc (GLenum func); +GLAPI void GLAPIENTRY glDepthMask (GLboolean flag); +GLAPI void GLAPIENTRY glDepthRange (GLclampd zNear, GLclampd zFar); +GLAPI void GLAPIENTRY glDisable (GLenum cap); +GLAPI void GLAPIENTRY glDisableClientState (GLenum array); +GLAPI void GLAPIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); +GLAPI void GLAPIENTRY glDrawBuffer (GLenum mode); +GLAPI void GLAPIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); +GLAPI void GLAPIENTRY glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glEdgeFlag (GLboolean flag); +GLAPI void GLAPIENTRY glEdgeFlagPointer (GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glEdgeFlagv (const GLboolean *flag); +GLAPI void GLAPIENTRY glEnable (GLenum cap); +GLAPI void GLAPIENTRY glEnableClientState (GLenum array); +GLAPI void GLAPIENTRY glEnd (void); +GLAPI void GLAPIENTRY glEndList (void); +GLAPI void GLAPIENTRY glEvalCoord1d (GLdouble u); +GLAPI void GLAPIENTRY glEvalCoord1dv (const GLdouble *u); +GLAPI void GLAPIENTRY glEvalCoord1f (GLfloat u); +GLAPI void GLAPIENTRY glEvalCoord1fv (const GLfloat *u); +GLAPI void GLAPIENTRY glEvalCoord2d (GLdouble u, GLdouble v); +GLAPI void GLAPIENTRY glEvalCoord2dv (const GLdouble *u); +GLAPI void GLAPIENTRY glEvalCoord2f (GLfloat u, GLfloat v); +GLAPI void GLAPIENTRY glEvalCoord2fv (const GLfloat *u); +GLAPI void GLAPIENTRY glEvalMesh1 (GLenum mode, GLint i1, GLint i2); +GLAPI void GLAPIENTRY glEvalMesh2 (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); +GLAPI void GLAPIENTRY glEvalPoint1 (GLint i); +GLAPI void GLAPIENTRY glEvalPoint2 (GLint i, GLint j); +GLAPI void GLAPIENTRY glFeedbackBuffer (GLsizei size, GLenum type, GLfloat *buffer); +GLAPI void GLAPIENTRY glFinish (void); +GLAPI void GLAPIENTRY glFlush (void); +GLAPI void GLAPIENTRY glFogf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glFogfv (GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glFogi (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glFogiv (GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glFrontFace (GLenum mode); +GLAPI void GLAPIENTRY glFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI GLuint GLAPIENTRY glGenLists (GLsizei range); +GLAPI void GLAPIENTRY glGenTextures (GLsizei n, GLuint *textures); +GLAPI void GLAPIENTRY glGetBooleanv (GLenum pname, GLboolean *params); +GLAPI void GLAPIENTRY glGetClipPlane (GLenum plane, GLdouble *equation); +GLAPI void GLAPIENTRY glGetDoublev (GLenum pname, GLdouble *params); +GLAPI GLenum GLAPIENTRY glGetError (void); +GLAPI void GLAPIENTRY glGetFloatv (GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetIntegerv (GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetLightiv (GLenum light, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetMapdv (GLenum target, GLenum query, GLdouble *v); +GLAPI void GLAPIENTRY glGetMapfv (GLenum target, GLenum query, GLfloat *v); +GLAPI void GLAPIENTRY glGetMapiv (GLenum target, GLenum query, GLint *v); +GLAPI void GLAPIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetMaterialiv (GLenum face, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetPixelMapfv (GLenum map, GLfloat *values); +GLAPI void GLAPIENTRY glGetPixelMapuiv (GLenum map, GLuint *values); +GLAPI void GLAPIENTRY glGetPixelMapusv (GLenum map, GLushort *values); +GLAPI void GLAPIENTRY glGetPointerv (GLenum pname, GLvoid* *params); +GLAPI void GLAPIENTRY glGetPolygonStipple (GLubyte *mask); +GLAPI const GLubyte * GLAPIENTRY glGetString (GLenum name); +GLAPI void GLAPIENTRY glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexEnviv (GLenum target, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params); +GLAPI void GLAPIENTRY glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexGeniv (GLenum coord, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +GLAPI void GLAPIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glHint (GLenum target, GLenum mode); +GLAPI void GLAPIENTRY glIndexMask (GLuint mask); +GLAPI void GLAPIENTRY glIndexPointer (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glIndexd (GLdouble c); +GLAPI void GLAPIENTRY glIndexdv (const GLdouble *c); +GLAPI void GLAPIENTRY glIndexf (GLfloat c); +GLAPI void GLAPIENTRY glIndexfv (const GLfloat *c); +GLAPI void GLAPIENTRY glIndexi (GLint c); +GLAPI void GLAPIENTRY glIndexiv (const GLint *c); +GLAPI void GLAPIENTRY glIndexs (GLshort c); +GLAPI void GLAPIENTRY glIndexsv (const GLshort *c); +GLAPI void GLAPIENTRY glIndexub (GLubyte c); +GLAPI void GLAPIENTRY glIndexubv (const GLubyte *c); +GLAPI void GLAPIENTRY glInitNames (void); +GLAPI void GLAPIENTRY glInterleavedArrays (GLenum format, GLsizei stride, const GLvoid *pointer); +GLAPI GLboolean GLAPIENTRY glIsEnabled (GLenum cap); +GLAPI GLboolean GLAPIENTRY glIsList (GLuint list); +GLAPI GLboolean GLAPIENTRY glIsTexture (GLuint texture); +GLAPI void GLAPIENTRY glLightModelf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glLightModelfv (GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glLightModeli (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glLightModeliv (GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glLightf (GLenum light, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glLighti (GLenum light, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glLightiv (GLenum light, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glLineStipple (GLint factor, GLushort pattern); +GLAPI void GLAPIENTRY glLineWidth (GLfloat width); +GLAPI void GLAPIENTRY glListBase (GLuint base); +GLAPI void GLAPIENTRY glLoadIdentity (void); +GLAPI void GLAPIENTRY glLoadMatrixd (const GLdouble *m); +GLAPI void GLAPIENTRY glLoadMatrixf (const GLfloat *m); +GLAPI void GLAPIENTRY glLoadName (GLuint name); +GLAPI void GLAPIENTRY glLogicOp (GLenum opcode); +GLAPI void GLAPIENTRY glMap1d (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +GLAPI void GLAPIENTRY glMap1f (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +GLAPI void GLAPIENTRY glMap2d (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +GLAPI void GLAPIENTRY glMap2f (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +GLAPI void GLAPIENTRY glMapGrid1d (GLint un, GLdouble u1, GLdouble u2); +GLAPI void GLAPIENTRY glMapGrid1f (GLint un, GLfloat u1, GLfloat u2); +GLAPI void GLAPIENTRY glMapGrid2d (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); +GLAPI void GLAPIENTRY glMapGrid2f (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); +GLAPI void GLAPIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glMateriali (GLenum face, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glMaterialiv (GLenum face, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glMatrixMode (GLenum mode); +GLAPI void GLAPIENTRY glMultMatrixd (const GLdouble *m); +GLAPI void GLAPIENTRY glMultMatrixf (const GLfloat *m); +GLAPI void GLAPIENTRY glNewList (GLuint list, GLenum mode); +GLAPI void GLAPIENTRY glNormal3b (GLbyte nx, GLbyte ny, GLbyte nz); +GLAPI void GLAPIENTRY glNormal3bv (const GLbyte *v); +GLAPI void GLAPIENTRY glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz); +GLAPI void GLAPIENTRY glNormal3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz); +GLAPI void GLAPIENTRY glNormal3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glNormal3i (GLint nx, GLint ny, GLint nz); +GLAPI void GLAPIENTRY glNormal3iv (const GLint *v); +GLAPI void GLAPIENTRY glNormal3s (GLshort nx, GLshort ny, GLshort nz); +GLAPI void GLAPIENTRY glNormal3sv (const GLshort *v); +GLAPI void GLAPIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI void GLAPIENTRY glPassThrough (GLfloat token); +GLAPI void GLAPIENTRY glPixelMapfv (GLenum map, GLsizei mapsize, const GLfloat *values); +GLAPI void GLAPIENTRY glPixelMapuiv (GLenum map, GLsizei mapsize, const GLuint *values); +GLAPI void GLAPIENTRY glPixelMapusv (GLenum map, GLsizei mapsize, const GLushort *values); +GLAPI void GLAPIENTRY glPixelStoref (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glPixelStorei (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glPixelTransferf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glPixelTransferi (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glPixelZoom (GLfloat xfactor, GLfloat yfactor); +GLAPI void GLAPIENTRY glPointSize (GLfloat size); +GLAPI void GLAPIENTRY glPolygonMode (GLenum face, GLenum mode); +GLAPI void GLAPIENTRY glPolygonOffset (GLfloat factor, GLfloat units); +GLAPI void GLAPIENTRY glPolygonStipple (const GLubyte *mask); +GLAPI void GLAPIENTRY glPopAttrib (void); +GLAPI void GLAPIENTRY glPopClientAttrib (void); +GLAPI void GLAPIENTRY glPopMatrix (void); +GLAPI void GLAPIENTRY glPopName (void); +GLAPI void GLAPIENTRY glPrioritizeTextures (GLsizei n, const GLuint *textures, const GLclampf *priorities); +GLAPI void GLAPIENTRY glPushAttrib (GLbitfield mask); +GLAPI void GLAPIENTRY glPushClientAttrib (GLbitfield mask); +GLAPI void GLAPIENTRY glPushMatrix (void); +GLAPI void GLAPIENTRY glPushName (GLuint name); +GLAPI void GLAPIENTRY glRasterPos2d (GLdouble x, GLdouble y); +GLAPI void GLAPIENTRY glRasterPos2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos2f (GLfloat x, GLfloat y); +GLAPI void GLAPIENTRY glRasterPos2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos2i (GLint x, GLint y); +GLAPI void GLAPIENTRY glRasterPos2iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos2s (GLshort x, GLshort y); +GLAPI void GLAPIENTRY glRasterPos2sv (const GLshort *v); +GLAPI void GLAPIENTRY glRasterPos3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glRasterPos3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glRasterPos3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos3i (GLint x, GLint y, GLint z); +GLAPI void GLAPIENTRY glRasterPos3iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos3s (GLshort x, GLshort y, GLshort z); +GLAPI void GLAPIENTRY glRasterPos3sv (const GLshort *v); +GLAPI void GLAPIENTRY glRasterPos4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void GLAPIENTRY glRasterPos4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void GLAPIENTRY glRasterPos4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos4i (GLint x, GLint y, GLint z, GLint w); +GLAPI void GLAPIENTRY glRasterPos4iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void GLAPIENTRY glRasterPos4sv (const GLshort *v); +GLAPI void GLAPIENTRY glReadBuffer (GLenum mode); +GLAPI void GLAPIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); +GLAPI void GLAPIENTRY glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); +GLAPI void GLAPIENTRY glRectdv (const GLdouble *v1, const GLdouble *v2); +GLAPI void GLAPIENTRY glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); +GLAPI void GLAPIENTRY glRectfv (const GLfloat *v1, const GLfloat *v2); +GLAPI void GLAPIENTRY glRecti (GLint x1, GLint y1, GLint x2, GLint y2); +GLAPI void GLAPIENTRY glRectiv (const GLint *v1, const GLint *v2); +GLAPI void GLAPIENTRY glRects (GLshort x1, GLshort y1, GLshort x2, GLshort y2); +GLAPI void GLAPIENTRY glRectsv (const GLshort *v1, const GLshort *v2); +GLAPI GLint GLAPIENTRY glRenderMode (GLenum mode); +GLAPI void GLAPIENTRY glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glScaled (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void GLAPIENTRY glSelectBuffer (GLsizei size, GLuint *buffer); +GLAPI void GLAPIENTRY glShadeModel (GLenum mode); +GLAPI void GLAPIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); +GLAPI void GLAPIENTRY glStencilMask (GLuint mask); +GLAPI void GLAPIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); +GLAPI void GLAPIENTRY glTexCoord1d (GLdouble s); +GLAPI void GLAPIENTRY glTexCoord1dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord1f (GLfloat s); +GLAPI void GLAPIENTRY glTexCoord1fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord1i (GLint s); +GLAPI void GLAPIENTRY glTexCoord1iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord1s (GLshort s); +GLAPI void GLAPIENTRY glTexCoord1sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord2d (GLdouble s, GLdouble t); +GLAPI void GLAPIENTRY glTexCoord2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord2f (GLfloat s, GLfloat t); +GLAPI void GLAPIENTRY glTexCoord2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord2i (GLint s, GLint t); +GLAPI void GLAPIENTRY glTexCoord2iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord2s (GLshort s, GLshort t); +GLAPI void GLAPIENTRY glTexCoord2sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord3d (GLdouble s, GLdouble t, GLdouble r); +GLAPI void GLAPIENTRY glTexCoord3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord3f (GLfloat s, GLfloat t, GLfloat r); +GLAPI void GLAPIENTRY glTexCoord3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord3i (GLint s, GLint t, GLint r); +GLAPI void GLAPIENTRY glTexCoord3iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord3s (GLshort s, GLshort t, GLshort r); +GLAPI void GLAPIENTRY glTexCoord3sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord4d (GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void GLAPIENTRY glTexCoord4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord4f (GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void GLAPIENTRY glTexCoord4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord4i (GLint s, GLint t, GLint r, GLint q); +GLAPI void GLAPIENTRY glTexCoord4iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void GLAPIENTRY glTexCoord4sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexGend (GLenum coord, GLenum pname, GLdouble param); +GLAPI void GLAPIENTRY glTexGendv (GLenum coord, GLenum pname, const GLdouble *params); +GLAPI void GLAPIENTRY glTexGenf (GLenum coord, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexGenfv (GLenum coord, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexGeni (GLenum coord, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexGeniv (GLenum coord, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTranslated (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glVertex2d (GLdouble x, GLdouble y); +GLAPI void GLAPIENTRY glVertex2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex2f (GLfloat x, GLfloat y); +GLAPI void GLAPIENTRY glVertex2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex2i (GLint x, GLint y); +GLAPI void GLAPIENTRY glVertex2iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex2s (GLshort x, GLshort y); +GLAPI void GLAPIENTRY glVertex2sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertex3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glVertex3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glVertex3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex3i (GLint x, GLint y, GLint z); +GLAPI void GLAPIENTRY glVertex3iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex3s (GLshort x, GLshort y, GLshort z); +GLAPI void GLAPIENTRY glVertex3sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertex4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void GLAPIENTRY glVertex4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void GLAPIENTRY glVertex4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex4i (GLint x, GLint y, GLint z, GLint w); +GLAPI void GLAPIENTRY glVertex4iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void GLAPIENTRY glVertex4sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); + +#define GLEW_VERSION_1_1 GLEW_GET_VAR(__GLEW_VERSION_1_1) + +#endif /* GL_VERSION_1_1 */ + +/* ---------------------------------- GLU ---------------------------------- */ + +#ifndef GLEW_NO_GLU +/* this is where we can safely include GLU */ +# if defined(__APPLE__) && defined(__MACH__) +# include +# else +# include +# endif +#endif + +/* ----------------------------- GL_VERSION_1_2 ---------------------------- */ + +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 + +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_RESCALE_NORMAL 0x803A +#define GL_TEXTURE_BINDING_3D 0x806A +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E + +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); + +#define glCopyTexSubImage3D GLEW_GET_FUN(__glewCopyTexSubImage3D) +#define glDrawRangeElements GLEW_GET_FUN(__glewDrawRangeElements) +#define glTexImage3D GLEW_GET_FUN(__glewTexImage3D) +#define glTexSubImage3D GLEW_GET_FUN(__glewTexSubImage3D) + +#define GLEW_VERSION_1_2 GLEW_GET_VAR(__GLEW_VERSION_1_2) + +#endif /* GL_VERSION_1_2 */ + +/* ---------------------------- GL_VERSION_1_2_1 --------------------------- */ + +#ifndef GL_VERSION_1_2_1 +#define GL_VERSION_1_2_1 1 + +#define GLEW_VERSION_1_2_1 GLEW_GET_VAR(__GLEW_VERSION_1_2_1) + +#endif /* GL_VERSION_1_2_1 */ + +/* ----------------------------- GL_VERSION_1_3 ---------------------------- */ + +#ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 + +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_CLAMP_TO_BORDER 0x812D +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +#define GL_SUBTRACT 0x84E7 +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +#define GL_MULTISAMPLE_BIT 0x20000000 + +typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, GLvoid *img); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); + +#define glActiveTexture GLEW_GET_FUN(__glewActiveTexture) +#define glClientActiveTexture GLEW_GET_FUN(__glewClientActiveTexture) +#define glCompressedTexImage1D GLEW_GET_FUN(__glewCompressedTexImage1D) +#define glCompressedTexImage2D GLEW_GET_FUN(__glewCompressedTexImage2D) +#define glCompressedTexImage3D GLEW_GET_FUN(__glewCompressedTexImage3D) +#define glCompressedTexSubImage1D GLEW_GET_FUN(__glewCompressedTexSubImage1D) +#define glCompressedTexSubImage2D GLEW_GET_FUN(__glewCompressedTexSubImage2D) +#define glCompressedTexSubImage3D GLEW_GET_FUN(__glewCompressedTexSubImage3D) +#define glGetCompressedTexImage GLEW_GET_FUN(__glewGetCompressedTexImage) +#define glLoadTransposeMatrixd GLEW_GET_FUN(__glewLoadTransposeMatrixd) +#define glLoadTransposeMatrixf GLEW_GET_FUN(__glewLoadTransposeMatrixf) +#define glMultTransposeMatrixd GLEW_GET_FUN(__glewMultTransposeMatrixd) +#define glMultTransposeMatrixf GLEW_GET_FUN(__glewMultTransposeMatrixf) +#define glMultiTexCoord1d GLEW_GET_FUN(__glewMultiTexCoord1d) +#define glMultiTexCoord1dv GLEW_GET_FUN(__glewMultiTexCoord1dv) +#define glMultiTexCoord1f GLEW_GET_FUN(__glewMultiTexCoord1f) +#define glMultiTexCoord1fv GLEW_GET_FUN(__glewMultiTexCoord1fv) +#define glMultiTexCoord1i GLEW_GET_FUN(__glewMultiTexCoord1i) +#define glMultiTexCoord1iv GLEW_GET_FUN(__glewMultiTexCoord1iv) +#define glMultiTexCoord1s GLEW_GET_FUN(__glewMultiTexCoord1s) +#define glMultiTexCoord1sv GLEW_GET_FUN(__glewMultiTexCoord1sv) +#define glMultiTexCoord2d GLEW_GET_FUN(__glewMultiTexCoord2d) +#define glMultiTexCoord2dv GLEW_GET_FUN(__glewMultiTexCoord2dv) +#define glMultiTexCoord2f GLEW_GET_FUN(__glewMultiTexCoord2f) +#define glMultiTexCoord2fv GLEW_GET_FUN(__glewMultiTexCoord2fv) +#define glMultiTexCoord2i GLEW_GET_FUN(__glewMultiTexCoord2i) +#define glMultiTexCoord2iv GLEW_GET_FUN(__glewMultiTexCoord2iv) +#define glMultiTexCoord2s GLEW_GET_FUN(__glewMultiTexCoord2s) +#define glMultiTexCoord2sv GLEW_GET_FUN(__glewMultiTexCoord2sv) +#define glMultiTexCoord3d GLEW_GET_FUN(__glewMultiTexCoord3d) +#define glMultiTexCoord3dv GLEW_GET_FUN(__glewMultiTexCoord3dv) +#define glMultiTexCoord3f GLEW_GET_FUN(__glewMultiTexCoord3f) +#define glMultiTexCoord3fv GLEW_GET_FUN(__glewMultiTexCoord3fv) +#define glMultiTexCoord3i GLEW_GET_FUN(__glewMultiTexCoord3i) +#define glMultiTexCoord3iv GLEW_GET_FUN(__glewMultiTexCoord3iv) +#define glMultiTexCoord3s GLEW_GET_FUN(__glewMultiTexCoord3s) +#define glMultiTexCoord3sv GLEW_GET_FUN(__glewMultiTexCoord3sv) +#define glMultiTexCoord4d GLEW_GET_FUN(__glewMultiTexCoord4d) +#define glMultiTexCoord4dv GLEW_GET_FUN(__glewMultiTexCoord4dv) +#define glMultiTexCoord4f GLEW_GET_FUN(__glewMultiTexCoord4f) +#define glMultiTexCoord4fv GLEW_GET_FUN(__glewMultiTexCoord4fv) +#define glMultiTexCoord4i GLEW_GET_FUN(__glewMultiTexCoord4i) +#define glMultiTexCoord4iv GLEW_GET_FUN(__glewMultiTexCoord4iv) +#define glMultiTexCoord4s GLEW_GET_FUN(__glewMultiTexCoord4s) +#define glMultiTexCoord4sv GLEW_GET_FUN(__glewMultiTexCoord4sv) +#define glSampleCoverage GLEW_GET_FUN(__glewSampleCoverage) + +#define GLEW_VERSION_1_3 GLEW_GET_VAR(__GLEW_VERSION_1_3) + +#endif /* GL_VERSION_1_3 */ + +/* ----------------------------- GL_VERSION_1_4 ---------------------------- */ + +#ifndef GL_VERSION_1_4 +#define GL_VERSION_1_4 1 + +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_GENERATE_MIPMAP 0x8191 +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_DEPTH_COMPONENT24 0x81A6 +#define GL_DEPTH_COMPONENT32 0x81A7 +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_FOG_COORDINATE_SOURCE 0x8450 +#define GL_FOG_COORDINATE 0x8451 +#define GL_FRAGMENT_DEPTH 0x8452 +#define GL_CURRENT_FOG_COORDINATE 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 +#define GL_FOG_COORDINATE_ARRAY 0x8457 +#define GL_COLOR_SUM 0x8458 +#define GL_CURRENT_SECONDARY_COLOR 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D +#define GL_SECONDARY_COLOR_ARRAY 0x845E +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD +#define GL_TEXTURE_FILTER_CONTROL 0x8500 +#define GL_TEXTURE_LOD_BIAS 0x8501 +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_TEXTURE_DEPTH_SIZE 0x884A +#define GL_DEPTH_TEXTURE_MODE 0x884B +#define GL_TEXTURE_COMPARE_MODE 0x884C +#define GL_TEXTURE_COMPARE_FUNC 0x884D +#define GL_COMPARE_R_TO_TEXTURE 0x884E + +typedef void (GLAPIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDPROC) (GLdouble coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDVPROC) (const GLdouble *coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFPROC) (GLfloat coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFVPROC) (const GLfloat *coord); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei drawcount); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVPROC) (const GLdouble *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVPROC) (const GLfloat *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVPROC) (const GLint *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVPROC) (const GLshort *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVPROC) (const GLdouble *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVPROC) (const GLfloat *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVPROC) (const GLint *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVPROC) (const GLshort *p); + +#define glBlendColor GLEW_GET_FUN(__glewBlendColor) +#define glBlendEquation GLEW_GET_FUN(__glewBlendEquation) +#define glBlendFuncSeparate GLEW_GET_FUN(__glewBlendFuncSeparate) +#define glFogCoordPointer GLEW_GET_FUN(__glewFogCoordPointer) +#define glFogCoordd GLEW_GET_FUN(__glewFogCoordd) +#define glFogCoorddv GLEW_GET_FUN(__glewFogCoorddv) +#define glFogCoordf GLEW_GET_FUN(__glewFogCoordf) +#define glFogCoordfv GLEW_GET_FUN(__glewFogCoordfv) +#define glMultiDrawArrays GLEW_GET_FUN(__glewMultiDrawArrays) +#define glMultiDrawElements GLEW_GET_FUN(__glewMultiDrawElements) +#define glPointParameterf GLEW_GET_FUN(__glewPointParameterf) +#define glPointParameterfv GLEW_GET_FUN(__glewPointParameterfv) +#define glPointParameteri GLEW_GET_FUN(__glewPointParameteri) +#define glPointParameteriv GLEW_GET_FUN(__glewPointParameteriv) +#define glSecondaryColor3b GLEW_GET_FUN(__glewSecondaryColor3b) +#define glSecondaryColor3bv GLEW_GET_FUN(__glewSecondaryColor3bv) +#define glSecondaryColor3d GLEW_GET_FUN(__glewSecondaryColor3d) +#define glSecondaryColor3dv GLEW_GET_FUN(__glewSecondaryColor3dv) +#define glSecondaryColor3f GLEW_GET_FUN(__glewSecondaryColor3f) +#define glSecondaryColor3fv GLEW_GET_FUN(__glewSecondaryColor3fv) +#define glSecondaryColor3i GLEW_GET_FUN(__glewSecondaryColor3i) +#define glSecondaryColor3iv GLEW_GET_FUN(__glewSecondaryColor3iv) +#define glSecondaryColor3s GLEW_GET_FUN(__glewSecondaryColor3s) +#define glSecondaryColor3sv GLEW_GET_FUN(__glewSecondaryColor3sv) +#define glSecondaryColor3ub GLEW_GET_FUN(__glewSecondaryColor3ub) +#define glSecondaryColor3ubv GLEW_GET_FUN(__glewSecondaryColor3ubv) +#define glSecondaryColor3ui GLEW_GET_FUN(__glewSecondaryColor3ui) +#define glSecondaryColor3uiv GLEW_GET_FUN(__glewSecondaryColor3uiv) +#define glSecondaryColor3us GLEW_GET_FUN(__glewSecondaryColor3us) +#define glSecondaryColor3usv GLEW_GET_FUN(__glewSecondaryColor3usv) +#define glSecondaryColorPointer GLEW_GET_FUN(__glewSecondaryColorPointer) +#define glWindowPos2d GLEW_GET_FUN(__glewWindowPos2d) +#define glWindowPos2dv GLEW_GET_FUN(__glewWindowPos2dv) +#define glWindowPos2f GLEW_GET_FUN(__glewWindowPos2f) +#define glWindowPos2fv GLEW_GET_FUN(__glewWindowPos2fv) +#define glWindowPos2i GLEW_GET_FUN(__glewWindowPos2i) +#define glWindowPos2iv GLEW_GET_FUN(__glewWindowPos2iv) +#define glWindowPos2s GLEW_GET_FUN(__glewWindowPos2s) +#define glWindowPos2sv GLEW_GET_FUN(__glewWindowPos2sv) +#define glWindowPos3d GLEW_GET_FUN(__glewWindowPos3d) +#define glWindowPos3dv GLEW_GET_FUN(__glewWindowPos3dv) +#define glWindowPos3f GLEW_GET_FUN(__glewWindowPos3f) +#define glWindowPos3fv GLEW_GET_FUN(__glewWindowPos3fv) +#define glWindowPos3i GLEW_GET_FUN(__glewWindowPos3i) +#define glWindowPos3iv GLEW_GET_FUN(__glewWindowPos3iv) +#define glWindowPos3s GLEW_GET_FUN(__glewWindowPos3s) +#define glWindowPos3sv GLEW_GET_FUN(__glewWindowPos3sv) + +#define GLEW_VERSION_1_4 GLEW_GET_VAR(__GLEW_VERSION_1_4) + +#endif /* GL_VERSION_1_4 */ + +/* ----------------------------- GL_VERSION_1_5 ---------------------------- */ + +#ifndef GL_VERSION_1_5 +#define GL_VERSION_1_5 1 + +#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE +#define GL_FOG_COORD GL_FOG_COORDINATE +#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY +#define GL_SRC0_RGB GL_SOURCE0_RGB +#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER +#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE +#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA +#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE +#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE +#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA +#define GL_SRC1_RGB GL_SOURCE1_RGB +#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING +#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA +#define GL_SRC2_RGB GL_SOURCE2_RGB +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_QUERY_COUNTER_BITS 0x8864 +#define GL_CURRENT_QUERY 0x8865 +#define GL_QUERY_RESULT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE 0x8867 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_READ_ONLY 0x88B8 +#define GL_WRITE_ONLY 0x88B9 +#define GL_READ_WRITE 0x88BA +#define GL_BUFFER_ACCESS 0x88BB +#define GL_BUFFER_MAPPED 0x88BC +#define GL_BUFFER_MAP_POINTER 0x88BD +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#define GL_SAMPLES_PASSED 0x8914 + +typedef ptrdiff_t GLintptr; +typedef ptrdiff_t GLsizeiptr; + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDQUERYPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGENBUFFERSPROC) (GLsizei n, GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGENQUERIESPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid* data); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERPROC) (GLuint buffer); +typedef GLboolean (GLAPIENTRY * PFNGLISQUERYPROC) (GLuint id); +typedef GLvoid* (GLAPIENTRY * PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERPROC) (GLenum target); + +#define glBeginQuery GLEW_GET_FUN(__glewBeginQuery) +#define glBindBuffer GLEW_GET_FUN(__glewBindBuffer) +#define glBufferData GLEW_GET_FUN(__glewBufferData) +#define glBufferSubData GLEW_GET_FUN(__glewBufferSubData) +#define glDeleteBuffers GLEW_GET_FUN(__glewDeleteBuffers) +#define glDeleteQueries GLEW_GET_FUN(__glewDeleteQueries) +#define glEndQuery GLEW_GET_FUN(__glewEndQuery) +#define glGenBuffers GLEW_GET_FUN(__glewGenBuffers) +#define glGenQueries GLEW_GET_FUN(__glewGenQueries) +#define glGetBufferParameteriv GLEW_GET_FUN(__glewGetBufferParameteriv) +#define glGetBufferPointerv GLEW_GET_FUN(__glewGetBufferPointerv) +#define glGetBufferSubData GLEW_GET_FUN(__glewGetBufferSubData) +#define glGetQueryObjectiv GLEW_GET_FUN(__glewGetQueryObjectiv) +#define glGetQueryObjectuiv GLEW_GET_FUN(__glewGetQueryObjectuiv) +#define glGetQueryiv GLEW_GET_FUN(__glewGetQueryiv) +#define glIsBuffer GLEW_GET_FUN(__glewIsBuffer) +#define glIsQuery GLEW_GET_FUN(__glewIsQuery) +#define glMapBuffer GLEW_GET_FUN(__glewMapBuffer) +#define glUnmapBuffer GLEW_GET_FUN(__glewUnmapBuffer) + +#define GLEW_VERSION_1_5 GLEW_GET_VAR(__GLEW_VERSION_1_5) + +#endif /* GL_VERSION_1_5 */ + +/* ----------------------------- GL_VERSION_2_0 ---------------------------- */ + +#ifndef GL_VERSION_2_0 +#define GL_VERSION_2_0 1 + +#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_MAX_DRAW_BUFFERS 0x8824 +#define GL_DRAW_BUFFER0 0x8825 +#define GL_DRAW_BUFFER1 0x8826 +#define GL_DRAW_BUFFER2 0x8827 +#define GL_DRAW_BUFFER3 0x8828 +#define GL_DRAW_BUFFER4 0x8829 +#define GL_DRAW_BUFFER5 0x882A +#define GL_DRAW_BUFFER6 0x882B +#define GL_DRAW_BUFFER7 0x882C +#define GL_DRAW_BUFFER8 0x882D +#define GL_DRAW_BUFFER9 0x882E +#define GL_DRAW_BUFFER10 0x882F +#define GL_DRAW_BUFFER11 0x8830 +#define GL_DRAW_BUFFER12 0x8831 +#define GL_DRAW_BUFFER13 0x8832 +#define GL_DRAW_BUFFER14 0x8833 +#define GL_DRAW_BUFFER15 0x8834 +#define GL_BLEND_EQUATION_ALPHA 0x883D +#define GL_POINT_SPRITE 0x8861 +#define GL_COORD_REPLACE 0x8862 +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_MAX_TEXTURE_COORDS 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A +#define GL_MAX_VARYING_FLOATS 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_SHADER_TYPE 0x8B4F +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_1D 0x8B5D +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_3D 0x8B5F +#define GL_SAMPLER_CUBE 0x8B60 +#define GL_SAMPLER_1D_SHADOW 0x8B61 +#define GL_SAMPLER_2D_SHADOW 0x8B62 +#define GL_DELETE_STATUS 0x8B80 +#define GL_COMPILE_STATUS 0x8B81 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D +#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 + +typedef void (GLAPIENTRY * PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum, GLenum); +typedef void (GLAPIENTRY * PFNGLCOMPILESHADERPROC) (GLuint shader); +typedef GLuint (GLAPIENTRY * PFNGLCREATEPROGRAMPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROC) (GLenum type); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLDELETESHADERPROC) (GLuint shader); +typedef void (GLAPIENTRY * PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint); +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum* bufs); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint); +typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders); +typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog); +typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEPROC) (GLuint obj, GLsizei maxLength, GLsizei* length, GLchar* source); +typedef void (GLAPIENTRY * PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint* param); +typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint, GLenum, GLvoid**); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVPROC) (GLuint, GLenum, GLdouble*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVPROC) (GLuint, GLenum, GLfloat*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVPROC) (GLuint, GLenum, GLint*); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPROC) (GLuint program); +typedef GLboolean (GLAPIENTRY * PFNGLISSHADERPROC) (GLuint shader); +typedef void (GLAPIENTRY * PFNGLLINKPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar** strings, const GLint* lengths); +typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILMASKSEPARATEPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IPROC) (GLint location, GLint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* pointer); + +#define glAttachShader GLEW_GET_FUN(__glewAttachShader) +#define glBindAttribLocation GLEW_GET_FUN(__glewBindAttribLocation) +#define glBlendEquationSeparate GLEW_GET_FUN(__glewBlendEquationSeparate) +#define glCompileShader GLEW_GET_FUN(__glewCompileShader) +#define glCreateProgram GLEW_GET_FUN(__glewCreateProgram) +#define glCreateShader GLEW_GET_FUN(__glewCreateShader) +#define glDeleteProgram GLEW_GET_FUN(__glewDeleteProgram) +#define glDeleteShader GLEW_GET_FUN(__glewDeleteShader) +#define glDetachShader GLEW_GET_FUN(__glewDetachShader) +#define glDisableVertexAttribArray GLEW_GET_FUN(__glewDisableVertexAttribArray) +#define glDrawBuffers GLEW_GET_FUN(__glewDrawBuffers) +#define glEnableVertexAttribArray GLEW_GET_FUN(__glewEnableVertexAttribArray) +#define glGetActiveAttrib GLEW_GET_FUN(__glewGetActiveAttrib) +#define glGetActiveUniform GLEW_GET_FUN(__glewGetActiveUniform) +#define glGetAttachedShaders GLEW_GET_FUN(__glewGetAttachedShaders) +#define glGetAttribLocation GLEW_GET_FUN(__glewGetAttribLocation) +#define glGetProgramInfoLog GLEW_GET_FUN(__glewGetProgramInfoLog) +#define glGetProgramiv GLEW_GET_FUN(__glewGetProgramiv) +#define glGetShaderInfoLog GLEW_GET_FUN(__glewGetShaderInfoLog) +#define glGetShaderSource GLEW_GET_FUN(__glewGetShaderSource) +#define glGetShaderiv GLEW_GET_FUN(__glewGetShaderiv) +#define glGetUniformLocation GLEW_GET_FUN(__glewGetUniformLocation) +#define glGetUniformfv GLEW_GET_FUN(__glewGetUniformfv) +#define glGetUniformiv GLEW_GET_FUN(__glewGetUniformiv) +#define glGetVertexAttribPointerv GLEW_GET_FUN(__glewGetVertexAttribPointerv) +#define glGetVertexAttribdv GLEW_GET_FUN(__glewGetVertexAttribdv) +#define glGetVertexAttribfv GLEW_GET_FUN(__glewGetVertexAttribfv) +#define glGetVertexAttribiv GLEW_GET_FUN(__glewGetVertexAttribiv) +#define glIsProgram GLEW_GET_FUN(__glewIsProgram) +#define glIsShader GLEW_GET_FUN(__glewIsShader) +#define glLinkProgram GLEW_GET_FUN(__glewLinkProgram) +#define glShaderSource GLEW_GET_FUN(__glewShaderSource) +#define glStencilFuncSeparate GLEW_GET_FUN(__glewStencilFuncSeparate) +#define glStencilMaskSeparate GLEW_GET_FUN(__glewStencilMaskSeparate) +#define glStencilOpSeparate GLEW_GET_FUN(__glewStencilOpSeparate) +#define glUniform1f GLEW_GET_FUN(__glewUniform1f) +#define glUniform1fv GLEW_GET_FUN(__glewUniform1fv) +#define glUniform1i GLEW_GET_FUN(__glewUniform1i) +#define glUniform1iv GLEW_GET_FUN(__glewUniform1iv) +#define glUniform2f GLEW_GET_FUN(__glewUniform2f) +#define glUniform2fv GLEW_GET_FUN(__glewUniform2fv) +#define glUniform2i GLEW_GET_FUN(__glewUniform2i) +#define glUniform2iv GLEW_GET_FUN(__glewUniform2iv) +#define glUniform3f GLEW_GET_FUN(__glewUniform3f) +#define glUniform3fv GLEW_GET_FUN(__glewUniform3fv) +#define glUniform3i GLEW_GET_FUN(__glewUniform3i) +#define glUniform3iv GLEW_GET_FUN(__glewUniform3iv) +#define glUniform4f GLEW_GET_FUN(__glewUniform4f) +#define glUniform4fv GLEW_GET_FUN(__glewUniform4fv) +#define glUniform4i GLEW_GET_FUN(__glewUniform4i) +#define glUniform4iv GLEW_GET_FUN(__glewUniform4iv) +#define glUniformMatrix2fv GLEW_GET_FUN(__glewUniformMatrix2fv) +#define glUniformMatrix3fv GLEW_GET_FUN(__glewUniformMatrix3fv) +#define glUniformMatrix4fv GLEW_GET_FUN(__glewUniformMatrix4fv) +#define glUseProgram GLEW_GET_FUN(__glewUseProgram) +#define glValidateProgram GLEW_GET_FUN(__glewValidateProgram) +#define glVertexAttrib1d GLEW_GET_FUN(__glewVertexAttrib1d) +#define glVertexAttrib1dv GLEW_GET_FUN(__glewVertexAttrib1dv) +#define glVertexAttrib1f GLEW_GET_FUN(__glewVertexAttrib1f) +#define glVertexAttrib1fv GLEW_GET_FUN(__glewVertexAttrib1fv) +#define glVertexAttrib1s GLEW_GET_FUN(__glewVertexAttrib1s) +#define glVertexAttrib1sv GLEW_GET_FUN(__glewVertexAttrib1sv) +#define glVertexAttrib2d GLEW_GET_FUN(__glewVertexAttrib2d) +#define glVertexAttrib2dv GLEW_GET_FUN(__glewVertexAttrib2dv) +#define glVertexAttrib2f GLEW_GET_FUN(__glewVertexAttrib2f) +#define glVertexAttrib2fv GLEW_GET_FUN(__glewVertexAttrib2fv) +#define glVertexAttrib2s GLEW_GET_FUN(__glewVertexAttrib2s) +#define glVertexAttrib2sv GLEW_GET_FUN(__glewVertexAttrib2sv) +#define glVertexAttrib3d GLEW_GET_FUN(__glewVertexAttrib3d) +#define glVertexAttrib3dv GLEW_GET_FUN(__glewVertexAttrib3dv) +#define glVertexAttrib3f GLEW_GET_FUN(__glewVertexAttrib3f) +#define glVertexAttrib3fv GLEW_GET_FUN(__glewVertexAttrib3fv) +#define glVertexAttrib3s GLEW_GET_FUN(__glewVertexAttrib3s) +#define glVertexAttrib3sv GLEW_GET_FUN(__glewVertexAttrib3sv) +#define glVertexAttrib4Nbv GLEW_GET_FUN(__glewVertexAttrib4Nbv) +#define glVertexAttrib4Niv GLEW_GET_FUN(__glewVertexAttrib4Niv) +#define glVertexAttrib4Nsv GLEW_GET_FUN(__glewVertexAttrib4Nsv) +#define glVertexAttrib4Nub GLEW_GET_FUN(__glewVertexAttrib4Nub) +#define glVertexAttrib4Nubv GLEW_GET_FUN(__glewVertexAttrib4Nubv) +#define glVertexAttrib4Nuiv GLEW_GET_FUN(__glewVertexAttrib4Nuiv) +#define glVertexAttrib4Nusv GLEW_GET_FUN(__glewVertexAttrib4Nusv) +#define glVertexAttrib4bv GLEW_GET_FUN(__glewVertexAttrib4bv) +#define glVertexAttrib4d GLEW_GET_FUN(__glewVertexAttrib4d) +#define glVertexAttrib4dv GLEW_GET_FUN(__glewVertexAttrib4dv) +#define glVertexAttrib4f GLEW_GET_FUN(__glewVertexAttrib4f) +#define glVertexAttrib4fv GLEW_GET_FUN(__glewVertexAttrib4fv) +#define glVertexAttrib4iv GLEW_GET_FUN(__glewVertexAttrib4iv) +#define glVertexAttrib4s GLEW_GET_FUN(__glewVertexAttrib4s) +#define glVertexAttrib4sv GLEW_GET_FUN(__glewVertexAttrib4sv) +#define glVertexAttrib4ubv GLEW_GET_FUN(__glewVertexAttrib4ubv) +#define glVertexAttrib4uiv GLEW_GET_FUN(__glewVertexAttrib4uiv) +#define glVertexAttrib4usv GLEW_GET_FUN(__glewVertexAttrib4usv) +#define glVertexAttribPointer GLEW_GET_FUN(__glewVertexAttribPointer) + +#define GLEW_VERSION_2_0 GLEW_GET_VAR(__GLEW_VERSION_2_0) + +#endif /* GL_VERSION_2_0 */ + +/* ----------------------------- GL_VERSION_2_1 ---------------------------- */ + +#ifndef GL_VERSION_2_1 +#define GL_VERSION_2_1 1 + +#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F +#define GL_PIXEL_PACK_BUFFER 0x88EB +#define GL_PIXEL_UNPACK_BUFFER 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF +#define GL_FLOAT_MAT2x3 0x8B65 +#define GL_FLOAT_MAT2x4 0x8B66 +#define GL_FLOAT_MAT3x2 0x8B67 +#define GL_FLOAT_MAT3x4 0x8B68 +#define GL_FLOAT_MAT4x2 0x8B69 +#define GL_FLOAT_MAT4x3 0x8B6A +#define GL_SRGB 0x8C40 +#define GL_SRGB8 0x8C41 +#define GL_SRGB_ALPHA 0x8C42 +#define GL_SRGB8_ALPHA8 0x8C43 +#define GL_SLUMINANCE_ALPHA 0x8C44 +#define GL_SLUMINANCE8_ALPHA8 0x8C45 +#define GL_SLUMINANCE 0x8C46 +#define GL_SLUMINANCE8 0x8C47 +#define GL_COMPRESSED_SRGB 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 +#define GL_COMPRESSED_SLUMINANCE 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B + +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + +#define glUniformMatrix2x3fv GLEW_GET_FUN(__glewUniformMatrix2x3fv) +#define glUniformMatrix2x4fv GLEW_GET_FUN(__glewUniformMatrix2x4fv) +#define glUniformMatrix3x2fv GLEW_GET_FUN(__glewUniformMatrix3x2fv) +#define glUniformMatrix3x4fv GLEW_GET_FUN(__glewUniformMatrix3x4fv) +#define glUniformMatrix4x2fv GLEW_GET_FUN(__glewUniformMatrix4x2fv) +#define glUniformMatrix4x3fv GLEW_GET_FUN(__glewUniformMatrix4x3fv) + +#define GLEW_VERSION_2_1 GLEW_GET_VAR(__GLEW_VERSION_2_1) + +#endif /* GL_VERSION_2_1 */ + +/* ----------------------------- GL_VERSION_3_0 ---------------------------- */ + +#ifndef GL_VERSION_3_0 +#define GL_VERSION_3_0 1 + +#define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES +#define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5 +#define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1 +#define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3 +#define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB +#define GL_CLIP_DISTANCE0 GL_CLIP_PLANE0 +#define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4 +#define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2 +#define GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS +#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 +#define GL_MAJOR_VERSION 0x821B +#define GL_MINOR_VERSION 0x821C +#define GL_NUM_EXTENSIONS 0x821D +#define GL_CONTEXT_FLAGS 0x821E +#define GL_DEPTH_BUFFER 0x8223 +#define GL_STENCIL_BUFFER 0x8224 +#define GL_RGBA32F 0x8814 +#define GL_RGB32F 0x8815 +#define GL_RGBA16F 0x881A +#define GL_RGB16F 0x881B +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD +#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF +#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 +#define GL_CLAMP_VERTEX_COLOR 0x891A +#define GL_CLAMP_FRAGMENT_COLOR 0x891B +#define GL_CLAMP_READ_COLOR 0x891C +#define GL_FIXED_ONLY 0x891D +#define GL_TEXTURE_RED_TYPE 0x8C10 +#define GL_TEXTURE_GREEN_TYPE 0x8C11 +#define GL_TEXTURE_BLUE_TYPE 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE 0x8C16 +#define GL_TEXTURE_1D_ARRAY 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 +#define GL_TEXTURE_2D_ARRAY 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D +#define GL_R11F_G11F_B10F 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B +#define GL_RGB9_E5 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E +#define GL_TEXTURE_SHARED_SIZE 0x8C3F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 +#define GL_PRIMITIVES_GENERATED 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 +#define GL_RASTERIZER_DISCARD 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B +#define GL_INTERLEAVED_ATTRIBS 0x8C8C +#define GL_SEPARATE_ATTRIBS 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F +#define GL_RGBA32UI 0x8D70 +#define GL_RGB32UI 0x8D71 +#define GL_RGBA16UI 0x8D76 +#define GL_RGB16UI 0x8D77 +#define GL_RGBA8UI 0x8D7C +#define GL_RGB8UI 0x8D7D +#define GL_RGBA32I 0x8D82 +#define GL_RGB32I 0x8D83 +#define GL_RGBA16I 0x8D88 +#define GL_RGB16I 0x8D89 +#define GL_RGBA8I 0x8D8E +#define GL_RGB8I 0x8D8F +#define GL_RED_INTEGER 0x8D94 +#define GL_GREEN_INTEGER 0x8D95 +#define GL_BLUE_INTEGER 0x8D96 +#define GL_ALPHA_INTEGER 0x8D97 +#define GL_RGB_INTEGER 0x8D98 +#define GL_RGBA_INTEGER 0x8D99 +#define GL_BGR_INTEGER 0x8D9A +#define GL_BGRA_INTEGER 0x8D9B +#define GL_SAMPLER_1D_ARRAY 0x8DC0 +#define GL_SAMPLER_2D_ARRAY 0x8DC1 +#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 +#define GL_UNSIGNED_INT_VEC2 0x8DC6 +#define GL_UNSIGNED_INT_VEC3 0x8DC7 +#define GL_UNSIGNED_INT_VEC4 0x8DC8 +#define GL_INT_SAMPLER_1D 0x8DC9 +#define GL_INT_SAMPLER_2D 0x8DCA +#define GL_INT_SAMPLER_3D 0x8DCB +#define GL_INT_SAMPLER_CUBE 0x8DCC +#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF +#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 +#define GL_QUERY_WAIT 0x8E13 +#define GL_QUERY_NO_WAIT 0x8E14 +#define GL_QUERY_BY_REGION_WAIT 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 + +typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERPROC) (GLuint, GLenum); +typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum); +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONPROC) (GLuint, GLuint, const GLchar*); +typedef void (GLAPIENTRY * PFNGLCLAMPCOLORPROC) (GLenum, GLenum); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFIPROC) (GLenum, GLint, GLfloat, GLint); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFVPROC) (GLenum, GLint, const GLfloat*); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERIVPROC) (GLenum, GLint, const GLint*); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERUIVPROC) (GLenum, GLint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLCOLORMASKIPROC) (GLuint, GLboolean, GLboolean, GLboolean, GLboolean); +typedef void (GLAPIENTRY * PFNGLDISABLEIPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLENABLEIPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERPROC) (void); +typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETBOOLEANI_VPROC) (GLenum, GLuint, GLboolean*); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONPROC) (GLuint, const GLchar*); +typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGIPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVPROC) (GLenum, GLenum, GLint*); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVPROC) (GLenum, GLenum, GLuint*); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVPROC) (GLuint, GLint, GLuint*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVPROC) (GLuint, GLenum, GLint*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint, GLenum, GLuint*); +typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDIPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVPROC) (GLenum, GLenum, const GLint*); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVPROC) (GLenum, GLenum, const GLuint*); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint, GLsizei, const GLchar **, GLenum); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIPROC) (GLint, GLuint); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVPROC) (GLint, GLsizei, const GLuint*); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIPROC) (GLint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVPROC) (GLint, GLsizei, const GLuint*); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIPROC) (GLint, GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVPROC) (GLint, GLsizei, const GLuint*); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIPROC) (GLint, GLuint, GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVPROC) (GLint, GLsizei, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IPROC) (GLuint, GLint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVPROC) (GLuint, const GLint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIPROC) (GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVPROC) (GLuint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IPROC) (GLuint, GLint, GLint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVPROC) (GLuint, const GLint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIPROC) (GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVPROC) (GLuint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IPROC) (GLuint, GLint, GLint, GLint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVPROC) (GLuint, const GLint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIPROC) (GLuint, GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVPROC) (GLuint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVPROC) (GLuint, const GLbyte*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IPROC) (GLuint, GLint, GLint, GLint, GLint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVPROC) (GLuint, const GLint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVPROC) (GLuint, const GLshort*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVPROC) (GLuint, const GLubyte*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIPROC) (GLuint, GLuint, GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVPROC) (GLuint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVPROC) (GLuint, const GLushort*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint, GLint, GLenum, GLsizei, const GLvoid*); + +#define glBeginConditionalRender GLEW_GET_FUN(__glewBeginConditionalRender) +#define glBeginTransformFeedback GLEW_GET_FUN(__glewBeginTransformFeedback) +#define glBindFragDataLocation GLEW_GET_FUN(__glewBindFragDataLocation) +#define glClampColor GLEW_GET_FUN(__glewClampColor) +#define glClearBufferfi GLEW_GET_FUN(__glewClearBufferfi) +#define glClearBufferfv GLEW_GET_FUN(__glewClearBufferfv) +#define glClearBufferiv GLEW_GET_FUN(__glewClearBufferiv) +#define glClearBufferuiv GLEW_GET_FUN(__glewClearBufferuiv) +#define glColorMaski GLEW_GET_FUN(__glewColorMaski) +#define glDisablei GLEW_GET_FUN(__glewDisablei) +#define glEnablei GLEW_GET_FUN(__glewEnablei) +#define glEndConditionalRender GLEW_GET_FUN(__glewEndConditionalRender) +#define glEndTransformFeedback GLEW_GET_FUN(__glewEndTransformFeedback) +#define glGetBooleani_v GLEW_GET_FUN(__glewGetBooleani_v) +#define glGetFragDataLocation GLEW_GET_FUN(__glewGetFragDataLocation) +#define glGetStringi GLEW_GET_FUN(__glewGetStringi) +#define glGetTexParameterIiv GLEW_GET_FUN(__glewGetTexParameterIiv) +#define glGetTexParameterIuiv GLEW_GET_FUN(__glewGetTexParameterIuiv) +#define glGetTransformFeedbackVarying GLEW_GET_FUN(__glewGetTransformFeedbackVarying) +#define glGetUniformuiv GLEW_GET_FUN(__glewGetUniformuiv) +#define glGetVertexAttribIiv GLEW_GET_FUN(__glewGetVertexAttribIiv) +#define glGetVertexAttribIuiv GLEW_GET_FUN(__glewGetVertexAttribIuiv) +#define glIsEnabledi GLEW_GET_FUN(__glewIsEnabledi) +#define glTexParameterIiv GLEW_GET_FUN(__glewTexParameterIiv) +#define glTexParameterIuiv GLEW_GET_FUN(__glewTexParameterIuiv) +#define glTransformFeedbackVaryings GLEW_GET_FUN(__glewTransformFeedbackVaryings) +#define glUniform1ui GLEW_GET_FUN(__glewUniform1ui) +#define glUniform1uiv GLEW_GET_FUN(__glewUniform1uiv) +#define glUniform2ui GLEW_GET_FUN(__glewUniform2ui) +#define glUniform2uiv GLEW_GET_FUN(__glewUniform2uiv) +#define glUniform3ui GLEW_GET_FUN(__glewUniform3ui) +#define glUniform3uiv GLEW_GET_FUN(__glewUniform3uiv) +#define glUniform4ui GLEW_GET_FUN(__glewUniform4ui) +#define glUniform4uiv GLEW_GET_FUN(__glewUniform4uiv) +#define glVertexAttribI1i GLEW_GET_FUN(__glewVertexAttribI1i) +#define glVertexAttribI1iv GLEW_GET_FUN(__glewVertexAttribI1iv) +#define glVertexAttribI1ui GLEW_GET_FUN(__glewVertexAttribI1ui) +#define glVertexAttribI1uiv GLEW_GET_FUN(__glewVertexAttribI1uiv) +#define glVertexAttribI2i GLEW_GET_FUN(__glewVertexAttribI2i) +#define glVertexAttribI2iv GLEW_GET_FUN(__glewVertexAttribI2iv) +#define glVertexAttribI2ui GLEW_GET_FUN(__glewVertexAttribI2ui) +#define glVertexAttribI2uiv GLEW_GET_FUN(__glewVertexAttribI2uiv) +#define glVertexAttribI3i GLEW_GET_FUN(__glewVertexAttribI3i) +#define glVertexAttribI3iv GLEW_GET_FUN(__glewVertexAttribI3iv) +#define glVertexAttribI3ui GLEW_GET_FUN(__glewVertexAttribI3ui) +#define glVertexAttribI3uiv GLEW_GET_FUN(__glewVertexAttribI3uiv) +#define glVertexAttribI4bv GLEW_GET_FUN(__glewVertexAttribI4bv) +#define glVertexAttribI4i GLEW_GET_FUN(__glewVertexAttribI4i) +#define glVertexAttribI4iv GLEW_GET_FUN(__glewVertexAttribI4iv) +#define glVertexAttribI4sv GLEW_GET_FUN(__glewVertexAttribI4sv) +#define glVertexAttribI4ubv GLEW_GET_FUN(__glewVertexAttribI4ubv) +#define glVertexAttribI4ui GLEW_GET_FUN(__glewVertexAttribI4ui) +#define glVertexAttribI4uiv GLEW_GET_FUN(__glewVertexAttribI4uiv) +#define glVertexAttribI4usv GLEW_GET_FUN(__glewVertexAttribI4usv) +#define glVertexAttribIPointer GLEW_GET_FUN(__glewVertexAttribIPointer) + +#define GLEW_VERSION_3_0 GLEW_GET_VAR(__GLEW_VERSION_3_0) + +#endif /* GL_VERSION_3_0 */ + +/* ----------------------------- GL_VERSION_3_1 ---------------------------- */ + +#ifndef GL_VERSION_3_1 +#define GL_VERSION_3_1 1 + +#define GL_TEXTURE_RECTANGLE 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 +#define GL_SAMPLER_2D_RECT 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 +#define GL_TEXTURE_BUFFER 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT 0x8C2E +#define GL_SAMPLER_BUFFER 0x8DC2 +#define GL_INT_SAMPLER_2D_RECT 0x8DCD +#define GL_INT_SAMPLER_BUFFER 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 +#define GL_RED_SNORM 0x8F90 +#define GL_RG_SNORM 0x8F91 +#define GL_RGB_SNORM 0x8F92 +#define GL_RGBA_SNORM 0x8F93 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM 0x8F98 +#define GL_RG16_SNORM 0x8F99 +#define GL_RGB16_SNORM 0x8F9A +#define GL_RGBA16_SNORM 0x8F9B +#define GL_SIGNED_NORMALIZED 0x8F9C +#define GL_PRIMITIVE_RESTART 0x8F9D +#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E +#define GL_BUFFER_ACCESS_FLAGS 0x911F +#define GL_BUFFER_MAP_LENGTH 0x9120 +#define GL_BUFFER_MAP_OFFSET 0x9121 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum, GLint, GLsizei, GLsizei); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum, GLsizei, GLenum, const GLvoid*, GLsizei); +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint); +typedef void (GLAPIENTRY * PFNGLTEXBUFFERPROC) (GLenum, GLenum, GLuint); + +#define glDrawArraysInstanced GLEW_GET_FUN(__glewDrawArraysInstanced) +#define glDrawElementsInstanced GLEW_GET_FUN(__glewDrawElementsInstanced) +#define glPrimitiveRestartIndex GLEW_GET_FUN(__glewPrimitiveRestartIndex) +#define glTexBuffer GLEW_GET_FUN(__glewTexBuffer) + +#define GLEW_VERSION_3_1 GLEW_GET_VAR(__GLEW_VERSION_3_1) + +#endif /* GL_VERSION_3_1 */ + +/* ----------------------------- GL_VERSION_3_2 ---------------------------- */ + +#ifndef GL_VERSION_3_2 +#define GL_VERSION_3_2 1 + +#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 +#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 +#define GL_LINES_ADJACENCY 0x000A +#define GL_LINE_STRIP_ADJACENCY 0x000B +#define GL_TRIANGLES_ADJACENCY 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D +#define GL_PROGRAM_POINT_SIZE 0x8642 +#define GL_GEOMETRY_VERTICES_OUT 0x8916 +#define GL_GEOMETRY_INPUT_TYPE 0x8917 +#define GL_GEOMETRY_OUTPUT_TYPE 0x8918 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 +#define GL_GEOMETRY_SHADER 0x8DD9 +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 +#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 +#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 +#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 +#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 +#define GL_CONTEXT_PROFILE_MASK 0x9126 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum, GLenum, GLuint, GLint); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum, GLenum, GLint64 *); +typedef void (GLAPIENTRY * PFNGLGETINTEGER64I_VPROC) (GLenum, GLuint, GLint64 *); + +#define glFramebufferTexture GLEW_GET_FUN(__glewFramebufferTexture) +#define glGetBufferParameteri64v GLEW_GET_FUN(__glewGetBufferParameteri64v) +#define glGetInteger64i_v GLEW_GET_FUN(__glewGetInteger64i_v) + +#define GLEW_VERSION_3_2 GLEW_GET_VAR(__GLEW_VERSION_3_2) + +#endif /* GL_VERSION_3_2 */ + +/* ----------------------------- GL_VERSION_3_3 ---------------------------- */ + +#ifndef GL_VERSION_3_3 +#define GL_VERSION_3_3 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE +#define GL_RGB10_A2UI 0x906F + +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); + +#define glVertexAttribDivisor GLEW_GET_FUN(__glewVertexAttribDivisor) + +#define GLEW_VERSION_3_3 GLEW_GET_VAR(__GLEW_VERSION_3_3) + +#endif /* GL_VERSION_3_3 */ + +/* ----------------------------- GL_VERSION_4_0 ---------------------------- */ + +#ifndef GL_VERSION_4_0 +#define GL_VERSION_4_0 1 + +#define GL_SAMPLE_SHADING 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F +#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS 0x8F9F +#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGPROC) (GLclampf value); + +#define glBlendEquationSeparatei GLEW_GET_FUN(__glewBlendEquationSeparatei) +#define glBlendEquationi GLEW_GET_FUN(__glewBlendEquationi) +#define glBlendFuncSeparatei GLEW_GET_FUN(__glewBlendFuncSeparatei) +#define glBlendFunci GLEW_GET_FUN(__glewBlendFunci) +#define glMinSampleShading GLEW_GET_FUN(__glewMinSampleShading) + +#define GLEW_VERSION_4_0 GLEW_GET_VAR(__GLEW_VERSION_4_0) + +#endif /* GL_VERSION_4_0 */ + +/* ----------------------------- GL_VERSION_4_1 ---------------------------- */ + +#ifndef GL_VERSION_4_1 +#define GL_VERSION_4_1 1 + +#define GLEW_VERSION_4_1 GLEW_GET_VAR(__GLEW_VERSION_4_1) + +#endif /* GL_VERSION_4_1 */ + +/* ----------------------------- GL_VERSION_4_2 ---------------------------- */ + +#ifndef GL_VERSION_4_2 +#define GL_VERSION_4_2 1 + +#define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F + +#define GLEW_VERSION_4_2 GLEW_GET_VAR(__GLEW_VERSION_4_2) + +#endif /* GL_VERSION_4_2 */ + +/* ----------------------------- GL_VERSION_4_3 ---------------------------- */ + +#ifndef GL_VERSION_4_3 +#define GL_VERSION_4_3 1 + +#define GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9 +#define GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E + +#define GLEW_VERSION_4_3 GLEW_GET_VAR(__GLEW_VERSION_4_3) + +#endif /* GL_VERSION_4_3 */ + +/* ----------------------------- GL_VERSION_4_4 ---------------------------- */ + +#ifndef GL_VERSION_4_4 +#define GL_VERSION_4_4 1 + +#define GL_MAX_VERTEX_ATTRIB_STRIDE 0x82E5 + +#define GLEW_VERSION_4_4 GLEW_GET_VAR(__GLEW_VERSION_4_4) + +#endif /* GL_VERSION_4_4 */ + +/* -------------------------- GL_3DFX_multisample -------------------------- */ + +#ifndef GL_3DFX_multisample +#define GL_3DFX_multisample 1 + +#define GL_MULTISAMPLE_3DFX 0x86B2 +#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 +#define GL_SAMPLES_3DFX 0x86B4 +#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 + +#define GLEW_3DFX_multisample GLEW_GET_VAR(__GLEW_3DFX_multisample) + +#endif /* GL_3DFX_multisample */ + +/* ---------------------------- GL_3DFX_tbuffer ---------------------------- */ + +#ifndef GL_3DFX_tbuffer +#define GL_3DFX_tbuffer 1 + +typedef void (GLAPIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); + +#define glTbufferMask3DFX GLEW_GET_FUN(__glewTbufferMask3DFX) + +#define GLEW_3DFX_tbuffer GLEW_GET_VAR(__GLEW_3DFX_tbuffer) + +#endif /* GL_3DFX_tbuffer */ + +/* -------------------- GL_3DFX_texture_compression_FXT1 ------------------- */ + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_3DFX_texture_compression_FXT1 1 + +#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 +#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 + +#define GLEW_3DFX_texture_compression_FXT1 GLEW_GET_VAR(__GLEW_3DFX_texture_compression_FXT1) + +#endif /* GL_3DFX_texture_compression_FXT1 */ + +/* ----------------------- GL_AMD_blend_minmax_factor ---------------------- */ + +#ifndef GL_AMD_blend_minmax_factor +#define GL_AMD_blend_minmax_factor 1 + +#define GL_FACTOR_MIN_AMD 0x901C +#define GL_FACTOR_MAX_AMD 0x901D + +#define GLEW_AMD_blend_minmax_factor GLEW_GET_VAR(__GLEW_AMD_blend_minmax_factor) + +#endif /* GL_AMD_blend_minmax_factor */ + +/* ----------------------- GL_AMD_conservative_depth ----------------------- */ + +#ifndef GL_AMD_conservative_depth +#define GL_AMD_conservative_depth 1 + +#define GLEW_AMD_conservative_depth GLEW_GET_VAR(__GLEW_AMD_conservative_depth) + +#endif /* GL_AMD_conservative_depth */ + +/* -------------------------- GL_AMD_debug_output -------------------------- */ + +#ifndef GL_AMD_debug_output +#define GL_AMD_debug_output 1 + +#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 +#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148 +#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 +#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A +#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B +#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C +#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D +#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E +#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F +#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 + +typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id, GLenum category, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, GLvoid *userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum* categories, GLuint* severities, GLuint* ids, GLsizei* lengths, GLchar* message); + +#define glDebugMessageCallbackAMD GLEW_GET_FUN(__glewDebugMessageCallbackAMD) +#define glDebugMessageEnableAMD GLEW_GET_FUN(__glewDebugMessageEnableAMD) +#define glDebugMessageInsertAMD GLEW_GET_FUN(__glewDebugMessageInsertAMD) +#define glGetDebugMessageLogAMD GLEW_GET_FUN(__glewGetDebugMessageLogAMD) + +#define GLEW_AMD_debug_output GLEW_GET_VAR(__GLEW_AMD_debug_output) + +#endif /* GL_AMD_debug_output */ + +/* ---------------------- GL_AMD_depth_clamp_separate ---------------------- */ + +#ifndef GL_AMD_depth_clamp_separate +#define GL_AMD_depth_clamp_separate 1 + +#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E +#define GL_DEPTH_CLAMP_FAR_AMD 0x901F + +#define GLEW_AMD_depth_clamp_separate GLEW_GET_VAR(__GLEW_AMD_depth_clamp_separate) + +#endif /* GL_AMD_depth_clamp_separate */ + +/* ----------------------- GL_AMD_draw_buffers_blend ----------------------- */ + +#ifndef GL_AMD_draw_buffers_blend +#define GL_AMD_draw_buffers_blend 1 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); + +#define glBlendEquationIndexedAMD GLEW_GET_FUN(__glewBlendEquationIndexedAMD) +#define glBlendEquationSeparateIndexedAMD GLEW_GET_FUN(__glewBlendEquationSeparateIndexedAMD) +#define glBlendFuncIndexedAMD GLEW_GET_FUN(__glewBlendFuncIndexedAMD) +#define glBlendFuncSeparateIndexedAMD GLEW_GET_FUN(__glewBlendFuncSeparateIndexedAMD) + +#define GLEW_AMD_draw_buffers_blend GLEW_GET_VAR(__GLEW_AMD_draw_buffers_blend) + +#endif /* GL_AMD_draw_buffers_blend */ + +/* ---------------------- GL_AMD_interleaved_elements ---------------------- */ + +#ifndef GL_AMD_interleaved_elements +#define GL_AMD_interleaved_elements 1 + +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_RG8UI 0x8238 +#define GL_RG16UI 0x823A +#define GL_RGBA8UI 0x8D7C +#define GL_VERTEX_ELEMENT_SWIZZLE_AMD 0x91A4 +#define GL_VERTEX_ID_SWIZZLE_AMD 0x91A5 + +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPARAMETERIAMDPROC) (GLuint index, GLenum pname, GLint param); + +#define glVertexAttribParameteriAMD GLEW_GET_FUN(__glewVertexAttribParameteriAMD) + +#define GLEW_AMD_interleaved_elements GLEW_GET_VAR(__GLEW_AMD_interleaved_elements) + +#endif /* GL_AMD_interleaved_elements */ + +/* ----------------------- GL_AMD_multi_draw_indirect ---------------------- */ + +#ifndef GL_AMD_multi_draw_indirect +#define GL_AMD_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride); + +#define glMultiDrawArraysIndirectAMD GLEW_GET_FUN(__glewMultiDrawArraysIndirectAMD) +#define glMultiDrawElementsIndirectAMD GLEW_GET_FUN(__glewMultiDrawElementsIndirectAMD) + +#define GLEW_AMD_multi_draw_indirect GLEW_GET_VAR(__GLEW_AMD_multi_draw_indirect) + +#endif /* GL_AMD_multi_draw_indirect */ + +/* ------------------------- GL_AMD_name_gen_delete ------------------------ */ + +#ifndef GL_AMD_name_gen_delete +#define GL_AMD_name_gen_delete 1 + +#define GL_DATA_BUFFER_AMD 0x9151 +#define GL_PERFORMANCE_MONITOR_AMD 0x9152 +#define GL_QUERY_OBJECT_AMD 0x9153 +#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154 +#define GL_SAMPLER_OBJECT_AMD 0x9155 + +typedef void (GLAPIENTRY * PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint* names); +typedef void (GLAPIENTRY * PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint* names); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name); + +#define glDeleteNamesAMD GLEW_GET_FUN(__glewDeleteNamesAMD) +#define glGenNamesAMD GLEW_GET_FUN(__glewGenNamesAMD) +#define glIsNameAMD GLEW_GET_FUN(__glewIsNameAMD) + +#define GLEW_AMD_name_gen_delete GLEW_GET_VAR(__GLEW_AMD_name_gen_delete) + +#endif /* GL_AMD_name_gen_delete */ + +/* ----------------------- GL_AMD_performance_monitor ---------------------- */ + +#ifndef GL_AMD_performance_monitor +#define GL_AMD_performance_monitor 1 + +#define GL_COUNTER_TYPE_AMD 0x8BC0 +#define GL_COUNTER_RANGE_AMD 0x8BC1 +#define GL_UNSIGNED_INT64_AMD 0x8BC2 +#define GL_PERCENTAGE_AMD 0x8BC3 +#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 +#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 +#define GL_PERFMON_RESULT_AMD 0x8BC6 + +typedef void (GLAPIENTRY * PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GLAPIENTRY * PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors); +typedef void (GLAPIENTRY * PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GLAPIENTRY * PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint *bytesWritten); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, GLchar *counterString); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint* numCounters, GLint *maxActiveCounters, GLsizei countersSize, GLuint *counters); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei* length, GLchar *groupString); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint* numGroups, GLsizei groupsSize, GLuint *groups); +typedef void (GLAPIENTRY * PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* counterList); + +#define glBeginPerfMonitorAMD GLEW_GET_FUN(__glewBeginPerfMonitorAMD) +#define glDeletePerfMonitorsAMD GLEW_GET_FUN(__glewDeletePerfMonitorsAMD) +#define glEndPerfMonitorAMD GLEW_GET_FUN(__glewEndPerfMonitorAMD) +#define glGenPerfMonitorsAMD GLEW_GET_FUN(__glewGenPerfMonitorsAMD) +#define glGetPerfMonitorCounterDataAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterDataAMD) +#define glGetPerfMonitorCounterInfoAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterInfoAMD) +#define glGetPerfMonitorCounterStringAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterStringAMD) +#define glGetPerfMonitorCountersAMD GLEW_GET_FUN(__glewGetPerfMonitorCountersAMD) +#define glGetPerfMonitorGroupStringAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupStringAMD) +#define glGetPerfMonitorGroupsAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupsAMD) +#define glSelectPerfMonitorCountersAMD GLEW_GET_FUN(__glewSelectPerfMonitorCountersAMD) + +#define GLEW_AMD_performance_monitor GLEW_GET_VAR(__GLEW_AMD_performance_monitor) + +#endif /* GL_AMD_performance_monitor */ + +/* -------------------------- GL_AMD_pinned_memory ------------------------- */ + +#ifndef GL_AMD_pinned_memory +#define GL_AMD_pinned_memory 1 + +#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160 + +#define GLEW_AMD_pinned_memory GLEW_GET_VAR(__GLEW_AMD_pinned_memory) + +#endif /* GL_AMD_pinned_memory */ + +/* ----------------------- GL_AMD_query_buffer_object ---------------------- */ + +#ifndef GL_AMD_query_buffer_object +#define GL_AMD_query_buffer_object 1 + +#define GL_QUERY_BUFFER_AMD 0x9192 +#define GL_QUERY_BUFFER_BINDING_AMD 0x9193 +#define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194 + +#define GLEW_AMD_query_buffer_object GLEW_GET_VAR(__GLEW_AMD_query_buffer_object) + +#endif /* GL_AMD_query_buffer_object */ + +/* ------------------------ GL_AMD_sample_positions ------------------------ */ + +#ifndef GL_AMD_sample_positions +#define GL_AMD_sample_positions 1 + +#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F + +typedef void (GLAPIENTRY * PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat* val); + +#define glSetMultisamplefvAMD GLEW_GET_FUN(__glewSetMultisamplefvAMD) + +#define GLEW_AMD_sample_positions GLEW_GET_VAR(__GLEW_AMD_sample_positions) + +#endif /* GL_AMD_sample_positions */ + +/* ------------------ GL_AMD_seamless_cubemap_per_texture ------------------ */ + +#ifndef GL_AMD_seamless_cubemap_per_texture +#define GL_AMD_seamless_cubemap_per_texture 1 + +#define GL_TEXTURE_CUBE_MAP_SEAMLESS_ARB 0x884F + +#define GLEW_AMD_seamless_cubemap_per_texture GLEW_GET_VAR(__GLEW_AMD_seamless_cubemap_per_texture) + +#endif /* GL_AMD_seamless_cubemap_per_texture */ + +/* ---------------------- GL_AMD_shader_stencil_export --------------------- */ + +#ifndef GL_AMD_shader_stencil_export +#define GL_AMD_shader_stencil_export 1 + +#define GLEW_AMD_shader_stencil_export GLEW_GET_VAR(__GLEW_AMD_shader_stencil_export) + +#endif /* GL_AMD_shader_stencil_export */ + +/* ---------------------- GL_AMD_shader_trinary_minmax --------------------- */ + +#ifndef GL_AMD_shader_trinary_minmax +#define GL_AMD_shader_trinary_minmax 1 + +#define GLEW_AMD_shader_trinary_minmax GLEW_GET_VAR(__GLEW_AMD_shader_trinary_minmax) + +#endif /* GL_AMD_shader_trinary_minmax */ + +/* ------------------------- GL_AMD_sparse_texture ------------------------- */ + +#ifndef GL_AMD_sparse_texture +#define GL_AMD_sparse_texture 1 + +#define GL_TEXTURE_STORAGE_SPARSE_BIT_AMD 0x00000001 +#define GL_VIRTUAL_PAGE_SIZE_X_AMD 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_AMD 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_AMD 0x9197 +#define GL_MAX_SPARSE_TEXTURE_SIZE_AMD 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS 0x919A +#define GL_MIN_SPARSE_LEVEL_AMD 0x919B +#define GL_MIN_LOD_WARNING_AMD 0x919C + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGESPARSEAMDPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGESPARSEAMDPROC) (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); + +#define glTexStorageSparseAMD GLEW_GET_FUN(__glewTexStorageSparseAMD) +#define glTextureStorageSparseAMD GLEW_GET_FUN(__glewTextureStorageSparseAMD) + +#define GLEW_AMD_sparse_texture GLEW_GET_VAR(__GLEW_AMD_sparse_texture) + +#endif /* GL_AMD_sparse_texture */ + +/* ------------------- GL_AMD_stencil_operation_extended ------------------- */ + +#ifndef GL_AMD_stencil_operation_extended +#define GL_AMD_stencil_operation_extended 1 + +#define GL_SET_AMD 0x874A +#define GL_REPLACE_VALUE_AMD 0x874B +#define GL_STENCIL_OP_VALUE_AMD 0x874C +#define GL_STENCIL_BACK_OP_VALUE_AMD 0x874D + +typedef void (GLAPIENTRY * PFNGLSTENCILOPVALUEAMDPROC) (GLenum face, GLuint value); + +#define glStencilOpValueAMD GLEW_GET_FUN(__glewStencilOpValueAMD) + +#define GLEW_AMD_stencil_operation_extended GLEW_GET_VAR(__GLEW_AMD_stencil_operation_extended) + +#endif /* GL_AMD_stencil_operation_extended */ + +/* ------------------------ GL_AMD_texture_texture4 ------------------------ */ + +#ifndef GL_AMD_texture_texture4 +#define GL_AMD_texture_texture4 1 + +#define GLEW_AMD_texture_texture4 GLEW_GET_VAR(__GLEW_AMD_texture_texture4) + +#endif /* GL_AMD_texture_texture4 */ + +/* --------------- GL_AMD_transform_feedback3_lines_triangles -------------- */ + +#ifndef GL_AMD_transform_feedback3_lines_triangles +#define GL_AMD_transform_feedback3_lines_triangles 1 + +#define GLEW_AMD_transform_feedback3_lines_triangles GLEW_GET_VAR(__GLEW_AMD_transform_feedback3_lines_triangles) + +#endif /* GL_AMD_transform_feedback3_lines_triangles */ + +/* ----------------------- GL_AMD_vertex_shader_layer ---------------------- */ + +#ifndef GL_AMD_vertex_shader_layer +#define GL_AMD_vertex_shader_layer 1 + +#define GLEW_AMD_vertex_shader_layer GLEW_GET_VAR(__GLEW_AMD_vertex_shader_layer) + +#endif /* GL_AMD_vertex_shader_layer */ + +/* -------------------- GL_AMD_vertex_shader_tessellator ------------------- */ + +#ifndef GL_AMD_vertex_shader_tessellator +#define GL_AMD_vertex_shader_tessellator 1 + +#define GL_SAMPLER_BUFFER_AMD 0x9001 +#define GL_INT_SAMPLER_BUFFER_AMD 0x9002 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 +#define GL_TESSELLATION_MODE_AMD 0x9004 +#define GL_TESSELLATION_FACTOR_AMD 0x9005 +#define GL_DISCRETE_AMD 0x9006 +#define GL_CONTINUOUS_AMD 0x9007 + +typedef void (GLAPIENTRY * PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); +typedef void (GLAPIENTRY * PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); + +#define glTessellationFactorAMD GLEW_GET_FUN(__glewTessellationFactorAMD) +#define glTessellationModeAMD GLEW_GET_FUN(__glewTessellationModeAMD) + +#define GLEW_AMD_vertex_shader_tessellator GLEW_GET_VAR(__GLEW_AMD_vertex_shader_tessellator) + +#endif /* GL_AMD_vertex_shader_tessellator */ + +/* ------------------ GL_AMD_vertex_shader_viewport_index ------------------ */ + +#ifndef GL_AMD_vertex_shader_viewport_index +#define GL_AMD_vertex_shader_viewport_index 1 + +#define GLEW_AMD_vertex_shader_viewport_index GLEW_GET_VAR(__GLEW_AMD_vertex_shader_viewport_index) + +#endif /* GL_AMD_vertex_shader_viewport_index */ + +/* ------------------------- GL_ANGLE_depth_texture ------------------------ */ + +#ifndef GL_ANGLE_depth_texture +#define GL_ANGLE_depth_texture 1 + +#define GLEW_ANGLE_depth_texture GLEW_GET_VAR(__GLEW_ANGLE_depth_texture) + +#endif /* GL_ANGLE_depth_texture */ + +/* ----------------------- GL_ANGLE_framebuffer_blit ----------------------- */ + +#ifndef GL_ANGLE_framebuffer_blit +#define GL_ANGLE_framebuffer_blit 1 + +#define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6 +#define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA + +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); + +#define glBlitFramebufferANGLE GLEW_GET_FUN(__glewBlitFramebufferANGLE) + +#define GLEW_ANGLE_framebuffer_blit GLEW_GET_VAR(__GLEW_ANGLE_framebuffer_blit) + +#endif /* GL_ANGLE_framebuffer_blit */ + +/* -------------------- GL_ANGLE_framebuffer_multisample ------------------- */ + +#ifndef GL_ANGLE_framebuffer_multisample +#define GL_ANGLE_framebuffer_multisample 1 + +#define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56 +#define GL_MAX_SAMPLES_ANGLE 0x8D57 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleANGLE GLEW_GET_FUN(__glewRenderbufferStorageMultisampleANGLE) + +#define GLEW_ANGLE_framebuffer_multisample GLEW_GET_VAR(__GLEW_ANGLE_framebuffer_multisample) + +#endif /* GL_ANGLE_framebuffer_multisample */ + +/* ----------------------- GL_ANGLE_instanced_arrays ----------------------- */ + +#ifndef GL_ANGLE_instanced_arrays +#define GL_ANGLE_instanced_arrays 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor); + +#define glDrawArraysInstancedANGLE GLEW_GET_FUN(__glewDrawArraysInstancedANGLE) +#define glDrawElementsInstancedANGLE GLEW_GET_FUN(__glewDrawElementsInstancedANGLE) +#define glVertexAttribDivisorANGLE GLEW_GET_FUN(__glewVertexAttribDivisorANGLE) + +#define GLEW_ANGLE_instanced_arrays GLEW_GET_VAR(__GLEW_ANGLE_instanced_arrays) + +#endif /* GL_ANGLE_instanced_arrays */ + +/* -------------------- GL_ANGLE_pack_reverse_row_order -------------------- */ + +#ifndef GL_ANGLE_pack_reverse_row_order +#define GL_ANGLE_pack_reverse_row_order 1 + +#define GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4 + +#define GLEW_ANGLE_pack_reverse_row_order GLEW_GET_VAR(__GLEW_ANGLE_pack_reverse_row_order) + +#endif /* GL_ANGLE_pack_reverse_row_order */ + +/* ------------------------ GL_ANGLE_program_binary ------------------------ */ + +#ifndef GL_ANGLE_program_binary +#define GL_ANGLE_program_binary 1 + +#define GL_PROGRAM_BINARY_ANGLE 0x93A6 + +#define GLEW_ANGLE_program_binary GLEW_GET_VAR(__GLEW_ANGLE_program_binary) + +#endif /* GL_ANGLE_program_binary */ + +/* ------------------- GL_ANGLE_texture_compression_dxt1 ------------------- */ + +#ifndef GL_ANGLE_texture_compression_dxt1 +#define GL_ANGLE_texture_compression_dxt1 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 + +#define GLEW_ANGLE_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt1) + +#endif /* GL_ANGLE_texture_compression_dxt1 */ + +/* ------------------- GL_ANGLE_texture_compression_dxt3 ------------------- */ + +#ifndef GL_ANGLE_texture_compression_dxt3 +#define GL_ANGLE_texture_compression_dxt3 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 + +#define GLEW_ANGLE_texture_compression_dxt3 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt3) + +#endif /* GL_ANGLE_texture_compression_dxt3 */ + +/* ------------------- GL_ANGLE_texture_compression_dxt5 ------------------- */ + +#ifndef GL_ANGLE_texture_compression_dxt5 +#define GL_ANGLE_texture_compression_dxt5 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 + +#define GLEW_ANGLE_texture_compression_dxt5 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt5) + +#endif /* GL_ANGLE_texture_compression_dxt5 */ + +/* ------------------------- GL_ANGLE_texture_usage ------------------------ */ + +#ifndef GL_ANGLE_texture_usage +#define GL_ANGLE_texture_usage 1 + +#define GL_TEXTURE_USAGE_ANGLE 0x93A2 +#define GL_FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3 + +#define GLEW_ANGLE_texture_usage GLEW_GET_VAR(__GLEW_ANGLE_texture_usage) + +#endif /* GL_ANGLE_texture_usage */ + +/* -------------------------- GL_ANGLE_timer_query ------------------------- */ + +#ifndef GL_ANGLE_timer_query +#define GL_ANGLE_timer_query 1 + +#define GL_QUERY_COUNTER_BITS_ANGLE 0x8864 +#define GL_CURRENT_QUERY_ANGLE 0x8865 +#define GL_QUERY_RESULT_ANGLE 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ANGLE 0x8867 +#define GL_TIME_ELAPSED_ANGLE 0x88BF +#define GL_TIMESTAMP_ANGLE 0x8E28 + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYANGLEPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEQUERIESANGLEPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDQUERYANGLEPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGENQUERIESANGLEPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VANGLEPROC) (GLuint id, GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVANGLEPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VANGLEPROC) (GLuint id, GLenum pname, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVANGLEPROC) (GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYIVANGLEPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISQUERYANGLEPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLQUERYCOUNTERANGLEPROC) (GLuint id, GLenum target); + +#define glBeginQueryANGLE GLEW_GET_FUN(__glewBeginQueryANGLE) +#define glDeleteQueriesANGLE GLEW_GET_FUN(__glewDeleteQueriesANGLE) +#define glEndQueryANGLE GLEW_GET_FUN(__glewEndQueryANGLE) +#define glGenQueriesANGLE GLEW_GET_FUN(__glewGenQueriesANGLE) +#define glGetQueryObjecti64vANGLE GLEW_GET_FUN(__glewGetQueryObjecti64vANGLE) +#define glGetQueryObjectivANGLE GLEW_GET_FUN(__glewGetQueryObjectivANGLE) +#define glGetQueryObjectui64vANGLE GLEW_GET_FUN(__glewGetQueryObjectui64vANGLE) +#define glGetQueryObjectuivANGLE GLEW_GET_FUN(__glewGetQueryObjectuivANGLE) +#define glGetQueryivANGLE GLEW_GET_FUN(__glewGetQueryivANGLE) +#define glIsQueryANGLE GLEW_GET_FUN(__glewIsQueryANGLE) +#define glQueryCounterANGLE GLEW_GET_FUN(__glewQueryCounterANGLE) + +#define GLEW_ANGLE_timer_query GLEW_GET_VAR(__GLEW_ANGLE_timer_query) + +#endif /* GL_ANGLE_timer_query */ + +/* ------------------- GL_ANGLE_translated_shader_source ------------------- */ + +#ifndef GL_ANGLE_translated_shader_source +#define GL_ANGLE_translated_shader_source 1 + +#define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0 + +typedef void (GLAPIENTRY * PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source); + +#define glGetTranslatedShaderSourceANGLE GLEW_GET_FUN(__glewGetTranslatedShaderSourceANGLE) + +#define GLEW_ANGLE_translated_shader_source GLEW_GET_VAR(__GLEW_ANGLE_translated_shader_source) + +#endif /* GL_ANGLE_translated_shader_source */ + +/* ----------------------- GL_APPLE_aux_depth_stencil ---------------------- */ + +#ifndef GL_APPLE_aux_depth_stencil +#define GL_APPLE_aux_depth_stencil 1 + +#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 + +#define GLEW_APPLE_aux_depth_stencil GLEW_GET_VAR(__GLEW_APPLE_aux_depth_stencil) + +#endif /* GL_APPLE_aux_depth_stencil */ + +/* ------------------------ GL_APPLE_client_storage ------------------------ */ + +#ifndef GL_APPLE_client_storage +#define GL_APPLE_client_storage 1 + +#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 + +#define GLEW_APPLE_client_storage GLEW_GET_VAR(__GLEW_APPLE_client_storage) + +#endif /* GL_APPLE_client_storage */ + +/* ------------------------- GL_APPLE_element_array ------------------------ */ + +#ifndef GL_APPLE_element_array +#define GL_APPLE_element_array 1 + +#define GL_ELEMENT_ARRAY_APPLE 0x8A0C +#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D +#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint* first, const GLsizei *count, GLsizei primcount); + +#define glDrawElementArrayAPPLE GLEW_GET_FUN(__glewDrawElementArrayAPPLE) +#define glDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewDrawRangeElementArrayAPPLE) +#define glElementPointerAPPLE GLEW_GET_FUN(__glewElementPointerAPPLE) +#define glMultiDrawElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawElementArrayAPPLE) +#define glMultiDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawRangeElementArrayAPPLE) + +#define GLEW_APPLE_element_array GLEW_GET_VAR(__GLEW_APPLE_element_array) + +#endif /* GL_APPLE_element_array */ + +/* ----------------------------- GL_APPLE_fence ---------------------------- */ + +#ifndef GL_APPLE_fence +#define GL_APPLE_fence 1 + +#define GL_DRAW_PIXELS_APPLE 0x8A0A +#define GL_FENCE_APPLE 0x8A0B + +typedef void (GLAPIENTRY * PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint* fences); +typedef void (GLAPIENTRY * PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); +typedef void (GLAPIENTRY * PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint* fences); +typedef GLboolean (GLAPIENTRY * PFNGLISFENCEAPPLEPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLSETFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (GLAPIENTRY * PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); + +#define glDeleteFencesAPPLE GLEW_GET_FUN(__glewDeleteFencesAPPLE) +#define glFinishFenceAPPLE GLEW_GET_FUN(__glewFinishFenceAPPLE) +#define glFinishObjectAPPLE GLEW_GET_FUN(__glewFinishObjectAPPLE) +#define glGenFencesAPPLE GLEW_GET_FUN(__glewGenFencesAPPLE) +#define glIsFenceAPPLE GLEW_GET_FUN(__glewIsFenceAPPLE) +#define glSetFenceAPPLE GLEW_GET_FUN(__glewSetFenceAPPLE) +#define glTestFenceAPPLE GLEW_GET_FUN(__glewTestFenceAPPLE) +#define glTestObjectAPPLE GLEW_GET_FUN(__glewTestObjectAPPLE) + +#define GLEW_APPLE_fence GLEW_GET_VAR(__GLEW_APPLE_fence) + +#endif /* GL_APPLE_fence */ + +/* ------------------------- GL_APPLE_float_pixels ------------------------- */ + +#ifndef GL_APPLE_float_pixels +#define GL_APPLE_float_pixels 1 + +#define GL_HALF_APPLE 0x140B +#define GL_RGBA_FLOAT32_APPLE 0x8814 +#define GL_RGB_FLOAT32_APPLE 0x8815 +#define GL_ALPHA_FLOAT32_APPLE 0x8816 +#define GL_INTENSITY_FLOAT32_APPLE 0x8817 +#define GL_LUMINANCE_FLOAT32_APPLE 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 +#define GL_RGBA_FLOAT16_APPLE 0x881A +#define GL_RGB_FLOAT16_APPLE 0x881B +#define GL_ALPHA_FLOAT16_APPLE 0x881C +#define GL_INTENSITY_FLOAT16_APPLE 0x881D +#define GL_LUMINANCE_FLOAT16_APPLE 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F +#define GL_COLOR_FLOAT_APPLE 0x8A0F + +#define GLEW_APPLE_float_pixels GLEW_GET_VAR(__GLEW_APPLE_float_pixels) + +#endif /* GL_APPLE_float_pixels */ + +/* ---------------------- GL_APPLE_flush_buffer_range ---------------------- */ + +#ifndef GL_APPLE_flush_buffer_range +#define GL_APPLE_flush_buffer_range 1 + +#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 +#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 + +typedef void (GLAPIENTRY * PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); + +#define glBufferParameteriAPPLE GLEW_GET_FUN(__glewBufferParameteriAPPLE) +#define glFlushMappedBufferRangeAPPLE GLEW_GET_FUN(__glewFlushMappedBufferRangeAPPLE) + +#define GLEW_APPLE_flush_buffer_range GLEW_GET_VAR(__GLEW_APPLE_flush_buffer_range) + +#endif /* GL_APPLE_flush_buffer_range */ + +/* ----------------------- GL_APPLE_object_purgeable ----------------------- */ + +#ifndef GL_APPLE_object_purgeable +#define GL_APPLE_object_purgeable 1 + +#define GL_BUFFER_OBJECT_APPLE 0x85B3 +#define GL_RELEASED_APPLE 0x8A19 +#define GL_VOLATILE_APPLE 0x8A1A +#define GL_RETAINED_APPLE 0x8A1B +#define GL_UNDEFINED_APPLE 0x8A1C +#define GL_PURGEABLE_APPLE 0x8A1D + +typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint* params); +typedef GLenum (GLAPIENTRY * PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); +typedef GLenum (GLAPIENTRY * PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); + +#define glGetObjectParameterivAPPLE GLEW_GET_FUN(__glewGetObjectParameterivAPPLE) +#define glObjectPurgeableAPPLE GLEW_GET_FUN(__glewObjectPurgeableAPPLE) +#define glObjectUnpurgeableAPPLE GLEW_GET_FUN(__glewObjectUnpurgeableAPPLE) + +#define GLEW_APPLE_object_purgeable GLEW_GET_VAR(__GLEW_APPLE_object_purgeable) + +#endif /* GL_APPLE_object_purgeable */ + +/* ------------------------- GL_APPLE_pixel_buffer ------------------------- */ + +#ifndef GL_APPLE_pixel_buffer +#define GL_APPLE_pixel_buffer 1 + +#define GL_MIN_PBUFFER_VIEWPORT_DIMS_APPLE 0x8A10 + +#define GLEW_APPLE_pixel_buffer GLEW_GET_VAR(__GLEW_APPLE_pixel_buffer) + +#endif /* GL_APPLE_pixel_buffer */ + +/* ---------------------------- GL_APPLE_rgb_422 --------------------------- */ + +#ifndef GL_APPLE_rgb_422 +#define GL_APPLE_rgb_422 1 + +#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB +#define GL_RGB_422_APPLE 0x8A1F + +#define GLEW_APPLE_rgb_422 GLEW_GET_VAR(__GLEW_APPLE_rgb_422) + +#endif /* GL_APPLE_rgb_422 */ + +/* --------------------------- GL_APPLE_row_bytes -------------------------- */ + +#ifndef GL_APPLE_row_bytes +#define GL_APPLE_row_bytes 1 + +#define GL_PACK_ROW_BYTES_APPLE 0x8A15 +#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16 + +#define GLEW_APPLE_row_bytes GLEW_GET_VAR(__GLEW_APPLE_row_bytes) + +#endif /* GL_APPLE_row_bytes */ + +/* ------------------------ GL_APPLE_specular_vector ----------------------- */ + +#ifndef GL_APPLE_specular_vector +#define GL_APPLE_specular_vector 1 + +#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 + +#define GLEW_APPLE_specular_vector GLEW_GET_VAR(__GLEW_APPLE_specular_vector) + +#endif /* GL_APPLE_specular_vector */ + +/* ------------------------- GL_APPLE_texture_range ------------------------ */ + +#ifndef GL_APPLE_texture_range +#define GL_APPLE_texture_range 1 + +#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 +#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 +#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC +#define GL_STORAGE_PRIVATE_APPLE 0x85BD +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF + +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, GLvoid **params); +typedef void (GLAPIENTRY * PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, GLvoid *pointer); + +#define glGetTexParameterPointervAPPLE GLEW_GET_FUN(__glewGetTexParameterPointervAPPLE) +#define glTextureRangeAPPLE GLEW_GET_FUN(__glewTextureRangeAPPLE) + +#define GLEW_APPLE_texture_range GLEW_GET_VAR(__GLEW_APPLE_texture_range) + +#endif /* GL_APPLE_texture_range */ + +/* ------------------------ GL_APPLE_transform_hint ------------------------ */ + +#ifndef GL_APPLE_transform_hint +#define GL_APPLE_transform_hint 1 + +#define GL_TRANSFORM_HINT_APPLE 0x85B1 + +#define GLEW_APPLE_transform_hint GLEW_GET_VAR(__GLEW_APPLE_transform_hint) + +#endif /* GL_APPLE_transform_hint */ + +/* ---------------------- GL_APPLE_vertex_array_object --------------------- */ + +#ifndef GL_APPLE_vertex_array_object +#define GL_APPLE_vertex_array_object 1 + +#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 + +typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays); +typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); + +#define glBindVertexArrayAPPLE GLEW_GET_FUN(__glewBindVertexArrayAPPLE) +#define glDeleteVertexArraysAPPLE GLEW_GET_FUN(__glewDeleteVertexArraysAPPLE) +#define glGenVertexArraysAPPLE GLEW_GET_FUN(__glewGenVertexArraysAPPLE) +#define glIsVertexArrayAPPLE GLEW_GET_FUN(__glewIsVertexArrayAPPLE) + +#define GLEW_APPLE_vertex_array_object GLEW_GET_VAR(__GLEW_APPLE_vertex_array_object) + +#endif /* GL_APPLE_vertex_array_object */ + +/* ---------------------- GL_APPLE_vertex_array_range ---------------------- */ + +#ifndef GL_APPLE_vertex_array_range +#define GL_APPLE_vertex_array_range 1 + +#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E +#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_APPLE 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 +#define GL_STORAGE_CLIENT_APPLE 0x85B4 +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF + +typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); + +#define glFlushVertexArrayRangeAPPLE GLEW_GET_FUN(__glewFlushVertexArrayRangeAPPLE) +#define glVertexArrayParameteriAPPLE GLEW_GET_FUN(__glewVertexArrayParameteriAPPLE) +#define glVertexArrayRangeAPPLE GLEW_GET_FUN(__glewVertexArrayRangeAPPLE) + +#define GLEW_APPLE_vertex_array_range GLEW_GET_VAR(__GLEW_APPLE_vertex_array_range) + +#endif /* GL_APPLE_vertex_array_range */ + +/* ------------------- GL_APPLE_vertex_program_evaluators ------------------ */ + +#ifndef GL_APPLE_vertex_program_evaluators +#define GL_APPLE_vertex_program_evaluators 1 + +#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00 +#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01 +#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02 +#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03 +#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04 +#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05 +#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06 +#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07 +#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08 +#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09 + +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble* points); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble* points); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat* points); + +#define glDisableVertexAttribAPPLE GLEW_GET_FUN(__glewDisableVertexAttribAPPLE) +#define glEnableVertexAttribAPPLE GLEW_GET_FUN(__glewEnableVertexAttribAPPLE) +#define glIsVertexAttribEnabledAPPLE GLEW_GET_FUN(__glewIsVertexAttribEnabledAPPLE) +#define glMapVertexAttrib1dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1dAPPLE) +#define glMapVertexAttrib1fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1fAPPLE) +#define glMapVertexAttrib2dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2dAPPLE) +#define glMapVertexAttrib2fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2fAPPLE) + +#define GLEW_APPLE_vertex_program_evaluators GLEW_GET_VAR(__GLEW_APPLE_vertex_program_evaluators) + +#endif /* GL_APPLE_vertex_program_evaluators */ + +/* --------------------------- GL_APPLE_ycbcr_422 -------------------------- */ + +#ifndef GL_APPLE_ycbcr_422 +#define GL_APPLE_ycbcr_422 1 + +#define GL_YCBCR_422_APPLE 0x85B9 + +#define GLEW_APPLE_ycbcr_422 GLEW_GET_VAR(__GLEW_APPLE_ycbcr_422) + +#endif /* GL_APPLE_ycbcr_422 */ + +/* ------------------------ GL_ARB_ES2_compatibility ----------------------- */ + +#ifndef GL_ARB_ES2_compatibility +#define GL_ARB_ES2_compatibility 1 + +#define GL_FIXED 0x140C +#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B +#define GL_RGB565 0x8D62 +#define GL_LOW_FLOAT 0x8DF0 +#define GL_MEDIUM_FLOAT 0x8DF1 +#define GL_HIGH_FLOAT 0x8DF2 +#define GL_LOW_INT 0x8DF3 +#define GL_MEDIUM_INT 0x8DF4 +#define GL_HIGH_INT 0x8DF5 +#define GL_SHADER_BINARY_FORMATS 0x8DF8 +#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 +#define GL_SHADER_COMPILER 0x8DFA +#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB +#define GL_MAX_VARYING_VECTORS 0x8DFC +#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD + +typedef int GLfixed; + +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFPROC) (GLclampf d); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFPROC) (GLclampf n, GLclampf f); +typedef void (GLAPIENTRY * PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint* range, GLint *precision); +typedef void (GLAPIENTRY * PFNGLRELEASESHADERCOMPILERPROC) (void); +typedef void (GLAPIENTRY * PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint* shaders, GLenum binaryformat, const GLvoid*binary, GLsizei length); + +#define glClearDepthf GLEW_GET_FUN(__glewClearDepthf) +#define glDepthRangef GLEW_GET_FUN(__glewDepthRangef) +#define glGetShaderPrecisionFormat GLEW_GET_FUN(__glewGetShaderPrecisionFormat) +#define glReleaseShaderCompiler GLEW_GET_FUN(__glewReleaseShaderCompiler) +#define glShaderBinary GLEW_GET_FUN(__glewShaderBinary) + +#define GLEW_ARB_ES2_compatibility GLEW_GET_VAR(__GLEW_ARB_ES2_compatibility) + +#endif /* GL_ARB_ES2_compatibility */ + +/* ------------------------ GL_ARB_ES3_compatibility ----------------------- */ + +#ifndef GL_ARB_ES3_compatibility +#define GL_ARB_ES3_compatibility 1 + +#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF +#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 +#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A +#define GL_MAX_ELEMENT_INDEX 0x8D6B +#define GL_COMPRESSED_R11_EAC 0x9270 +#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 +#define GL_COMPRESSED_RG11_EAC 0x9272 +#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 +#define GL_COMPRESSED_RGB8_ETC2 0x9274 +#define GL_COMPRESSED_SRGB8_ETC2 0x9275 +#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 +#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 +#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 +#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 + +#define GLEW_ARB_ES3_compatibility GLEW_GET_VAR(__GLEW_ARB_ES3_compatibility) + +#endif /* GL_ARB_ES3_compatibility */ + +/* ------------------------ GL_ARB_arrays_of_arrays ------------------------ */ + +#ifndef GL_ARB_arrays_of_arrays +#define GL_ARB_arrays_of_arrays 1 + +#define GLEW_ARB_arrays_of_arrays GLEW_GET_VAR(__GLEW_ARB_arrays_of_arrays) + +#endif /* GL_ARB_arrays_of_arrays */ + +/* -------------------------- GL_ARB_base_instance ------------------------- */ + +#ifndef GL_ARB_base_instance +#define GL_ARB_base_instance 1 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLuint baseinstance); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLint basevertex, GLuint baseinstance); + +#define glDrawArraysInstancedBaseInstance GLEW_GET_FUN(__glewDrawArraysInstancedBaseInstance) +#define glDrawElementsInstancedBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseInstance) +#define glDrawElementsInstancedBaseVertexBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertexBaseInstance) + +#define GLEW_ARB_base_instance GLEW_GET_VAR(__GLEW_ARB_base_instance) + +#endif /* GL_ARB_base_instance */ + +/* ------------------------ GL_ARB_bindless_texture ------------------------ */ + +#ifndef GL_ARB_bindless_texture +#define GL_ARB_bindless_texture 1 + +#define GL_UNSIGNED_INT64_ARB 0x140F + +typedef GLuint64 (GLAPIENTRY * PFNGLGETIMAGEHANDLEARBPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTUREHANDLEARBPROC) (GLuint texture); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTURESAMPLERHANDLEARBPROC) (GLuint texture, GLuint sampler); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLUI64VARBPROC) (GLuint index, GLenum pname, GLuint64EXT* params); +typedef GLboolean (GLAPIENTRY * PFNGLISIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle, GLenum access); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC) (GLuint program, GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* values); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64ARBPROC) (GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64ARBPROC) (GLuint index, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64VARBPROC) (GLuint index, const GLuint64EXT* v); + +#define glGetImageHandleARB GLEW_GET_FUN(__glewGetImageHandleARB) +#define glGetTextureHandleARB GLEW_GET_FUN(__glewGetTextureHandleARB) +#define glGetTextureSamplerHandleARB GLEW_GET_FUN(__glewGetTextureSamplerHandleARB) +#define glGetVertexAttribLui64vARB GLEW_GET_FUN(__glewGetVertexAttribLui64vARB) +#define glIsImageHandleResidentARB GLEW_GET_FUN(__glewIsImageHandleResidentARB) +#define glIsTextureHandleResidentARB GLEW_GET_FUN(__glewIsTextureHandleResidentARB) +#define glMakeImageHandleNonResidentARB GLEW_GET_FUN(__glewMakeImageHandleNonResidentARB) +#define glMakeImageHandleResidentARB GLEW_GET_FUN(__glewMakeImageHandleResidentARB) +#define glMakeTextureHandleNonResidentARB GLEW_GET_FUN(__glewMakeTextureHandleNonResidentARB) +#define glMakeTextureHandleResidentARB GLEW_GET_FUN(__glewMakeTextureHandleResidentARB) +#define glProgramUniformHandleui64ARB GLEW_GET_FUN(__glewProgramUniformHandleui64ARB) +#define glProgramUniformHandleui64vARB GLEW_GET_FUN(__glewProgramUniformHandleui64vARB) +#define glUniformHandleui64ARB GLEW_GET_FUN(__glewUniformHandleui64ARB) +#define glUniformHandleui64vARB GLEW_GET_FUN(__glewUniformHandleui64vARB) +#define glVertexAttribL1ui64ARB GLEW_GET_FUN(__glewVertexAttribL1ui64ARB) +#define glVertexAttribL1ui64vARB GLEW_GET_FUN(__glewVertexAttribL1ui64vARB) + +#define GLEW_ARB_bindless_texture GLEW_GET_VAR(__GLEW_ARB_bindless_texture) + +#endif /* GL_ARB_bindless_texture */ + +/* ----------------------- GL_ARB_blend_func_extended ---------------------- */ + +#ifndef GL_ARB_blend_func_extended +#define GL_ARB_blend_func_extended 1 + +#define GL_SRC1_COLOR 0x88F9 +#define GL_ONE_MINUS_SRC1_COLOR 0x88FA +#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB +#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC + +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar * name); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar * name); + +#define glBindFragDataLocationIndexed GLEW_GET_FUN(__glewBindFragDataLocationIndexed) +#define glGetFragDataIndex GLEW_GET_FUN(__glewGetFragDataIndex) + +#define GLEW_ARB_blend_func_extended GLEW_GET_VAR(__GLEW_ARB_blend_func_extended) + +#endif /* GL_ARB_blend_func_extended */ + +/* ------------------------- GL_ARB_buffer_storage ------------------------- */ + +#ifndef GL_ARB_buffer_storage +#define GL_ARB_buffer_storage 1 + +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_PERSISTENT_BIT 0x00000040 +#define GL_MAP_COHERENT_BIT 0x00000080 +#define GL_DYNAMIC_STORAGE_BIT 0x0100 +#define GL_CLIENT_STORAGE_BIT 0x0200 +#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT 0x00004000 +#define GL_BUFFER_IMMUTABLE_STORAGE 0x821F +#define GL_BUFFER_STORAGE_FLAGS 0x8220 + +typedef void (GLAPIENTRY * PFNGLBUFFERSTORAGEPROC) (GLenum target, GLsizeiptr size, const GLvoid* data, GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSTORAGEEXTPROC) (GLuint buffer, GLsizeiptr size, const GLvoid* data, GLbitfield flags); + +#define glBufferStorage GLEW_GET_FUN(__glewBufferStorage) +#define glNamedBufferStorageEXT GLEW_GET_FUN(__glewNamedBufferStorageEXT) + +#define GLEW_ARB_buffer_storage GLEW_GET_VAR(__GLEW_ARB_buffer_storage) + +#endif /* GL_ARB_buffer_storage */ + +/* ---------------------------- GL_ARB_cl_event ---------------------------- */ + +#ifndef GL_ARB_cl_event +#define GL_ARB_cl_event 1 + +#define GL_SYNC_CL_EVENT_ARB 0x8240 +#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 + +typedef struct _cl_context *cl_context; +typedef struct _cl_event *cl_event; + +typedef GLsync (GLAPIENTRY * PFNGLCREATESYNCFROMCLEVENTARBPROC) (cl_context context, cl_event event, GLbitfield flags); + +#define glCreateSyncFromCLeventARB GLEW_GET_FUN(__glewCreateSyncFromCLeventARB) + +#define GLEW_ARB_cl_event GLEW_GET_VAR(__GLEW_ARB_cl_event) + +#endif /* GL_ARB_cl_event */ + +/* ----------------------- GL_ARB_clear_buffer_object ---------------------- */ + +#ifndef GL_ARB_clear_buffer_object +#define GL_ARB_clear_buffer_object 1 + +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const GLvoid* data); + +#define glClearBufferData GLEW_GET_FUN(__glewClearBufferData) +#define glClearBufferSubData GLEW_GET_FUN(__glewClearBufferSubData) +#define glClearNamedBufferDataEXT GLEW_GET_FUN(__glewClearNamedBufferDataEXT) +#define glClearNamedBufferSubDataEXT GLEW_GET_FUN(__glewClearNamedBufferSubDataEXT) + +#define GLEW_ARB_clear_buffer_object GLEW_GET_VAR(__GLEW_ARB_clear_buffer_object) + +#endif /* GL_ARB_clear_buffer_object */ + +/* -------------------------- GL_ARB_clear_texture ------------------------- */ + +#ifndef GL_ARB_clear_texture +#define GL_ARB_clear_texture 1 + +#define GL_CLEAR_TEXTURE 0x9365 + +typedef void (GLAPIENTRY * PFNGLCLEARTEXIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLCLEARTEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* data); + +#define glClearTexImage GLEW_GET_FUN(__glewClearTexImage) +#define glClearTexSubImage GLEW_GET_FUN(__glewClearTexSubImage) + +#define GLEW_ARB_clear_texture GLEW_GET_VAR(__GLEW_ARB_clear_texture) + +#endif /* GL_ARB_clear_texture */ + +/* ----------------------- GL_ARB_color_buffer_float ----------------------- */ + +#ifndef GL_ARB_color_buffer_float +#define GL_ARB_color_buffer_float 1 + +#define GL_RGBA_FLOAT_MODE_ARB 0x8820 +#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A +#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B +#define GL_CLAMP_READ_COLOR_ARB 0x891C +#define GL_FIXED_ONLY_ARB 0x891D + +typedef void (GLAPIENTRY * PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); + +#define glClampColorARB GLEW_GET_FUN(__glewClampColorARB) + +#define GLEW_ARB_color_buffer_float GLEW_GET_VAR(__GLEW_ARB_color_buffer_float) + +#endif /* GL_ARB_color_buffer_float */ + +/* -------------------------- GL_ARB_compatibility ------------------------- */ + +#ifndef GL_ARB_compatibility +#define GL_ARB_compatibility 1 + +#define GLEW_ARB_compatibility GLEW_GET_VAR(__GLEW_ARB_compatibility) + +#endif /* GL_ARB_compatibility */ + +/* ---------------- GL_ARB_compressed_texture_pixel_storage ---------------- */ + +#ifndef GL_ARB_compressed_texture_pixel_storage +#define GL_ARB_compressed_texture_pixel_storage 1 + +#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 +#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 +#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 +#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A +#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B +#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C +#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D +#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E + +#define GLEW_ARB_compressed_texture_pixel_storage GLEW_GET_VAR(__GLEW_ARB_compressed_texture_pixel_storage) + +#endif /* GL_ARB_compressed_texture_pixel_storage */ + +/* ------------------------- GL_ARB_compute_shader ------------------------- */ + +#ifndef GL_ARB_compute_shader +#define GL_ARB_compute_shader 1 + +#define GL_COMPUTE_SHADER_BIT 0x00000020 +#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262 +#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263 +#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264 +#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265 +#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266 +#define GL_COMPUTE_WORK_GROUP_SIZE 0x8267 +#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB +#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED +#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE +#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF +#define GL_COMPUTE_SHADER 0x91B9 +#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB +#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC +#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD +#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE +#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF + +typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); +typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect); + +#define glDispatchCompute GLEW_GET_FUN(__glewDispatchCompute) +#define glDispatchComputeIndirect GLEW_GET_FUN(__glewDispatchComputeIndirect) + +#define GLEW_ARB_compute_shader GLEW_GET_VAR(__GLEW_ARB_compute_shader) + +#endif /* GL_ARB_compute_shader */ + +/* ------------------- GL_ARB_compute_variable_group_size ------------------ */ + +#ifndef GL_ARB_compute_variable_group_size +#define GL_ARB_compute_variable_group_size 1 + +#define GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB 0x90EB +#define GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB 0x91BF +#define GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB 0x9344 +#define GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB 0x9345 + +typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z); + +#define glDispatchComputeGroupSizeARB GLEW_GET_FUN(__glewDispatchComputeGroupSizeARB) + +#define GLEW_ARB_compute_variable_group_size GLEW_GET_VAR(__GLEW_ARB_compute_variable_group_size) + +#endif /* GL_ARB_compute_variable_group_size */ + +/* ----------------------- GL_ARB_conservative_depth ----------------------- */ + +#ifndef GL_ARB_conservative_depth +#define GL_ARB_conservative_depth 1 + +#define GLEW_ARB_conservative_depth GLEW_GET_VAR(__GLEW_ARB_conservative_depth) + +#endif /* GL_ARB_conservative_depth */ + +/* --------------------------- GL_ARB_copy_buffer -------------------------- */ + +#ifndef GL_ARB_copy_buffer +#define GL_ARB_copy_buffer 1 + +#define GL_COPY_READ_BUFFER 0x8F36 +#define GL_COPY_WRITE_BUFFER 0x8F37 + +typedef void (GLAPIENTRY * PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size); + +#define glCopyBufferSubData GLEW_GET_FUN(__glewCopyBufferSubData) + +#define GLEW_ARB_copy_buffer GLEW_GET_VAR(__GLEW_ARB_copy_buffer) + +#endif /* GL_ARB_copy_buffer */ + +/* --------------------------- GL_ARB_copy_image --------------------------- */ + +#ifndef GL_ARB_copy_image +#define GL_ARB_copy_image 1 + +typedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); + +#define glCopyImageSubData GLEW_GET_FUN(__glewCopyImageSubData) + +#define GLEW_ARB_copy_image GLEW_GET_VAR(__GLEW_ARB_copy_image) + +#endif /* GL_ARB_copy_image */ + +/* -------------------------- GL_ARB_debug_output -------------------------- */ + +#ifndef GL_ARB_debug_output +#define GL_ARB_debug_output 1 + +#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 +#define GL_DEBUG_SOURCE_API_ARB 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A +#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B +#define GL_DEBUG_TYPE_ERROR_ARB 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E +#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 +#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 +#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 +#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 + +typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const GLvoid *userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufsize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); + +#define glDebugMessageCallbackARB GLEW_GET_FUN(__glewDebugMessageCallbackARB) +#define glDebugMessageControlARB GLEW_GET_FUN(__glewDebugMessageControlARB) +#define glDebugMessageInsertARB GLEW_GET_FUN(__glewDebugMessageInsertARB) +#define glGetDebugMessageLogARB GLEW_GET_FUN(__glewGetDebugMessageLogARB) + +#define GLEW_ARB_debug_output GLEW_GET_VAR(__GLEW_ARB_debug_output) + +#endif /* GL_ARB_debug_output */ + +/* ----------------------- GL_ARB_depth_buffer_float ----------------------- */ + +#ifndef GL_ARB_depth_buffer_float +#define GL_ARB_depth_buffer_float 1 + +#define GL_DEPTH_COMPONENT32F 0x8CAC +#define GL_DEPTH32F_STENCIL8 0x8CAD +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD + +#define GLEW_ARB_depth_buffer_float GLEW_GET_VAR(__GLEW_ARB_depth_buffer_float) + +#endif /* GL_ARB_depth_buffer_float */ + +/* --------------------------- GL_ARB_depth_clamp -------------------------- */ + +#ifndef GL_ARB_depth_clamp +#define GL_ARB_depth_clamp 1 + +#define GL_DEPTH_CLAMP 0x864F + +#define GLEW_ARB_depth_clamp GLEW_GET_VAR(__GLEW_ARB_depth_clamp) + +#endif /* GL_ARB_depth_clamp */ + +/* -------------------------- GL_ARB_depth_texture ------------------------- */ + +#ifndef GL_ARB_depth_texture +#define GL_ARB_depth_texture 1 + +#define GL_DEPTH_COMPONENT16_ARB 0x81A5 +#define GL_DEPTH_COMPONENT24_ARB 0x81A6 +#define GL_DEPTH_COMPONENT32_ARB 0x81A7 +#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A +#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B + +#define GLEW_ARB_depth_texture GLEW_GET_VAR(__GLEW_ARB_depth_texture) + +#endif /* GL_ARB_depth_texture */ + +/* -------------------------- GL_ARB_draw_buffers -------------------------- */ + +#ifndef GL_ARB_draw_buffers +#define GL_ARB_draw_buffers 1 + +#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 +#define GL_DRAW_BUFFER0_ARB 0x8825 +#define GL_DRAW_BUFFER1_ARB 0x8826 +#define GL_DRAW_BUFFER2_ARB 0x8827 +#define GL_DRAW_BUFFER3_ARB 0x8828 +#define GL_DRAW_BUFFER4_ARB 0x8829 +#define GL_DRAW_BUFFER5_ARB 0x882A +#define GL_DRAW_BUFFER6_ARB 0x882B +#define GL_DRAW_BUFFER7_ARB 0x882C +#define GL_DRAW_BUFFER8_ARB 0x882D +#define GL_DRAW_BUFFER9_ARB 0x882E +#define GL_DRAW_BUFFER10_ARB 0x882F +#define GL_DRAW_BUFFER11_ARB 0x8830 +#define GL_DRAW_BUFFER12_ARB 0x8831 +#define GL_DRAW_BUFFER13_ARB 0x8832 +#define GL_DRAW_BUFFER14_ARB 0x8833 +#define GL_DRAW_BUFFER15_ARB 0x8834 + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum* bufs); + +#define glDrawBuffersARB GLEW_GET_FUN(__glewDrawBuffersARB) + +#define GLEW_ARB_draw_buffers GLEW_GET_VAR(__GLEW_ARB_draw_buffers) + +#endif /* GL_ARB_draw_buffers */ + +/* ----------------------- GL_ARB_draw_buffers_blend ----------------------- */ + +#ifndef GL_ARB_draw_buffers_blend +#define GL_ARB_draw_buffers_blend 1 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst); + +#define glBlendEquationSeparateiARB GLEW_GET_FUN(__glewBlendEquationSeparateiARB) +#define glBlendEquationiARB GLEW_GET_FUN(__glewBlendEquationiARB) +#define glBlendFuncSeparateiARB GLEW_GET_FUN(__glewBlendFuncSeparateiARB) +#define glBlendFunciARB GLEW_GET_FUN(__glewBlendFunciARB) + +#define GLEW_ARB_draw_buffers_blend GLEW_GET_VAR(__GLEW_ARB_draw_buffers_blend) + +#endif /* GL_ARB_draw_buffers_blend */ + +/* -------------------- GL_ARB_draw_elements_base_vertex ------------------- */ + +#ifndef GL_ARB_draw_elements_base_vertex +#define GL_ARB_draw_elements_base_vertex 1 + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei* count, GLenum type, const GLvoid* const *indices, GLsizei primcount, const GLint *basevertex); + +#define glDrawElementsBaseVertex GLEW_GET_FUN(__glewDrawElementsBaseVertex) +#define glDrawElementsInstancedBaseVertex GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertex) +#define glDrawRangeElementsBaseVertex GLEW_GET_FUN(__glewDrawRangeElementsBaseVertex) +#define glMultiDrawElementsBaseVertex GLEW_GET_FUN(__glewMultiDrawElementsBaseVertex) + +#define GLEW_ARB_draw_elements_base_vertex GLEW_GET_VAR(__GLEW_ARB_draw_elements_base_vertex) + +#endif /* GL_ARB_draw_elements_base_vertex */ + +/* -------------------------- GL_ARB_draw_indirect ------------------------- */ + +#ifndef GL_ARB_draw_indirect +#define GL_ARB_draw_indirect 1 + +#define GL_DRAW_INDIRECT_BUFFER 0x8F3F +#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const GLvoid *indirect); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const GLvoid *indirect); + +#define glDrawArraysIndirect GLEW_GET_FUN(__glewDrawArraysIndirect) +#define glDrawElementsIndirect GLEW_GET_FUN(__glewDrawElementsIndirect) + +#define GLEW_ARB_draw_indirect GLEW_GET_VAR(__GLEW_ARB_draw_indirect) + +#endif /* GL_ARB_draw_indirect */ + +/* ------------------------- GL_ARB_draw_instanced ------------------------- */ + +#ifndef GL_ARB_draw_instanced +#define GL_ARB_draw_instanced 1 + +#define GLEW_ARB_draw_instanced GLEW_GET_VAR(__GLEW_ARB_draw_instanced) + +#endif /* GL_ARB_draw_instanced */ + +/* ------------------------ GL_ARB_enhanced_layouts ------------------------ */ + +#ifndef GL_ARB_enhanced_layouts +#define GL_ARB_enhanced_layouts 1 + +#define GL_LOCATION_COMPONENT 0x934A +#define GL_TRANSFORM_FEEDBACK_BUFFER_INDEX 0x934B +#define GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE 0x934C + +#define GLEW_ARB_enhanced_layouts GLEW_GET_VAR(__GLEW_ARB_enhanced_layouts) + +#endif /* GL_ARB_enhanced_layouts */ + +/* -------------------- GL_ARB_explicit_attrib_location -------------------- */ + +#ifndef GL_ARB_explicit_attrib_location +#define GL_ARB_explicit_attrib_location 1 + +#define GLEW_ARB_explicit_attrib_location GLEW_GET_VAR(__GLEW_ARB_explicit_attrib_location) + +#endif /* GL_ARB_explicit_attrib_location */ + +/* -------------------- GL_ARB_explicit_uniform_location ------------------- */ + +#ifndef GL_ARB_explicit_uniform_location +#define GL_ARB_explicit_uniform_location 1 + +#define GL_MAX_UNIFORM_LOCATIONS 0x826E + +#define GLEW_ARB_explicit_uniform_location GLEW_GET_VAR(__GLEW_ARB_explicit_uniform_location) + +#endif /* GL_ARB_explicit_uniform_location */ + +/* ------------------- GL_ARB_fragment_coord_conventions ------------------- */ + +#ifndef GL_ARB_fragment_coord_conventions +#define GL_ARB_fragment_coord_conventions 1 + +#define GLEW_ARB_fragment_coord_conventions GLEW_GET_VAR(__GLEW_ARB_fragment_coord_conventions) + +#endif /* GL_ARB_fragment_coord_conventions */ + +/* --------------------- GL_ARB_fragment_layer_viewport -------------------- */ + +#ifndef GL_ARB_fragment_layer_viewport +#define GL_ARB_fragment_layer_viewport 1 + +#define GLEW_ARB_fragment_layer_viewport GLEW_GET_VAR(__GLEW_ARB_fragment_layer_viewport) + +#endif /* GL_ARB_fragment_layer_viewport */ + +/* ------------------------ GL_ARB_fragment_program ------------------------ */ + +#ifndef GL_ARB_fragment_program +#define GL_ARB_fragment_program 1 + +#define GL_FRAGMENT_PROGRAM_ARB 0x8804 +#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 +#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 +#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 +#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 +#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 +#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A +#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B +#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C +#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D +#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E +#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F +#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 +#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 + +#define GLEW_ARB_fragment_program GLEW_GET_VAR(__GLEW_ARB_fragment_program) + +#endif /* GL_ARB_fragment_program */ + +/* --------------------- GL_ARB_fragment_program_shadow -------------------- */ + +#ifndef GL_ARB_fragment_program_shadow +#define GL_ARB_fragment_program_shadow 1 + +#define GLEW_ARB_fragment_program_shadow GLEW_GET_VAR(__GLEW_ARB_fragment_program_shadow) + +#endif /* GL_ARB_fragment_program_shadow */ + +/* ------------------------- GL_ARB_fragment_shader ------------------------ */ + +#ifndef GL_ARB_fragment_shader +#define GL_ARB_fragment_shader 1 + +#define GL_FRAGMENT_SHADER_ARB 0x8B30 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B + +#define GLEW_ARB_fragment_shader GLEW_GET_VAR(__GLEW_ARB_fragment_shader) + +#endif /* GL_ARB_fragment_shader */ + +/* ------------------- GL_ARB_framebuffer_no_attachments ------------------- */ + +#ifndef GL_ARB_framebuffer_no_attachments +#define GL_ARB_framebuffer_no_attachments 1 + +#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310 +#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311 +#define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312 +#define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313 +#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314 +#define GL_MAX_FRAMEBUFFER_WIDTH 0x9315 +#define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316 +#define GL_MAX_FRAMEBUFFER_LAYERS 0x9317 +#define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param); + +#define glFramebufferParameteri GLEW_GET_FUN(__glewFramebufferParameteri) +#define glGetFramebufferParameteriv GLEW_GET_FUN(__glewGetFramebufferParameteriv) +#define glGetNamedFramebufferParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferParameterivEXT) +#define glNamedFramebufferParameteriEXT GLEW_GET_FUN(__glewNamedFramebufferParameteriEXT) + +#define GLEW_ARB_framebuffer_no_attachments GLEW_GET_VAR(__GLEW_ARB_framebuffer_no_attachments) + +#endif /* GL_ARB_framebuffer_no_attachments */ + +/* ----------------------- GL_ARB_framebuffer_object ----------------------- */ + +#ifndef GL_ARB_framebuffer_object +#define GL_ARB_framebuffer_object 1 + +#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 +#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 +#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 +#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 +#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 +#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 +#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 +#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 +#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 +#define GL_FRAMEBUFFER_DEFAULT 0x8218 +#define GL_FRAMEBUFFER_UNDEFINED 0x8219 +#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A +#define GL_INDEX 0x8222 +#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 +#define GL_DEPTH_STENCIL 0x84F9 +#define GL_UNSIGNED_INT_24_8 0x84FA +#define GL_DEPTH24_STENCIL8 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE 0x88F1 +#define GL_UNSIGNED_NORMALIZED 0x8C17 +#define GL_SRGB 0x8C40 +#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_RENDERBUFFER_BINDING 0x8CA7 +#define GL_READ_FRAMEBUFFER 0x8CA8 +#define GL_DRAW_FRAMEBUFFER 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA +#define GL_RENDERBUFFER_SAMPLES 0x8CAB +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF +#define GL_COLOR_ATTACHMENT0 0x8CE0 +#define GL_COLOR_ATTACHMENT1 0x8CE1 +#define GL_COLOR_ATTACHMENT2 0x8CE2 +#define GL_COLOR_ATTACHMENT3 0x8CE3 +#define GL_COLOR_ATTACHMENT4 0x8CE4 +#define GL_COLOR_ATTACHMENT5 0x8CE5 +#define GL_COLOR_ATTACHMENT6 0x8CE6 +#define GL_COLOR_ATTACHMENT7 0x8CE7 +#define GL_COLOR_ATTACHMENT8 0x8CE8 +#define GL_COLOR_ATTACHMENT9 0x8CE9 +#define GL_COLOR_ATTACHMENT10 0x8CEA +#define GL_COLOR_ATTACHMENT11 0x8CEB +#define GL_COLOR_ATTACHMENT12 0x8CEC +#define GL_COLOR_ATTACHMENT13 0x8CED +#define GL_COLOR_ATTACHMENT14 0x8CEE +#define GL_COLOR_ATTACHMENT15 0x8CEF +#define GL_DEPTH_ATTACHMENT 0x8D00 +#define GL_STENCIL_ATTACHMENT 0x8D20 +#define GL_FRAMEBUFFER 0x8D40 +#define GL_RENDERBUFFER 0x8D41 +#define GL_RENDERBUFFER_WIDTH 0x8D42 +#define GL_RENDERBUFFER_HEIGHT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 +#define GL_STENCIL_INDEX1 0x8D46 +#define GL_STENCIL_INDEX4 0x8D47 +#define GL_STENCIL_INDEX8 0x8D48 +#define GL_STENCIL_INDEX16 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 +#define GL_MAX_SAMPLES 0x8D57 + +typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); +typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target,GLenum attachment, GLuint texture,GLint level,GLint layer); +typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); +typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glBindFramebuffer GLEW_GET_FUN(__glewBindFramebuffer) +#define glBindRenderbuffer GLEW_GET_FUN(__glewBindRenderbuffer) +#define glBlitFramebuffer GLEW_GET_FUN(__glewBlitFramebuffer) +#define glCheckFramebufferStatus GLEW_GET_FUN(__glewCheckFramebufferStatus) +#define glDeleteFramebuffers GLEW_GET_FUN(__glewDeleteFramebuffers) +#define glDeleteRenderbuffers GLEW_GET_FUN(__glewDeleteRenderbuffers) +#define glFramebufferRenderbuffer GLEW_GET_FUN(__glewFramebufferRenderbuffer) +#define glFramebufferTexture1D GLEW_GET_FUN(__glewFramebufferTexture1D) +#define glFramebufferTexture2D GLEW_GET_FUN(__glewFramebufferTexture2D) +#define glFramebufferTexture3D GLEW_GET_FUN(__glewFramebufferTexture3D) +#define glFramebufferTextureLayer GLEW_GET_FUN(__glewFramebufferTextureLayer) +#define glGenFramebuffers GLEW_GET_FUN(__glewGenFramebuffers) +#define glGenRenderbuffers GLEW_GET_FUN(__glewGenRenderbuffers) +#define glGenerateMipmap GLEW_GET_FUN(__glewGenerateMipmap) +#define glGetFramebufferAttachmentParameteriv GLEW_GET_FUN(__glewGetFramebufferAttachmentParameteriv) +#define glGetRenderbufferParameteriv GLEW_GET_FUN(__glewGetRenderbufferParameteriv) +#define glIsFramebuffer GLEW_GET_FUN(__glewIsFramebuffer) +#define glIsRenderbuffer GLEW_GET_FUN(__glewIsRenderbuffer) +#define glRenderbufferStorage GLEW_GET_FUN(__glewRenderbufferStorage) +#define glRenderbufferStorageMultisample GLEW_GET_FUN(__glewRenderbufferStorageMultisample) + +#define GLEW_ARB_framebuffer_object GLEW_GET_VAR(__GLEW_ARB_framebuffer_object) + +#endif /* GL_ARB_framebuffer_object */ + +/* ------------------------ GL_ARB_framebuffer_sRGB ------------------------ */ + +#ifndef GL_ARB_framebuffer_sRGB +#define GL_ARB_framebuffer_sRGB 1 + +#define GL_FRAMEBUFFER_SRGB 0x8DB9 + +#define GLEW_ARB_framebuffer_sRGB GLEW_GET_VAR(__GLEW_ARB_framebuffer_sRGB) + +#endif /* GL_ARB_framebuffer_sRGB */ + +/* ------------------------ GL_ARB_geometry_shader4 ------------------------ */ + +#ifndef GL_ARB_geometry_shader4 +#define GL_ARB_geometry_shader4 1 + +#define GL_LINES_ADJACENCY_ARB 0xA +#define GL_LINE_STRIP_ADJACENCY_ARB 0xB +#define GL_TRIANGLES_ADJACENCY_ARB 0xC +#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0xD +#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 +#define GL_GEOMETRY_SHADER_ARB 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); + +#define glFramebufferTextureARB GLEW_GET_FUN(__glewFramebufferTextureARB) +#define glFramebufferTextureFaceARB GLEW_GET_FUN(__glewFramebufferTextureFaceARB) +#define glFramebufferTextureLayerARB GLEW_GET_FUN(__glewFramebufferTextureLayerARB) +#define glProgramParameteriARB GLEW_GET_FUN(__glewProgramParameteriARB) + +#define GLEW_ARB_geometry_shader4 GLEW_GET_VAR(__GLEW_ARB_geometry_shader4) + +#endif /* GL_ARB_geometry_shader4 */ + +/* ----------------------- GL_ARB_get_program_binary ----------------------- */ + +#ifndef GL_ARB_get_program_binary +#define GL_ARB_get_program_binary 1 + +#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 +#define GL_PROGRAM_BINARY_LENGTH 0x8741 +#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE +#define GL_PROGRAM_BINARY_FORMATS 0x87FF + +typedef void (GLAPIENTRY * PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLenum *binaryFormat, GLvoid*binary); +typedef void (GLAPIENTRY * PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); + +#define glGetProgramBinary GLEW_GET_FUN(__glewGetProgramBinary) +#define glProgramBinary GLEW_GET_FUN(__glewProgramBinary) +#define glProgramParameteri GLEW_GET_FUN(__glewProgramParameteri) + +#define GLEW_ARB_get_program_binary GLEW_GET_VAR(__GLEW_ARB_get_program_binary) + +#endif /* GL_ARB_get_program_binary */ + +/* --------------------------- GL_ARB_gpu_shader5 -------------------------- */ + +#ifndef GL_ARB_gpu_shader5 +#define GL_ARB_gpu_shader5 1 + +#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F +#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C +#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D +#define GL_MAX_VERTEX_STREAMS 0x8E71 + +#define GLEW_ARB_gpu_shader5 GLEW_GET_VAR(__GLEW_ARB_gpu_shader5) + +#endif /* GL_ARB_gpu_shader5 */ + +/* ------------------------- GL_ARB_gpu_shader_fp64 ------------------------ */ + +#ifndef GL_ARB_gpu_shader_fp64 +#define GL_ARB_gpu_shader_fp64 1 + +#define GL_DOUBLE_MAT2 0x8F46 +#define GL_DOUBLE_MAT3 0x8F47 +#define GL_DOUBLE_MAT4 0x8F48 +#define GL_DOUBLE_MAT2x3 0x8F49 +#define GL_DOUBLE_MAT2x4 0x8F4A +#define GL_DOUBLE_MAT3x2 0x8F4B +#define GL_DOUBLE_MAT3x4 0x8F4C +#define GL_DOUBLE_MAT4x2 0x8F4D +#define GL_DOUBLE_MAT4x3 0x8F4E +#define GL_DOUBLE_VEC2 0x8FFC +#define GL_DOUBLE_VEC3 0x8FFD +#define GL_DOUBLE_VEC4 0x8FFE + +typedef void (GLAPIENTRY * PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLUNIFORM1DPROC) (GLint location, GLdouble x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); + +#define glGetUniformdv GLEW_GET_FUN(__glewGetUniformdv) +#define glUniform1d GLEW_GET_FUN(__glewUniform1d) +#define glUniform1dv GLEW_GET_FUN(__glewUniform1dv) +#define glUniform2d GLEW_GET_FUN(__glewUniform2d) +#define glUniform2dv GLEW_GET_FUN(__glewUniform2dv) +#define glUniform3d GLEW_GET_FUN(__glewUniform3d) +#define glUniform3dv GLEW_GET_FUN(__glewUniform3dv) +#define glUniform4d GLEW_GET_FUN(__glewUniform4d) +#define glUniform4dv GLEW_GET_FUN(__glewUniform4dv) +#define glUniformMatrix2dv GLEW_GET_FUN(__glewUniformMatrix2dv) +#define glUniformMatrix2x3dv GLEW_GET_FUN(__glewUniformMatrix2x3dv) +#define glUniformMatrix2x4dv GLEW_GET_FUN(__glewUniformMatrix2x4dv) +#define glUniformMatrix3dv GLEW_GET_FUN(__glewUniformMatrix3dv) +#define glUniformMatrix3x2dv GLEW_GET_FUN(__glewUniformMatrix3x2dv) +#define glUniformMatrix3x4dv GLEW_GET_FUN(__glewUniformMatrix3x4dv) +#define glUniformMatrix4dv GLEW_GET_FUN(__glewUniformMatrix4dv) +#define glUniformMatrix4x2dv GLEW_GET_FUN(__glewUniformMatrix4x2dv) +#define glUniformMatrix4x3dv GLEW_GET_FUN(__glewUniformMatrix4x3dv) + +#define GLEW_ARB_gpu_shader_fp64 GLEW_GET_VAR(__GLEW_ARB_gpu_shader_fp64) + +#endif /* GL_ARB_gpu_shader_fp64 */ + +/* ------------------------ GL_ARB_half_float_pixel ------------------------ */ + +#ifndef GL_ARB_half_float_pixel +#define GL_ARB_half_float_pixel 1 + +#define GL_HALF_FLOAT_ARB 0x140B + +#define GLEW_ARB_half_float_pixel GLEW_GET_VAR(__GLEW_ARB_half_float_pixel) + +#endif /* GL_ARB_half_float_pixel */ + +/* ------------------------ GL_ARB_half_float_vertex ----------------------- */ + +#ifndef GL_ARB_half_float_vertex +#define GL_ARB_half_float_vertex 1 + +#define GL_HALF_FLOAT 0x140B + +#define GLEW_ARB_half_float_vertex GLEW_GET_VAR(__GLEW_ARB_half_float_vertex) + +#endif /* GL_ARB_half_float_vertex */ + +/* ----------------------------- GL_ARB_imaging ---------------------------- */ + +#ifndef GL_ARB_imaging +#define GL_ARB_imaging 1 + +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BLEND_COLOR 0x8005 +#define GL_FUNC_ADD 0x8006 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_BLEND_EQUATION 0x8009 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_IGNORE_BORDER 0x8150 +#define GL_CONSTANT_BORDER 0x8151 +#define GL_WRAP_BORDER 0x8152 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 + +typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (GLAPIENTRY * PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLRESETMINMAXPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); + +#define glColorSubTable GLEW_GET_FUN(__glewColorSubTable) +#define glColorTable GLEW_GET_FUN(__glewColorTable) +#define glColorTableParameterfv GLEW_GET_FUN(__glewColorTableParameterfv) +#define glColorTableParameteriv GLEW_GET_FUN(__glewColorTableParameteriv) +#define glConvolutionFilter1D GLEW_GET_FUN(__glewConvolutionFilter1D) +#define glConvolutionFilter2D GLEW_GET_FUN(__glewConvolutionFilter2D) +#define glConvolutionParameterf GLEW_GET_FUN(__glewConvolutionParameterf) +#define glConvolutionParameterfv GLEW_GET_FUN(__glewConvolutionParameterfv) +#define glConvolutionParameteri GLEW_GET_FUN(__glewConvolutionParameteri) +#define glConvolutionParameteriv GLEW_GET_FUN(__glewConvolutionParameteriv) +#define glCopyColorSubTable GLEW_GET_FUN(__glewCopyColorSubTable) +#define glCopyColorTable GLEW_GET_FUN(__glewCopyColorTable) +#define glCopyConvolutionFilter1D GLEW_GET_FUN(__glewCopyConvolutionFilter1D) +#define glCopyConvolutionFilter2D GLEW_GET_FUN(__glewCopyConvolutionFilter2D) +#define glGetColorTable GLEW_GET_FUN(__glewGetColorTable) +#define glGetColorTableParameterfv GLEW_GET_FUN(__glewGetColorTableParameterfv) +#define glGetColorTableParameteriv GLEW_GET_FUN(__glewGetColorTableParameteriv) +#define glGetConvolutionFilter GLEW_GET_FUN(__glewGetConvolutionFilter) +#define glGetConvolutionParameterfv GLEW_GET_FUN(__glewGetConvolutionParameterfv) +#define glGetConvolutionParameteriv GLEW_GET_FUN(__glewGetConvolutionParameteriv) +#define glGetHistogram GLEW_GET_FUN(__glewGetHistogram) +#define glGetHistogramParameterfv GLEW_GET_FUN(__glewGetHistogramParameterfv) +#define glGetHistogramParameteriv GLEW_GET_FUN(__glewGetHistogramParameteriv) +#define glGetMinmax GLEW_GET_FUN(__glewGetMinmax) +#define glGetMinmaxParameterfv GLEW_GET_FUN(__glewGetMinmaxParameterfv) +#define glGetMinmaxParameteriv GLEW_GET_FUN(__glewGetMinmaxParameteriv) +#define glGetSeparableFilter GLEW_GET_FUN(__glewGetSeparableFilter) +#define glHistogram GLEW_GET_FUN(__glewHistogram) +#define glMinmax GLEW_GET_FUN(__glewMinmax) +#define glResetHistogram GLEW_GET_FUN(__glewResetHistogram) +#define glResetMinmax GLEW_GET_FUN(__glewResetMinmax) +#define glSeparableFilter2D GLEW_GET_FUN(__glewSeparableFilter2D) + +#define GLEW_ARB_imaging GLEW_GET_VAR(__GLEW_ARB_imaging) + +#endif /* GL_ARB_imaging */ + +/* ----------------------- GL_ARB_indirect_parameters ---------------------- */ + +#ifndef GL_ARB_indirect_parameters +#define GL_ARB_indirect_parameters 1 + +#define GL_PARAMETER_BUFFER_ARB 0x80EE +#define GL_PARAMETER_BUFFER_BINDING_ARB 0x80EF + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC) (GLenum mode, const GLvoid *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); + +#define glMultiDrawArraysIndirectCountARB GLEW_GET_FUN(__glewMultiDrawArraysIndirectCountARB) +#define glMultiDrawElementsIndirectCountARB GLEW_GET_FUN(__glewMultiDrawElementsIndirectCountARB) + +#define GLEW_ARB_indirect_parameters GLEW_GET_VAR(__GLEW_ARB_indirect_parameters) + +#endif /* GL_ARB_indirect_parameters */ + +/* ------------------------ GL_ARB_instanced_arrays ------------------------ */ + +#ifndef GL_ARB_instanced_arrays +#define GL_ARB_instanced_arrays 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor); + +#define glDrawArraysInstancedARB GLEW_GET_FUN(__glewDrawArraysInstancedARB) +#define glDrawElementsInstancedARB GLEW_GET_FUN(__glewDrawElementsInstancedARB) +#define glVertexAttribDivisorARB GLEW_GET_FUN(__glewVertexAttribDivisorARB) + +#define GLEW_ARB_instanced_arrays GLEW_GET_VAR(__GLEW_ARB_instanced_arrays) + +#endif /* GL_ARB_instanced_arrays */ + +/* ---------------------- GL_ARB_internalformat_query ---------------------- */ + +#ifndef GL_ARB_internalformat_query +#define GL_ARB_internalformat_query 1 + +#define GL_NUM_SAMPLE_COUNTS 0x9380 + +typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params); + +#define glGetInternalformativ GLEW_GET_FUN(__glewGetInternalformativ) + +#define GLEW_ARB_internalformat_query GLEW_GET_VAR(__GLEW_ARB_internalformat_query) + +#endif /* GL_ARB_internalformat_query */ + +/* ---------------------- GL_ARB_internalformat_query2 --------------------- */ + +#ifndef GL_ARB_internalformat_query2 +#define GL_ARB_internalformat_query2 1 + +#define GL_INTERNALFORMAT_SUPPORTED 0x826F +#define GL_INTERNALFORMAT_PREFERRED 0x8270 +#define GL_INTERNALFORMAT_RED_SIZE 0x8271 +#define GL_INTERNALFORMAT_GREEN_SIZE 0x8272 +#define GL_INTERNALFORMAT_BLUE_SIZE 0x8273 +#define GL_INTERNALFORMAT_ALPHA_SIZE 0x8274 +#define GL_INTERNALFORMAT_DEPTH_SIZE 0x8275 +#define GL_INTERNALFORMAT_STENCIL_SIZE 0x8276 +#define GL_INTERNALFORMAT_SHARED_SIZE 0x8277 +#define GL_INTERNALFORMAT_RED_TYPE 0x8278 +#define GL_INTERNALFORMAT_GREEN_TYPE 0x8279 +#define GL_INTERNALFORMAT_BLUE_TYPE 0x827A +#define GL_INTERNALFORMAT_ALPHA_TYPE 0x827B +#define GL_INTERNALFORMAT_DEPTH_TYPE 0x827C +#define GL_INTERNALFORMAT_STENCIL_TYPE 0x827D +#define GL_MAX_WIDTH 0x827E +#define GL_MAX_HEIGHT 0x827F +#define GL_MAX_DEPTH 0x8280 +#define GL_MAX_LAYERS 0x8281 +#define GL_MAX_COMBINED_DIMENSIONS 0x8282 +#define GL_COLOR_COMPONENTS 0x8283 +#define GL_DEPTH_COMPONENTS 0x8284 +#define GL_STENCIL_COMPONENTS 0x8285 +#define GL_COLOR_RENDERABLE 0x8286 +#define GL_DEPTH_RENDERABLE 0x8287 +#define GL_STENCIL_RENDERABLE 0x8288 +#define GL_FRAMEBUFFER_RENDERABLE 0x8289 +#define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A +#define GL_FRAMEBUFFER_BLEND 0x828B +#define GL_READ_PIXELS 0x828C +#define GL_READ_PIXELS_FORMAT 0x828D +#define GL_READ_PIXELS_TYPE 0x828E +#define GL_TEXTURE_IMAGE_FORMAT 0x828F +#define GL_TEXTURE_IMAGE_TYPE 0x8290 +#define GL_GET_TEXTURE_IMAGE_FORMAT 0x8291 +#define GL_GET_TEXTURE_IMAGE_TYPE 0x8292 +#define GL_MIPMAP 0x8293 +#define GL_MANUAL_GENERATE_MIPMAP 0x8294 +#define GL_AUTO_GENERATE_MIPMAP 0x8295 +#define GL_COLOR_ENCODING 0x8296 +#define GL_SRGB_READ 0x8297 +#define GL_SRGB_WRITE 0x8298 +#define GL_SRGB_DECODE_ARB 0x8299 +#define GL_FILTER 0x829A +#define GL_VERTEX_TEXTURE 0x829B +#define GL_TESS_CONTROL_TEXTURE 0x829C +#define GL_TESS_EVALUATION_TEXTURE 0x829D +#define GL_GEOMETRY_TEXTURE 0x829E +#define GL_FRAGMENT_TEXTURE 0x829F +#define GL_COMPUTE_TEXTURE 0x82A0 +#define GL_TEXTURE_SHADOW 0x82A1 +#define GL_TEXTURE_GATHER 0x82A2 +#define GL_TEXTURE_GATHER_SHADOW 0x82A3 +#define GL_SHADER_IMAGE_LOAD 0x82A4 +#define GL_SHADER_IMAGE_STORE 0x82A5 +#define GL_SHADER_IMAGE_ATOMIC 0x82A6 +#define GL_IMAGE_TEXEL_SIZE 0x82A7 +#define GL_IMAGE_COMPATIBILITY_CLASS 0x82A8 +#define GL_IMAGE_PIXEL_FORMAT 0x82A9 +#define GL_IMAGE_PIXEL_TYPE 0x82AA +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD +#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE +#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF +#define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1 +#define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2 +#define GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3 +#define GL_CLEAR_BUFFER 0x82B4 +#define GL_TEXTURE_VIEW 0x82B5 +#define GL_VIEW_COMPATIBILITY_CLASS 0x82B6 +#define GL_FULL_SUPPORT 0x82B7 +#define GL_CAVEAT_SUPPORT 0x82B8 +#define GL_IMAGE_CLASS_4_X_32 0x82B9 +#define GL_IMAGE_CLASS_2_X_32 0x82BA +#define GL_IMAGE_CLASS_1_X_32 0x82BB +#define GL_IMAGE_CLASS_4_X_16 0x82BC +#define GL_IMAGE_CLASS_2_X_16 0x82BD +#define GL_IMAGE_CLASS_1_X_16 0x82BE +#define GL_IMAGE_CLASS_4_X_8 0x82BF +#define GL_IMAGE_CLASS_2_X_8 0x82C0 +#define GL_IMAGE_CLASS_1_X_8 0x82C1 +#define GL_IMAGE_CLASS_11_11_10 0x82C2 +#define GL_IMAGE_CLASS_10_10_10_2 0x82C3 +#define GL_VIEW_CLASS_128_BITS 0x82C4 +#define GL_VIEW_CLASS_96_BITS 0x82C5 +#define GL_VIEW_CLASS_64_BITS 0x82C6 +#define GL_VIEW_CLASS_48_BITS 0x82C7 +#define GL_VIEW_CLASS_32_BITS 0x82C8 +#define GL_VIEW_CLASS_24_BITS 0x82C9 +#define GL_VIEW_CLASS_16_BITS 0x82CA +#define GL_VIEW_CLASS_8_BITS 0x82CB +#define GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC +#define GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD +#define GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE +#define GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF +#define GL_VIEW_CLASS_RGTC1_RED 0x82D0 +#define GL_VIEW_CLASS_RGTC2_RG 0x82D1 +#define GL_VIEW_CLASS_BPTC_UNORM 0x82D2 +#define GL_VIEW_CLASS_BPTC_FLOAT 0x82D3 + +typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64* params); + +#define glGetInternalformati64v GLEW_GET_FUN(__glewGetInternalformati64v) + +#define GLEW_ARB_internalformat_query2 GLEW_GET_VAR(__GLEW_ARB_internalformat_query2) + +#endif /* GL_ARB_internalformat_query2 */ + +/* ----------------------- GL_ARB_invalidate_subdata ----------------------- */ + +#ifndef GL_ARB_invalidate_subdata +#define GL_ARB_invalidate_subdata 1 + +typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERDATAPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments); +typedef void (GLAPIENTRY * PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); + +#define glInvalidateBufferData GLEW_GET_FUN(__glewInvalidateBufferData) +#define glInvalidateBufferSubData GLEW_GET_FUN(__glewInvalidateBufferSubData) +#define glInvalidateFramebuffer GLEW_GET_FUN(__glewInvalidateFramebuffer) +#define glInvalidateSubFramebuffer GLEW_GET_FUN(__glewInvalidateSubFramebuffer) +#define glInvalidateTexImage GLEW_GET_FUN(__glewInvalidateTexImage) +#define glInvalidateTexSubImage GLEW_GET_FUN(__glewInvalidateTexSubImage) + +#define GLEW_ARB_invalidate_subdata GLEW_GET_VAR(__GLEW_ARB_invalidate_subdata) + +#endif /* GL_ARB_invalidate_subdata */ + +/* ---------------------- GL_ARB_map_buffer_alignment ---------------------- */ + +#ifndef GL_ARB_map_buffer_alignment +#define GL_ARB_map_buffer_alignment 1 + +#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC + +#define GLEW_ARB_map_buffer_alignment GLEW_GET_VAR(__GLEW_ARB_map_buffer_alignment) + +#endif /* GL_ARB_map_buffer_alignment */ + +/* ------------------------ GL_ARB_map_buffer_range ------------------------ */ + +#ifndef GL_ARB_map_buffer_range +#define GL_ARB_map_buffer_range 1 + +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 +#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 +#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 +#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 + +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); +typedef GLvoid * (GLAPIENTRY * PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); + +#define glFlushMappedBufferRange GLEW_GET_FUN(__glewFlushMappedBufferRange) +#define glMapBufferRange GLEW_GET_FUN(__glewMapBufferRange) + +#define GLEW_ARB_map_buffer_range GLEW_GET_VAR(__GLEW_ARB_map_buffer_range) + +#endif /* GL_ARB_map_buffer_range */ + +/* ------------------------- GL_ARB_matrix_palette ------------------------- */ + +#ifndef GL_ARB_matrix_palette +#define GL_ARB_matrix_palette 1 + +#define GL_MATRIX_PALETTE_ARB 0x8840 +#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 +#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 +#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 +#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 +#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 +#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 + +typedef void (GLAPIENTRY * PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUBVARBPROC) (GLint size, GLubyte *indices); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUIVARBPROC) (GLint size, GLuint *indices); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUSVARBPROC) (GLint size, GLushort *indices); + +#define glCurrentPaletteMatrixARB GLEW_GET_FUN(__glewCurrentPaletteMatrixARB) +#define glMatrixIndexPointerARB GLEW_GET_FUN(__glewMatrixIndexPointerARB) +#define glMatrixIndexubvARB GLEW_GET_FUN(__glewMatrixIndexubvARB) +#define glMatrixIndexuivARB GLEW_GET_FUN(__glewMatrixIndexuivARB) +#define glMatrixIndexusvARB GLEW_GET_FUN(__glewMatrixIndexusvARB) + +#define GLEW_ARB_matrix_palette GLEW_GET_VAR(__GLEW_ARB_matrix_palette) + +#endif /* GL_ARB_matrix_palette */ + +/* --------------------------- GL_ARB_multi_bind --------------------------- */ + +#ifndef GL_ARB_multi_bind +#define GL_ARB_multi_bind 1 + +typedef void (GLAPIENTRY * PFNGLBINDBUFFERSBASEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERSRANGEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizeiptr *sizes); +typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTURESPROC) (GLuint first, GLsizei count, const GLuint* textures); +typedef void (GLAPIENTRY * PFNGLBINDSAMPLERSPROC) (GLuint first, GLsizei count, const GLuint* samplers); +typedef void (GLAPIENTRY * PFNGLBINDTEXTURESPROC) (GLuint first, GLsizei count, const GLuint* textures); +typedef void (GLAPIENTRY * PFNGLBINDVERTEXBUFFERSPROC) (GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizei *strides); + +#define glBindBuffersBase GLEW_GET_FUN(__glewBindBuffersBase) +#define glBindBuffersRange GLEW_GET_FUN(__glewBindBuffersRange) +#define glBindImageTextures GLEW_GET_FUN(__glewBindImageTextures) +#define glBindSamplers GLEW_GET_FUN(__glewBindSamplers) +#define glBindTextures GLEW_GET_FUN(__glewBindTextures) +#define glBindVertexBuffers GLEW_GET_FUN(__glewBindVertexBuffers) + +#define GLEW_ARB_multi_bind GLEW_GET_VAR(__GLEW_ARB_multi_bind) + +#endif /* GL_ARB_multi_bind */ + +/* ----------------------- GL_ARB_multi_draw_indirect ---------------------- */ + +#ifndef GL_ARB_multi_draw_indirect +#define GL_ARB_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride); + +#define glMultiDrawArraysIndirect GLEW_GET_FUN(__glewMultiDrawArraysIndirect) +#define glMultiDrawElementsIndirect GLEW_GET_FUN(__glewMultiDrawElementsIndirect) + +#define GLEW_ARB_multi_draw_indirect GLEW_GET_VAR(__GLEW_ARB_multi_draw_indirect) + +#endif /* GL_ARB_multi_draw_indirect */ + +/* --------------------------- GL_ARB_multisample -------------------------- */ + +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 + +#define GL_MULTISAMPLE_ARB 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F +#define GL_SAMPLE_COVERAGE_ARB 0x80A0 +#define GL_SAMPLE_BUFFERS_ARB 0x80A8 +#define GL_SAMPLES_ARB 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB +#define GL_MULTISAMPLE_BIT_ARB 0x20000000 + +typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); + +#define glSampleCoverageARB GLEW_GET_FUN(__glewSampleCoverageARB) + +#define GLEW_ARB_multisample GLEW_GET_VAR(__GLEW_ARB_multisample) + +#endif /* GL_ARB_multisample */ + +/* -------------------------- GL_ARB_multitexture -------------------------- */ + +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 + +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 + +typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); + +#define glActiveTextureARB GLEW_GET_FUN(__glewActiveTextureARB) +#define glClientActiveTextureARB GLEW_GET_FUN(__glewClientActiveTextureARB) +#define glMultiTexCoord1dARB GLEW_GET_FUN(__glewMultiTexCoord1dARB) +#define glMultiTexCoord1dvARB GLEW_GET_FUN(__glewMultiTexCoord1dvARB) +#define glMultiTexCoord1fARB GLEW_GET_FUN(__glewMultiTexCoord1fARB) +#define glMultiTexCoord1fvARB GLEW_GET_FUN(__glewMultiTexCoord1fvARB) +#define glMultiTexCoord1iARB GLEW_GET_FUN(__glewMultiTexCoord1iARB) +#define glMultiTexCoord1ivARB GLEW_GET_FUN(__glewMultiTexCoord1ivARB) +#define glMultiTexCoord1sARB GLEW_GET_FUN(__glewMultiTexCoord1sARB) +#define glMultiTexCoord1svARB GLEW_GET_FUN(__glewMultiTexCoord1svARB) +#define glMultiTexCoord2dARB GLEW_GET_FUN(__glewMultiTexCoord2dARB) +#define glMultiTexCoord2dvARB GLEW_GET_FUN(__glewMultiTexCoord2dvARB) +#define glMultiTexCoord2fARB GLEW_GET_FUN(__glewMultiTexCoord2fARB) +#define glMultiTexCoord2fvARB GLEW_GET_FUN(__glewMultiTexCoord2fvARB) +#define glMultiTexCoord2iARB GLEW_GET_FUN(__glewMultiTexCoord2iARB) +#define glMultiTexCoord2ivARB GLEW_GET_FUN(__glewMultiTexCoord2ivARB) +#define glMultiTexCoord2sARB GLEW_GET_FUN(__glewMultiTexCoord2sARB) +#define glMultiTexCoord2svARB GLEW_GET_FUN(__glewMultiTexCoord2svARB) +#define glMultiTexCoord3dARB GLEW_GET_FUN(__glewMultiTexCoord3dARB) +#define glMultiTexCoord3dvARB GLEW_GET_FUN(__glewMultiTexCoord3dvARB) +#define glMultiTexCoord3fARB GLEW_GET_FUN(__glewMultiTexCoord3fARB) +#define glMultiTexCoord3fvARB GLEW_GET_FUN(__glewMultiTexCoord3fvARB) +#define glMultiTexCoord3iARB GLEW_GET_FUN(__glewMultiTexCoord3iARB) +#define glMultiTexCoord3ivARB GLEW_GET_FUN(__glewMultiTexCoord3ivARB) +#define glMultiTexCoord3sARB GLEW_GET_FUN(__glewMultiTexCoord3sARB) +#define glMultiTexCoord3svARB GLEW_GET_FUN(__glewMultiTexCoord3svARB) +#define glMultiTexCoord4dARB GLEW_GET_FUN(__glewMultiTexCoord4dARB) +#define glMultiTexCoord4dvARB GLEW_GET_FUN(__glewMultiTexCoord4dvARB) +#define glMultiTexCoord4fARB GLEW_GET_FUN(__glewMultiTexCoord4fARB) +#define glMultiTexCoord4fvARB GLEW_GET_FUN(__glewMultiTexCoord4fvARB) +#define glMultiTexCoord4iARB GLEW_GET_FUN(__glewMultiTexCoord4iARB) +#define glMultiTexCoord4ivARB GLEW_GET_FUN(__glewMultiTexCoord4ivARB) +#define glMultiTexCoord4sARB GLEW_GET_FUN(__glewMultiTexCoord4sARB) +#define glMultiTexCoord4svARB GLEW_GET_FUN(__glewMultiTexCoord4svARB) + +#define GLEW_ARB_multitexture GLEW_GET_VAR(__GLEW_ARB_multitexture) + +#endif /* GL_ARB_multitexture */ + +/* ------------------------- GL_ARB_occlusion_query ------------------------ */ + +#ifndef GL_ARB_occlusion_query +#define GL_ARB_occlusion_query 1 + +#define GL_QUERY_COUNTER_BITS_ARB 0x8864 +#define GL_CURRENT_QUERY_ARB 0x8865 +#define GL_QUERY_RESULT_ARB 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 +#define GL_SAMPLES_PASSED_ARB 0x8914 + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDQUERYARBPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISQUERYARBPROC) (GLuint id); + +#define glBeginQueryARB GLEW_GET_FUN(__glewBeginQueryARB) +#define glDeleteQueriesARB GLEW_GET_FUN(__glewDeleteQueriesARB) +#define glEndQueryARB GLEW_GET_FUN(__glewEndQueryARB) +#define glGenQueriesARB GLEW_GET_FUN(__glewGenQueriesARB) +#define glGetQueryObjectivARB GLEW_GET_FUN(__glewGetQueryObjectivARB) +#define glGetQueryObjectuivARB GLEW_GET_FUN(__glewGetQueryObjectuivARB) +#define glGetQueryivARB GLEW_GET_FUN(__glewGetQueryivARB) +#define glIsQueryARB GLEW_GET_FUN(__glewIsQueryARB) + +#define GLEW_ARB_occlusion_query GLEW_GET_VAR(__GLEW_ARB_occlusion_query) + +#endif /* GL_ARB_occlusion_query */ + +/* ------------------------ GL_ARB_occlusion_query2 ------------------------ */ + +#ifndef GL_ARB_occlusion_query2 +#define GL_ARB_occlusion_query2 1 + +#define GL_ANY_SAMPLES_PASSED 0x8C2F + +#define GLEW_ARB_occlusion_query2 GLEW_GET_VAR(__GLEW_ARB_occlusion_query2) + +#endif /* GL_ARB_occlusion_query2 */ + +/* ----------------------- GL_ARB_pixel_buffer_object ---------------------- */ + +#ifndef GL_ARB_pixel_buffer_object +#define GL_ARB_pixel_buffer_object 1 + +#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF + +#define GLEW_ARB_pixel_buffer_object GLEW_GET_VAR(__GLEW_ARB_pixel_buffer_object) + +#endif /* GL_ARB_pixel_buffer_object */ + +/* ------------------------ GL_ARB_point_parameters ------------------------ */ + +#ifndef GL_ARB_point_parameters +#define GL_ARB_point_parameters 1 + +#define GL_POINT_SIZE_MIN_ARB 0x8126 +#define GL_POINT_SIZE_MAX_ARB 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 + +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat* params); + +#define glPointParameterfARB GLEW_GET_FUN(__glewPointParameterfARB) +#define glPointParameterfvARB GLEW_GET_FUN(__glewPointParameterfvARB) + +#define GLEW_ARB_point_parameters GLEW_GET_VAR(__GLEW_ARB_point_parameters) + +#endif /* GL_ARB_point_parameters */ + +/* -------------------------- GL_ARB_point_sprite -------------------------- */ + +#ifndef GL_ARB_point_sprite +#define GL_ARB_point_sprite 1 + +#define GL_POINT_SPRITE_ARB 0x8861 +#define GL_COORD_REPLACE_ARB 0x8862 + +#define GLEW_ARB_point_sprite GLEW_GET_VAR(__GLEW_ARB_point_sprite) + +#endif /* GL_ARB_point_sprite */ + +/* --------------------- GL_ARB_program_interface_query -------------------- */ + +#ifndef GL_ARB_program_interface_query +#define GL_ARB_program_interface_query 1 + +#define GL_UNIFORM 0x92E1 +#define GL_UNIFORM_BLOCK 0x92E2 +#define GL_PROGRAM_INPUT 0x92E3 +#define GL_PROGRAM_OUTPUT 0x92E4 +#define GL_BUFFER_VARIABLE 0x92E5 +#define GL_SHADER_STORAGE_BLOCK 0x92E6 +#define GL_IS_PER_PATCH 0x92E7 +#define GL_VERTEX_SUBROUTINE 0x92E8 +#define GL_TESS_CONTROL_SUBROUTINE 0x92E9 +#define GL_TESS_EVALUATION_SUBROUTINE 0x92EA +#define GL_GEOMETRY_SUBROUTINE 0x92EB +#define GL_FRAGMENT_SUBROUTINE 0x92EC +#define GL_COMPUTE_SUBROUTINE 0x92ED +#define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE +#define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF +#define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0 +#define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1 +#define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2 +#define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3 +#define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4 +#define GL_ACTIVE_RESOURCES 0x92F5 +#define GL_MAX_NAME_LENGTH 0x92F6 +#define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7 +#define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8 +#define GL_NAME_LENGTH 0x92F9 +#define GL_TYPE 0x92FA +#define GL_ARRAY_SIZE 0x92FB +#define GL_OFFSET 0x92FC +#define GL_BLOCK_INDEX 0x92FD +#define GL_ARRAY_STRIDE 0x92FE +#define GL_MATRIX_STRIDE 0x92FF +#define GL_IS_ROW_MAJOR 0x9300 +#define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301 +#define GL_BUFFER_BINDING 0x9302 +#define GL_BUFFER_DATA_SIZE 0x9303 +#define GL_NUM_ACTIVE_VARIABLES 0x9304 +#define GL_ACTIVE_VARIABLES 0x9305 +#define GL_REFERENCED_BY_VERTEX_SHADER 0x9306 +#define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307 +#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308 +#define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309 +#define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A +#define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B +#define GL_TOP_LEVEL_ARRAY_SIZE 0x930C +#define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D +#define GL_LOCATION 0x930E +#define GL_LOCATION_INDEX 0x930F + +typedef void (GLAPIENTRY * PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint* params); +typedef GLuint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei *length, GLint *params); + +#define glGetProgramInterfaceiv GLEW_GET_FUN(__glewGetProgramInterfaceiv) +#define glGetProgramResourceIndex GLEW_GET_FUN(__glewGetProgramResourceIndex) +#define glGetProgramResourceLocation GLEW_GET_FUN(__glewGetProgramResourceLocation) +#define glGetProgramResourceLocationIndex GLEW_GET_FUN(__glewGetProgramResourceLocationIndex) +#define glGetProgramResourceName GLEW_GET_FUN(__glewGetProgramResourceName) +#define glGetProgramResourceiv GLEW_GET_FUN(__glewGetProgramResourceiv) + +#define GLEW_ARB_program_interface_query GLEW_GET_VAR(__GLEW_ARB_program_interface_query) + +#endif /* GL_ARB_program_interface_query */ + +/* ------------------------ GL_ARB_provoking_vertex ------------------------ */ + +#ifndef GL_ARB_provoking_vertex +#define GL_ARB_provoking_vertex 1 + +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION 0x8E4D +#define GL_LAST_VERTEX_CONVENTION 0x8E4E +#define GL_PROVOKING_VERTEX 0x8E4F + +typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXPROC) (GLenum mode); + +#define glProvokingVertex GLEW_GET_FUN(__glewProvokingVertex) + +#define GLEW_ARB_provoking_vertex GLEW_GET_VAR(__GLEW_ARB_provoking_vertex) + +#endif /* GL_ARB_provoking_vertex */ + +/* ----------------------- GL_ARB_query_buffer_object ---------------------- */ + +#ifndef GL_ARB_query_buffer_object +#define GL_ARB_query_buffer_object 1 + +#define GL_QUERY_BUFFER_BARRIER_BIT 0x00008000 +#define GL_QUERY_BUFFER 0x9192 +#define GL_QUERY_BUFFER_BINDING 0x9193 +#define GL_QUERY_RESULT_NO_WAIT 0x9194 + +#define GLEW_ARB_query_buffer_object GLEW_GET_VAR(__GLEW_ARB_query_buffer_object) + +#endif /* GL_ARB_query_buffer_object */ + +/* ------------------ GL_ARB_robust_buffer_access_behavior ----------------- */ + +#ifndef GL_ARB_robust_buffer_access_behavior +#define GL_ARB_robust_buffer_access_behavior 1 + +#define GLEW_ARB_robust_buffer_access_behavior GLEW_GET_VAR(__GLEW_ARB_robust_buffer_access_behavior) + +#endif /* GL_ARB_robust_buffer_access_behavior */ + +/* --------------------------- GL_ARB_robustness --------------------------- */ + +#ifndef GL_ARB_robustness +#define GL_ARB_robustness 1 + +#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 +#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 +#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 +#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define GL_NO_RESET_NOTIFICATION_ARB 0x8261 + +typedef GLenum (GLAPIENTRY * PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* table); +typedef void (GLAPIENTRY * PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, void* img); +typedef void (GLAPIENTRY * PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* image); +typedef void (GLAPIENTRY * PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); +typedef void (GLAPIENTRY * PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble* v); +typedef void (GLAPIENTRY * PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat* v); +typedef void (GLAPIENTRY * PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint* v); +typedef void (GLAPIENTRY * PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort* values); +typedef void (GLAPIENTRY * PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte* pattern); +typedef void (GLAPIENTRY * PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void* row, GLsizei columnBufSize, GLvoid*column, GLvoid*span); +typedef void (GLAPIENTRY * PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* img); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint* params); +typedef void (GLAPIENTRY * PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data); + +#define glGetGraphicsResetStatusARB GLEW_GET_FUN(__glewGetGraphicsResetStatusARB) +#define glGetnColorTableARB GLEW_GET_FUN(__glewGetnColorTableARB) +#define glGetnCompressedTexImageARB GLEW_GET_FUN(__glewGetnCompressedTexImageARB) +#define glGetnConvolutionFilterARB GLEW_GET_FUN(__glewGetnConvolutionFilterARB) +#define glGetnHistogramARB GLEW_GET_FUN(__glewGetnHistogramARB) +#define glGetnMapdvARB GLEW_GET_FUN(__glewGetnMapdvARB) +#define glGetnMapfvARB GLEW_GET_FUN(__glewGetnMapfvARB) +#define glGetnMapivARB GLEW_GET_FUN(__glewGetnMapivARB) +#define glGetnMinmaxARB GLEW_GET_FUN(__glewGetnMinmaxARB) +#define glGetnPixelMapfvARB GLEW_GET_FUN(__glewGetnPixelMapfvARB) +#define glGetnPixelMapuivARB GLEW_GET_FUN(__glewGetnPixelMapuivARB) +#define glGetnPixelMapusvARB GLEW_GET_FUN(__glewGetnPixelMapusvARB) +#define glGetnPolygonStippleARB GLEW_GET_FUN(__glewGetnPolygonStippleARB) +#define glGetnSeparableFilterARB GLEW_GET_FUN(__glewGetnSeparableFilterARB) +#define glGetnTexImageARB GLEW_GET_FUN(__glewGetnTexImageARB) +#define glGetnUniformdvARB GLEW_GET_FUN(__glewGetnUniformdvARB) +#define glGetnUniformfvARB GLEW_GET_FUN(__glewGetnUniformfvARB) +#define glGetnUniformivARB GLEW_GET_FUN(__glewGetnUniformivARB) +#define glGetnUniformuivARB GLEW_GET_FUN(__glewGetnUniformuivARB) +#define glReadnPixelsARB GLEW_GET_FUN(__glewReadnPixelsARB) + +#define GLEW_ARB_robustness GLEW_GET_VAR(__GLEW_ARB_robustness) + +#endif /* GL_ARB_robustness */ + +/* ---------------- GL_ARB_robustness_application_isolation ---------------- */ + +#ifndef GL_ARB_robustness_application_isolation +#define GL_ARB_robustness_application_isolation 1 + +#define GLEW_ARB_robustness_application_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_application_isolation) + +#endif /* GL_ARB_robustness_application_isolation */ + +/* ---------------- GL_ARB_robustness_share_group_isolation ---------------- */ + +#ifndef GL_ARB_robustness_share_group_isolation +#define GL_ARB_robustness_share_group_isolation 1 + +#define GLEW_ARB_robustness_share_group_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_share_group_isolation) + +#endif /* GL_ARB_robustness_share_group_isolation */ + +/* ------------------------- GL_ARB_sample_shading ------------------------- */ + +#ifndef GL_ARB_sample_shading +#define GL_ARB_sample_shading 1 + +#define GL_SAMPLE_SHADING_ARB 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37 + +typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGARBPROC) (GLclampf value); + +#define glMinSampleShadingARB GLEW_GET_FUN(__glewMinSampleShadingARB) + +#define GLEW_ARB_sample_shading GLEW_GET_VAR(__GLEW_ARB_sample_shading) + +#endif /* GL_ARB_sample_shading */ + +/* ------------------------- GL_ARB_sampler_objects ------------------------ */ + +#ifndef GL_ARB_sampler_objects +#define GL_ARB_sampler_objects 1 + +#define GL_SAMPLER_BINDING 0x8919 + +typedef void (GLAPIENTRY * PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler); +typedef void (GLAPIENTRY * PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint * samplers); +typedef void (GLAPIENTRY * PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint* samplers); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISSAMPLERPROC) (GLuint sampler); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint* params); + +#define glBindSampler GLEW_GET_FUN(__glewBindSampler) +#define glDeleteSamplers GLEW_GET_FUN(__glewDeleteSamplers) +#define glGenSamplers GLEW_GET_FUN(__glewGenSamplers) +#define glGetSamplerParameterIiv GLEW_GET_FUN(__glewGetSamplerParameterIiv) +#define glGetSamplerParameterIuiv GLEW_GET_FUN(__glewGetSamplerParameterIuiv) +#define glGetSamplerParameterfv GLEW_GET_FUN(__glewGetSamplerParameterfv) +#define glGetSamplerParameteriv GLEW_GET_FUN(__glewGetSamplerParameteriv) +#define glIsSampler GLEW_GET_FUN(__glewIsSampler) +#define glSamplerParameterIiv GLEW_GET_FUN(__glewSamplerParameterIiv) +#define glSamplerParameterIuiv GLEW_GET_FUN(__glewSamplerParameterIuiv) +#define glSamplerParameterf GLEW_GET_FUN(__glewSamplerParameterf) +#define glSamplerParameterfv GLEW_GET_FUN(__glewSamplerParameterfv) +#define glSamplerParameteri GLEW_GET_FUN(__glewSamplerParameteri) +#define glSamplerParameteriv GLEW_GET_FUN(__glewSamplerParameteriv) + +#define GLEW_ARB_sampler_objects GLEW_GET_VAR(__GLEW_ARB_sampler_objects) + +#endif /* GL_ARB_sampler_objects */ + +/* ------------------------ GL_ARB_seamless_cube_map ----------------------- */ + +#ifndef GL_ARB_seamless_cube_map +#define GL_ARB_seamless_cube_map 1 + +#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F + +#define GLEW_ARB_seamless_cube_map GLEW_GET_VAR(__GLEW_ARB_seamless_cube_map) + +#endif /* GL_ARB_seamless_cube_map */ + +/* ------------------ GL_ARB_seamless_cubemap_per_texture ------------------ */ + +#ifndef GL_ARB_seamless_cubemap_per_texture +#define GL_ARB_seamless_cubemap_per_texture 1 + +#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F + +#define GLEW_ARB_seamless_cubemap_per_texture GLEW_GET_VAR(__GLEW_ARB_seamless_cubemap_per_texture) + +#endif /* GL_ARB_seamless_cubemap_per_texture */ + +/* --------------------- GL_ARB_separate_shader_objects -------------------- */ + +#ifndef GL_ARB_separate_shader_objects +#define GL_ARB_separate_shader_objects 1 + +#define GL_VERTEX_SHADER_BIT 0x00000001 +#define GL_FRAGMENT_SHADER_BIT 0x00000002 +#define GL_GEOMETRY_SHADER_BIT 0x00000004 +#define GL_TESS_CONTROL_SHADER_BIT 0x00000008 +#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010 +#define GL_PROGRAM_SEPARABLE 0x8258 +#define GL_ACTIVE_PROGRAM 0x8259 +#define GL_PROGRAM_PIPELINE_BINDING 0x825A +#define GL_ALL_SHADER_BITS 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program); +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar ** strings); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint* pipelines); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint* pipelines); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar *infoLog); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint x, GLuint y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline); + +#define glActiveShaderProgram GLEW_GET_FUN(__glewActiveShaderProgram) +#define glBindProgramPipeline GLEW_GET_FUN(__glewBindProgramPipeline) +#define glCreateShaderProgramv GLEW_GET_FUN(__glewCreateShaderProgramv) +#define glDeleteProgramPipelines GLEW_GET_FUN(__glewDeleteProgramPipelines) +#define glGenProgramPipelines GLEW_GET_FUN(__glewGenProgramPipelines) +#define glGetProgramPipelineInfoLog GLEW_GET_FUN(__glewGetProgramPipelineInfoLog) +#define glGetProgramPipelineiv GLEW_GET_FUN(__glewGetProgramPipelineiv) +#define glIsProgramPipeline GLEW_GET_FUN(__glewIsProgramPipeline) +#define glProgramUniform1d GLEW_GET_FUN(__glewProgramUniform1d) +#define glProgramUniform1dv GLEW_GET_FUN(__glewProgramUniform1dv) +#define glProgramUniform1f GLEW_GET_FUN(__glewProgramUniform1f) +#define glProgramUniform1fv GLEW_GET_FUN(__glewProgramUniform1fv) +#define glProgramUniform1i GLEW_GET_FUN(__glewProgramUniform1i) +#define glProgramUniform1iv GLEW_GET_FUN(__glewProgramUniform1iv) +#define glProgramUniform1ui GLEW_GET_FUN(__glewProgramUniform1ui) +#define glProgramUniform1uiv GLEW_GET_FUN(__glewProgramUniform1uiv) +#define glProgramUniform2d GLEW_GET_FUN(__glewProgramUniform2d) +#define glProgramUniform2dv GLEW_GET_FUN(__glewProgramUniform2dv) +#define glProgramUniform2f GLEW_GET_FUN(__glewProgramUniform2f) +#define glProgramUniform2fv GLEW_GET_FUN(__glewProgramUniform2fv) +#define glProgramUniform2i GLEW_GET_FUN(__glewProgramUniform2i) +#define glProgramUniform2iv GLEW_GET_FUN(__glewProgramUniform2iv) +#define glProgramUniform2ui GLEW_GET_FUN(__glewProgramUniform2ui) +#define glProgramUniform2uiv GLEW_GET_FUN(__glewProgramUniform2uiv) +#define glProgramUniform3d GLEW_GET_FUN(__glewProgramUniform3d) +#define glProgramUniform3dv GLEW_GET_FUN(__glewProgramUniform3dv) +#define glProgramUniform3f GLEW_GET_FUN(__glewProgramUniform3f) +#define glProgramUniform3fv GLEW_GET_FUN(__glewProgramUniform3fv) +#define glProgramUniform3i GLEW_GET_FUN(__glewProgramUniform3i) +#define glProgramUniform3iv GLEW_GET_FUN(__glewProgramUniform3iv) +#define glProgramUniform3ui GLEW_GET_FUN(__glewProgramUniform3ui) +#define glProgramUniform3uiv GLEW_GET_FUN(__glewProgramUniform3uiv) +#define glProgramUniform4d GLEW_GET_FUN(__glewProgramUniform4d) +#define glProgramUniform4dv GLEW_GET_FUN(__glewProgramUniform4dv) +#define glProgramUniform4f GLEW_GET_FUN(__glewProgramUniform4f) +#define glProgramUniform4fv GLEW_GET_FUN(__glewProgramUniform4fv) +#define glProgramUniform4i GLEW_GET_FUN(__glewProgramUniform4i) +#define glProgramUniform4iv GLEW_GET_FUN(__glewProgramUniform4iv) +#define glProgramUniform4ui GLEW_GET_FUN(__glewProgramUniform4ui) +#define glProgramUniform4uiv GLEW_GET_FUN(__glewProgramUniform4uiv) +#define glProgramUniformMatrix2dv GLEW_GET_FUN(__glewProgramUniformMatrix2dv) +#define glProgramUniformMatrix2fv GLEW_GET_FUN(__glewProgramUniformMatrix2fv) +#define glProgramUniformMatrix2x3dv GLEW_GET_FUN(__glewProgramUniformMatrix2x3dv) +#define glProgramUniformMatrix2x3fv GLEW_GET_FUN(__glewProgramUniformMatrix2x3fv) +#define glProgramUniformMatrix2x4dv GLEW_GET_FUN(__glewProgramUniformMatrix2x4dv) +#define glProgramUniformMatrix2x4fv GLEW_GET_FUN(__glewProgramUniformMatrix2x4fv) +#define glProgramUniformMatrix3dv GLEW_GET_FUN(__glewProgramUniformMatrix3dv) +#define glProgramUniformMatrix3fv GLEW_GET_FUN(__glewProgramUniformMatrix3fv) +#define glProgramUniformMatrix3x2dv GLEW_GET_FUN(__glewProgramUniformMatrix3x2dv) +#define glProgramUniformMatrix3x2fv GLEW_GET_FUN(__glewProgramUniformMatrix3x2fv) +#define glProgramUniformMatrix3x4dv GLEW_GET_FUN(__glewProgramUniformMatrix3x4dv) +#define glProgramUniformMatrix3x4fv GLEW_GET_FUN(__glewProgramUniformMatrix3x4fv) +#define glProgramUniformMatrix4dv GLEW_GET_FUN(__glewProgramUniformMatrix4dv) +#define glProgramUniformMatrix4fv GLEW_GET_FUN(__glewProgramUniformMatrix4fv) +#define glProgramUniformMatrix4x2dv GLEW_GET_FUN(__glewProgramUniformMatrix4x2dv) +#define glProgramUniformMatrix4x2fv GLEW_GET_FUN(__glewProgramUniformMatrix4x2fv) +#define glProgramUniformMatrix4x3dv GLEW_GET_FUN(__glewProgramUniformMatrix4x3dv) +#define glProgramUniformMatrix4x3fv GLEW_GET_FUN(__glewProgramUniformMatrix4x3fv) +#define glUseProgramStages GLEW_GET_FUN(__glewUseProgramStages) +#define glValidateProgramPipeline GLEW_GET_FUN(__glewValidateProgramPipeline) + +#define GLEW_ARB_separate_shader_objects GLEW_GET_VAR(__GLEW_ARB_separate_shader_objects) + +#endif /* GL_ARB_separate_shader_objects */ + +/* --------------------- GL_ARB_shader_atomic_counters --------------------- */ + +#ifndef GL_ARB_shader_atomic_counters +#define GL_ARB_shader_atomic_counters 1 + +#define GL_ATOMIC_COUNTER_BUFFER 0x92C0 +#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1 +#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2 +#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3 +#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5 +#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9 +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA +#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB +#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE +#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF +#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0 +#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1 +#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2 +#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3 +#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4 +#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5 +#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6 +#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7 +#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8 +#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9 +#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA +#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB +#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC + +typedef void (GLAPIENTRY * PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint* params); + +#define glGetActiveAtomicCounterBufferiv GLEW_GET_FUN(__glewGetActiveAtomicCounterBufferiv) + +#define GLEW_ARB_shader_atomic_counters GLEW_GET_VAR(__GLEW_ARB_shader_atomic_counters) + +#endif /* GL_ARB_shader_atomic_counters */ + +/* ----------------------- GL_ARB_shader_bit_encoding ---------------------- */ + +#ifndef GL_ARB_shader_bit_encoding +#define GL_ARB_shader_bit_encoding 1 + +#define GLEW_ARB_shader_bit_encoding GLEW_GET_VAR(__GLEW_ARB_shader_bit_encoding) + +#endif /* GL_ARB_shader_bit_encoding */ + +/* --------------------- GL_ARB_shader_draw_parameters --------------------- */ + +#ifndef GL_ARB_shader_draw_parameters +#define GL_ARB_shader_draw_parameters 1 + +#define GLEW_ARB_shader_draw_parameters GLEW_GET_VAR(__GLEW_ARB_shader_draw_parameters) + +#endif /* GL_ARB_shader_draw_parameters */ + +/* ------------------------ GL_ARB_shader_group_vote ----------------------- */ + +#ifndef GL_ARB_shader_group_vote +#define GL_ARB_shader_group_vote 1 + +#define GLEW_ARB_shader_group_vote GLEW_GET_VAR(__GLEW_ARB_shader_group_vote) + +#endif /* GL_ARB_shader_group_vote */ + +/* --------------------- GL_ARB_shader_image_load_store -------------------- */ + +#ifndef GL_ARB_shader_image_load_store +#define GL_ARB_shader_image_load_store 1 + +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020 +#define GL_COMMAND_BARRIER_BIT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000 +#define GL_MAX_IMAGE_UNITS 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39 +#define GL_IMAGE_BINDING_NAME 0x8F3A +#define GL_IMAGE_BINDING_LEVEL 0x8F3B +#define GL_IMAGE_BINDING_LAYERED 0x8F3C +#define GL_IMAGE_BINDING_LAYER 0x8F3D +#define GL_IMAGE_BINDING_ACCESS 0x8F3E +#define GL_IMAGE_1D 0x904C +#define GL_IMAGE_2D 0x904D +#define GL_IMAGE_3D 0x904E +#define GL_IMAGE_2D_RECT 0x904F +#define GL_IMAGE_CUBE 0x9050 +#define GL_IMAGE_BUFFER 0x9051 +#define GL_IMAGE_1D_ARRAY 0x9052 +#define GL_IMAGE_2D_ARRAY 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056 +#define GL_INT_IMAGE_1D 0x9057 +#define GL_INT_IMAGE_2D 0x9058 +#define GL_INT_IMAGE_3D 0x9059 +#define GL_INT_IMAGE_2D_RECT 0x905A +#define GL_INT_IMAGE_CUBE 0x905B +#define GL_INT_IMAGE_BUFFER 0x905C +#define GL_INT_IMAGE_1D_ARRAY 0x905D +#define GL_INT_IMAGE_2D_ARRAY 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C +#define GL_MAX_IMAGE_SAMPLES 0x906D +#define GL_IMAGE_BINDING_FORMAT 0x906E +#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8 +#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9 +#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA +#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB +#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC +#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD +#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE +#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF +#define GL_ALL_BARRIER_BITS 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); +typedef void (GLAPIENTRY * PFNGLMEMORYBARRIERPROC) (GLbitfield barriers); + +#define glBindImageTexture GLEW_GET_FUN(__glewBindImageTexture) +#define glMemoryBarrier GLEW_GET_FUN(__glewMemoryBarrier) + +#define GLEW_ARB_shader_image_load_store GLEW_GET_VAR(__GLEW_ARB_shader_image_load_store) + +#endif /* GL_ARB_shader_image_load_store */ + +/* ------------------------ GL_ARB_shader_image_size ----------------------- */ + +#ifndef GL_ARB_shader_image_size +#define GL_ARB_shader_image_size 1 + +#define GLEW_ARB_shader_image_size GLEW_GET_VAR(__GLEW_ARB_shader_image_size) + +#endif /* GL_ARB_shader_image_size */ + +/* ------------------------- GL_ARB_shader_objects ------------------------- */ + +#ifndef GL_ARB_shader_objects +#define GL_ARB_shader_objects 1 + +#define GL_PROGRAM_OBJECT_ARB 0x8B40 +#define GL_SHADER_OBJECT_ARB 0x8B48 +#define GL_OBJECT_TYPE_ARB 0x8B4E +#define GL_OBJECT_SUBTYPE_ARB 0x8B4F +#define GL_FLOAT_VEC2_ARB 0x8B50 +#define GL_FLOAT_VEC3_ARB 0x8B51 +#define GL_FLOAT_VEC4_ARB 0x8B52 +#define GL_INT_VEC2_ARB 0x8B53 +#define GL_INT_VEC3_ARB 0x8B54 +#define GL_INT_VEC4_ARB 0x8B55 +#define GL_BOOL_ARB 0x8B56 +#define GL_BOOL_VEC2_ARB 0x8B57 +#define GL_BOOL_VEC3_ARB 0x8B58 +#define GL_BOOL_VEC4_ARB 0x8B59 +#define GL_FLOAT_MAT2_ARB 0x8B5A +#define GL_FLOAT_MAT3_ARB 0x8B5B +#define GL_FLOAT_MAT4_ARB 0x8B5C +#define GL_SAMPLER_1D_ARB 0x8B5D +#define GL_SAMPLER_2D_ARB 0x8B5E +#define GL_SAMPLER_3D_ARB 0x8B5F +#define GL_SAMPLER_CUBE_ARB 0x8B60 +#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 +#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 +#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 +#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 +#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 +#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 +#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 +#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 +#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 +#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 +#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 + +typedef char GLcharARB; +typedef unsigned int GLhandleARB; + +typedef void (GLAPIENTRY * PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); +typedef void (GLAPIENTRY * PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); +typedef GLhandleARB (GLAPIENTRY * PFNGLCREATEPROGRAMOBJECTARBPROC) (void); +typedef GLhandleARB (GLAPIENTRY * PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); +typedef void (GLAPIENTRY * PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); +typedef void (GLAPIENTRY * PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name); +typedef void (GLAPIENTRY * PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei* count, GLhandleARB *obj); +typedef GLhandleARB (GLAPIENTRY * PFNGLGETHANDLEARBPROC) (GLenum pname); +typedef void (GLAPIENTRY * PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *infoLog); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *source); +typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint* params); +typedef void (GLAPIENTRY * PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (GLAPIENTRY * PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB ** string, const GLint *length); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); + +#define glAttachObjectARB GLEW_GET_FUN(__glewAttachObjectARB) +#define glCompileShaderARB GLEW_GET_FUN(__glewCompileShaderARB) +#define glCreateProgramObjectARB GLEW_GET_FUN(__glewCreateProgramObjectARB) +#define glCreateShaderObjectARB GLEW_GET_FUN(__glewCreateShaderObjectARB) +#define glDeleteObjectARB GLEW_GET_FUN(__glewDeleteObjectARB) +#define glDetachObjectARB GLEW_GET_FUN(__glewDetachObjectARB) +#define glGetActiveUniformARB GLEW_GET_FUN(__glewGetActiveUniformARB) +#define glGetAttachedObjectsARB GLEW_GET_FUN(__glewGetAttachedObjectsARB) +#define glGetHandleARB GLEW_GET_FUN(__glewGetHandleARB) +#define glGetInfoLogARB GLEW_GET_FUN(__glewGetInfoLogARB) +#define glGetObjectParameterfvARB GLEW_GET_FUN(__glewGetObjectParameterfvARB) +#define glGetObjectParameterivARB GLEW_GET_FUN(__glewGetObjectParameterivARB) +#define glGetShaderSourceARB GLEW_GET_FUN(__glewGetShaderSourceARB) +#define glGetUniformLocationARB GLEW_GET_FUN(__glewGetUniformLocationARB) +#define glGetUniformfvARB GLEW_GET_FUN(__glewGetUniformfvARB) +#define glGetUniformivARB GLEW_GET_FUN(__glewGetUniformivARB) +#define glLinkProgramARB GLEW_GET_FUN(__glewLinkProgramARB) +#define glShaderSourceARB GLEW_GET_FUN(__glewShaderSourceARB) +#define glUniform1fARB GLEW_GET_FUN(__glewUniform1fARB) +#define glUniform1fvARB GLEW_GET_FUN(__glewUniform1fvARB) +#define glUniform1iARB GLEW_GET_FUN(__glewUniform1iARB) +#define glUniform1ivARB GLEW_GET_FUN(__glewUniform1ivARB) +#define glUniform2fARB GLEW_GET_FUN(__glewUniform2fARB) +#define glUniform2fvARB GLEW_GET_FUN(__glewUniform2fvARB) +#define glUniform2iARB GLEW_GET_FUN(__glewUniform2iARB) +#define glUniform2ivARB GLEW_GET_FUN(__glewUniform2ivARB) +#define glUniform3fARB GLEW_GET_FUN(__glewUniform3fARB) +#define glUniform3fvARB GLEW_GET_FUN(__glewUniform3fvARB) +#define glUniform3iARB GLEW_GET_FUN(__glewUniform3iARB) +#define glUniform3ivARB GLEW_GET_FUN(__glewUniform3ivARB) +#define glUniform4fARB GLEW_GET_FUN(__glewUniform4fARB) +#define glUniform4fvARB GLEW_GET_FUN(__glewUniform4fvARB) +#define glUniform4iARB GLEW_GET_FUN(__glewUniform4iARB) +#define glUniform4ivARB GLEW_GET_FUN(__glewUniform4ivARB) +#define glUniformMatrix2fvARB GLEW_GET_FUN(__glewUniformMatrix2fvARB) +#define glUniformMatrix3fvARB GLEW_GET_FUN(__glewUniformMatrix3fvARB) +#define glUniformMatrix4fvARB GLEW_GET_FUN(__glewUniformMatrix4fvARB) +#define glUseProgramObjectARB GLEW_GET_FUN(__glewUseProgramObjectARB) +#define glValidateProgramARB GLEW_GET_FUN(__glewValidateProgramARB) + +#define GLEW_ARB_shader_objects GLEW_GET_VAR(__GLEW_ARB_shader_objects) + +#endif /* GL_ARB_shader_objects */ + +/* ------------------------ GL_ARB_shader_precision ------------------------ */ + +#ifndef GL_ARB_shader_precision +#define GL_ARB_shader_precision 1 + +#define GLEW_ARB_shader_precision GLEW_GET_VAR(__GLEW_ARB_shader_precision) + +#endif /* GL_ARB_shader_precision */ + +/* ---------------------- GL_ARB_shader_stencil_export --------------------- */ + +#ifndef GL_ARB_shader_stencil_export +#define GL_ARB_shader_stencil_export 1 + +#define GLEW_ARB_shader_stencil_export GLEW_GET_VAR(__GLEW_ARB_shader_stencil_export) + +#endif /* GL_ARB_shader_stencil_export */ + +/* ------------------ GL_ARB_shader_storage_buffer_object ------------------ */ + +#ifndef GL_ARB_shader_storage_buffer_object +#define GL_ARB_shader_storage_buffer_object 1 + +#define GL_SHADER_STORAGE_BARRIER_BIT 0x2000 +#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39 +#define GL_SHADER_STORAGE_BUFFER 0x90D2 +#define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3 +#define GL_SHADER_STORAGE_BUFFER_START 0x90D4 +#define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5 +#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6 +#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7 +#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8 +#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9 +#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA +#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB +#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC +#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD +#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE +#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF + +typedef void (GLAPIENTRY * PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); + +#define glShaderStorageBlockBinding GLEW_GET_FUN(__glewShaderStorageBlockBinding) + +#define GLEW_ARB_shader_storage_buffer_object GLEW_GET_VAR(__GLEW_ARB_shader_storage_buffer_object) + +#endif /* GL_ARB_shader_storage_buffer_object */ + +/* ------------------------ GL_ARB_shader_subroutine ----------------------- */ + +#ifndef GL_ARB_shader_subroutine +#define GL_ARB_shader_subroutine 1 + +#define GL_ACTIVE_SUBROUTINES 0x8DE5 +#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6 +#define GL_MAX_SUBROUTINES 0x8DE7 +#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47 +#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49 +#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A +#define GL_COMPATIBLE_SUBROUTINES 0x8E4B + +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint* values); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint* values); +typedef GLuint (GLAPIENTRY * PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar* name); +typedef GLint (GLAPIENTRY * PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint* params); +typedef void (GLAPIENTRY * PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint* indices); + +#define glGetActiveSubroutineName GLEW_GET_FUN(__glewGetActiveSubroutineName) +#define glGetActiveSubroutineUniformName GLEW_GET_FUN(__glewGetActiveSubroutineUniformName) +#define glGetActiveSubroutineUniformiv GLEW_GET_FUN(__glewGetActiveSubroutineUniformiv) +#define glGetProgramStageiv GLEW_GET_FUN(__glewGetProgramStageiv) +#define glGetSubroutineIndex GLEW_GET_FUN(__glewGetSubroutineIndex) +#define glGetSubroutineUniformLocation GLEW_GET_FUN(__glewGetSubroutineUniformLocation) +#define glGetUniformSubroutineuiv GLEW_GET_FUN(__glewGetUniformSubroutineuiv) +#define glUniformSubroutinesuiv GLEW_GET_FUN(__glewUniformSubroutinesuiv) + +#define GLEW_ARB_shader_subroutine GLEW_GET_VAR(__GLEW_ARB_shader_subroutine) + +#endif /* GL_ARB_shader_subroutine */ + +/* ----------------------- GL_ARB_shader_texture_lod ----------------------- */ + +#ifndef GL_ARB_shader_texture_lod +#define GL_ARB_shader_texture_lod 1 + +#define GLEW_ARB_shader_texture_lod GLEW_GET_VAR(__GLEW_ARB_shader_texture_lod) + +#endif /* GL_ARB_shader_texture_lod */ + +/* ---------------------- GL_ARB_shading_language_100 ---------------------- */ + +#ifndef GL_ARB_shading_language_100 +#define GL_ARB_shading_language_100 1 + +#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C + +#define GLEW_ARB_shading_language_100 GLEW_GET_VAR(__GLEW_ARB_shading_language_100) + +#endif /* GL_ARB_shading_language_100 */ + +/* -------------------- GL_ARB_shading_language_420pack -------------------- */ + +#ifndef GL_ARB_shading_language_420pack +#define GL_ARB_shading_language_420pack 1 + +#define GLEW_ARB_shading_language_420pack GLEW_GET_VAR(__GLEW_ARB_shading_language_420pack) + +#endif /* GL_ARB_shading_language_420pack */ + +/* -------------------- GL_ARB_shading_language_include -------------------- */ + +#ifndef GL_ARB_shading_language_include +#define GL_ARB_shading_language_include 1 + +#define GL_SHADER_INCLUDE_ARB 0x8DAE +#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9 +#define GL_NAMED_STRING_TYPE_ARB 0x8DEA + +typedef void (GLAPIENTRY * PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar* const *path, const GLint *length); +typedef void (GLAPIENTRY * PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name, GLsizei bufSize, GLint *stringlen, GLchar *string); +typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar* name, GLenum pname, GLint *params); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar* name, GLint stringlen, const GLchar *string); + +#define glCompileShaderIncludeARB GLEW_GET_FUN(__glewCompileShaderIncludeARB) +#define glDeleteNamedStringARB GLEW_GET_FUN(__glewDeleteNamedStringARB) +#define glGetNamedStringARB GLEW_GET_FUN(__glewGetNamedStringARB) +#define glGetNamedStringivARB GLEW_GET_FUN(__glewGetNamedStringivARB) +#define glIsNamedStringARB GLEW_GET_FUN(__glewIsNamedStringARB) +#define glNamedStringARB GLEW_GET_FUN(__glewNamedStringARB) + +#define GLEW_ARB_shading_language_include GLEW_GET_VAR(__GLEW_ARB_shading_language_include) + +#endif /* GL_ARB_shading_language_include */ + +/* -------------------- GL_ARB_shading_language_packing -------------------- */ + +#ifndef GL_ARB_shading_language_packing +#define GL_ARB_shading_language_packing 1 + +#define GLEW_ARB_shading_language_packing GLEW_GET_VAR(__GLEW_ARB_shading_language_packing) + +#endif /* GL_ARB_shading_language_packing */ + +/* ----------------------------- GL_ARB_shadow ----------------------------- */ + +#ifndef GL_ARB_shadow +#define GL_ARB_shadow 1 + +#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C +#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D +#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E + +#define GLEW_ARB_shadow GLEW_GET_VAR(__GLEW_ARB_shadow) + +#endif /* GL_ARB_shadow */ + +/* ------------------------- GL_ARB_shadow_ambient ------------------------- */ + +#ifndef GL_ARB_shadow_ambient +#define GL_ARB_shadow_ambient 1 + +#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF + +#define GLEW_ARB_shadow_ambient GLEW_GET_VAR(__GLEW_ARB_shadow_ambient) + +#endif /* GL_ARB_shadow_ambient */ + +/* ------------------------- GL_ARB_sparse_texture ------------------------- */ + +#ifndef GL_ARB_sparse_texture +#define GL_ARB_sparse_texture 1 + +#define GL_VIRTUAL_PAGE_SIZE_X_ARB 0x9195 +#define GL_VIRTUAL_PAGE_SIZE_Y_ARB 0x9196 +#define GL_VIRTUAL_PAGE_SIZE_Z_ARB 0x9197 +#define GL_MAX_SPARSE_TEXTURE_SIZE_ARB 0x9198 +#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB 0x9199 +#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB 0x919A +#define GL_TEXTURE_SPARSE_ARB 0x91A6 +#define GL_VIRTUAL_PAGE_SIZE_INDEX_ARB 0x91A7 +#define GL_NUM_VIRTUAL_PAGE_SIZES_ARB 0x91A8 +#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB 0x91A9 +#define GL_NUM_SPARSE_LEVELS_ARB 0x91AA + +typedef void (GLAPIENTRY * PFNGLTEXPAGECOMMITMENTARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); +typedef void (GLAPIENTRY * PFNGLTEXTUREPAGECOMMITMENTEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); + +#define glTexPageCommitmentARB GLEW_GET_FUN(__glewTexPageCommitmentARB) +#define glTexturePageCommitmentEXT GLEW_GET_FUN(__glewTexturePageCommitmentEXT) + +#define GLEW_ARB_sparse_texture GLEW_GET_VAR(__GLEW_ARB_sparse_texture) + +#endif /* GL_ARB_sparse_texture */ + +/* ------------------------ GL_ARB_stencil_texturing ----------------------- */ + +#ifndef GL_ARB_stencil_texturing +#define GL_ARB_stencil_texturing 1 + +#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA + +#define GLEW_ARB_stencil_texturing GLEW_GET_VAR(__GLEW_ARB_stencil_texturing) + +#endif /* GL_ARB_stencil_texturing */ + +/* ------------------------------ GL_ARB_sync ------------------------------ */ + +#ifndef GL_ARB_sync +#define GL_ARB_sync 1 + +#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 +#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 +#define GL_OBJECT_TYPE 0x9112 +#define GL_SYNC_CONDITION 0x9113 +#define GL_SYNC_STATUS 0x9114 +#define GL_SYNC_FLAGS 0x9115 +#define GL_SYNC_FENCE 0x9116 +#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 +#define GL_UNSIGNALED 0x9118 +#define GL_SIGNALED 0x9119 +#define GL_ALREADY_SIGNALED 0x911A +#define GL_TIMEOUT_EXPIRED 0x911B +#define GL_CONDITION_SATISFIED 0x911C +#define GL_WAIT_FAILED 0x911D +#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF + +typedef GLenum (GLAPIENTRY * PFNGLCLIENTWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout); +typedef void (GLAPIENTRY * PFNGLDELETESYNCPROC) (GLsync GLsync); +typedef GLsync (GLAPIENTRY * PFNGLFENCESYNCPROC) (GLenum condition,GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETSYNCIVPROC) (GLsync GLsync,GLenum pname,GLsizei bufSize,GLsizei* length, GLint *values); +typedef GLboolean (GLAPIENTRY * PFNGLISSYNCPROC) (GLsync GLsync); +typedef void (GLAPIENTRY * PFNGLWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout); + +#define glClientWaitSync GLEW_GET_FUN(__glewClientWaitSync) +#define glDeleteSync GLEW_GET_FUN(__glewDeleteSync) +#define glFenceSync GLEW_GET_FUN(__glewFenceSync) +#define glGetInteger64v GLEW_GET_FUN(__glewGetInteger64v) +#define glGetSynciv GLEW_GET_FUN(__glewGetSynciv) +#define glIsSync GLEW_GET_FUN(__glewIsSync) +#define glWaitSync GLEW_GET_FUN(__glewWaitSync) + +#define GLEW_ARB_sync GLEW_GET_VAR(__GLEW_ARB_sync) + +#endif /* GL_ARB_sync */ + +/* ----------------------- GL_ARB_tessellation_shader ---------------------- */ + +#ifndef GL_ARB_tessellation_shader +#define GL_ARB_tessellation_shader 1 + +#define GL_PATCHES 0xE +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 +#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C +#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D +#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E +#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F +#define GL_PATCH_VERTICES 0x8E72 +#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 +#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74 +#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75 +#define GL_TESS_GEN_MODE 0x8E76 +#define GL_TESS_GEN_SPACING 0x8E77 +#define GL_TESS_GEN_VERTEX_ORDER 0x8E78 +#define GL_TESS_GEN_POINT_MODE 0x8E79 +#define GL_ISOLINES 0x8E7A +#define GL_FRACTIONAL_ODD 0x8E7B +#define GL_FRACTIONAL_EVEN 0x8E7C +#define GL_MAX_PATCH_VERTICES 0x8E7D +#define GL_MAX_TESS_GEN_LEVEL 0x8E7E +#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F +#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80 +#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81 +#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82 +#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83 +#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84 +#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85 +#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86 +#define GL_TESS_EVALUATION_SHADER 0x8E87 +#define GL_TESS_CONTROL_SHADER 0x8E88 +#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89 +#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A + +typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat* values); +typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value); + +#define glPatchParameterfv GLEW_GET_FUN(__glewPatchParameterfv) +#define glPatchParameteri GLEW_GET_FUN(__glewPatchParameteri) + +#define GLEW_ARB_tessellation_shader GLEW_GET_VAR(__GLEW_ARB_tessellation_shader) + +#endif /* GL_ARB_tessellation_shader */ + +/* ---------------------- GL_ARB_texture_border_clamp ---------------------- */ + +#ifndef GL_ARB_texture_border_clamp +#define GL_ARB_texture_border_clamp 1 + +#define GL_CLAMP_TO_BORDER_ARB 0x812D + +#define GLEW_ARB_texture_border_clamp GLEW_GET_VAR(__GLEW_ARB_texture_border_clamp) + +#endif /* GL_ARB_texture_border_clamp */ + +/* ---------------------- GL_ARB_texture_buffer_object --------------------- */ + +#ifndef GL_ARB_texture_buffer_object +#define GL_ARB_texture_buffer_object 1 + +#define GL_TEXTURE_BUFFER_ARB 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E + +typedef void (GLAPIENTRY * PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); + +#define glTexBufferARB GLEW_GET_FUN(__glewTexBufferARB) + +#define GLEW_ARB_texture_buffer_object GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object) + +#endif /* GL_ARB_texture_buffer_object */ + +/* ------------------- GL_ARB_texture_buffer_object_rgb32 ------------------ */ + +#ifndef GL_ARB_texture_buffer_object_rgb32 +#define GL_ARB_texture_buffer_object_rgb32 1 + +#define GLEW_ARB_texture_buffer_object_rgb32 GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object_rgb32) + +#endif /* GL_ARB_texture_buffer_object_rgb32 */ + +/* ---------------------- GL_ARB_texture_buffer_range ---------------------- */ + +#ifndef GL_ARB_texture_buffer_range +#define GL_ARB_texture_buffer_range 1 + +#define GL_TEXTURE_BUFFER_OFFSET 0x919D +#define GL_TEXTURE_BUFFER_SIZE 0x919E +#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F + +typedef void (GLAPIENTRY * PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFERRANGEEXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); + +#define glTexBufferRange GLEW_GET_FUN(__glewTexBufferRange) +#define glTextureBufferRangeEXT GLEW_GET_FUN(__glewTextureBufferRangeEXT) + +#define GLEW_ARB_texture_buffer_range GLEW_GET_VAR(__GLEW_ARB_texture_buffer_range) + +#endif /* GL_ARB_texture_buffer_range */ + +/* ----------------------- GL_ARB_texture_compression ---------------------- */ + +#ifndef GL_ARB_texture_compression +#define GL_ARB_texture_compression 1 + +#define GL_COMPRESSED_ALPHA_ARB 0x84E9 +#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB +#define GL_COMPRESSED_INTENSITY_ARB 0x84EC +#define GL_COMPRESSED_RGB_ARB 0x84ED +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 + +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLvoid *img); + +#define glCompressedTexImage1DARB GLEW_GET_FUN(__glewCompressedTexImage1DARB) +#define glCompressedTexImage2DARB GLEW_GET_FUN(__glewCompressedTexImage2DARB) +#define glCompressedTexImage3DARB GLEW_GET_FUN(__glewCompressedTexImage3DARB) +#define glCompressedTexSubImage1DARB GLEW_GET_FUN(__glewCompressedTexSubImage1DARB) +#define glCompressedTexSubImage2DARB GLEW_GET_FUN(__glewCompressedTexSubImage2DARB) +#define glCompressedTexSubImage3DARB GLEW_GET_FUN(__glewCompressedTexSubImage3DARB) +#define glGetCompressedTexImageARB GLEW_GET_FUN(__glewGetCompressedTexImageARB) + +#define GLEW_ARB_texture_compression GLEW_GET_VAR(__GLEW_ARB_texture_compression) + +#endif /* GL_ARB_texture_compression */ + +/* -------------------- GL_ARB_texture_compression_bptc -------------------- */ + +#ifndef GL_ARB_texture_compression_bptc +#define GL_ARB_texture_compression_bptc 1 + +#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F + +#define GLEW_ARB_texture_compression_bptc GLEW_GET_VAR(__GLEW_ARB_texture_compression_bptc) + +#endif /* GL_ARB_texture_compression_bptc */ + +/* -------------------- GL_ARB_texture_compression_rgtc -------------------- */ + +#ifndef GL_ARB_texture_compression_rgtc +#define GL_ARB_texture_compression_rgtc 1 + +#define GL_COMPRESSED_RED_RGTC1 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC +#define GL_COMPRESSED_RG_RGTC2 0x8DBD +#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE + +#define GLEW_ARB_texture_compression_rgtc GLEW_GET_VAR(__GLEW_ARB_texture_compression_rgtc) + +#endif /* GL_ARB_texture_compression_rgtc */ + +/* ------------------------ GL_ARB_texture_cube_map ------------------------ */ + +#ifndef GL_ARB_texture_cube_map +#define GL_ARB_texture_cube_map 1 + +#define GL_NORMAL_MAP_ARB 0x8511 +#define GL_REFLECTION_MAP_ARB 0x8512 +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C + +#define GLEW_ARB_texture_cube_map GLEW_GET_VAR(__GLEW_ARB_texture_cube_map) + +#endif /* GL_ARB_texture_cube_map */ + +/* --------------------- GL_ARB_texture_cube_map_array --------------------- */ + +#ifndef GL_ARB_texture_cube_map_array +#define GL_ARB_texture_cube_map_array 1 + +#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F + +#define GLEW_ARB_texture_cube_map_array GLEW_GET_VAR(__GLEW_ARB_texture_cube_map_array) + +#endif /* GL_ARB_texture_cube_map_array */ + +/* ------------------------- GL_ARB_texture_env_add ------------------------ */ + +#ifndef GL_ARB_texture_env_add +#define GL_ARB_texture_env_add 1 + +#define GLEW_ARB_texture_env_add GLEW_GET_VAR(__GLEW_ARB_texture_env_add) + +#endif /* GL_ARB_texture_env_add */ + +/* ----------------------- GL_ARB_texture_env_combine ---------------------- */ + +#ifndef GL_ARB_texture_env_combine +#define GL_ARB_texture_env_combine 1 + +#define GL_SUBTRACT_ARB 0x84E7 +#define GL_COMBINE_ARB 0x8570 +#define GL_COMBINE_RGB_ARB 0x8571 +#define GL_COMBINE_ALPHA_ARB 0x8572 +#define GL_RGB_SCALE_ARB 0x8573 +#define GL_ADD_SIGNED_ARB 0x8574 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PRIMARY_COLOR_ARB 0x8577 +#define GL_PREVIOUS_ARB 0x8578 +#define GL_SOURCE0_RGB_ARB 0x8580 +#define GL_SOURCE1_RGB_ARB 0x8581 +#define GL_SOURCE2_RGB_ARB 0x8582 +#define GL_SOURCE0_ALPHA_ARB 0x8588 +#define GL_SOURCE1_ALPHA_ARB 0x8589 +#define GL_SOURCE2_ALPHA_ARB 0x858A +#define GL_OPERAND0_RGB_ARB 0x8590 +#define GL_OPERAND1_RGB_ARB 0x8591 +#define GL_OPERAND2_RGB_ARB 0x8592 +#define GL_OPERAND0_ALPHA_ARB 0x8598 +#define GL_OPERAND1_ALPHA_ARB 0x8599 +#define GL_OPERAND2_ALPHA_ARB 0x859A + +#define GLEW_ARB_texture_env_combine GLEW_GET_VAR(__GLEW_ARB_texture_env_combine) + +#endif /* GL_ARB_texture_env_combine */ + +/* ---------------------- GL_ARB_texture_env_crossbar ---------------------- */ + +#ifndef GL_ARB_texture_env_crossbar +#define GL_ARB_texture_env_crossbar 1 + +#define GLEW_ARB_texture_env_crossbar GLEW_GET_VAR(__GLEW_ARB_texture_env_crossbar) + +#endif /* GL_ARB_texture_env_crossbar */ + +/* ------------------------ GL_ARB_texture_env_dot3 ------------------------ */ + +#ifndef GL_ARB_texture_env_dot3 +#define GL_ARB_texture_env_dot3 1 + +#define GL_DOT3_RGB_ARB 0x86AE +#define GL_DOT3_RGBA_ARB 0x86AF + +#define GLEW_ARB_texture_env_dot3 GLEW_GET_VAR(__GLEW_ARB_texture_env_dot3) + +#endif /* GL_ARB_texture_env_dot3 */ + +/* -------------------------- GL_ARB_texture_float ------------------------- */ + +#ifndef GL_ARB_texture_float +#define GL_ARB_texture_float 1 + +#define GL_RGBA32F_ARB 0x8814 +#define GL_RGB32F_ARB 0x8815 +#define GL_ALPHA32F_ARB 0x8816 +#define GL_INTENSITY32F_ARB 0x8817 +#define GL_LUMINANCE32F_ARB 0x8818 +#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 +#define GL_RGBA16F_ARB 0x881A +#define GL_RGB16F_ARB 0x881B +#define GL_ALPHA16F_ARB 0x881C +#define GL_INTENSITY16F_ARB 0x881D +#define GL_LUMINANCE16F_ARB 0x881E +#define GL_LUMINANCE_ALPHA16F_ARB 0x881F +#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 +#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 +#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 +#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 + +#define GLEW_ARB_texture_float GLEW_GET_VAR(__GLEW_ARB_texture_float) + +#endif /* GL_ARB_texture_float */ + +/* ------------------------- GL_ARB_texture_gather ------------------------- */ + +#ifndef GL_ARB_texture_gather +#define GL_ARB_texture_gather 1 + +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F +#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F + +#define GLEW_ARB_texture_gather GLEW_GET_VAR(__GLEW_ARB_texture_gather) + +#endif /* GL_ARB_texture_gather */ + +/* ------------------ GL_ARB_texture_mirror_clamp_to_edge ------------------ */ + +#ifndef GL_ARB_texture_mirror_clamp_to_edge +#define GL_ARB_texture_mirror_clamp_to_edge 1 + +#define GL_MIRROR_CLAMP_TO_EDGE 0x8743 + +#define GLEW_ARB_texture_mirror_clamp_to_edge GLEW_GET_VAR(__GLEW_ARB_texture_mirror_clamp_to_edge) + +#endif /* GL_ARB_texture_mirror_clamp_to_edge */ + +/* --------------------- GL_ARB_texture_mirrored_repeat -------------------- */ + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_ARB_texture_mirrored_repeat 1 + +#define GL_MIRRORED_REPEAT_ARB 0x8370 + +#define GLEW_ARB_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_ARB_texture_mirrored_repeat) + +#endif /* GL_ARB_texture_mirrored_repeat */ + +/* ----------------------- GL_ARB_texture_multisample ---------------------- */ + +#ifndef GL_ARB_texture_multisample +#define GL_ARB_texture_multisample 1 + +#define GL_SAMPLE_POSITION 0x8E50 +#define GL_SAMPLE_MASK 0x8E51 +#define GL_SAMPLE_MASK_VALUE 0x8E52 +#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 +#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 +#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 +#define GL_TEXTURE_SAMPLES 0x9106 +#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 +#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 +#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A +#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B +#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D +#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E +#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F +#define GL_MAX_INTEGER_SAMPLES 0x9110 + +typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat* val); +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); + +#define glGetMultisamplefv GLEW_GET_FUN(__glewGetMultisamplefv) +#define glSampleMaski GLEW_GET_FUN(__glewSampleMaski) +#define glTexImage2DMultisample GLEW_GET_FUN(__glewTexImage2DMultisample) +#define glTexImage3DMultisample GLEW_GET_FUN(__glewTexImage3DMultisample) + +#define GLEW_ARB_texture_multisample GLEW_GET_VAR(__GLEW_ARB_texture_multisample) + +#endif /* GL_ARB_texture_multisample */ + +/* -------------------- GL_ARB_texture_non_power_of_two -------------------- */ + +#ifndef GL_ARB_texture_non_power_of_two +#define GL_ARB_texture_non_power_of_two 1 + +#define GLEW_ARB_texture_non_power_of_two GLEW_GET_VAR(__GLEW_ARB_texture_non_power_of_two) + +#endif /* GL_ARB_texture_non_power_of_two */ + +/* ---------------------- GL_ARB_texture_query_levels ---------------------- */ + +#ifndef GL_ARB_texture_query_levels +#define GL_ARB_texture_query_levels 1 + +#define GLEW_ARB_texture_query_levels GLEW_GET_VAR(__GLEW_ARB_texture_query_levels) + +#endif /* GL_ARB_texture_query_levels */ + +/* ------------------------ GL_ARB_texture_query_lod ----------------------- */ + +#ifndef GL_ARB_texture_query_lod +#define GL_ARB_texture_query_lod 1 + +#define GLEW_ARB_texture_query_lod GLEW_GET_VAR(__GLEW_ARB_texture_query_lod) + +#endif /* GL_ARB_texture_query_lod */ + +/* ------------------------ GL_ARB_texture_rectangle ----------------------- */ + +#ifndef GL_ARB_texture_rectangle +#define GL_ARB_texture_rectangle 1 + +#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 + +#define GLEW_ARB_texture_rectangle GLEW_GET_VAR(__GLEW_ARB_texture_rectangle) + +#endif /* GL_ARB_texture_rectangle */ + +/* --------------------------- GL_ARB_texture_rg --------------------------- */ + +#ifndef GL_ARB_texture_rg +#define GL_ARB_texture_rg 1 + +#define GL_COMPRESSED_RED 0x8225 +#define GL_COMPRESSED_RG 0x8226 +#define GL_RG 0x8227 +#define GL_RG_INTEGER 0x8228 +#define GL_R8 0x8229 +#define GL_R16 0x822A +#define GL_RG8 0x822B +#define GL_RG16 0x822C +#define GL_R16F 0x822D +#define GL_R32F 0x822E +#define GL_RG16F 0x822F +#define GL_RG32F 0x8230 +#define GL_R8I 0x8231 +#define GL_R8UI 0x8232 +#define GL_R16I 0x8233 +#define GL_R16UI 0x8234 +#define GL_R32I 0x8235 +#define GL_R32UI 0x8236 +#define GL_RG8I 0x8237 +#define GL_RG8UI 0x8238 +#define GL_RG16I 0x8239 +#define GL_RG16UI 0x823A +#define GL_RG32I 0x823B +#define GL_RG32UI 0x823C + +#define GLEW_ARB_texture_rg GLEW_GET_VAR(__GLEW_ARB_texture_rg) + +#endif /* GL_ARB_texture_rg */ + +/* ----------------------- GL_ARB_texture_rgb10_a2ui ----------------------- */ + +#ifndef GL_ARB_texture_rgb10_a2ui +#define GL_ARB_texture_rgb10_a2ui 1 + +#define GL_RGB10_A2UI 0x906F + +#define GLEW_ARB_texture_rgb10_a2ui GLEW_GET_VAR(__GLEW_ARB_texture_rgb10_a2ui) + +#endif /* GL_ARB_texture_rgb10_a2ui */ + +/* ------------------------ GL_ARB_texture_stencil8 ------------------------ */ + +#ifndef GL_ARB_texture_stencil8 +#define GL_ARB_texture_stencil8 1 + +#define GL_STENCIL_INDEX 0x1901 +#define GL_STENCIL_INDEX8 0x8D48 + +#define GLEW_ARB_texture_stencil8 GLEW_GET_VAR(__GLEW_ARB_texture_stencil8) + +#endif /* GL_ARB_texture_stencil8 */ + +/* ------------------------- GL_ARB_texture_storage ------------------------ */ + +#ifndef GL_ARB_texture_storage +#define GL_ARB_texture_storage 1 + +#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); + +#define glTexStorage1D GLEW_GET_FUN(__glewTexStorage1D) +#define glTexStorage2D GLEW_GET_FUN(__glewTexStorage2D) +#define glTexStorage3D GLEW_GET_FUN(__glewTexStorage3D) +#define glTextureStorage1DEXT GLEW_GET_FUN(__glewTextureStorage1DEXT) +#define glTextureStorage2DEXT GLEW_GET_FUN(__glewTextureStorage2DEXT) +#define glTextureStorage3DEXT GLEW_GET_FUN(__glewTextureStorage3DEXT) + +#define GLEW_ARB_texture_storage GLEW_GET_VAR(__GLEW_ARB_texture_storage) + +#endif /* GL_ARB_texture_storage */ + +/* ------------------- GL_ARB_texture_storage_multisample ------------------ */ + +#ifndef GL_ARB_texture_storage_multisample +#define GL_ARB_texture_storage_multisample 1 + +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); + +#define glTexStorage2DMultisample GLEW_GET_FUN(__glewTexStorage2DMultisample) +#define glTexStorage3DMultisample GLEW_GET_FUN(__glewTexStorage3DMultisample) +#define glTextureStorage2DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage2DMultisampleEXT) +#define glTextureStorage3DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage3DMultisampleEXT) + +#define GLEW_ARB_texture_storage_multisample GLEW_GET_VAR(__GLEW_ARB_texture_storage_multisample) + +#endif /* GL_ARB_texture_storage_multisample */ + +/* ------------------------- GL_ARB_texture_swizzle ------------------------ */ + +#ifndef GL_ARB_texture_swizzle +#define GL_ARB_texture_swizzle 1 + +#define GL_TEXTURE_SWIZZLE_R 0x8E42 +#define GL_TEXTURE_SWIZZLE_G 0x8E43 +#define GL_TEXTURE_SWIZZLE_B 0x8E44 +#define GL_TEXTURE_SWIZZLE_A 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 + +#define GLEW_ARB_texture_swizzle GLEW_GET_VAR(__GLEW_ARB_texture_swizzle) + +#endif /* GL_ARB_texture_swizzle */ + +/* -------------------------- GL_ARB_texture_view -------------------------- */ + +#ifndef GL_ARB_texture_view +#define GL_ARB_texture_view 1 + +#define GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB +#define GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC +#define GL_TEXTURE_VIEW_MIN_LAYER 0x82DD +#define GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE +#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF + +typedef void (GLAPIENTRY * PFNGLTEXTUREVIEWPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); + +#define glTextureView GLEW_GET_FUN(__glewTextureView) + +#define GLEW_ARB_texture_view GLEW_GET_VAR(__GLEW_ARB_texture_view) + +#endif /* GL_ARB_texture_view */ + +/* --------------------------- GL_ARB_timer_query -------------------------- */ + +#ifndef GL_ARB_timer_query +#define GL_ARB_timer_query 1 + +#define GL_TIME_ELAPSED 0x88BF +#define GL_TIMESTAMP 0x8E28 + +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target); + +#define glGetQueryObjecti64v GLEW_GET_FUN(__glewGetQueryObjecti64v) +#define glGetQueryObjectui64v GLEW_GET_FUN(__glewGetQueryObjectui64v) +#define glQueryCounter GLEW_GET_FUN(__glewQueryCounter) + +#define GLEW_ARB_timer_query GLEW_GET_VAR(__GLEW_ARB_timer_query) + +#endif /* GL_ARB_timer_query */ + +/* ----------------------- GL_ARB_transform_feedback2 ---------------------- */ + +#ifndef GL_ARB_transform_feedback2 +#define GL_ARB_transform_feedback2 1 + +#define GL_TRANSFORM_FEEDBACK 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 + +typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id); +typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint* ids); +typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKPROC) (void); +typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKPROC) (void); + +#define glBindTransformFeedback GLEW_GET_FUN(__glewBindTransformFeedback) +#define glDeleteTransformFeedbacks GLEW_GET_FUN(__glewDeleteTransformFeedbacks) +#define glDrawTransformFeedback GLEW_GET_FUN(__glewDrawTransformFeedback) +#define glGenTransformFeedbacks GLEW_GET_FUN(__glewGenTransformFeedbacks) +#define glIsTransformFeedback GLEW_GET_FUN(__glewIsTransformFeedback) +#define glPauseTransformFeedback GLEW_GET_FUN(__glewPauseTransformFeedback) +#define glResumeTransformFeedback GLEW_GET_FUN(__glewResumeTransformFeedback) + +#define GLEW_ARB_transform_feedback2 GLEW_GET_VAR(__GLEW_ARB_transform_feedback2) + +#endif /* GL_ARB_transform_feedback2 */ + +/* ----------------------- GL_ARB_transform_feedback3 ---------------------- */ + +#ifndef GL_ARB_transform_feedback3 +#define GL_ARB_transform_feedback3 1 + +#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70 +#define GL_MAX_VERTEX_STREAMS 0x8E71 + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream); +typedef void (GLAPIENTRY * PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params); + +#define glBeginQueryIndexed GLEW_GET_FUN(__glewBeginQueryIndexed) +#define glDrawTransformFeedbackStream GLEW_GET_FUN(__glewDrawTransformFeedbackStream) +#define glEndQueryIndexed GLEW_GET_FUN(__glewEndQueryIndexed) +#define glGetQueryIndexediv GLEW_GET_FUN(__glewGetQueryIndexediv) + +#define GLEW_ARB_transform_feedback3 GLEW_GET_VAR(__GLEW_ARB_transform_feedback3) + +#endif /* GL_ARB_transform_feedback3 */ + +/* ------------------ GL_ARB_transform_feedback_instanced ------------------ */ + +#ifndef GL_ARB_transform_feedback_instanced +#define GL_ARB_transform_feedback_instanced 1 + +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei primcount); + +#define glDrawTransformFeedbackInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackInstanced) +#define glDrawTransformFeedbackStreamInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackStreamInstanced) + +#define GLEW_ARB_transform_feedback_instanced GLEW_GET_VAR(__GLEW_ARB_transform_feedback_instanced) + +#endif /* GL_ARB_transform_feedback_instanced */ + +/* ------------------------ GL_ARB_transpose_matrix ------------------------ */ + +#ifndef GL_ARB_transpose_matrix +#define GL_ARB_transpose_matrix 1 + +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 + +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); + +#define glLoadTransposeMatrixdARB GLEW_GET_FUN(__glewLoadTransposeMatrixdARB) +#define glLoadTransposeMatrixfARB GLEW_GET_FUN(__glewLoadTransposeMatrixfARB) +#define glMultTransposeMatrixdARB GLEW_GET_FUN(__glewMultTransposeMatrixdARB) +#define glMultTransposeMatrixfARB GLEW_GET_FUN(__glewMultTransposeMatrixfARB) + +#define GLEW_ARB_transpose_matrix GLEW_GET_VAR(__GLEW_ARB_transpose_matrix) + +#endif /* GL_ARB_transpose_matrix */ + +/* ---------------------- GL_ARB_uniform_buffer_object --------------------- */ + +#ifndef GL_ARB_uniform_buffer_object +#define GL_ARB_uniform_buffer_object 1 + +#define GL_UNIFORM_BUFFER 0x8A11 +#define GL_UNIFORM_BUFFER_BINDING 0x8A28 +#define GL_UNIFORM_BUFFER_START 0x8A29 +#define GL_UNIFORM_BUFFER_SIZE 0x8A2A +#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C +#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D +#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E +#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F +#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 +#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 +#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 +#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 +#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 +#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 +#define GL_UNIFORM_TYPE 0x8A37 +#define GL_UNIFORM_SIZE 0x8A38 +#define GL_UNIFORM_NAME_LENGTH 0x8A39 +#define GL_UNIFORM_BLOCK_INDEX 0x8A3A +#define GL_UNIFORM_OFFSET 0x8A3B +#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C +#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D +#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E +#define GL_UNIFORM_BLOCK_BINDING 0x8A3F +#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 +#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 +#define GL_INVALID_INDEX 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformName); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint* data); +typedef GLuint (GLAPIENTRY * PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar* uniformBlockName); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar** uniformNames, GLuint* uniformIndices); +typedef void (GLAPIENTRY * PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); + +#define glBindBufferBase GLEW_GET_FUN(__glewBindBufferBase) +#define glBindBufferRange GLEW_GET_FUN(__glewBindBufferRange) +#define glGetActiveUniformBlockName GLEW_GET_FUN(__glewGetActiveUniformBlockName) +#define glGetActiveUniformBlockiv GLEW_GET_FUN(__glewGetActiveUniformBlockiv) +#define glGetActiveUniformName GLEW_GET_FUN(__glewGetActiveUniformName) +#define glGetActiveUniformsiv GLEW_GET_FUN(__glewGetActiveUniformsiv) +#define glGetIntegeri_v GLEW_GET_FUN(__glewGetIntegeri_v) +#define glGetUniformBlockIndex GLEW_GET_FUN(__glewGetUniformBlockIndex) +#define glGetUniformIndices GLEW_GET_FUN(__glewGetUniformIndices) +#define glUniformBlockBinding GLEW_GET_FUN(__glewUniformBlockBinding) + +#define GLEW_ARB_uniform_buffer_object GLEW_GET_VAR(__GLEW_ARB_uniform_buffer_object) + +#endif /* GL_ARB_uniform_buffer_object */ + +/* ------------------------ GL_ARB_vertex_array_bgra ----------------------- */ + +#ifndef GL_ARB_vertex_array_bgra +#define GL_ARB_vertex_array_bgra 1 + +#define GL_BGRA 0x80E1 + +#define GLEW_ARB_vertex_array_bgra GLEW_GET_VAR(__GLEW_ARB_vertex_array_bgra) + +#endif /* GL_ARB_vertex_array_bgra */ + +/* ----------------------- GL_ARB_vertex_array_object ---------------------- */ + +#ifndef GL_ARB_vertex_array_object +#define GL_ARB_vertex_array_object 1 + +#define GL_VERTEX_ARRAY_BINDING 0x85B5 + +typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYPROC) (GLuint array); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint* arrays); +typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint* arrays); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYPROC) (GLuint array); + +#define glBindVertexArray GLEW_GET_FUN(__glewBindVertexArray) +#define glDeleteVertexArrays GLEW_GET_FUN(__glewDeleteVertexArrays) +#define glGenVertexArrays GLEW_GET_FUN(__glewGenVertexArrays) +#define glIsVertexArray GLEW_GET_FUN(__glewIsVertexArray) + +#define GLEW_ARB_vertex_array_object GLEW_GET_VAR(__GLEW_ARB_vertex_array_object) + +#endif /* GL_ARB_vertex_array_object */ + +/* ----------------------- GL_ARB_vertex_attrib_64bit ---------------------- */ + +#ifndef GL_ARB_vertex_attrib_64bit +#define GL_ARB_vertex_attrib_64bit 1 + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); + +#define glGetVertexAttribLdv GLEW_GET_FUN(__glewGetVertexAttribLdv) +#define glVertexAttribL1d GLEW_GET_FUN(__glewVertexAttribL1d) +#define glVertexAttribL1dv GLEW_GET_FUN(__glewVertexAttribL1dv) +#define glVertexAttribL2d GLEW_GET_FUN(__glewVertexAttribL2d) +#define glVertexAttribL2dv GLEW_GET_FUN(__glewVertexAttribL2dv) +#define glVertexAttribL3d GLEW_GET_FUN(__glewVertexAttribL3d) +#define glVertexAttribL3dv GLEW_GET_FUN(__glewVertexAttribL3dv) +#define glVertexAttribL4d GLEW_GET_FUN(__glewVertexAttribL4d) +#define glVertexAttribL4dv GLEW_GET_FUN(__glewVertexAttribL4dv) +#define glVertexAttribLPointer GLEW_GET_FUN(__glewVertexAttribLPointer) + +#define GLEW_ARB_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_64bit) + +#endif /* GL_ARB_vertex_attrib_64bit */ + +/* ---------------------- GL_ARB_vertex_attrib_binding --------------------- */ + +#ifndef GL_ARB_vertex_attrib_binding +#define GL_ARB_vertex_attrib_binding 1 + +#define GL_VERTEX_ATTRIB_BINDING 0x82D4 +#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5 +#define GL_VERTEX_BINDING_DIVISOR 0x82D6 +#define GL_VERTEX_BINDING_OFFSET 0x82D7 +#define GL_VERTEX_BINDING_STRIDE 0x82D8 +#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9 +#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA + +typedef void (GLAPIENTRY * PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); +typedef void (GLAPIENTRY * PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor); + +#define glBindVertexBuffer GLEW_GET_FUN(__glewBindVertexBuffer) +#define glVertexAttribBinding GLEW_GET_FUN(__glewVertexAttribBinding) +#define glVertexAttribFormat GLEW_GET_FUN(__glewVertexAttribFormat) +#define glVertexAttribIFormat GLEW_GET_FUN(__glewVertexAttribIFormat) +#define glVertexAttribLFormat GLEW_GET_FUN(__glewVertexAttribLFormat) +#define glVertexBindingDivisor GLEW_GET_FUN(__glewVertexBindingDivisor) + +#define GLEW_ARB_vertex_attrib_binding GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_binding) + +#endif /* GL_ARB_vertex_attrib_binding */ + +/* -------------------------- GL_ARB_vertex_blend -------------------------- */ + +#ifndef GL_ARB_vertex_blend +#define GL_ARB_vertex_blend 1 + +#define GL_MODELVIEW0_ARB 0x1700 +#define GL_MODELVIEW1_ARB 0x850A +#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 +#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 +#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 +#define GL_VERTEX_BLEND_ARB 0x86A7 +#define GL_CURRENT_WEIGHT_ARB 0x86A8 +#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA +#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB +#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC +#define GL_WEIGHT_ARRAY_ARB 0x86AD +#define GL_MODELVIEW2_ARB 0x8722 +#define GL_MODELVIEW3_ARB 0x8723 +#define GL_MODELVIEW4_ARB 0x8724 +#define GL_MODELVIEW5_ARB 0x8725 +#define GL_MODELVIEW6_ARB 0x8726 +#define GL_MODELVIEW7_ARB 0x8727 +#define GL_MODELVIEW8_ARB 0x8728 +#define GL_MODELVIEW9_ARB 0x8729 +#define GL_MODELVIEW10_ARB 0x872A +#define GL_MODELVIEW11_ARB 0x872B +#define GL_MODELVIEW12_ARB 0x872C +#define GL_MODELVIEW13_ARB 0x872D +#define GL_MODELVIEW14_ARB 0x872E +#define GL_MODELVIEW15_ARB 0x872F +#define GL_MODELVIEW16_ARB 0x8730 +#define GL_MODELVIEW17_ARB 0x8731 +#define GL_MODELVIEW18_ARB 0x8732 +#define GL_MODELVIEW19_ARB 0x8733 +#define GL_MODELVIEW20_ARB 0x8734 +#define GL_MODELVIEW21_ARB 0x8735 +#define GL_MODELVIEW22_ARB 0x8736 +#define GL_MODELVIEW23_ARB 0x8737 +#define GL_MODELVIEW24_ARB 0x8738 +#define GL_MODELVIEW25_ARB 0x8739 +#define GL_MODELVIEW26_ARB 0x873A +#define GL_MODELVIEW27_ARB 0x873B +#define GL_MODELVIEW28_ARB 0x873C +#define GL_MODELVIEW29_ARB 0x873D +#define GL_MODELVIEW30_ARB 0x873E +#define GL_MODELVIEW31_ARB 0x873F + +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDARBPROC) (GLint count); +typedef void (GLAPIENTRY * PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLWEIGHTBVARBPROC) (GLint size, GLbyte *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTDVARBPROC) (GLint size, GLdouble *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTFVARBPROC) (GLint size, GLfloat *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTIVARBPROC) (GLint size, GLint *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTSVARBPROC) (GLint size, GLshort *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUBVARBPROC) (GLint size, GLubyte *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUIVARBPROC) (GLint size, GLuint *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUSVARBPROC) (GLint size, GLushort *weights); + +#define glVertexBlendARB GLEW_GET_FUN(__glewVertexBlendARB) +#define glWeightPointerARB GLEW_GET_FUN(__glewWeightPointerARB) +#define glWeightbvARB GLEW_GET_FUN(__glewWeightbvARB) +#define glWeightdvARB GLEW_GET_FUN(__glewWeightdvARB) +#define glWeightfvARB GLEW_GET_FUN(__glewWeightfvARB) +#define glWeightivARB GLEW_GET_FUN(__glewWeightivARB) +#define glWeightsvARB GLEW_GET_FUN(__glewWeightsvARB) +#define glWeightubvARB GLEW_GET_FUN(__glewWeightubvARB) +#define glWeightuivARB GLEW_GET_FUN(__glewWeightuivARB) +#define glWeightusvARB GLEW_GET_FUN(__glewWeightusvARB) + +#define GLEW_ARB_vertex_blend GLEW_GET_VAR(__GLEW_ARB_vertex_blend) + +#endif /* GL_ARB_vertex_blend */ + +/* ---------------------- GL_ARB_vertex_buffer_object ---------------------- */ + +#ifndef GL_ARB_vertex_buffer_object +#define GL_ARB_vertex_buffer_object 1 + +#define GL_BUFFER_SIZE_ARB 0x8764 +#define GL_BUFFER_USAGE_ARB 0x8765 +#define GL_ARRAY_BUFFER_ARB 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 +#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F +#define GL_READ_ONLY_ARB 0x88B8 +#define GL_WRITE_ONLY_ARB 0x88B9 +#define GL_READ_WRITE_ARB 0x88BA +#define GL_BUFFER_ACCESS_ARB 0x88BB +#define GL_BUFFER_MAPPED_ARB 0x88BC +#define GL_BUFFER_MAP_POINTER_ARB 0x88BD +#define GL_STREAM_DRAW_ARB 0x88E0 +#define GL_STREAM_READ_ARB 0x88E1 +#define GL_STREAM_COPY_ARB 0x88E2 +#define GL_STATIC_DRAW_ARB 0x88E4 +#define GL_STATIC_READ_ARB 0x88E5 +#define GL_STATIC_COPY_ARB 0x88E6 +#define GL_DYNAMIC_DRAW_ARB 0x88E8 +#define GL_DYNAMIC_READ_ARB 0x88E9 +#define GL_DYNAMIC_COPY_ARB 0x88EA + +typedef ptrdiff_t GLintptrARB; +typedef ptrdiff_t GLsizeiptrARB; + +typedef void (GLAPIENTRY * PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERARBPROC) (GLuint buffer); +typedef GLvoid * (GLAPIENTRY * PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERARBPROC) (GLenum target); + +#define glBindBufferARB GLEW_GET_FUN(__glewBindBufferARB) +#define glBufferDataARB GLEW_GET_FUN(__glewBufferDataARB) +#define glBufferSubDataARB GLEW_GET_FUN(__glewBufferSubDataARB) +#define glDeleteBuffersARB GLEW_GET_FUN(__glewDeleteBuffersARB) +#define glGenBuffersARB GLEW_GET_FUN(__glewGenBuffersARB) +#define glGetBufferParameterivARB GLEW_GET_FUN(__glewGetBufferParameterivARB) +#define glGetBufferPointervARB GLEW_GET_FUN(__glewGetBufferPointervARB) +#define glGetBufferSubDataARB GLEW_GET_FUN(__glewGetBufferSubDataARB) +#define glIsBufferARB GLEW_GET_FUN(__glewIsBufferARB) +#define glMapBufferARB GLEW_GET_FUN(__glewMapBufferARB) +#define glUnmapBufferARB GLEW_GET_FUN(__glewUnmapBufferARB) + +#define GLEW_ARB_vertex_buffer_object GLEW_GET_VAR(__GLEW_ARB_vertex_buffer_object) + +#endif /* GL_ARB_vertex_buffer_object */ + +/* ------------------------- GL_ARB_vertex_program ------------------------- */ + +#ifndef GL_ARB_vertex_program +#define GL_ARB_vertex_program 1 + +#define GL_COLOR_SUM_ARB 0x8458 +#define GL_VERTEX_PROGRAM_ARB 0x8620 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 +#define GL_PROGRAM_LENGTH_ARB 0x8627 +#define GL_PROGRAM_STRING_ARB 0x8628 +#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E +#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F +#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 +#define GL_CURRENT_MATRIX_ARB 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 +#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B +#define GL_PROGRAM_BINDING_ARB 0x8677 +#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A +#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 +#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 +#define GL_PROGRAM_FORMAT_ARB 0x8876 +#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 +#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 +#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 +#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 +#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 +#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 +#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 +#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 +#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 +#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 +#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA +#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB +#define GL_PROGRAM_ATTRIBS_ARB 0x88AC +#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD +#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE +#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF +#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 +#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 +#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 +#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 +#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 +#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 +#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 +#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 +#define GL_MATRIX0_ARB 0x88C0 +#define GL_MATRIX1_ARB 0x88C1 +#define GL_MATRIX2_ARB 0x88C2 +#define GL_MATRIX3_ARB 0x88C3 +#define GL_MATRIX4_ARB 0x88C4 +#define GL_MATRIX5_ARB 0x88C5 +#define GL_MATRIX6_ARB 0x88C6 +#define GL_MATRIX7_ARB 0x88C7 +#define GL_MATRIX8_ARB 0x88C8 +#define GL_MATRIX9_ARB 0x88C9 +#define GL_MATRIX10_ARB 0x88CA +#define GL_MATRIX11_ARB 0x88CB +#define GL_MATRIX12_ARB 0x88CC +#define GL_MATRIX13_ARB 0x88CD +#define GL_MATRIX14_ARB 0x88CE +#define GL_MATRIX15_ARB 0x88CF +#define GL_MATRIX16_ARB 0x88D0 +#define GL_MATRIX17_ARB 0x88D1 +#define GL_MATRIX18_ARB 0x88D2 +#define GL_MATRIX19_ARB 0x88D3 +#define GL_MATRIX20_ARB 0x88D4 +#define GL_MATRIX21_ARB 0x88D5 +#define GL_MATRIX22_ARB 0x88D6 +#define GL_MATRIX23_ARB 0x88D7 +#define GL_MATRIX24_ARB 0x88D8 +#define GL_MATRIX25_ARB 0x88D9 +#define GL_MATRIX26_ARB 0x88DA +#define GL_MATRIX27_ARB 0x88DB +#define GL_MATRIX28_ARB 0x88DC +#define GL_MATRIX29_ARB 0x88DD +#define GL_MATRIX30_ARB 0x88DE +#define GL_MATRIX31_ARB 0x88DF + +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint* programs); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint* programs); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid** pointer); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMARBPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); + +#define glBindProgramARB GLEW_GET_FUN(__glewBindProgramARB) +#define glDeleteProgramsARB GLEW_GET_FUN(__glewDeleteProgramsARB) +#define glDisableVertexAttribArrayARB GLEW_GET_FUN(__glewDisableVertexAttribArrayARB) +#define glEnableVertexAttribArrayARB GLEW_GET_FUN(__glewEnableVertexAttribArrayARB) +#define glGenProgramsARB GLEW_GET_FUN(__glewGenProgramsARB) +#define glGetProgramEnvParameterdvARB GLEW_GET_FUN(__glewGetProgramEnvParameterdvARB) +#define glGetProgramEnvParameterfvARB GLEW_GET_FUN(__glewGetProgramEnvParameterfvARB) +#define glGetProgramLocalParameterdvARB GLEW_GET_FUN(__glewGetProgramLocalParameterdvARB) +#define glGetProgramLocalParameterfvARB GLEW_GET_FUN(__glewGetProgramLocalParameterfvARB) +#define glGetProgramStringARB GLEW_GET_FUN(__glewGetProgramStringARB) +#define glGetProgramivARB GLEW_GET_FUN(__glewGetProgramivARB) +#define glGetVertexAttribPointervARB GLEW_GET_FUN(__glewGetVertexAttribPointervARB) +#define glGetVertexAttribdvARB GLEW_GET_FUN(__glewGetVertexAttribdvARB) +#define glGetVertexAttribfvARB GLEW_GET_FUN(__glewGetVertexAttribfvARB) +#define glGetVertexAttribivARB GLEW_GET_FUN(__glewGetVertexAttribivARB) +#define glIsProgramARB GLEW_GET_FUN(__glewIsProgramARB) +#define glProgramEnvParameter4dARB GLEW_GET_FUN(__glewProgramEnvParameter4dARB) +#define glProgramEnvParameter4dvARB GLEW_GET_FUN(__glewProgramEnvParameter4dvARB) +#define glProgramEnvParameter4fARB GLEW_GET_FUN(__glewProgramEnvParameter4fARB) +#define glProgramEnvParameter4fvARB GLEW_GET_FUN(__glewProgramEnvParameter4fvARB) +#define glProgramLocalParameter4dARB GLEW_GET_FUN(__glewProgramLocalParameter4dARB) +#define glProgramLocalParameter4dvARB GLEW_GET_FUN(__glewProgramLocalParameter4dvARB) +#define glProgramLocalParameter4fARB GLEW_GET_FUN(__glewProgramLocalParameter4fARB) +#define glProgramLocalParameter4fvARB GLEW_GET_FUN(__glewProgramLocalParameter4fvARB) +#define glProgramStringARB GLEW_GET_FUN(__glewProgramStringARB) +#define glVertexAttrib1dARB GLEW_GET_FUN(__glewVertexAttrib1dARB) +#define glVertexAttrib1dvARB GLEW_GET_FUN(__glewVertexAttrib1dvARB) +#define glVertexAttrib1fARB GLEW_GET_FUN(__glewVertexAttrib1fARB) +#define glVertexAttrib1fvARB GLEW_GET_FUN(__glewVertexAttrib1fvARB) +#define glVertexAttrib1sARB GLEW_GET_FUN(__glewVertexAttrib1sARB) +#define glVertexAttrib1svARB GLEW_GET_FUN(__glewVertexAttrib1svARB) +#define glVertexAttrib2dARB GLEW_GET_FUN(__glewVertexAttrib2dARB) +#define glVertexAttrib2dvARB GLEW_GET_FUN(__glewVertexAttrib2dvARB) +#define glVertexAttrib2fARB GLEW_GET_FUN(__glewVertexAttrib2fARB) +#define glVertexAttrib2fvARB GLEW_GET_FUN(__glewVertexAttrib2fvARB) +#define glVertexAttrib2sARB GLEW_GET_FUN(__glewVertexAttrib2sARB) +#define glVertexAttrib2svARB GLEW_GET_FUN(__glewVertexAttrib2svARB) +#define glVertexAttrib3dARB GLEW_GET_FUN(__glewVertexAttrib3dARB) +#define glVertexAttrib3dvARB GLEW_GET_FUN(__glewVertexAttrib3dvARB) +#define glVertexAttrib3fARB GLEW_GET_FUN(__glewVertexAttrib3fARB) +#define glVertexAttrib3fvARB GLEW_GET_FUN(__glewVertexAttrib3fvARB) +#define glVertexAttrib3sARB GLEW_GET_FUN(__glewVertexAttrib3sARB) +#define glVertexAttrib3svARB GLEW_GET_FUN(__glewVertexAttrib3svARB) +#define glVertexAttrib4NbvARB GLEW_GET_FUN(__glewVertexAttrib4NbvARB) +#define glVertexAttrib4NivARB GLEW_GET_FUN(__glewVertexAttrib4NivARB) +#define glVertexAttrib4NsvARB GLEW_GET_FUN(__glewVertexAttrib4NsvARB) +#define glVertexAttrib4NubARB GLEW_GET_FUN(__glewVertexAttrib4NubARB) +#define glVertexAttrib4NubvARB GLEW_GET_FUN(__glewVertexAttrib4NubvARB) +#define glVertexAttrib4NuivARB GLEW_GET_FUN(__glewVertexAttrib4NuivARB) +#define glVertexAttrib4NusvARB GLEW_GET_FUN(__glewVertexAttrib4NusvARB) +#define glVertexAttrib4bvARB GLEW_GET_FUN(__glewVertexAttrib4bvARB) +#define glVertexAttrib4dARB GLEW_GET_FUN(__glewVertexAttrib4dARB) +#define glVertexAttrib4dvARB GLEW_GET_FUN(__glewVertexAttrib4dvARB) +#define glVertexAttrib4fARB GLEW_GET_FUN(__glewVertexAttrib4fARB) +#define glVertexAttrib4fvARB GLEW_GET_FUN(__glewVertexAttrib4fvARB) +#define glVertexAttrib4ivARB GLEW_GET_FUN(__glewVertexAttrib4ivARB) +#define glVertexAttrib4sARB GLEW_GET_FUN(__glewVertexAttrib4sARB) +#define glVertexAttrib4svARB GLEW_GET_FUN(__glewVertexAttrib4svARB) +#define glVertexAttrib4ubvARB GLEW_GET_FUN(__glewVertexAttrib4ubvARB) +#define glVertexAttrib4uivARB GLEW_GET_FUN(__glewVertexAttrib4uivARB) +#define glVertexAttrib4usvARB GLEW_GET_FUN(__glewVertexAttrib4usvARB) +#define glVertexAttribPointerARB GLEW_GET_FUN(__glewVertexAttribPointerARB) + +#define GLEW_ARB_vertex_program GLEW_GET_VAR(__GLEW_ARB_vertex_program) + +#endif /* GL_ARB_vertex_program */ + +/* -------------------------- GL_ARB_vertex_shader ------------------------- */ + +#ifndef GL_ARB_vertex_shader +#define GL_ARB_vertex_shader 1 + +#define GL_VERTEX_SHADER_ARB 0x8B31 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A +#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D +#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 +#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A + +typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB* name); +typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name); +typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name); + +#define glBindAttribLocationARB GLEW_GET_FUN(__glewBindAttribLocationARB) +#define glGetActiveAttribARB GLEW_GET_FUN(__glewGetActiveAttribARB) +#define glGetAttribLocationARB GLEW_GET_FUN(__glewGetAttribLocationARB) + +#define GLEW_ARB_vertex_shader GLEW_GET_VAR(__GLEW_ARB_vertex_shader) + +#endif /* GL_ARB_vertex_shader */ + +/* ------------------- GL_ARB_vertex_type_10f_11f_11f_rev ------------------ */ + +#ifndef GL_ARB_vertex_type_10f_11f_11f_rev +#define GL_ARB_vertex_type_10f_11f_11f_rev 1 + +#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B + +#define GLEW_ARB_vertex_type_10f_11f_11f_rev GLEW_GET_VAR(__GLEW_ARB_vertex_type_10f_11f_11f_rev) + +#endif /* GL_ARB_vertex_type_10f_11f_11f_rev */ + +/* ------------------- GL_ARB_vertex_type_2_10_10_10_rev ------------------- */ + +#ifndef GL_ARB_vertex_type_2_10_10_10_rev +#define GL_ARB_vertex_type_2_10_10_10_rev 1 + +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_INT_2_10_10_10_REV 0x8D9F + +typedef void (GLAPIENTRY * PFNGLCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLCOLORP4UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint* value); + +#define glColorP3ui GLEW_GET_FUN(__glewColorP3ui) +#define glColorP3uiv GLEW_GET_FUN(__glewColorP3uiv) +#define glColorP4ui GLEW_GET_FUN(__glewColorP4ui) +#define glColorP4uiv GLEW_GET_FUN(__glewColorP4uiv) +#define glMultiTexCoordP1ui GLEW_GET_FUN(__glewMultiTexCoordP1ui) +#define glMultiTexCoordP1uiv GLEW_GET_FUN(__glewMultiTexCoordP1uiv) +#define glMultiTexCoordP2ui GLEW_GET_FUN(__glewMultiTexCoordP2ui) +#define glMultiTexCoordP2uiv GLEW_GET_FUN(__glewMultiTexCoordP2uiv) +#define glMultiTexCoordP3ui GLEW_GET_FUN(__glewMultiTexCoordP3ui) +#define glMultiTexCoordP3uiv GLEW_GET_FUN(__glewMultiTexCoordP3uiv) +#define glMultiTexCoordP4ui GLEW_GET_FUN(__glewMultiTexCoordP4ui) +#define glMultiTexCoordP4uiv GLEW_GET_FUN(__glewMultiTexCoordP4uiv) +#define glNormalP3ui GLEW_GET_FUN(__glewNormalP3ui) +#define glNormalP3uiv GLEW_GET_FUN(__glewNormalP3uiv) +#define glSecondaryColorP3ui GLEW_GET_FUN(__glewSecondaryColorP3ui) +#define glSecondaryColorP3uiv GLEW_GET_FUN(__glewSecondaryColorP3uiv) +#define glTexCoordP1ui GLEW_GET_FUN(__glewTexCoordP1ui) +#define glTexCoordP1uiv GLEW_GET_FUN(__glewTexCoordP1uiv) +#define glTexCoordP2ui GLEW_GET_FUN(__glewTexCoordP2ui) +#define glTexCoordP2uiv GLEW_GET_FUN(__glewTexCoordP2uiv) +#define glTexCoordP3ui GLEW_GET_FUN(__glewTexCoordP3ui) +#define glTexCoordP3uiv GLEW_GET_FUN(__glewTexCoordP3uiv) +#define glTexCoordP4ui GLEW_GET_FUN(__glewTexCoordP4ui) +#define glTexCoordP4uiv GLEW_GET_FUN(__glewTexCoordP4uiv) +#define glVertexAttribP1ui GLEW_GET_FUN(__glewVertexAttribP1ui) +#define glVertexAttribP1uiv GLEW_GET_FUN(__glewVertexAttribP1uiv) +#define glVertexAttribP2ui GLEW_GET_FUN(__glewVertexAttribP2ui) +#define glVertexAttribP2uiv GLEW_GET_FUN(__glewVertexAttribP2uiv) +#define glVertexAttribP3ui GLEW_GET_FUN(__glewVertexAttribP3ui) +#define glVertexAttribP3uiv GLEW_GET_FUN(__glewVertexAttribP3uiv) +#define glVertexAttribP4ui GLEW_GET_FUN(__glewVertexAttribP4ui) +#define glVertexAttribP4uiv GLEW_GET_FUN(__glewVertexAttribP4uiv) +#define glVertexP2ui GLEW_GET_FUN(__glewVertexP2ui) +#define glVertexP2uiv GLEW_GET_FUN(__glewVertexP2uiv) +#define glVertexP3ui GLEW_GET_FUN(__glewVertexP3ui) +#define glVertexP3uiv GLEW_GET_FUN(__glewVertexP3uiv) +#define glVertexP4ui GLEW_GET_FUN(__glewVertexP4ui) +#define glVertexP4uiv GLEW_GET_FUN(__glewVertexP4uiv) + +#define GLEW_ARB_vertex_type_2_10_10_10_rev GLEW_GET_VAR(__GLEW_ARB_vertex_type_2_10_10_10_rev) + +#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ + +/* ------------------------- GL_ARB_viewport_array ------------------------- */ + +#ifndef GL_ARB_viewport_array +#define GL_ARB_viewport_array 1 + +#define GL_DEPTH_RANGE 0x0B70 +#define GL_VIEWPORT 0x0BA2 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_MAX_VIEWPORTS 0x825B +#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C +#define GL_VIEWPORT_BOUNDS_RANGE 0x825D +#define GL_LAYER_PROVOKING_VERTEX 0x825E +#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F +#define GL_UNDEFINED_VERTEX 0x8260 +#define GL_FIRST_VERTEX_CONVENTION 0x8E4D +#define GL_LAST_VERTEX_CONVENTION 0x8E4E +#define GL_PROVOKING_VERTEX 0x8E4F + +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLclampd * v); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLclampd n, GLclampd f); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble* data); +typedef void (GLAPIENTRY * PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat* data); +typedef void (GLAPIENTRY * PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint * v); +typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint * v); +typedef void (GLAPIENTRY * PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat * v); +typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat * v); + +#define glDepthRangeArrayv GLEW_GET_FUN(__glewDepthRangeArrayv) +#define glDepthRangeIndexed GLEW_GET_FUN(__glewDepthRangeIndexed) +#define glGetDoublei_v GLEW_GET_FUN(__glewGetDoublei_v) +#define glGetFloati_v GLEW_GET_FUN(__glewGetFloati_v) +#define glScissorArrayv GLEW_GET_FUN(__glewScissorArrayv) +#define glScissorIndexed GLEW_GET_FUN(__glewScissorIndexed) +#define glScissorIndexedv GLEW_GET_FUN(__glewScissorIndexedv) +#define glViewportArrayv GLEW_GET_FUN(__glewViewportArrayv) +#define glViewportIndexedf GLEW_GET_FUN(__glewViewportIndexedf) +#define glViewportIndexedfv GLEW_GET_FUN(__glewViewportIndexedfv) + +#define GLEW_ARB_viewport_array GLEW_GET_VAR(__GLEW_ARB_viewport_array) + +#endif /* GL_ARB_viewport_array */ + +/* --------------------------- GL_ARB_window_pos --------------------------- */ + +#ifndef GL_ARB_window_pos +#define GL_ARB_window_pos 1 + +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVARBPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVARBPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVARBPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVARBPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVARBPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVARBPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVARBPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVARBPROC) (const GLshort* p); + +#define glWindowPos2dARB GLEW_GET_FUN(__glewWindowPos2dARB) +#define glWindowPos2dvARB GLEW_GET_FUN(__glewWindowPos2dvARB) +#define glWindowPos2fARB GLEW_GET_FUN(__glewWindowPos2fARB) +#define glWindowPos2fvARB GLEW_GET_FUN(__glewWindowPos2fvARB) +#define glWindowPos2iARB GLEW_GET_FUN(__glewWindowPos2iARB) +#define glWindowPos2ivARB GLEW_GET_FUN(__glewWindowPos2ivARB) +#define glWindowPos2sARB GLEW_GET_FUN(__glewWindowPos2sARB) +#define glWindowPos2svARB GLEW_GET_FUN(__glewWindowPos2svARB) +#define glWindowPos3dARB GLEW_GET_FUN(__glewWindowPos3dARB) +#define glWindowPos3dvARB GLEW_GET_FUN(__glewWindowPos3dvARB) +#define glWindowPos3fARB GLEW_GET_FUN(__glewWindowPos3fARB) +#define glWindowPos3fvARB GLEW_GET_FUN(__glewWindowPos3fvARB) +#define glWindowPos3iARB GLEW_GET_FUN(__glewWindowPos3iARB) +#define glWindowPos3ivARB GLEW_GET_FUN(__glewWindowPos3ivARB) +#define glWindowPos3sARB GLEW_GET_FUN(__glewWindowPos3sARB) +#define glWindowPos3svARB GLEW_GET_FUN(__glewWindowPos3svARB) + +#define GLEW_ARB_window_pos GLEW_GET_VAR(__GLEW_ARB_window_pos) + +#endif /* GL_ARB_window_pos */ + +/* ------------------------- GL_ATIX_point_sprites ------------------------- */ + +#ifndef GL_ATIX_point_sprites +#define GL_ATIX_point_sprites 1 + +#define GL_TEXTURE_POINT_MODE_ATIX 0x60B0 +#define GL_TEXTURE_POINT_ONE_COORD_ATIX 0x60B1 +#define GL_TEXTURE_POINT_SPRITE_ATIX 0x60B2 +#define GL_POINT_SPRITE_CULL_MODE_ATIX 0x60B3 +#define GL_POINT_SPRITE_CULL_CENTER_ATIX 0x60B4 +#define GL_POINT_SPRITE_CULL_CLIP_ATIX 0x60B5 + +#define GLEW_ATIX_point_sprites GLEW_GET_VAR(__GLEW_ATIX_point_sprites) + +#endif /* GL_ATIX_point_sprites */ + +/* ---------------------- GL_ATIX_texture_env_combine3 --------------------- */ + +#ifndef GL_ATIX_texture_env_combine3 +#define GL_ATIX_texture_env_combine3 1 + +#define GL_MODULATE_ADD_ATIX 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATIX 0x8745 +#define GL_MODULATE_SUBTRACT_ATIX 0x8746 + +#define GLEW_ATIX_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATIX_texture_env_combine3) + +#endif /* GL_ATIX_texture_env_combine3 */ + +/* ----------------------- GL_ATIX_texture_env_route ----------------------- */ + +#ifndef GL_ATIX_texture_env_route +#define GL_ATIX_texture_env_route 1 + +#define GL_SECONDARY_COLOR_ATIX 0x8747 +#define GL_TEXTURE_OUTPUT_RGB_ATIX 0x8748 +#define GL_TEXTURE_OUTPUT_ALPHA_ATIX 0x8749 + +#define GLEW_ATIX_texture_env_route GLEW_GET_VAR(__GLEW_ATIX_texture_env_route) + +#endif /* GL_ATIX_texture_env_route */ + +/* ---------------- GL_ATIX_vertex_shader_output_point_size ---------------- */ + +#ifndef GL_ATIX_vertex_shader_output_point_size +#define GL_ATIX_vertex_shader_output_point_size 1 + +#define GL_OUTPUT_POINT_SIZE_ATIX 0x610E + +#define GLEW_ATIX_vertex_shader_output_point_size GLEW_GET_VAR(__GLEW_ATIX_vertex_shader_output_point_size) + +#endif /* GL_ATIX_vertex_shader_output_point_size */ + +/* -------------------------- GL_ATI_draw_buffers -------------------------- */ + +#ifndef GL_ATI_draw_buffers +#define GL_ATI_draw_buffers 1 + +#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 +#define GL_DRAW_BUFFER0_ATI 0x8825 +#define GL_DRAW_BUFFER1_ATI 0x8826 +#define GL_DRAW_BUFFER2_ATI 0x8827 +#define GL_DRAW_BUFFER3_ATI 0x8828 +#define GL_DRAW_BUFFER4_ATI 0x8829 +#define GL_DRAW_BUFFER5_ATI 0x882A +#define GL_DRAW_BUFFER6_ATI 0x882B +#define GL_DRAW_BUFFER7_ATI 0x882C +#define GL_DRAW_BUFFER8_ATI 0x882D +#define GL_DRAW_BUFFER9_ATI 0x882E +#define GL_DRAW_BUFFER10_ATI 0x882F +#define GL_DRAW_BUFFER11_ATI 0x8830 +#define GL_DRAW_BUFFER12_ATI 0x8831 +#define GL_DRAW_BUFFER13_ATI 0x8832 +#define GL_DRAW_BUFFER14_ATI 0x8833 +#define GL_DRAW_BUFFER15_ATI 0x8834 + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum* bufs); + +#define glDrawBuffersATI GLEW_GET_FUN(__glewDrawBuffersATI) + +#define GLEW_ATI_draw_buffers GLEW_GET_VAR(__GLEW_ATI_draw_buffers) + +#endif /* GL_ATI_draw_buffers */ + +/* -------------------------- GL_ATI_element_array ------------------------- */ + +#ifndef GL_ATI_element_array +#define GL_ATI_element_array 1 + +#define GL_ELEMENT_ARRAY_ATI 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); +typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer); + +#define glDrawElementArrayATI GLEW_GET_FUN(__glewDrawElementArrayATI) +#define glDrawRangeElementArrayATI GLEW_GET_FUN(__glewDrawRangeElementArrayATI) +#define glElementPointerATI GLEW_GET_FUN(__glewElementPointerATI) + +#define GLEW_ATI_element_array GLEW_GET_VAR(__GLEW_ATI_element_array) + +#endif /* GL_ATI_element_array */ + +/* ------------------------- GL_ATI_envmap_bumpmap ------------------------- */ + +#ifndef GL_ATI_envmap_bumpmap +#define GL_ATI_envmap_bumpmap 1 + +#define GL_BUMP_ROT_MATRIX_ATI 0x8775 +#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 +#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 +#define GL_BUMP_TEX_UNITS_ATI 0x8778 +#define GL_DUDV_ATI 0x8779 +#define GL_DU8DV8_ATI 0x877A +#define GL_BUMP_ENVMAP_ATI 0x877B +#define GL_BUMP_TARGET_ATI 0x877C + +typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); +typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); + +#define glGetTexBumpParameterfvATI GLEW_GET_FUN(__glewGetTexBumpParameterfvATI) +#define glGetTexBumpParameterivATI GLEW_GET_FUN(__glewGetTexBumpParameterivATI) +#define glTexBumpParameterfvATI GLEW_GET_FUN(__glewTexBumpParameterfvATI) +#define glTexBumpParameterivATI GLEW_GET_FUN(__glewTexBumpParameterivATI) + +#define GLEW_ATI_envmap_bumpmap GLEW_GET_VAR(__GLEW_ATI_envmap_bumpmap) + +#endif /* GL_ATI_envmap_bumpmap */ + +/* ------------------------- GL_ATI_fragment_shader ------------------------ */ + +#ifndef GL_ATI_fragment_shader +#define GL_ATI_fragment_shader 1 + +#define GL_RED_BIT_ATI 0x00000001 +#define GL_2X_BIT_ATI 0x00000001 +#define GL_4X_BIT_ATI 0x00000002 +#define GL_GREEN_BIT_ATI 0x00000002 +#define GL_COMP_BIT_ATI 0x00000002 +#define GL_BLUE_BIT_ATI 0x00000004 +#define GL_8X_BIT_ATI 0x00000004 +#define GL_NEGATE_BIT_ATI 0x00000004 +#define GL_BIAS_BIT_ATI 0x00000008 +#define GL_HALF_BIT_ATI 0x00000008 +#define GL_QUARTER_BIT_ATI 0x00000010 +#define GL_EIGHTH_BIT_ATI 0x00000020 +#define GL_SATURATE_BIT_ATI 0x00000040 +#define GL_FRAGMENT_SHADER_ATI 0x8920 +#define GL_REG_0_ATI 0x8921 +#define GL_REG_1_ATI 0x8922 +#define GL_REG_2_ATI 0x8923 +#define GL_REG_3_ATI 0x8924 +#define GL_REG_4_ATI 0x8925 +#define GL_REG_5_ATI 0x8926 +#define GL_CON_0_ATI 0x8941 +#define GL_CON_1_ATI 0x8942 +#define GL_CON_2_ATI 0x8943 +#define GL_CON_3_ATI 0x8944 +#define GL_CON_4_ATI 0x8945 +#define GL_CON_5_ATI 0x8946 +#define GL_CON_6_ATI 0x8947 +#define GL_CON_7_ATI 0x8948 +#define GL_MOV_ATI 0x8961 +#define GL_ADD_ATI 0x8963 +#define GL_MUL_ATI 0x8964 +#define GL_SUB_ATI 0x8965 +#define GL_DOT3_ATI 0x8966 +#define GL_DOT4_ATI 0x8967 +#define GL_MAD_ATI 0x8968 +#define GL_LERP_ATI 0x8969 +#define GL_CND_ATI 0x896A +#define GL_CND0_ATI 0x896B +#define GL_DOT2_ADD_ATI 0x896C +#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D +#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E +#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F +#define GL_NUM_PASSES_ATI 0x8970 +#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 +#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 +#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 +#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 +#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 +#define GL_SWIZZLE_STR_ATI 0x8976 +#define GL_SWIZZLE_STQ_ATI 0x8977 +#define GL_SWIZZLE_STR_DR_ATI 0x8978 +#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 +#define GL_SWIZZLE_STRQ_ATI 0x897A +#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B + +typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (GLAPIENTRY * PFNGLBEGINFRAGMENTSHADERATIPROC) (void); +typedef void (GLAPIENTRY * PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (GLAPIENTRY * PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENDFRAGMENTSHADERATIPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); +typedef void (GLAPIENTRY * PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); +typedef void (GLAPIENTRY * PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); +typedef void (GLAPIENTRY * PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat* value); + +#define glAlphaFragmentOp1ATI GLEW_GET_FUN(__glewAlphaFragmentOp1ATI) +#define glAlphaFragmentOp2ATI GLEW_GET_FUN(__glewAlphaFragmentOp2ATI) +#define glAlphaFragmentOp3ATI GLEW_GET_FUN(__glewAlphaFragmentOp3ATI) +#define glBeginFragmentShaderATI GLEW_GET_FUN(__glewBeginFragmentShaderATI) +#define glBindFragmentShaderATI GLEW_GET_FUN(__glewBindFragmentShaderATI) +#define glColorFragmentOp1ATI GLEW_GET_FUN(__glewColorFragmentOp1ATI) +#define glColorFragmentOp2ATI GLEW_GET_FUN(__glewColorFragmentOp2ATI) +#define glColorFragmentOp3ATI GLEW_GET_FUN(__glewColorFragmentOp3ATI) +#define glDeleteFragmentShaderATI GLEW_GET_FUN(__glewDeleteFragmentShaderATI) +#define glEndFragmentShaderATI GLEW_GET_FUN(__glewEndFragmentShaderATI) +#define glGenFragmentShadersATI GLEW_GET_FUN(__glewGenFragmentShadersATI) +#define glPassTexCoordATI GLEW_GET_FUN(__glewPassTexCoordATI) +#define glSampleMapATI GLEW_GET_FUN(__glewSampleMapATI) +#define glSetFragmentShaderConstantATI GLEW_GET_FUN(__glewSetFragmentShaderConstantATI) + +#define GLEW_ATI_fragment_shader GLEW_GET_VAR(__GLEW_ATI_fragment_shader) + +#endif /* GL_ATI_fragment_shader */ + +/* ------------------------ GL_ATI_map_object_buffer ----------------------- */ + +#ifndef GL_ATI_map_object_buffer +#define GL_ATI_map_object_buffer 1 + +typedef GLvoid * (GLAPIENTRY * PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); + +#define glMapObjectBufferATI GLEW_GET_FUN(__glewMapObjectBufferATI) +#define glUnmapObjectBufferATI GLEW_GET_FUN(__glewUnmapObjectBufferATI) + +#define GLEW_ATI_map_object_buffer GLEW_GET_VAR(__GLEW_ATI_map_object_buffer) + +#endif /* GL_ATI_map_object_buffer */ + +/* ----------------------------- GL_ATI_meminfo ---------------------------- */ + +#ifndef GL_ATI_meminfo +#define GL_ATI_meminfo 1 + +#define GL_VBO_FREE_MEMORY_ATI 0x87FB +#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC +#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD + +#define GLEW_ATI_meminfo GLEW_GET_VAR(__GLEW_ATI_meminfo) + +#endif /* GL_ATI_meminfo */ + +/* -------------------------- GL_ATI_pn_triangles -------------------------- */ + +#ifndef GL_ATI_pn_triangles +#define GL_ATI_pn_triangles 1 + +#define GL_PN_TRIANGLES_ATI 0x87F0 +#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 +#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 +#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 +#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 +#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 +#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 +#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 +#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 + +typedef void (GLAPIENTRY * PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); + +#define glPNTrianglesfATI GLEW_GET_FUN(__glewPNTrianglesfATI) +#define glPNTrianglesiATI GLEW_GET_FUN(__glewPNTrianglesiATI) + +#define GLEW_ATI_pn_triangles GLEW_GET_VAR(__GLEW_ATI_pn_triangles) + +#endif /* GL_ATI_pn_triangles */ + +/* ------------------------ GL_ATI_separate_stencil ------------------------ */ + +#ifndef GL_ATI_separate_stencil +#define GL_ATI_separate_stencil 1 + +#define GL_STENCIL_BACK_FUNC_ATI 0x8800 +#define GL_STENCIL_BACK_FAIL_ATI 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 + +typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); + +#define glStencilFuncSeparateATI GLEW_GET_FUN(__glewStencilFuncSeparateATI) +#define glStencilOpSeparateATI GLEW_GET_FUN(__glewStencilOpSeparateATI) + +#define GLEW_ATI_separate_stencil GLEW_GET_VAR(__GLEW_ATI_separate_stencil) + +#endif /* GL_ATI_separate_stencil */ + +/* ----------------------- GL_ATI_shader_texture_lod ----------------------- */ + +#ifndef GL_ATI_shader_texture_lod +#define GL_ATI_shader_texture_lod 1 + +#define GLEW_ATI_shader_texture_lod GLEW_GET_VAR(__GLEW_ATI_shader_texture_lod) + +#endif /* GL_ATI_shader_texture_lod */ + +/* ---------------------- GL_ATI_text_fragment_shader ---------------------- */ + +#ifndef GL_ATI_text_fragment_shader +#define GL_ATI_text_fragment_shader 1 + +#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 + +#define GLEW_ATI_text_fragment_shader GLEW_GET_VAR(__GLEW_ATI_text_fragment_shader) + +#endif /* GL_ATI_text_fragment_shader */ + +/* --------------------- GL_ATI_texture_compression_3dc -------------------- */ + +#ifndef GL_ATI_texture_compression_3dc +#define GL_ATI_texture_compression_3dc 1 + +#define GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837 + +#define GLEW_ATI_texture_compression_3dc GLEW_GET_VAR(__GLEW_ATI_texture_compression_3dc) + +#endif /* GL_ATI_texture_compression_3dc */ + +/* ---------------------- GL_ATI_texture_env_combine3 ---------------------- */ + +#ifndef GL_ATI_texture_env_combine3 +#define GL_ATI_texture_env_combine3 1 + +#define GL_MODULATE_ADD_ATI 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 +#define GL_MODULATE_SUBTRACT_ATI 0x8746 + +#define GLEW_ATI_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATI_texture_env_combine3) + +#endif /* GL_ATI_texture_env_combine3 */ + +/* -------------------------- GL_ATI_texture_float ------------------------- */ + +#ifndef GL_ATI_texture_float +#define GL_ATI_texture_float 1 + +#define GL_RGBA_FLOAT32_ATI 0x8814 +#define GL_RGB_FLOAT32_ATI 0x8815 +#define GL_ALPHA_FLOAT32_ATI 0x8816 +#define GL_INTENSITY_FLOAT32_ATI 0x8817 +#define GL_LUMINANCE_FLOAT32_ATI 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 +#define GL_RGBA_FLOAT16_ATI 0x881A +#define GL_RGB_FLOAT16_ATI 0x881B +#define GL_ALPHA_FLOAT16_ATI 0x881C +#define GL_INTENSITY_FLOAT16_ATI 0x881D +#define GL_LUMINANCE_FLOAT16_ATI 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F + +#define GLEW_ATI_texture_float GLEW_GET_VAR(__GLEW_ATI_texture_float) + +#endif /* GL_ATI_texture_float */ + +/* ----------------------- GL_ATI_texture_mirror_once ---------------------- */ + +#ifndef GL_ATI_texture_mirror_once +#define GL_ATI_texture_mirror_once 1 + +#define GL_MIRROR_CLAMP_ATI 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 + +#define GLEW_ATI_texture_mirror_once GLEW_GET_VAR(__GLEW_ATI_texture_mirror_once) + +#endif /* GL_ATI_texture_mirror_once */ + +/* ----------------------- GL_ATI_vertex_array_object ---------------------- */ + +#ifndef GL_ATI_vertex_array_object +#define GL_ATI_vertex_array_object 1 + +#define GL_STATIC_ATI 0x8760 +#define GL_DYNAMIC_ATI 0x8761 +#define GL_PRESERVE_ATI 0x8762 +#define GL_DISCARD_ATI 0x8763 +#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 +#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 +#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 +#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 + +typedef void (GLAPIENTRY * PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (GLAPIENTRY * PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); +typedef GLuint (GLAPIENTRY * PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage); +typedef void (GLAPIENTRY * PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); +typedef void (GLAPIENTRY * PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); + +#define glArrayObjectATI GLEW_GET_FUN(__glewArrayObjectATI) +#define glFreeObjectBufferATI GLEW_GET_FUN(__glewFreeObjectBufferATI) +#define glGetArrayObjectfvATI GLEW_GET_FUN(__glewGetArrayObjectfvATI) +#define glGetArrayObjectivATI GLEW_GET_FUN(__glewGetArrayObjectivATI) +#define glGetObjectBufferfvATI GLEW_GET_FUN(__glewGetObjectBufferfvATI) +#define glGetObjectBufferivATI GLEW_GET_FUN(__glewGetObjectBufferivATI) +#define glGetVariantArrayObjectfvATI GLEW_GET_FUN(__glewGetVariantArrayObjectfvATI) +#define glGetVariantArrayObjectivATI GLEW_GET_FUN(__glewGetVariantArrayObjectivATI) +#define glIsObjectBufferATI GLEW_GET_FUN(__glewIsObjectBufferATI) +#define glNewObjectBufferATI GLEW_GET_FUN(__glewNewObjectBufferATI) +#define glUpdateObjectBufferATI GLEW_GET_FUN(__glewUpdateObjectBufferATI) +#define glVariantArrayObjectATI GLEW_GET_FUN(__glewVariantArrayObjectATI) + +#define GLEW_ATI_vertex_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_array_object) + +#endif /* GL_ATI_vertex_array_object */ + +/* ------------------- GL_ATI_vertex_attrib_array_object ------------------- */ + +#ifndef GL_ATI_vertex_attrib_array_object +#define GL_ATI_vertex_attrib_array_object 1 + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); + +#define glGetVertexAttribArrayObjectfvATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectfvATI) +#define glGetVertexAttribArrayObjectivATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectivATI) +#define glVertexAttribArrayObjectATI GLEW_GET_FUN(__glewVertexAttribArrayObjectATI) + +#define GLEW_ATI_vertex_attrib_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_attrib_array_object) + +#endif /* GL_ATI_vertex_attrib_array_object */ + +/* ------------------------- GL_ATI_vertex_streams ------------------------- */ + +#ifndef GL_ATI_vertex_streams +#define GL_ATI_vertex_streams 1 + +#define GL_MAX_VERTEX_STREAMS_ATI 0x876B +#define GL_VERTEX_SOURCE_ATI 0x876C +#define GL_VERTEX_STREAM0_ATI 0x876D +#define GL_VERTEX_STREAM1_ATI 0x876E +#define GL_VERTEX_STREAM2_ATI 0x876F +#define GL_VERTEX_STREAM3_ATI 0x8770 +#define GL_VERTEX_STREAM4_ATI 0x8771 +#define GL_VERTEX_STREAM5_ATI 0x8772 +#define GL_VERTEX_STREAM6_ATI 0x8773 +#define GL_VERTEX_STREAM7_ATI 0x8774 + +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte x, GLbyte y, GLbyte z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); + +#define glClientActiveVertexStreamATI GLEW_GET_FUN(__glewClientActiveVertexStreamATI) +#define glNormalStream3bATI GLEW_GET_FUN(__glewNormalStream3bATI) +#define glNormalStream3bvATI GLEW_GET_FUN(__glewNormalStream3bvATI) +#define glNormalStream3dATI GLEW_GET_FUN(__glewNormalStream3dATI) +#define glNormalStream3dvATI GLEW_GET_FUN(__glewNormalStream3dvATI) +#define glNormalStream3fATI GLEW_GET_FUN(__glewNormalStream3fATI) +#define glNormalStream3fvATI GLEW_GET_FUN(__glewNormalStream3fvATI) +#define glNormalStream3iATI GLEW_GET_FUN(__glewNormalStream3iATI) +#define glNormalStream3ivATI GLEW_GET_FUN(__glewNormalStream3ivATI) +#define glNormalStream3sATI GLEW_GET_FUN(__glewNormalStream3sATI) +#define glNormalStream3svATI GLEW_GET_FUN(__glewNormalStream3svATI) +#define glVertexBlendEnvfATI GLEW_GET_FUN(__glewVertexBlendEnvfATI) +#define glVertexBlendEnviATI GLEW_GET_FUN(__glewVertexBlendEnviATI) +#define glVertexStream1dATI GLEW_GET_FUN(__glewVertexStream1dATI) +#define glVertexStream1dvATI GLEW_GET_FUN(__glewVertexStream1dvATI) +#define glVertexStream1fATI GLEW_GET_FUN(__glewVertexStream1fATI) +#define glVertexStream1fvATI GLEW_GET_FUN(__glewVertexStream1fvATI) +#define glVertexStream1iATI GLEW_GET_FUN(__glewVertexStream1iATI) +#define glVertexStream1ivATI GLEW_GET_FUN(__glewVertexStream1ivATI) +#define glVertexStream1sATI GLEW_GET_FUN(__glewVertexStream1sATI) +#define glVertexStream1svATI GLEW_GET_FUN(__glewVertexStream1svATI) +#define glVertexStream2dATI GLEW_GET_FUN(__glewVertexStream2dATI) +#define glVertexStream2dvATI GLEW_GET_FUN(__glewVertexStream2dvATI) +#define glVertexStream2fATI GLEW_GET_FUN(__glewVertexStream2fATI) +#define glVertexStream2fvATI GLEW_GET_FUN(__glewVertexStream2fvATI) +#define glVertexStream2iATI GLEW_GET_FUN(__glewVertexStream2iATI) +#define glVertexStream2ivATI GLEW_GET_FUN(__glewVertexStream2ivATI) +#define glVertexStream2sATI GLEW_GET_FUN(__glewVertexStream2sATI) +#define glVertexStream2svATI GLEW_GET_FUN(__glewVertexStream2svATI) +#define glVertexStream3dATI GLEW_GET_FUN(__glewVertexStream3dATI) +#define glVertexStream3dvATI GLEW_GET_FUN(__glewVertexStream3dvATI) +#define glVertexStream3fATI GLEW_GET_FUN(__glewVertexStream3fATI) +#define glVertexStream3fvATI GLEW_GET_FUN(__glewVertexStream3fvATI) +#define glVertexStream3iATI GLEW_GET_FUN(__glewVertexStream3iATI) +#define glVertexStream3ivATI GLEW_GET_FUN(__glewVertexStream3ivATI) +#define glVertexStream3sATI GLEW_GET_FUN(__glewVertexStream3sATI) +#define glVertexStream3svATI GLEW_GET_FUN(__glewVertexStream3svATI) +#define glVertexStream4dATI GLEW_GET_FUN(__glewVertexStream4dATI) +#define glVertexStream4dvATI GLEW_GET_FUN(__glewVertexStream4dvATI) +#define glVertexStream4fATI GLEW_GET_FUN(__glewVertexStream4fATI) +#define glVertexStream4fvATI GLEW_GET_FUN(__glewVertexStream4fvATI) +#define glVertexStream4iATI GLEW_GET_FUN(__glewVertexStream4iATI) +#define glVertexStream4ivATI GLEW_GET_FUN(__glewVertexStream4ivATI) +#define glVertexStream4sATI GLEW_GET_FUN(__glewVertexStream4sATI) +#define glVertexStream4svATI GLEW_GET_FUN(__glewVertexStream4svATI) + +#define GLEW_ATI_vertex_streams GLEW_GET_VAR(__GLEW_ATI_vertex_streams) + +#endif /* GL_ATI_vertex_streams */ + +/* --------------------------- GL_EXT_422_pixels --------------------------- */ + +#ifndef GL_EXT_422_pixels +#define GL_EXT_422_pixels 1 + +#define GL_422_EXT 0x80CC +#define GL_422_REV_EXT 0x80CD +#define GL_422_AVERAGE_EXT 0x80CE +#define GL_422_REV_AVERAGE_EXT 0x80CF + +#define GLEW_EXT_422_pixels GLEW_GET_VAR(__GLEW_EXT_422_pixels) + +#endif /* GL_EXT_422_pixels */ + +/* ---------------------------- GL_EXT_Cg_shader --------------------------- */ + +#ifndef GL_EXT_Cg_shader +#define GL_EXT_Cg_shader 1 + +#define GL_CG_VERTEX_SHADER_EXT 0x890E +#define GL_CG_FRAGMENT_SHADER_EXT 0x890F + +#define GLEW_EXT_Cg_shader GLEW_GET_VAR(__GLEW_EXT_Cg_shader) + +#endif /* GL_EXT_Cg_shader */ + +/* ------------------------------ GL_EXT_abgr ------------------------------ */ + +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 + +#define GL_ABGR_EXT 0x8000 + +#define GLEW_EXT_abgr GLEW_GET_VAR(__GLEW_EXT_abgr) + +#endif /* GL_EXT_abgr */ + +/* ------------------------------ GL_EXT_bgra ------------------------------ */ + +#ifndef GL_EXT_bgra +#define GL_EXT_bgra 1 + +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 + +#define GLEW_EXT_bgra GLEW_GET_VAR(__GLEW_EXT_bgra) + +#endif /* GL_EXT_bgra */ + +/* ------------------------ GL_EXT_bindable_uniform ------------------------ */ + +#ifndef GL_EXT_bindable_uniform +#define GL_EXT_bindable_uniform 1 + +#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 +#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 +#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 +#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED +#define GL_UNIFORM_BUFFER_EXT 0x8DEE +#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF + +typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); +typedef GLintptr (GLAPIENTRY * PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); +typedef void (GLAPIENTRY * PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); + +#define glGetUniformBufferSizeEXT GLEW_GET_FUN(__glewGetUniformBufferSizeEXT) +#define glGetUniformOffsetEXT GLEW_GET_FUN(__glewGetUniformOffsetEXT) +#define glUniformBufferEXT GLEW_GET_FUN(__glewUniformBufferEXT) + +#define GLEW_EXT_bindable_uniform GLEW_GET_VAR(__GLEW_EXT_bindable_uniform) + +#endif /* GL_EXT_bindable_uniform */ + +/* --------------------------- GL_EXT_blend_color -------------------------- */ + +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 + +#define GL_CONSTANT_COLOR_EXT 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 +#define GL_CONSTANT_ALPHA_EXT 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 +#define GL_BLEND_COLOR_EXT 0x8005 + +typedef void (GLAPIENTRY * PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); + +#define glBlendColorEXT GLEW_GET_FUN(__glewBlendColorEXT) + +#define GLEW_EXT_blend_color GLEW_GET_VAR(__GLEW_EXT_blend_color) + +#endif /* GL_EXT_blend_color */ + +/* --------------------- GL_EXT_blend_equation_separate -------------------- */ + +#ifndef GL_EXT_blend_equation_separate +#define GL_EXT_blend_equation_separate 1 + +#define GL_BLEND_EQUATION_RGB_EXT 0x8009 +#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); + +#define glBlendEquationSeparateEXT GLEW_GET_FUN(__glewBlendEquationSeparateEXT) + +#define GLEW_EXT_blend_equation_separate GLEW_GET_VAR(__GLEW_EXT_blend_equation_separate) + +#endif /* GL_EXT_blend_equation_separate */ + +/* ----------------------- GL_EXT_blend_func_separate ---------------------- */ + +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 + +#define GL_BLEND_DST_RGB_EXT 0x80C8 +#define GL_BLEND_SRC_RGB_EXT 0x80C9 +#define GL_BLEND_DST_ALPHA_EXT 0x80CA +#define GL_BLEND_SRC_ALPHA_EXT 0x80CB + +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); + +#define glBlendFuncSeparateEXT GLEW_GET_FUN(__glewBlendFuncSeparateEXT) + +#define GLEW_EXT_blend_func_separate GLEW_GET_VAR(__GLEW_EXT_blend_func_separate) + +#endif /* GL_EXT_blend_func_separate */ + +/* ------------------------- GL_EXT_blend_logic_op ------------------------- */ + +#ifndef GL_EXT_blend_logic_op +#define GL_EXT_blend_logic_op 1 + +#define GLEW_EXT_blend_logic_op GLEW_GET_VAR(__GLEW_EXT_blend_logic_op) + +#endif /* GL_EXT_blend_logic_op */ + +/* -------------------------- GL_EXT_blend_minmax -------------------------- */ + +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 + +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_BLEND_EQUATION_EXT 0x8009 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); + +#define glBlendEquationEXT GLEW_GET_FUN(__glewBlendEquationEXT) + +#define GLEW_EXT_blend_minmax GLEW_GET_VAR(__GLEW_EXT_blend_minmax) + +#endif /* GL_EXT_blend_minmax */ + +/* ------------------------- GL_EXT_blend_subtract ------------------------- */ + +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 + +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B + +#define GLEW_EXT_blend_subtract GLEW_GET_VAR(__GLEW_EXT_blend_subtract) + +#endif /* GL_EXT_blend_subtract */ + +/* ------------------------ GL_EXT_clip_volume_hint ------------------------ */ + +#ifndef GL_EXT_clip_volume_hint +#define GL_EXT_clip_volume_hint 1 + +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 + +#define GLEW_EXT_clip_volume_hint GLEW_GET_VAR(__GLEW_EXT_clip_volume_hint) + +#endif /* GL_EXT_clip_volume_hint */ + +/* ------------------------------ GL_EXT_cmyka ----------------------------- */ + +#ifndef GL_EXT_cmyka +#define GL_EXT_cmyka 1 + +#define GL_CMYK_EXT 0x800C +#define GL_CMYKA_EXT 0x800D +#define GL_PACK_CMYK_HINT_EXT 0x800E +#define GL_UNPACK_CMYK_HINT_EXT 0x800F + +#define GLEW_EXT_cmyka GLEW_GET_VAR(__GLEW_EXT_cmyka) + +#endif /* GL_EXT_cmyka */ + +/* ------------------------- GL_EXT_color_subtable ------------------------- */ + +#ifndef GL_EXT_color_subtable +#define GL_EXT_color_subtable 1 + +typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); + +#define glColorSubTableEXT GLEW_GET_FUN(__glewColorSubTableEXT) +#define glCopyColorSubTableEXT GLEW_GET_FUN(__glewCopyColorSubTableEXT) + +#define GLEW_EXT_color_subtable GLEW_GET_VAR(__GLEW_EXT_color_subtable) + +#endif /* GL_EXT_color_subtable */ + +/* ---------------------- GL_EXT_compiled_vertex_array --------------------- */ + +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 1 + +#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 + +typedef void (GLAPIENTRY * PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void); + +#define glLockArraysEXT GLEW_GET_FUN(__glewLockArraysEXT) +#define glUnlockArraysEXT GLEW_GET_FUN(__glewUnlockArraysEXT) + +#define GLEW_EXT_compiled_vertex_array GLEW_GET_VAR(__GLEW_EXT_compiled_vertex_array) + +#endif /* GL_EXT_compiled_vertex_array */ + +/* --------------------------- GL_EXT_convolution -------------------------- */ + +#ifndef GL_EXT_convolution +#define GL_EXT_convolution 1 + +#define GL_CONVOLUTION_1D_EXT 0x8010 +#define GL_CONVOLUTION_2D_EXT 0x8011 +#define GL_SEPARABLE_2D_EXT 0x8012 +#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 +#define GL_REDUCE_EXT 0x8016 +#define GL_CONVOLUTION_FORMAT_EXT 0x8017 +#define GL_CONVOLUTION_WIDTH_EXT 0x8018 +#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 + +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); + +#define glConvolutionFilter1DEXT GLEW_GET_FUN(__glewConvolutionFilter1DEXT) +#define glConvolutionFilter2DEXT GLEW_GET_FUN(__glewConvolutionFilter2DEXT) +#define glConvolutionParameterfEXT GLEW_GET_FUN(__glewConvolutionParameterfEXT) +#define glConvolutionParameterfvEXT GLEW_GET_FUN(__glewConvolutionParameterfvEXT) +#define glConvolutionParameteriEXT GLEW_GET_FUN(__glewConvolutionParameteriEXT) +#define glConvolutionParameterivEXT GLEW_GET_FUN(__glewConvolutionParameterivEXT) +#define glCopyConvolutionFilter1DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter1DEXT) +#define glCopyConvolutionFilter2DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter2DEXT) +#define glGetConvolutionFilterEXT GLEW_GET_FUN(__glewGetConvolutionFilterEXT) +#define glGetConvolutionParameterfvEXT GLEW_GET_FUN(__glewGetConvolutionParameterfvEXT) +#define glGetConvolutionParameterivEXT GLEW_GET_FUN(__glewGetConvolutionParameterivEXT) +#define glGetSeparableFilterEXT GLEW_GET_FUN(__glewGetSeparableFilterEXT) +#define glSeparableFilter2DEXT GLEW_GET_FUN(__glewSeparableFilter2DEXT) + +#define GLEW_EXT_convolution GLEW_GET_VAR(__GLEW_EXT_convolution) + +#endif /* GL_EXT_convolution */ + +/* ------------------------ GL_EXT_coordinate_frame ------------------------ */ + +#ifndef GL_EXT_coordinate_frame +#define GL_EXT_coordinate_frame 1 + +#define GL_TANGENT_ARRAY_EXT 0x8439 +#define GL_BINORMAL_ARRAY_EXT 0x843A +#define GL_CURRENT_TANGENT_EXT 0x843B +#define GL_CURRENT_BINORMAL_EXT 0x843C +#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E +#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F +#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 +#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 +#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 +#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 +#define GL_MAP1_TANGENT_EXT 0x8444 +#define GL_MAP2_TANGENT_EXT 0x8445 +#define GL_MAP1_BINORMAL_EXT 0x8446 +#define GL_MAP2_BINORMAL_EXT 0x8447 + +typedef void (GLAPIENTRY * PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, GLvoid *pointer); + +#define glBinormalPointerEXT GLEW_GET_FUN(__glewBinormalPointerEXT) +#define glTangentPointerEXT GLEW_GET_FUN(__glewTangentPointerEXT) + +#define GLEW_EXT_coordinate_frame GLEW_GET_VAR(__GLEW_EXT_coordinate_frame) + +#endif /* GL_EXT_coordinate_frame */ + +/* -------------------------- GL_EXT_copy_texture -------------------------- */ + +#ifndef GL_EXT_copy_texture +#define GL_EXT_copy_texture 1 + +typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); + +#define glCopyTexImage1DEXT GLEW_GET_FUN(__glewCopyTexImage1DEXT) +#define glCopyTexImage2DEXT GLEW_GET_FUN(__glewCopyTexImage2DEXT) +#define glCopyTexSubImage1DEXT GLEW_GET_FUN(__glewCopyTexSubImage1DEXT) +#define glCopyTexSubImage2DEXT GLEW_GET_FUN(__glewCopyTexSubImage2DEXT) +#define glCopyTexSubImage3DEXT GLEW_GET_FUN(__glewCopyTexSubImage3DEXT) + +#define GLEW_EXT_copy_texture GLEW_GET_VAR(__GLEW_EXT_copy_texture) + +#endif /* GL_EXT_copy_texture */ + +/* --------------------------- GL_EXT_cull_vertex -------------------------- */ + +#ifndef GL_EXT_cull_vertex +#define GL_EXT_cull_vertex 1 + +#define GL_CULL_VERTEX_EXT 0x81AA +#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB +#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC + +typedef void (GLAPIENTRY * PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat* params); + +#define glCullParameterdvEXT GLEW_GET_FUN(__glewCullParameterdvEXT) +#define glCullParameterfvEXT GLEW_GET_FUN(__glewCullParameterfvEXT) + +#define GLEW_EXT_cull_vertex GLEW_GET_VAR(__GLEW_EXT_cull_vertex) + +#endif /* GL_EXT_cull_vertex */ + +/* -------------------------- GL_EXT_debug_marker -------------------------- */ + +#ifndef GL_EXT_debug_marker +#define GL_EXT_debug_marker 1 + +typedef void (GLAPIENTRY * PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar* marker); +typedef void (GLAPIENTRY * PFNGLPOPGROUPMARKEREXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar* marker); + +#define glInsertEventMarkerEXT GLEW_GET_FUN(__glewInsertEventMarkerEXT) +#define glPopGroupMarkerEXT GLEW_GET_FUN(__glewPopGroupMarkerEXT) +#define glPushGroupMarkerEXT GLEW_GET_FUN(__glewPushGroupMarkerEXT) + +#define GLEW_EXT_debug_marker GLEW_GET_VAR(__GLEW_EXT_debug_marker) + +#endif /* GL_EXT_debug_marker */ + +/* ------------------------ GL_EXT_depth_bounds_test ----------------------- */ + +#ifndef GL_EXT_depth_bounds_test +#define GL_EXT_depth_bounds_test 1 + +#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 +#define GL_DEPTH_BOUNDS_EXT 0x8891 + +typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); + +#define glDepthBoundsEXT GLEW_GET_FUN(__glewDepthBoundsEXT) + +#define GLEW_EXT_depth_bounds_test GLEW_GET_VAR(__GLEW_EXT_depth_bounds_test) + +#endif /* GL_EXT_depth_bounds_test */ + +/* ----------------------- GL_EXT_direct_state_access ---------------------- */ + +#ifndef GL_EXT_direct_state_access +#define GL_EXT_direct_state_access 1 + +#define GL_PROGRAM_MATRIX_EXT 0x8E2D +#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E +#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F + +typedef void (GLAPIENTRY * PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); +typedef GLenum (GLAPIENTRY * PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); +typedef void (GLAPIENTRY * PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); +typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum* bufs); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (GLAPIENTRY * PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); +typedef void (GLAPIENTRY * PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLvoid *img); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLvoid *img); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VEXTPROC) (GLenum pname, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFLOATI_VEXTPROC) (GLenum pname, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, void** params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, GLvoid *string); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETPOINTERI_VEXTPROC) (GLenum pname, GLuint index, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERVEXTPROC) (GLuint vaobj, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLvoid** param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERVEXTPROC) (GLuint vaobj, GLenum pname, GLvoid** param); +typedef GLvoid * (GLAPIENTRY * PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); +typedef GLvoid * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (GLAPIENTRY * PFNGLMATRIXFRUSTUMEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum matrixMode); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXORTHOEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f); +typedef void (GLAPIENTRY * PFNGLMATRIXPOPEXTPROC) (GLenum matrixMode); +typedef void (GLAPIENTRY * PFNGLMATRIXPUSHEXTPROC) (GLenum matrixMode); +typedef void (GLAPIENTRY * PFNGLMATRIXROTATEDEXTPROC) (GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLMATRIXROTATEFEXTPROC) (GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLMATRIXSCALEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLMATRIXSCALEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* param); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* param); +typedef void (GLAPIENTRY * PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat* param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* param); +typedef void (GLAPIENTRY * PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYINDEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYNORMALOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); + +#define glBindMultiTextureEXT GLEW_GET_FUN(__glewBindMultiTextureEXT) +#define glCheckNamedFramebufferStatusEXT GLEW_GET_FUN(__glewCheckNamedFramebufferStatusEXT) +#define glClientAttribDefaultEXT GLEW_GET_FUN(__glewClientAttribDefaultEXT) +#define glCompressedMultiTexImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage1DEXT) +#define glCompressedMultiTexImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage2DEXT) +#define glCompressedMultiTexImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage3DEXT) +#define glCompressedMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage1DEXT) +#define glCompressedMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage2DEXT) +#define glCompressedMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage3DEXT) +#define glCompressedTextureImage1DEXT GLEW_GET_FUN(__glewCompressedTextureImage1DEXT) +#define glCompressedTextureImage2DEXT GLEW_GET_FUN(__glewCompressedTextureImage2DEXT) +#define glCompressedTextureImage3DEXT GLEW_GET_FUN(__glewCompressedTextureImage3DEXT) +#define glCompressedTextureSubImage1DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage1DEXT) +#define glCompressedTextureSubImage2DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage2DEXT) +#define glCompressedTextureSubImage3DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage3DEXT) +#define glCopyMultiTexImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexImage1DEXT) +#define glCopyMultiTexImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexImage2DEXT) +#define glCopyMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage1DEXT) +#define glCopyMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage2DEXT) +#define glCopyMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage3DEXT) +#define glCopyTextureImage1DEXT GLEW_GET_FUN(__glewCopyTextureImage1DEXT) +#define glCopyTextureImage2DEXT GLEW_GET_FUN(__glewCopyTextureImage2DEXT) +#define glCopyTextureSubImage1DEXT GLEW_GET_FUN(__glewCopyTextureSubImage1DEXT) +#define glCopyTextureSubImage2DEXT GLEW_GET_FUN(__glewCopyTextureSubImage2DEXT) +#define glCopyTextureSubImage3DEXT GLEW_GET_FUN(__glewCopyTextureSubImage3DEXT) +#define glDisableClientStateIndexedEXT GLEW_GET_FUN(__glewDisableClientStateIndexedEXT) +#define glDisableClientStateiEXT GLEW_GET_FUN(__glewDisableClientStateiEXT) +#define glDisableVertexArrayAttribEXT GLEW_GET_FUN(__glewDisableVertexArrayAttribEXT) +#define glDisableVertexArrayEXT GLEW_GET_FUN(__glewDisableVertexArrayEXT) +#define glEnableClientStateIndexedEXT GLEW_GET_FUN(__glewEnableClientStateIndexedEXT) +#define glEnableClientStateiEXT GLEW_GET_FUN(__glewEnableClientStateiEXT) +#define glEnableVertexArrayAttribEXT GLEW_GET_FUN(__glewEnableVertexArrayAttribEXT) +#define glEnableVertexArrayEXT GLEW_GET_FUN(__glewEnableVertexArrayEXT) +#define glFlushMappedNamedBufferRangeEXT GLEW_GET_FUN(__glewFlushMappedNamedBufferRangeEXT) +#define glFramebufferDrawBufferEXT GLEW_GET_FUN(__glewFramebufferDrawBufferEXT) +#define glFramebufferDrawBuffersEXT GLEW_GET_FUN(__glewFramebufferDrawBuffersEXT) +#define glFramebufferReadBufferEXT GLEW_GET_FUN(__glewFramebufferReadBufferEXT) +#define glGenerateMultiTexMipmapEXT GLEW_GET_FUN(__glewGenerateMultiTexMipmapEXT) +#define glGenerateTextureMipmapEXT GLEW_GET_FUN(__glewGenerateTextureMipmapEXT) +#define glGetCompressedMultiTexImageEXT GLEW_GET_FUN(__glewGetCompressedMultiTexImageEXT) +#define glGetCompressedTextureImageEXT GLEW_GET_FUN(__glewGetCompressedTextureImageEXT) +#define glGetDoubleIndexedvEXT GLEW_GET_FUN(__glewGetDoubleIndexedvEXT) +#define glGetDoublei_vEXT GLEW_GET_FUN(__glewGetDoublei_vEXT) +#define glGetFloatIndexedvEXT GLEW_GET_FUN(__glewGetFloatIndexedvEXT) +#define glGetFloati_vEXT GLEW_GET_FUN(__glewGetFloati_vEXT) +#define glGetFramebufferParameterivEXT GLEW_GET_FUN(__glewGetFramebufferParameterivEXT) +#define glGetMultiTexEnvfvEXT GLEW_GET_FUN(__glewGetMultiTexEnvfvEXT) +#define glGetMultiTexEnvivEXT GLEW_GET_FUN(__glewGetMultiTexEnvivEXT) +#define glGetMultiTexGendvEXT GLEW_GET_FUN(__glewGetMultiTexGendvEXT) +#define glGetMultiTexGenfvEXT GLEW_GET_FUN(__glewGetMultiTexGenfvEXT) +#define glGetMultiTexGenivEXT GLEW_GET_FUN(__glewGetMultiTexGenivEXT) +#define glGetMultiTexImageEXT GLEW_GET_FUN(__glewGetMultiTexImageEXT) +#define glGetMultiTexLevelParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterfvEXT) +#define glGetMultiTexLevelParameterivEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterivEXT) +#define glGetMultiTexParameterIivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIivEXT) +#define glGetMultiTexParameterIuivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIuivEXT) +#define glGetMultiTexParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexParameterfvEXT) +#define glGetMultiTexParameterivEXT GLEW_GET_FUN(__glewGetMultiTexParameterivEXT) +#define glGetNamedBufferParameterivEXT GLEW_GET_FUN(__glewGetNamedBufferParameterivEXT) +#define glGetNamedBufferPointervEXT GLEW_GET_FUN(__glewGetNamedBufferPointervEXT) +#define glGetNamedBufferSubDataEXT GLEW_GET_FUN(__glewGetNamedBufferSubDataEXT) +#define glGetNamedFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferAttachmentParameterivEXT) +#define glGetNamedProgramLocalParameterIivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIivEXT) +#define glGetNamedProgramLocalParameterIuivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIuivEXT) +#define glGetNamedProgramLocalParameterdvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterdvEXT) +#define glGetNamedProgramLocalParameterfvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterfvEXT) +#define glGetNamedProgramStringEXT GLEW_GET_FUN(__glewGetNamedProgramStringEXT) +#define glGetNamedProgramivEXT GLEW_GET_FUN(__glewGetNamedProgramivEXT) +#define glGetNamedRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetNamedRenderbufferParameterivEXT) +#define glGetPointerIndexedvEXT GLEW_GET_FUN(__glewGetPointerIndexedvEXT) +#define glGetPointeri_vEXT GLEW_GET_FUN(__glewGetPointeri_vEXT) +#define glGetTextureImageEXT GLEW_GET_FUN(__glewGetTextureImageEXT) +#define glGetTextureLevelParameterfvEXT GLEW_GET_FUN(__glewGetTextureLevelParameterfvEXT) +#define glGetTextureLevelParameterivEXT GLEW_GET_FUN(__glewGetTextureLevelParameterivEXT) +#define glGetTextureParameterIivEXT GLEW_GET_FUN(__glewGetTextureParameterIivEXT) +#define glGetTextureParameterIuivEXT GLEW_GET_FUN(__glewGetTextureParameterIuivEXT) +#define glGetTextureParameterfvEXT GLEW_GET_FUN(__glewGetTextureParameterfvEXT) +#define glGetTextureParameterivEXT GLEW_GET_FUN(__glewGetTextureParameterivEXT) +#define glGetVertexArrayIntegeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayIntegeri_vEXT) +#define glGetVertexArrayIntegervEXT GLEW_GET_FUN(__glewGetVertexArrayIntegervEXT) +#define glGetVertexArrayPointeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayPointeri_vEXT) +#define glGetVertexArrayPointervEXT GLEW_GET_FUN(__glewGetVertexArrayPointervEXT) +#define glMapNamedBufferEXT GLEW_GET_FUN(__glewMapNamedBufferEXT) +#define glMapNamedBufferRangeEXT GLEW_GET_FUN(__glewMapNamedBufferRangeEXT) +#define glMatrixFrustumEXT GLEW_GET_FUN(__glewMatrixFrustumEXT) +#define glMatrixLoadIdentityEXT GLEW_GET_FUN(__glewMatrixLoadIdentityEXT) +#define glMatrixLoadTransposedEXT GLEW_GET_FUN(__glewMatrixLoadTransposedEXT) +#define glMatrixLoadTransposefEXT GLEW_GET_FUN(__glewMatrixLoadTransposefEXT) +#define glMatrixLoaddEXT GLEW_GET_FUN(__glewMatrixLoaddEXT) +#define glMatrixLoadfEXT GLEW_GET_FUN(__glewMatrixLoadfEXT) +#define glMatrixMultTransposedEXT GLEW_GET_FUN(__glewMatrixMultTransposedEXT) +#define glMatrixMultTransposefEXT GLEW_GET_FUN(__glewMatrixMultTransposefEXT) +#define glMatrixMultdEXT GLEW_GET_FUN(__glewMatrixMultdEXT) +#define glMatrixMultfEXT GLEW_GET_FUN(__glewMatrixMultfEXT) +#define glMatrixOrthoEXT GLEW_GET_FUN(__glewMatrixOrthoEXT) +#define glMatrixPopEXT GLEW_GET_FUN(__glewMatrixPopEXT) +#define glMatrixPushEXT GLEW_GET_FUN(__glewMatrixPushEXT) +#define glMatrixRotatedEXT GLEW_GET_FUN(__glewMatrixRotatedEXT) +#define glMatrixRotatefEXT GLEW_GET_FUN(__glewMatrixRotatefEXT) +#define glMatrixScaledEXT GLEW_GET_FUN(__glewMatrixScaledEXT) +#define glMatrixScalefEXT GLEW_GET_FUN(__glewMatrixScalefEXT) +#define glMatrixTranslatedEXT GLEW_GET_FUN(__glewMatrixTranslatedEXT) +#define glMatrixTranslatefEXT GLEW_GET_FUN(__glewMatrixTranslatefEXT) +#define glMultiTexBufferEXT GLEW_GET_FUN(__glewMultiTexBufferEXT) +#define glMultiTexCoordPointerEXT GLEW_GET_FUN(__glewMultiTexCoordPointerEXT) +#define glMultiTexEnvfEXT GLEW_GET_FUN(__glewMultiTexEnvfEXT) +#define glMultiTexEnvfvEXT GLEW_GET_FUN(__glewMultiTexEnvfvEXT) +#define glMultiTexEnviEXT GLEW_GET_FUN(__glewMultiTexEnviEXT) +#define glMultiTexEnvivEXT GLEW_GET_FUN(__glewMultiTexEnvivEXT) +#define glMultiTexGendEXT GLEW_GET_FUN(__glewMultiTexGendEXT) +#define glMultiTexGendvEXT GLEW_GET_FUN(__glewMultiTexGendvEXT) +#define glMultiTexGenfEXT GLEW_GET_FUN(__glewMultiTexGenfEXT) +#define glMultiTexGenfvEXT GLEW_GET_FUN(__glewMultiTexGenfvEXT) +#define glMultiTexGeniEXT GLEW_GET_FUN(__glewMultiTexGeniEXT) +#define glMultiTexGenivEXT GLEW_GET_FUN(__glewMultiTexGenivEXT) +#define glMultiTexImage1DEXT GLEW_GET_FUN(__glewMultiTexImage1DEXT) +#define glMultiTexImage2DEXT GLEW_GET_FUN(__glewMultiTexImage2DEXT) +#define glMultiTexImage3DEXT GLEW_GET_FUN(__glewMultiTexImage3DEXT) +#define glMultiTexParameterIivEXT GLEW_GET_FUN(__glewMultiTexParameterIivEXT) +#define glMultiTexParameterIuivEXT GLEW_GET_FUN(__glewMultiTexParameterIuivEXT) +#define glMultiTexParameterfEXT GLEW_GET_FUN(__glewMultiTexParameterfEXT) +#define glMultiTexParameterfvEXT GLEW_GET_FUN(__glewMultiTexParameterfvEXT) +#define glMultiTexParameteriEXT GLEW_GET_FUN(__glewMultiTexParameteriEXT) +#define glMultiTexParameterivEXT GLEW_GET_FUN(__glewMultiTexParameterivEXT) +#define glMultiTexRenderbufferEXT GLEW_GET_FUN(__glewMultiTexRenderbufferEXT) +#define glMultiTexSubImage1DEXT GLEW_GET_FUN(__glewMultiTexSubImage1DEXT) +#define glMultiTexSubImage2DEXT GLEW_GET_FUN(__glewMultiTexSubImage2DEXT) +#define glMultiTexSubImage3DEXT GLEW_GET_FUN(__glewMultiTexSubImage3DEXT) +#define glNamedBufferDataEXT GLEW_GET_FUN(__glewNamedBufferDataEXT) +#define glNamedBufferSubDataEXT GLEW_GET_FUN(__glewNamedBufferSubDataEXT) +#define glNamedCopyBufferSubDataEXT GLEW_GET_FUN(__glewNamedCopyBufferSubDataEXT) +#define glNamedFramebufferRenderbufferEXT GLEW_GET_FUN(__glewNamedFramebufferRenderbufferEXT) +#define glNamedFramebufferTexture1DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture1DEXT) +#define glNamedFramebufferTexture2DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture2DEXT) +#define glNamedFramebufferTexture3DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture3DEXT) +#define glNamedFramebufferTextureEXT GLEW_GET_FUN(__glewNamedFramebufferTextureEXT) +#define glNamedFramebufferTextureFaceEXT GLEW_GET_FUN(__glewNamedFramebufferTextureFaceEXT) +#define glNamedFramebufferTextureLayerEXT GLEW_GET_FUN(__glewNamedFramebufferTextureLayerEXT) +#define glNamedProgramLocalParameter4dEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dEXT) +#define glNamedProgramLocalParameter4dvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dvEXT) +#define glNamedProgramLocalParameter4fEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fEXT) +#define glNamedProgramLocalParameter4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fvEXT) +#define glNamedProgramLocalParameterI4iEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4iEXT) +#define glNamedProgramLocalParameterI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4ivEXT) +#define glNamedProgramLocalParameterI4uiEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uiEXT) +#define glNamedProgramLocalParameterI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uivEXT) +#define glNamedProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameters4fvEXT) +#define glNamedProgramLocalParametersI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4ivEXT) +#define glNamedProgramLocalParametersI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4uivEXT) +#define glNamedProgramStringEXT GLEW_GET_FUN(__glewNamedProgramStringEXT) +#define glNamedRenderbufferStorageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageEXT) +#define glNamedRenderbufferStorageMultisampleCoverageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleCoverageEXT) +#define glNamedRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleEXT) +#define glProgramUniform1fEXT GLEW_GET_FUN(__glewProgramUniform1fEXT) +#define glProgramUniform1fvEXT GLEW_GET_FUN(__glewProgramUniform1fvEXT) +#define glProgramUniform1iEXT GLEW_GET_FUN(__glewProgramUniform1iEXT) +#define glProgramUniform1ivEXT GLEW_GET_FUN(__glewProgramUniform1ivEXT) +#define glProgramUniform1uiEXT GLEW_GET_FUN(__glewProgramUniform1uiEXT) +#define glProgramUniform1uivEXT GLEW_GET_FUN(__glewProgramUniform1uivEXT) +#define glProgramUniform2fEXT GLEW_GET_FUN(__glewProgramUniform2fEXT) +#define glProgramUniform2fvEXT GLEW_GET_FUN(__glewProgramUniform2fvEXT) +#define glProgramUniform2iEXT GLEW_GET_FUN(__glewProgramUniform2iEXT) +#define glProgramUniform2ivEXT GLEW_GET_FUN(__glewProgramUniform2ivEXT) +#define glProgramUniform2uiEXT GLEW_GET_FUN(__glewProgramUniform2uiEXT) +#define glProgramUniform2uivEXT GLEW_GET_FUN(__glewProgramUniform2uivEXT) +#define glProgramUniform3fEXT GLEW_GET_FUN(__glewProgramUniform3fEXT) +#define glProgramUniform3fvEXT GLEW_GET_FUN(__glewProgramUniform3fvEXT) +#define glProgramUniform3iEXT GLEW_GET_FUN(__glewProgramUniform3iEXT) +#define glProgramUniform3ivEXT GLEW_GET_FUN(__glewProgramUniform3ivEXT) +#define glProgramUniform3uiEXT GLEW_GET_FUN(__glewProgramUniform3uiEXT) +#define glProgramUniform3uivEXT GLEW_GET_FUN(__glewProgramUniform3uivEXT) +#define glProgramUniform4fEXT GLEW_GET_FUN(__glewProgramUniform4fEXT) +#define glProgramUniform4fvEXT GLEW_GET_FUN(__glewProgramUniform4fvEXT) +#define glProgramUniform4iEXT GLEW_GET_FUN(__glewProgramUniform4iEXT) +#define glProgramUniform4ivEXT GLEW_GET_FUN(__glewProgramUniform4ivEXT) +#define glProgramUniform4uiEXT GLEW_GET_FUN(__glewProgramUniform4uiEXT) +#define glProgramUniform4uivEXT GLEW_GET_FUN(__glewProgramUniform4uivEXT) +#define glProgramUniformMatrix2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2fvEXT) +#define glProgramUniformMatrix2x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x3fvEXT) +#define glProgramUniformMatrix2x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x4fvEXT) +#define glProgramUniformMatrix3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3fvEXT) +#define glProgramUniformMatrix3x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x2fvEXT) +#define glProgramUniformMatrix3x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x4fvEXT) +#define glProgramUniformMatrix4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4fvEXT) +#define glProgramUniformMatrix4x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x2fvEXT) +#define glProgramUniformMatrix4x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x3fvEXT) +#define glPushClientAttribDefaultEXT GLEW_GET_FUN(__glewPushClientAttribDefaultEXT) +#define glTextureBufferEXT GLEW_GET_FUN(__glewTextureBufferEXT) +#define glTextureImage1DEXT GLEW_GET_FUN(__glewTextureImage1DEXT) +#define glTextureImage2DEXT GLEW_GET_FUN(__glewTextureImage2DEXT) +#define glTextureImage3DEXT GLEW_GET_FUN(__glewTextureImage3DEXT) +#define glTextureParameterIivEXT GLEW_GET_FUN(__glewTextureParameterIivEXT) +#define glTextureParameterIuivEXT GLEW_GET_FUN(__glewTextureParameterIuivEXT) +#define glTextureParameterfEXT GLEW_GET_FUN(__glewTextureParameterfEXT) +#define glTextureParameterfvEXT GLEW_GET_FUN(__glewTextureParameterfvEXT) +#define glTextureParameteriEXT GLEW_GET_FUN(__glewTextureParameteriEXT) +#define glTextureParameterivEXT GLEW_GET_FUN(__glewTextureParameterivEXT) +#define glTextureRenderbufferEXT GLEW_GET_FUN(__glewTextureRenderbufferEXT) +#define glTextureSubImage1DEXT GLEW_GET_FUN(__glewTextureSubImage1DEXT) +#define glTextureSubImage2DEXT GLEW_GET_FUN(__glewTextureSubImage2DEXT) +#define glTextureSubImage3DEXT GLEW_GET_FUN(__glewTextureSubImage3DEXT) +#define glUnmapNamedBufferEXT GLEW_GET_FUN(__glewUnmapNamedBufferEXT) +#define glVertexArrayColorOffsetEXT GLEW_GET_FUN(__glewVertexArrayColorOffsetEXT) +#define glVertexArrayEdgeFlagOffsetEXT GLEW_GET_FUN(__glewVertexArrayEdgeFlagOffsetEXT) +#define glVertexArrayFogCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayFogCoordOffsetEXT) +#define glVertexArrayIndexOffsetEXT GLEW_GET_FUN(__glewVertexArrayIndexOffsetEXT) +#define glVertexArrayMultiTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayMultiTexCoordOffsetEXT) +#define glVertexArrayNormalOffsetEXT GLEW_GET_FUN(__glewVertexArrayNormalOffsetEXT) +#define glVertexArraySecondaryColorOffsetEXT GLEW_GET_FUN(__glewVertexArraySecondaryColorOffsetEXT) +#define glVertexArrayTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayTexCoordOffsetEXT) +#define glVertexArrayVertexAttribIOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribIOffsetEXT) +#define glVertexArrayVertexAttribOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribOffsetEXT) +#define glVertexArrayVertexOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexOffsetEXT) + +#define GLEW_EXT_direct_state_access GLEW_GET_VAR(__GLEW_EXT_direct_state_access) + +#endif /* GL_EXT_direct_state_access */ + +/* -------------------------- GL_EXT_draw_buffers2 ------------------------- */ + +#ifndef GL_EXT_draw_buffers2 +#define GL_EXT_draw_buffers2 1 + +typedef void (GLAPIENTRY * PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (GLAPIENTRY * PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum value, GLuint index, GLboolean* data); +typedef void (GLAPIENTRY * PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum value, GLuint index, GLint* data); +typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); + +#define glColorMaskIndexedEXT GLEW_GET_FUN(__glewColorMaskIndexedEXT) +#define glDisableIndexedEXT GLEW_GET_FUN(__glewDisableIndexedEXT) +#define glEnableIndexedEXT GLEW_GET_FUN(__glewEnableIndexedEXT) +#define glGetBooleanIndexedvEXT GLEW_GET_FUN(__glewGetBooleanIndexedvEXT) +#define glGetIntegerIndexedvEXT GLEW_GET_FUN(__glewGetIntegerIndexedvEXT) +#define glIsEnabledIndexedEXT GLEW_GET_FUN(__glewIsEnabledIndexedEXT) + +#define GLEW_EXT_draw_buffers2 GLEW_GET_VAR(__GLEW_EXT_draw_buffers2) + +#endif /* GL_EXT_draw_buffers2 */ + +/* ------------------------- GL_EXT_draw_instanced ------------------------- */ + +#ifndef GL_EXT_draw_instanced +#define GL_EXT_draw_instanced 1 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); + +#define glDrawArraysInstancedEXT GLEW_GET_FUN(__glewDrawArraysInstancedEXT) +#define glDrawElementsInstancedEXT GLEW_GET_FUN(__glewDrawElementsInstancedEXT) + +#define GLEW_EXT_draw_instanced GLEW_GET_VAR(__GLEW_EXT_draw_instanced) + +#endif /* GL_EXT_draw_instanced */ + +/* ----------------------- GL_EXT_draw_range_elements ---------------------- */ + +#ifndef GL_EXT_draw_range_elements +#define GL_EXT_draw_range_elements 1 + +#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 +#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 + +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); + +#define glDrawRangeElementsEXT GLEW_GET_FUN(__glewDrawRangeElementsEXT) + +#define GLEW_EXT_draw_range_elements GLEW_GET_VAR(__GLEW_EXT_draw_range_elements) + +#endif /* GL_EXT_draw_range_elements */ + +/* ---------------------------- GL_EXT_fog_coord --------------------------- */ + +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 1 + +#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 +#define GL_FOG_COORDINATE_EXT 0x8451 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 +#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 +#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 + +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); + +#define glFogCoordPointerEXT GLEW_GET_FUN(__glewFogCoordPointerEXT) +#define glFogCoorddEXT GLEW_GET_FUN(__glewFogCoorddEXT) +#define glFogCoorddvEXT GLEW_GET_FUN(__glewFogCoorddvEXT) +#define glFogCoordfEXT GLEW_GET_FUN(__glewFogCoordfEXT) +#define glFogCoordfvEXT GLEW_GET_FUN(__glewFogCoordfvEXT) + +#define GLEW_EXT_fog_coord GLEW_GET_VAR(__GLEW_EXT_fog_coord) + +#endif /* GL_EXT_fog_coord */ + +/* ------------------------ GL_EXT_fragment_lighting ----------------------- */ + +#ifndef GL_EXT_fragment_lighting +#define GL_EXT_fragment_lighting 1 + +#define GL_FRAGMENT_LIGHTING_EXT 0x8400 +#define GL_FRAGMENT_COLOR_MATERIAL_EXT 0x8401 +#define GL_FRAGMENT_COLOR_MATERIAL_FACE_EXT 0x8402 +#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_EXT 0x8403 +#define GL_MAX_FRAGMENT_LIGHTS_EXT 0x8404 +#define GL_MAX_ACTIVE_LIGHTS_EXT 0x8405 +#define GL_CURRENT_RASTER_NORMAL_EXT 0x8406 +#define GL_LIGHT_ENV_MODE_EXT 0x8407 +#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_EXT 0x8408 +#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_EXT 0x8409 +#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_EXT 0x840A +#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_EXT 0x840B +#define GL_FRAGMENT_LIGHT0_EXT 0x840C +#define GL_FRAGMENT_LIGHT7_EXT 0x8413 + +typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALEXTPROC) (GLenum face, GLenum mode); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFEXTPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVEXTPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIEXTPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVEXTPROC) (GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFEXTPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIEXTPROC) (GLenum light, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFEXTPROC) (GLenum face, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIEXTPROC) (GLenum face, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLLIGHTENVIEXTPROC) (GLenum pname, GLint param); + +#define glFragmentColorMaterialEXT GLEW_GET_FUN(__glewFragmentColorMaterialEXT) +#define glFragmentLightModelfEXT GLEW_GET_FUN(__glewFragmentLightModelfEXT) +#define glFragmentLightModelfvEXT GLEW_GET_FUN(__glewFragmentLightModelfvEXT) +#define glFragmentLightModeliEXT GLEW_GET_FUN(__glewFragmentLightModeliEXT) +#define glFragmentLightModelivEXT GLEW_GET_FUN(__glewFragmentLightModelivEXT) +#define glFragmentLightfEXT GLEW_GET_FUN(__glewFragmentLightfEXT) +#define glFragmentLightfvEXT GLEW_GET_FUN(__glewFragmentLightfvEXT) +#define glFragmentLightiEXT GLEW_GET_FUN(__glewFragmentLightiEXT) +#define glFragmentLightivEXT GLEW_GET_FUN(__glewFragmentLightivEXT) +#define glFragmentMaterialfEXT GLEW_GET_FUN(__glewFragmentMaterialfEXT) +#define glFragmentMaterialfvEXT GLEW_GET_FUN(__glewFragmentMaterialfvEXT) +#define glFragmentMaterialiEXT GLEW_GET_FUN(__glewFragmentMaterialiEXT) +#define glFragmentMaterialivEXT GLEW_GET_FUN(__glewFragmentMaterialivEXT) +#define glGetFragmentLightfvEXT GLEW_GET_FUN(__glewGetFragmentLightfvEXT) +#define glGetFragmentLightivEXT GLEW_GET_FUN(__glewGetFragmentLightivEXT) +#define glGetFragmentMaterialfvEXT GLEW_GET_FUN(__glewGetFragmentMaterialfvEXT) +#define glGetFragmentMaterialivEXT GLEW_GET_FUN(__glewGetFragmentMaterialivEXT) +#define glLightEnviEXT GLEW_GET_FUN(__glewLightEnviEXT) + +#define GLEW_EXT_fragment_lighting GLEW_GET_VAR(__GLEW_EXT_fragment_lighting) + +#endif /* GL_EXT_fragment_lighting */ + +/* ------------------------ GL_EXT_framebuffer_blit ------------------------ */ + +#ifndef GL_EXT_framebuffer_blit +#define GL_EXT_framebuffer_blit 1 + +#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA + +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); + +#define glBlitFramebufferEXT GLEW_GET_FUN(__glewBlitFramebufferEXT) + +#define GLEW_EXT_framebuffer_blit GLEW_GET_VAR(__GLEW_EXT_framebuffer_blit) + +#endif /* GL_EXT_framebuffer_blit */ + +/* --------------------- GL_EXT_framebuffer_multisample -------------------- */ + +#ifndef GL_EXT_framebuffer_multisample +#define GL_EXT_framebuffer_multisample 1 + +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewRenderbufferStorageMultisampleEXT) + +#define GLEW_EXT_framebuffer_multisample GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample) + +#endif /* GL_EXT_framebuffer_multisample */ + +/* --------------- GL_EXT_framebuffer_multisample_blit_scaled -------------- */ + +#ifndef GL_EXT_framebuffer_multisample_blit_scaled +#define GL_EXT_framebuffer_multisample_blit_scaled 1 + +#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA +#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB + +#define GLEW_EXT_framebuffer_multisample_blit_scaled GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample_blit_scaled) + +#endif /* GL_EXT_framebuffer_multisample_blit_scaled */ + +/* ----------------------- GL_EXT_framebuffer_object ----------------------- */ + +#ifndef GL_EXT_framebuffer_object +#define GL_EXT_framebuffer_object 1 + +#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 +#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 +#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF +#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 +#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 +#define GL_FRAMEBUFFER_EXT 0x8D40 +#define GL_RENDERBUFFER_EXT 0x8D41 +#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 +#define GL_STENCIL_INDEX1_EXT 0x8D46 +#define GL_STENCIL_INDEX4_EXT 0x8D47 +#define GL_STENCIL_INDEX8_EXT 0x8D48 +#define GL_STENCIL_INDEX16_EXT 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 + +typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); +typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); +typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); +typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); + +#define glBindFramebufferEXT GLEW_GET_FUN(__glewBindFramebufferEXT) +#define glBindRenderbufferEXT GLEW_GET_FUN(__glewBindRenderbufferEXT) +#define glCheckFramebufferStatusEXT GLEW_GET_FUN(__glewCheckFramebufferStatusEXT) +#define glDeleteFramebuffersEXT GLEW_GET_FUN(__glewDeleteFramebuffersEXT) +#define glDeleteRenderbuffersEXT GLEW_GET_FUN(__glewDeleteRenderbuffersEXT) +#define glFramebufferRenderbufferEXT GLEW_GET_FUN(__glewFramebufferRenderbufferEXT) +#define glFramebufferTexture1DEXT GLEW_GET_FUN(__glewFramebufferTexture1DEXT) +#define glFramebufferTexture2DEXT GLEW_GET_FUN(__glewFramebufferTexture2DEXT) +#define glFramebufferTexture3DEXT GLEW_GET_FUN(__glewFramebufferTexture3DEXT) +#define glGenFramebuffersEXT GLEW_GET_FUN(__glewGenFramebuffersEXT) +#define glGenRenderbuffersEXT GLEW_GET_FUN(__glewGenRenderbuffersEXT) +#define glGenerateMipmapEXT GLEW_GET_FUN(__glewGenerateMipmapEXT) +#define glGetFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetFramebufferAttachmentParameterivEXT) +#define glGetRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetRenderbufferParameterivEXT) +#define glIsFramebufferEXT GLEW_GET_FUN(__glewIsFramebufferEXT) +#define glIsRenderbufferEXT GLEW_GET_FUN(__glewIsRenderbufferEXT) +#define glRenderbufferStorageEXT GLEW_GET_FUN(__glewRenderbufferStorageEXT) + +#define GLEW_EXT_framebuffer_object GLEW_GET_VAR(__GLEW_EXT_framebuffer_object) + +#endif /* GL_EXT_framebuffer_object */ + +/* ------------------------ GL_EXT_framebuffer_sRGB ------------------------ */ + +#ifndef GL_EXT_framebuffer_sRGB +#define GL_EXT_framebuffer_sRGB 1 + +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 +#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA + +#define GLEW_EXT_framebuffer_sRGB GLEW_GET_VAR(__GLEW_EXT_framebuffer_sRGB) + +#endif /* GL_EXT_framebuffer_sRGB */ + +/* ------------------------ GL_EXT_geometry_shader4 ------------------------ */ + +#ifndef GL_EXT_geometry_shader4 +#define GL_EXT_geometry_shader4 1 + +#define GL_LINES_ADJACENCY_EXT 0xA +#define GL_LINE_STRIP_ADJACENCY_EXT 0xB +#define GL_TRIANGLES_ADJACENCY_EXT 0xC +#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD +#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 +#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); + +#define glFramebufferTextureEXT GLEW_GET_FUN(__glewFramebufferTextureEXT) +#define glFramebufferTextureFaceEXT GLEW_GET_FUN(__glewFramebufferTextureFaceEXT) +#define glProgramParameteriEXT GLEW_GET_FUN(__glewProgramParameteriEXT) + +#define GLEW_EXT_geometry_shader4 GLEW_GET_VAR(__GLEW_EXT_geometry_shader4) + +#endif /* GL_EXT_geometry_shader4 */ + +/* --------------------- GL_EXT_gpu_program_parameters --------------------- */ + +#ifndef GL_EXT_gpu_program_parameters +#define GL_EXT_gpu_program_parameters 1 + +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params); + +#define glProgramEnvParameters4fvEXT GLEW_GET_FUN(__glewProgramEnvParameters4fvEXT) +#define glProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewProgramLocalParameters4fvEXT) + +#define GLEW_EXT_gpu_program_parameters GLEW_GET_VAR(__GLEW_EXT_gpu_program_parameters) + +#endif /* GL_EXT_gpu_program_parameters */ + +/* --------------------------- GL_EXT_gpu_shader4 -------------------------- */ + +#ifndef GL_EXT_gpu_shader4 +#define GL_EXT_gpu_shader4 1 + +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD +#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 +#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 +#define GL_SAMPLER_BUFFER_EXT 0x8DC2 +#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 +#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 +#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 +#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 +#define GL_INT_SAMPLER_1D_EXT 0x8DC9 +#define GL_INT_SAMPLER_2D_EXT 0x8DCA +#define GL_INT_SAMPLER_3D_EXT 0x8DCB +#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC +#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD +#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF +#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 + +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); + +#define glBindFragDataLocationEXT GLEW_GET_FUN(__glewBindFragDataLocationEXT) +#define glGetFragDataLocationEXT GLEW_GET_FUN(__glewGetFragDataLocationEXT) +#define glGetUniformuivEXT GLEW_GET_FUN(__glewGetUniformuivEXT) +#define glGetVertexAttribIivEXT GLEW_GET_FUN(__glewGetVertexAttribIivEXT) +#define glGetVertexAttribIuivEXT GLEW_GET_FUN(__glewGetVertexAttribIuivEXT) +#define glUniform1uiEXT GLEW_GET_FUN(__glewUniform1uiEXT) +#define glUniform1uivEXT GLEW_GET_FUN(__glewUniform1uivEXT) +#define glUniform2uiEXT GLEW_GET_FUN(__glewUniform2uiEXT) +#define glUniform2uivEXT GLEW_GET_FUN(__glewUniform2uivEXT) +#define glUniform3uiEXT GLEW_GET_FUN(__glewUniform3uiEXT) +#define glUniform3uivEXT GLEW_GET_FUN(__glewUniform3uivEXT) +#define glUniform4uiEXT GLEW_GET_FUN(__glewUniform4uiEXT) +#define glUniform4uivEXT GLEW_GET_FUN(__glewUniform4uivEXT) +#define glVertexAttribI1iEXT GLEW_GET_FUN(__glewVertexAttribI1iEXT) +#define glVertexAttribI1ivEXT GLEW_GET_FUN(__glewVertexAttribI1ivEXT) +#define glVertexAttribI1uiEXT GLEW_GET_FUN(__glewVertexAttribI1uiEXT) +#define glVertexAttribI1uivEXT GLEW_GET_FUN(__glewVertexAttribI1uivEXT) +#define glVertexAttribI2iEXT GLEW_GET_FUN(__glewVertexAttribI2iEXT) +#define glVertexAttribI2ivEXT GLEW_GET_FUN(__glewVertexAttribI2ivEXT) +#define glVertexAttribI2uiEXT GLEW_GET_FUN(__glewVertexAttribI2uiEXT) +#define glVertexAttribI2uivEXT GLEW_GET_FUN(__glewVertexAttribI2uivEXT) +#define glVertexAttribI3iEXT GLEW_GET_FUN(__glewVertexAttribI3iEXT) +#define glVertexAttribI3ivEXT GLEW_GET_FUN(__glewVertexAttribI3ivEXT) +#define glVertexAttribI3uiEXT GLEW_GET_FUN(__glewVertexAttribI3uiEXT) +#define glVertexAttribI3uivEXT GLEW_GET_FUN(__glewVertexAttribI3uivEXT) +#define glVertexAttribI4bvEXT GLEW_GET_FUN(__glewVertexAttribI4bvEXT) +#define glVertexAttribI4iEXT GLEW_GET_FUN(__glewVertexAttribI4iEXT) +#define glVertexAttribI4ivEXT GLEW_GET_FUN(__glewVertexAttribI4ivEXT) +#define glVertexAttribI4svEXT GLEW_GET_FUN(__glewVertexAttribI4svEXT) +#define glVertexAttribI4ubvEXT GLEW_GET_FUN(__glewVertexAttribI4ubvEXT) +#define glVertexAttribI4uiEXT GLEW_GET_FUN(__glewVertexAttribI4uiEXT) +#define glVertexAttribI4uivEXT GLEW_GET_FUN(__glewVertexAttribI4uivEXT) +#define glVertexAttribI4usvEXT GLEW_GET_FUN(__glewVertexAttribI4usvEXT) +#define glVertexAttribIPointerEXT GLEW_GET_FUN(__glewVertexAttribIPointerEXT) + +#define GLEW_EXT_gpu_shader4 GLEW_GET_VAR(__GLEW_EXT_gpu_shader4) + +#endif /* GL_EXT_gpu_shader4 */ + +/* ---------------------------- GL_EXT_histogram --------------------------- */ + +#ifndef GL_EXT_histogram +#define GL_EXT_histogram 1 + +#define GL_HISTOGRAM_EXT 0x8024 +#define GL_PROXY_HISTOGRAM_EXT 0x8025 +#define GL_HISTOGRAM_WIDTH_EXT 0x8026 +#define GL_HISTOGRAM_FORMAT_EXT 0x8027 +#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C +#define GL_HISTOGRAM_SINK_EXT 0x802D +#define GL_MINMAX_EXT 0x802E +#define GL_MINMAX_FORMAT_EXT 0x802F +#define GL_MINMAX_SINK_EXT 0x8030 + +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLRESETMINMAXEXTPROC) (GLenum target); + +#define glGetHistogramEXT GLEW_GET_FUN(__glewGetHistogramEXT) +#define glGetHistogramParameterfvEXT GLEW_GET_FUN(__glewGetHistogramParameterfvEXT) +#define glGetHistogramParameterivEXT GLEW_GET_FUN(__glewGetHistogramParameterivEXT) +#define glGetMinmaxEXT GLEW_GET_FUN(__glewGetMinmaxEXT) +#define glGetMinmaxParameterfvEXT GLEW_GET_FUN(__glewGetMinmaxParameterfvEXT) +#define glGetMinmaxParameterivEXT GLEW_GET_FUN(__glewGetMinmaxParameterivEXT) +#define glHistogramEXT GLEW_GET_FUN(__glewHistogramEXT) +#define glMinmaxEXT GLEW_GET_FUN(__glewMinmaxEXT) +#define glResetHistogramEXT GLEW_GET_FUN(__glewResetHistogramEXT) +#define glResetMinmaxEXT GLEW_GET_FUN(__glewResetMinmaxEXT) + +#define GLEW_EXT_histogram GLEW_GET_VAR(__GLEW_EXT_histogram) + +#endif /* GL_EXT_histogram */ + +/* ----------------------- GL_EXT_index_array_formats ---------------------- */ + +#ifndef GL_EXT_index_array_formats +#define GL_EXT_index_array_formats 1 + +#define GLEW_EXT_index_array_formats GLEW_GET_VAR(__GLEW_EXT_index_array_formats) + +#endif /* GL_EXT_index_array_formats */ + +/* --------------------------- GL_EXT_index_func --------------------------- */ + +#ifndef GL_EXT_index_func +#define GL_EXT_index_func 1 + +typedef void (GLAPIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLfloat ref); + +#define glIndexFuncEXT GLEW_GET_FUN(__glewIndexFuncEXT) + +#define GLEW_EXT_index_func GLEW_GET_VAR(__GLEW_EXT_index_func) + +#endif /* GL_EXT_index_func */ + +/* ------------------------- GL_EXT_index_material ------------------------- */ + +#ifndef GL_EXT_index_material +#define GL_EXT_index_material 1 + +typedef void (GLAPIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); + +#define glIndexMaterialEXT GLEW_GET_FUN(__glewIndexMaterialEXT) + +#define GLEW_EXT_index_material GLEW_GET_VAR(__GLEW_EXT_index_material) + +#endif /* GL_EXT_index_material */ + +/* -------------------------- GL_EXT_index_texture ------------------------- */ + +#ifndef GL_EXT_index_texture +#define GL_EXT_index_texture 1 + +#define GLEW_EXT_index_texture GLEW_GET_VAR(__GLEW_EXT_index_texture) + +#endif /* GL_EXT_index_texture */ + +/* -------------------------- GL_EXT_light_texture ------------------------- */ + +#ifndef GL_EXT_light_texture +#define GL_EXT_light_texture 1 + +#define GL_FRAGMENT_MATERIAL_EXT 0x8349 +#define GL_FRAGMENT_NORMAL_EXT 0x834A +#define GL_FRAGMENT_COLOR_EXT 0x834C +#define GL_ATTENUATION_EXT 0x834D +#define GL_SHADOW_ATTENUATION_EXT 0x834E +#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F +#define GL_TEXTURE_LIGHT_EXT 0x8350 +#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 +#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 + +typedef void (GLAPIENTRY * PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); +typedef void (GLAPIENTRY * PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); +typedef void (GLAPIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); + +#define glApplyTextureEXT GLEW_GET_FUN(__glewApplyTextureEXT) +#define glTextureLightEXT GLEW_GET_FUN(__glewTextureLightEXT) +#define glTextureMaterialEXT GLEW_GET_FUN(__glewTextureMaterialEXT) + +#define GLEW_EXT_light_texture GLEW_GET_VAR(__GLEW_EXT_light_texture) + +#endif /* GL_EXT_light_texture */ + +/* ------------------------- GL_EXT_misc_attribute ------------------------- */ + +#ifndef GL_EXT_misc_attribute +#define GL_EXT_misc_attribute 1 + +#define GLEW_EXT_misc_attribute GLEW_GET_VAR(__GLEW_EXT_misc_attribute) + +#endif /* GL_EXT_misc_attribute */ + +/* ------------------------ GL_EXT_multi_draw_arrays ----------------------- */ + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, GLsizei* count, GLenum type, const GLvoid * const *indices, GLsizei primcount); + +#define glMultiDrawArraysEXT GLEW_GET_FUN(__glewMultiDrawArraysEXT) +#define glMultiDrawElementsEXT GLEW_GET_FUN(__glewMultiDrawElementsEXT) + +#define GLEW_EXT_multi_draw_arrays GLEW_GET_VAR(__GLEW_EXT_multi_draw_arrays) + +#endif /* GL_EXT_multi_draw_arrays */ + +/* --------------------------- GL_EXT_multisample -------------------------- */ + +#ifndef GL_EXT_multisample +#define GL_EXT_multisample 1 + +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F +#define GL_SAMPLE_MASK_EXT 0x80A0 +#define GL_1PASS_EXT 0x80A1 +#define GL_2PASS_0_EXT 0x80A2 +#define GL_2PASS_1_EXT 0x80A3 +#define GL_4PASS_0_EXT 0x80A4 +#define GL_4PASS_1_EXT 0x80A5 +#define GL_4PASS_2_EXT 0x80A6 +#define GL_4PASS_3_EXT 0x80A7 +#define GL_SAMPLE_BUFFERS_EXT 0x80A8 +#define GL_SAMPLES_EXT 0x80A9 +#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA +#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB +#define GL_SAMPLE_PATTERN_EXT 0x80AC +#define GL_MULTISAMPLE_BIT_EXT 0x20000000 + +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); +typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); + +#define glSampleMaskEXT GLEW_GET_FUN(__glewSampleMaskEXT) +#define glSamplePatternEXT GLEW_GET_FUN(__glewSamplePatternEXT) + +#define GLEW_EXT_multisample GLEW_GET_VAR(__GLEW_EXT_multisample) + +#endif /* GL_EXT_multisample */ + +/* ---------------------- GL_EXT_packed_depth_stencil ---------------------- */ + +#ifndef GL_EXT_packed_depth_stencil +#define GL_EXT_packed_depth_stencil 1 + +#define GL_DEPTH_STENCIL_EXT 0x84F9 +#define GL_UNSIGNED_INT_24_8_EXT 0x84FA +#define GL_DEPTH24_STENCIL8_EXT 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 + +#define GLEW_EXT_packed_depth_stencil GLEW_GET_VAR(__GLEW_EXT_packed_depth_stencil) + +#endif /* GL_EXT_packed_depth_stencil */ + +/* -------------------------- GL_EXT_packed_float -------------------------- */ + +#ifndef GL_EXT_packed_float +#define GL_EXT_packed_float 1 + +#define GL_R11F_G11F_B10F_EXT 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B +#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C + +#define GLEW_EXT_packed_float GLEW_GET_VAR(__GLEW_EXT_packed_float) + +#endif /* GL_EXT_packed_float */ + +/* -------------------------- GL_EXT_packed_pixels ------------------------- */ + +#ifndef GL_EXT_packed_pixels +#define GL_EXT_packed_pixels 1 + +#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 + +#define GLEW_EXT_packed_pixels GLEW_GET_VAR(__GLEW_EXT_packed_pixels) + +#endif /* GL_EXT_packed_pixels */ + +/* ------------------------ GL_EXT_paletted_texture ------------------------ */ + +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 + +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 +#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B + +typedef void (GLAPIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); + +#define glColorTableEXT GLEW_GET_FUN(__glewColorTableEXT) +#define glGetColorTableEXT GLEW_GET_FUN(__glewGetColorTableEXT) +#define glGetColorTableParameterfvEXT GLEW_GET_FUN(__glewGetColorTableParameterfvEXT) +#define glGetColorTableParameterivEXT GLEW_GET_FUN(__glewGetColorTableParameterivEXT) + +#define GLEW_EXT_paletted_texture GLEW_GET_VAR(__GLEW_EXT_paletted_texture) + +#endif /* GL_EXT_paletted_texture */ + +/* ----------------------- GL_EXT_pixel_buffer_object ---------------------- */ + +#ifndef GL_EXT_pixel_buffer_object +#define GL_EXT_pixel_buffer_object 1 + +#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF + +#define GLEW_EXT_pixel_buffer_object GLEW_GET_VAR(__GLEW_EXT_pixel_buffer_object) + +#endif /* GL_EXT_pixel_buffer_object */ + +/* ------------------------- GL_EXT_pixel_transform ------------------------ */ + +#ifndef GL_EXT_pixel_transform +#define GL_EXT_pixel_transform 1 + +#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 +#define GL_PIXEL_MAG_FILTER_EXT 0x8331 +#define GL_PIXEL_MIN_FILTER_EXT 0x8332 +#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 +#define GL_CUBIC_EXT 0x8334 +#define GL_AVERAGE_EXT 0x8335 +#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 +#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 +#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 + +typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glGetPixelTransformParameterfvEXT GLEW_GET_FUN(__glewGetPixelTransformParameterfvEXT) +#define glGetPixelTransformParameterivEXT GLEW_GET_FUN(__glewGetPixelTransformParameterivEXT) +#define glPixelTransformParameterfEXT GLEW_GET_FUN(__glewPixelTransformParameterfEXT) +#define glPixelTransformParameterfvEXT GLEW_GET_FUN(__glewPixelTransformParameterfvEXT) +#define glPixelTransformParameteriEXT GLEW_GET_FUN(__glewPixelTransformParameteriEXT) +#define glPixelTransformParameterivEXT GLEW_GET_FUN(__glewPixelTransformParameterivEXT) + +#define GLEW_EXT_pixel_transform GLEW_GET_VAR(__GLEW_EXT_pixel_transform) + +#endif /* GL_EXT_pixel_transform */ + +/* ------------------- GL_EXT_pixel_transform_color_table ------------------ */ + +#ifndef GL_EXT_pixel_transform_color_table +#define GL_EXT_pixel_transform_color_table 1 + +#define GLEW_EXT_pixel_transform_color_table GLEW_GET_VAR(__GLEW_EXT_pixel_transform_color_table) + +#endif /* GL_EXT_pixel_transform_color_table */ + +/* ------------------------ GL_EXT_point_parameters ------------------------ */ + +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 + +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 + +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat* params); + +#define glPointParameterfEXT GLEW_GET_FUN(__glewPointParameterfEXT) +#define glPointParameterfvEXT GLEW_GET_FUN(__glewPointParameterfvEXT) + +#define GLEW_EXT_point_parameters GLEW_GET_VAR(__GLEW_EXT_point_parameters) + +#endif /* GL_EXT_point_parameters */ + +/* ------------------------- GL_EXT_polygon_offset ------------------------- */ + +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 + +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 + +typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); + +#define glPolygonOffsetEXT GLEW_GET_FUN(__glewPolygonOffsetEXT) + +#define GLEW_EXT_polygon_offset GLEW_GET_VAR(__GLEW_EXT_polygon_offset) + +#endif /* GL_EXT_polygon_offset */ + +/* ------------------------ GL_EXT_provoking_vertex ------------------------ */ + +#ifndef GL_EXT_provoking_vertex +#define GL_EXT_provoking_vertex 1 + +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D +#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E +#define GL_PROVOKING_VERTEX_EXT 0x8E4F + +typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); + +#define glProvokingVertexEXT GLEW_GET_FUN(__glewProvokingVertexEXT) + +#define GLEW_EXT_provoking_vertex GLEW_GET_VAR(__GLEW_EXT_provoking_vertex) + +#endif /* GL_EXT_provoking_vertex */ + +/* ------------------------- GL_EXT_rescale_normal ------------------------- */ + +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 + +#define GL_RESCALE_NORMAL_EXT 0x803A + +#define GLEW_EXT_rescale_normal GLEW_GET_VAR(__GLEW_EXT_rescale_normal) + +#endif /* GL_EXT_rescale_normal */ + +/* -------------------------- GL_EXT_scene_marker -------------------------- */ + +#ifndef GL_EXT_scene_marker +#define GL_EXT_scene_marker 1 + +typedef void (GLAPIENTRY * PFNGLBEGINSCENEEXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLENDSCENEEXTPROC) (void); + +#define glBeginSceneEXT GLEW_GET_FUN(__glewBeginSceneEXT) +#define glEndSceneEXT GLEW_GET_FUN(__glewEndSceneEXT) + +#define GLEW_EXT_scene_marker GLEW_GET_VAR(__GLEW_EXT_scene_marker) + +#endif /* GL_EXT_scene_marker */ + +/* ------------------------- GL_EXT_secondary_color ------------------------ */ + +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 + +#define GL_COLOR_SUM_EXT 0x8458 +#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D +#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E + +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); + +#define glSecondaryColor3bEXT GLEW_GET_FUN(__glewSecondaryColor3bEXT) +#define glSecondaryColor3bvEXT GLEW_GET_FUN(__glewSecondaryColor3bvEXT) +#define glSecondaryColor3dEXT GLEW_GET_FUN(__glewSecondaryColor3dEXT) +#define glSecondaryColor3dvEXT GLEW_GET_FUN(__glewSecondaryColor3dvEXT) +#define glSecondaryColor3fEXT GLEW_GET_FUN(__glewSecondaryColor3fEXT) +#define glSecondaryColor3fvEXT GLEW_GET_FUN(__glewSecondaryColor3fvEXT) +#define glSecondaryColor3iEXT GLEW_GET_FUN(__glewSecondaryColor3iEXT) +#define glSecondaryColor3ivEXT GLEW_GET_FUN(__glewSecondaryColor3ivEXT) +#define glSecondaryColor3sEXT GLEW_GET_FUN(__glewSecondaryColor3sEXT) +#define glSecondaryColor3svEXT GLEW_GET_FUN(__glewSecondaryColor3svEXT) +#define glSecondaryColor3ubEXT GLEW_GET_FUN(__glewSecondaryColor3ubEXT) +#define glSecondaryColor3ubvEXT GLEW_GET_FUN(__glewSecondaryColor3ubvEXT) +#define glSecondaryColor3uiEXT GLEW_GET_FUN(__glewSecondaryColor3uiEXT) +#define glSecondaryColor3uivEXT GLEW_GET_FUN(__glewSecondaryColor3uivEXT) +#define glSecondaryColor3usEXT GLEW_GET_FUN(__glewSecondaryColor3usEXT) +#define glSecondaryColor3usvEXT GLEW_GET_FUN(__glewSecondaryColor3usvEXT) +#define glSecondaryColorPointerEXT GLEW_GET_FUN(__glewSecondaryColorPointerEXT) + +#define GLEW_EXT_secondary_color GLEW_GET_VAR(__GLEW_EXT_secondary_color) + +#endif /* GL_EXT_secondary_color */ + +/* --------------------- GL_EXT_separate_shader_objects -------------------- */ + +#ifndef GL_EXT_separate_shader_objects +#define GL_EXT_separate_shader_objects 1 + +#define GL_ACTIVE_PROGRAM_EXT 0x8B8D + +typedef void (GLAPIENTRY * PFNGLACTIVEPROGRAMEXTPROC) (GLuint program); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar* string); +typedef void (GLAPIENTRY * PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program); + +#define glActiveProgramEXT GLEW_GET_FUN(__glewActiveProgramEXT) +#define glCreateShaderProgramEXT GLEW_GET_FUN(__glewCreateShaderProgramEXT) +#define glUseShaderProgramEXT GLEW_GET_FUN(__glewUseShaderProgramEXT) + +#define GLEW_EXT_separate_shader_objects GLEW_GET_VAR(__GLEW_EXT_separate_shader_objects) + +#endif /* GL_EXT_separate_shader_objects */ + +/* --------------------- GL_EXT_separate_specular_color -------------------- */ + +#ifndef GL_EXT_separate_specular_color +#define GL_EXT_separate_specular_color 1 + +#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 +#define GL_SINGLE_COLOR_EXT 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA + +#define GLEW_EXT_separate_specular_color GLEW_GET_VAR(__GLEW_EXT_separate_specular_color) + +#endif /* GL_EXT_separate_specular_color */ + +/* --------------------- GL_EXT_shader_image_load_store -------------------- */ + +#ifndef GL_EXT_shader_image_load_store +#define GL_EXT_shader_image_load_store 1 + +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020 +#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000 +#define GL_MAX_IMAGE_UNITS_EXT 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39 +#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A +#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B +#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C +#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D +#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E +#define GL_IMAGE_1D_EXT 0x904C +#define GL_IMAGE_2D_EXT 0x904D +#define GL_IMAGE_3D_EXT 0x904E +#define GL_IMAGE_2D_RECT_EXT 0x904F +#define GL_IMAGE_CUBE_EXT 0x9050 +#define GL_IMAGE_BUFFER_EXT 0x9051 +#define GL_IMAGE_1D_ARRAY_EXT 0x9052 +#define GL_IMAGE_2D_ARRAY_EXT 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056 +#define GL_INT_IMAGE_1D_EXT 0x9057 +#define GL_INT_IMAGE_2D_EXT 0x9058 +#define GL_INT_IMAGE_3D_EXT 0x9059 +#define GL_INT_IMAGE_2D_RECT_EXT 0x905A +#define GL_INT_IMAGE_CUBE_EXT 0x905B +#define GL_INT_IMAGE_BUFFER_EXT 0x905C +#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D +#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C +#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D +#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E +#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); +typedef void (GLAPIENTRY * PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers); + +#define glBindImageTextureEXT GLEW_GET_FUN(__glewBindImageTextureEXT) +#define glMemoryBarrierEXT GLEW_GET_FUN(__glewMemoryBarrierEXT) + +#define GLEW_EXT_shader_image_load_store GLEW_GET_VAR(__GLEW_EXT_shader_image_load_store) + +#endif /* GL_EXT_shader_image_load_store */ + +/* -------------------------- GL_EXT_shadow_funcs -------------------------- */ + +#ifndef GL_EXT_shadow_funcs +#define GL_EXT_shadow_funcs 1 + +#define GLEW_EXT_shadow_funcs GLEW_GET_VAR(__GLEW_EXT_shadow_funcs) + +#endif /* GL_EXT_shadow_funcs */ + +/* --------------------- GL_EXT_shared_texture_palette --------------------- */ + +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 + +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB + +#define GLEW_EXT_shared_texture_palette GLEW_GET_VAR(__GLEW_EXT_shared_texture_palette) + +#endif /* GL_EXT_shared_texture_palette */ + +/* ------------------------ GL_EXT_stencil_clear_tag ----------------------- */ + +#ifndef GL_EXT_stencil_clear_tag +#define GL_EXT_stencil_clear_tag 1 + +#define GL_STENCIL_TAG_BITS_EXT 0x88F2 +#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 + +#define GLEW_EXT_stencil_clear_tag GLEW_GET_VAR(__GLEW_EXT_stencil_clear_tag) + +#endif /* GL_EXT_stencil_clear_tag */ + +/* ------------------------ GL_EXT_stencil_two_side ------------------------ */ + +#ifndef GL_EXT_stencil_two_side +#define GL_EXT_stencil_two_side 1 + +#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 +#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 + +typedef void (GLAPIENTRY * PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); + +#define glActiveStencilFaceEXT GLEW_GET_FUN(__glewActiveStencilFaceEXT) + +#define GLEW_EXT_stencil_two_side GLEW_GET_VAR(__GLEW_EXT_stencil_two_side) + +#endif /* GL_EXT_stencil_two_side */ + +/* -------------------------- GL_EXT_stencil_wrap -------------------------- */ + +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 + +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 + +#define GLEW_EXT_stencil_wrap GLEW_GET_VAR(__GLEW_EXT_stencil_wrap) + +#endif /* GL_EXT_stencil_wrap */ + +/* --------------------------- GL_EXT_subtexture --------------------------- */ + +#ifndef GL_EXT_subtexture +#define GL_EXT_subtexture 1 + +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); + +#define glTexSubImage1DEXT GLEW_GET_FUN(__glewTexSubImage1DEXT) +#define glTexSubImage2DEXT GLEW_GET_FUN(__glewTexSubImage2DEXT) +#define glTexSubImage3DEXT GLEW_GET_FUN(__glewTexSubImage3DEXT) + +#define GLEW_EXT_subtexture GLEW_GET_VAR(__GLEW_EXT_subtexture) + +#endif /* GL_EXT_subtexture */ + +/* ----------------------------- GL_EXT_texture ---------------------------- */ + +#ifndef GL_EXT_texture +#define GL_EXT_texture 1 + +#define GL_ALPHA4_EXT 0x803B +#define GL_ALPHA8_EXT 0x803C +#define GL_ALPHA12_EXT 0x803D +#define GL_ALPHA16_EXT 0x803E +#define GL_LUMINANCE4_EXT 0x803F +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE12_EXT 0x8041 +#define GL_LUMINANCE16_EXT 0x8042 +#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 +#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 +#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 +#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 +#define GL_INTENSITY_EXT 0x8049 +#define GL_INTENSITY4_EXT 0x804A +#define GL_INTENSITY8_EXT 0x804B +#define GL_INTENSITY12_EXT 0x804C +#define GL_INTENSITY16_EXT 0x804D +#define GL_RGB2_EXT 0x804E +#define GL_RGB4_EXT 0x804F +#define GL_RGB5_EXT 0x8050 +#define GL_RGB8_EXT 0x8051 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB12_EXT 0x8053 +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA2_EXT 0x8055 +#define GL_RGBA4_EXT 0x8056 +#define GL_RGB5_A1_EXT 0x8057 +#define GL_RGBA8_EXT 0x8058 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGBA12_EXT 0x805A +#define GL_RGBA16_EXT 0x805B +#define GL_TEXTURE_RED_SIZE_EXT 0x805C +#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D +#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E +#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 +#define GL_REPLACE_EXT 0x8062 +#define GL_PROXY_TEXTURE_1D_EXT 0x8063 +#define GL_PROXY_TEXTURE_2D_EXT 0x8064 + +#define GLEW_EXT_texture GLEW_GET_VAR(__GLEW_EXT_texture) + +#endif /* GL_EXT_texture */ + +/* ---------------------------- GL_EXT_texture3D --------------------------- */ + +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 + +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 + +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); + +#define glTexImage3DEXT GLEW_GET_FUN(__glewTexImage3DEXT) + +#define GLEW_EXT_texture3D GLEW_GET_VAR(__GLEW_EXT_texture3D) + +#endif /* GL_EXT_texture3D */ + +/* -------------------------- GL_EXT_texture_array ------------------------- */ + +#ifndef GL_EXT_texture_array +#define GL_EXT_texture_array 1 + +#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E +#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF +#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 +#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); + +#define glFramebufferTextureLayerEXT GLEW_GET_FUN(__glewFramebufferTextureLayerEXT) + +#define GLEW_EXT_texture_array GLEW_GET_VAR(__GLEW_EXT_texture_array) + +#endif /* GL_EXT_texture_array */ + +/* ---------------------- GL_EXT_texture_buffer_object --------------------- */ + +#ifndef GL_EXT_texture_buffer_object +#define GL_EXT_texture_buffer_object 1 + +#define GL_TEXTURE_BUFFER_EXT 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E + +typedef void (GLAPIENTRY * PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); + +#define glTexBufferEXT GLEW_GET_FUN(__glewTexBufferEXT) + +#define GLEW_EXT_texture_buffer_object GLEW_GET_VAR(__GLEW_EXT_texture_buffer_object) + +#endif /* GL_EXT_texture_buffer_object */ + +/* -------------------- GL_EXT_texture_compression_dxt1 -------------------- */ + +#ifndef GL_EXT_texture_compression_dxt1 +#define GL_EXT_texture_compression_dxt1 1 + +#define GLEW_EXT_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_EXT_texture_compression_dxt1) + +#endif /* GL_EXT_texture_compression_dxt1 */ + +/* -------------------- GL_EXT_texture_compression_latc -------------------- */ + +#ifndef GL_EXT_texture_compression_latc +#define GL_EXT_texture_compression_latc 1 + +#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 +#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 +#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 +#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 + +#define GLEW_EXT_texture_compression_latc GLEW_GET_VAR(__GLEW_EXT_texture_compression_latc) + +#endif /* GL_EXT_texture_compression_latc */ + +/* -------------------- GL_EXT_texture_compression_rgtc -------------------- */ + +#ifndef GL_EXT_texture_compression_rgtc +#define GL_EXT_texture_compression_rgtc 1 + +#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC +#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD +#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE + +#define GLEW_EXT_texture_compression_rgtc GLEW_GET_VAR(__GLEW_EXT_texture_compression_rgtc) + +#endif /* GL_EXT_texture_compression_rgtc */ + +/* -------------------- GL_EXT_texture_compression_s3tc -------------------- */ + +#ifndef GL_EXT_texture_compression_s3tc +#define GL_EXT_texture_compression_s3tc 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 + +#define GLEW_EXT_texture_compression_s3tc GLEW_GET_VAR(__GLEW_EXT_texture_compression_s3tc) + +#endif /* GL_EXT_texture_compression_s3tc */ + +/* ------------------------ GL_EXT_texture_cube_map ------------------------ */ + +#ifndef GL_EXT_texture_cube_map +#define GL_EXT_texture_cube_map 1 + +#define GL_NORMAL_MAP_EXT 0x8511 +#define GL_REFLECTION_MAP_EXT 0x8512 +#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C + +#define GLEW_EXT_texture_cube_map GLEW_GET_VAR(__GLEW_EXT_texture_cube_map) + +#endif /* GL_EXT_texture_cube_map */ + +/* ----------------------- GL_EXT_texture_edge_clamp ----------------------- */ + +#ifndef GL_EXT_texture_edge_clamp +#define GL_EXT_texture_edge_clamp 1 + +#define GL_CLAMP_TO_EDGE_EXT 0x812F + +#define GLEW_EXT_texture_edge_clamp GLEW_GET_VAR(__GLEW_EXT_texture_edge_clamp) + +#endif /* GL_EXT_texture_edge_clamp */ + +/* --------------------------- GL_EXT_texture_env -------------------------- */ + +#ifndef GL_EXT_texture_env +#define GL_EXT_texture_env 1 + +#define GLEW_EXT_texture_env GLEW_GET_VAR(__GLEW_EXT_texture_env) + +#endif /* GL_EXT_texture_env */ + +/* ------------------------- GL_EXT_texture_env_add ------------------------ */ + +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 + +#define GLEW_EXT_texture_env_add GLEW_GET_VAR(__GLEW_EXT_texture_env_add) + +#endif /* GL_EXT_texture_env_add */ + +/* ----------------------- GL_EXT_texture_env_combine ---------------------- */ + +#ifndef GL_EXT_texture_env_combine +#define GL_EXT_texture_env_combine 1 + +#define GL_COMBINE_EXT 0x8570 +#define GL_COMBINE_RGB_EXT 0x8571 +#define GL_COMBINE_ALPHA_EXT 0x8572 +#define GL_RGB_SCALE_EXT 0x8573 +#define GL_ADD_SIGNED_EXT 0x8574 +#define GL_INTERPOLATE_EXT 0x8575 +#define GL_CONSTANT_EXT 0x8576 +#define GL_PRIMARY_COLOR_EXT 0x8577 +#define GL_PREVIOUS_EXT 0x8578 +#define GL_SOURCE0_RGB_EXT 0x8580 +#define GL_SOURCE1_RGB_EXT 0x8581 +#define GL_SOURCE2_RGB_EXT 0x8582 +#define GL_SOURCE0_ALPHA_EXT 0x8588 +#define GL_SOURCE1_ALPHA_EXT 0x8589 +#define GL_SOURCE2_ALPHA_EXT 0x858A +#define GL_OPERAND0_RGB_EXT 0x8590 +#define GL_OPERAND1_RGB_EXT 0x8591 +#define GL_OPERAND2_RGB_EXT 0x8592 +#define GL_OPERAND0_ALPHA_EXT 0x8598 +#define GL_OPERAND1_ALPHA_EXT 0x8599 +#define GL_OPERAND2_ALPHA_EXT 0x859A + +#define GLEW_EXT_texture_env_combine GLEW_GET_VAR(__GLEW_EXT_texture_env_combine) + +#endif /* GL_EXT_texture_env_combine */ + +/* ------------------------ GL_EXT_texture_env_dot3 ------------------------ */ + +#ifndef GL_EXT_texture_env_dot3 +#define GL_EXT_texture_env_dot3 1 + +#define GL_DOT3_RGB_EXT 0x8740 +#define GL_DOT3_RGBA_EXT 0x8741 + +#define GLEW_EXT_texture_env_dot3 GLEW_GET_VAR(__GLEW_EXT_texture_env_dot3) + +#endif /* GL_EXT_texture_env_dot3 */ + +/* ------------------- GL_EXT_texture_filter_anisotropic ------------------- */ + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 + +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF + +#define GLEW_EXT_texture_filter_anisotropic GLEW_GET_VAR(__GLEW_EXT_texture_filter_anisotropic) + +#endif /* GL_EXT_texture_filter_anisotropic */ + +/* ------------------------- GL_EXT_texture_integer ------------------------ */ + +#ifndef GL_EXT_texture_integer +#define GL_EXT_texture_integer 1 + +#define GL_RGBA32UI_EXT 0x8D70 +#define GL_RGB32UI_EXT 0x8D71 +#define GL_ALPHA32UI_EXT 0x8D72 +#define GL_INTENSITY32UI_EXT 0x8D73 +#define GL_LUMINANCE32UI_EXT 0x8D74 +#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 +#define GL_RGBA16UI_EXT 0x8D76 +#define GL_RGB16UI_EXT 0x8D77 +#define GL_ALPHA16UI_EXT 0x8D78 +#define GL_INTENSITY16UI_EXT 0x8D79 +#define GL_LUMINANCE16UI_EXT 0x8D7A +#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B +#define GL_RGBA8UI_EXT 0x8D7C +#define GL_RGB8UI_EXT 0x8D7D +#define GL_ALPHA8UI_EXT 0x8D7E +#define GL_INTENSITY8UI_EXT 0x8D7F +#define GL_LUMINANCE8UI_EXT 0x8D80 +#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 +#define GL_RGBA32I_EXT 0x8D82 +#define GL_RGB32I_EXT 0x8D83 +#define GL_ALPHA32I_EXT 0x8D84 +#define GL_INTENSITY32I_EXT 0x8D85 +#define GL_LUMINANCE32I_EXT 0x8D86 +#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 +#define GL_RGBA16I_EXT 0x8D88 +#define GL_RGB16I_EXT 0x8D89 +#define GL_ALPHA16I_EXT 0x8D8A +#define GL_INTENSITY16I_EXT 0x8D8B +#define GL_LUMINANCE16I_EXT 0x8D8C +#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D +#define GL_RGBA8I_EXT 0x8D8E +#define GL_RGB8I_EXT 0x8D8F +#define GL_ALPHA8I_EXT 0x8D90 +#define GL_INTENSITY8I_EXT 0x8D91 +#define GL_LUMINANCE8I_EXT 0x8D92 +#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 +#define GL_RED_INTEGER_EXT 0x8D94 +#define GL_GREEN_INTEGER_EXT 0x8D95 +#define GL_BLUE_INTEGER_EXT 0x8D96 +#define GL_ALPHA_INTEGER_EXT 0x8D97 +#define GL_RGB_INTEGER_EXT 0x8D98 +#define GL_RGBA_INTEGER_EXT 0x8D99 +#define GL_BGR_INTEGER_EXT 0x8D9A +#define GL_BGRA_INTEGER_EXT 0x8D9B +#define GL_LUMINANCE_INTEGER_EXT 0x8D9C +#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D +#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E + +typedef void (GLAPIENTRY * PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); +typedef void (GLAPIENTRY * PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); + +#define glClearColorIiEXT GLEW_GET_FUN(__glewClearColorIiEXT) +#define glClearColorIuiEXT GLEW_GET_FUN(__glewClearColorIuiEXT) +#define glGetTexParameterIivEXT GLEW_GET_FUN(__glewGetTexParameterIivEXT) +#define glGetTexParameterIuivEXT GLEW_GET_FUN(__glewGetTexParameterIuivEXT) +#define glTexParameterIivEXT GLEW_GET_FUN(__glewTexParameterIivEXT) +#define glTexParameterIuivEXT GLEW_GET_FUN(__glewTexParameterIuivEXT) + +#define GLEW_EXT_texture_integer GLEW_GET_VAR(__GLEW_EXT_texture_integer) + +#endif /* GL_EXT_texture_integer */ + +/* ------------------------ GL_EXT_texture_lod_bias ------------------------ */ + +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 + +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 + +#define GLEW_EXT_texture_lod_bias GLEW_GET_VAR(__GLEW_EXT_texture_lod_bias) + +#endif /* GL_EXT_texture_lod_bias */ + +/* ---------------------- GL_EXT_texture_mirror_clamp ---------------------- */ + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_EXT_texture_mirror_clamp 1 + +#define GL_MIRROR_CLAMP_EXT 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 +#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 + +#define GLEW_EXT_texture_mirror_clamp GLEW_GET_VAR(__GLEW_EXT_texture_mirror_clamp) + +#endif /* GL_EXT_texture_mirror_clamp */ + +/* ------------------------- GL_EXT_texture_object ------------------------- */ + +#ifndef GL_EXT_texture_object +#define GL_EXT_texture_object 1 + +#define GL_TEXTURE_PRIORITY_EXT 0x8066 +#define GL_TEXTURE_RESIDENT_EXT 0x8067 +#define GL_TEXTURE_1D_BINDING_EXT 0x8068 +#define GL_TEXTURE_2D_BINDING_EXT 0x8069 +#define GL_TEXTURE_3D_BINDING_EXT 0x806A + +typedef GLboolean (GLAPIENTRY * PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint* textures, GLboolean* residences); +typedef void (GLAPIENTRY * PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); +typedef void (GLAPIENTRY * PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint* textures); +typedef void (GLAPIENTRY * PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint* textures); +typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREEXTPROC) (GLuint texture); +typedef void (GLAPIENTRY * PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint* textures, const GLclampf* priorities); + +#define glAreTexturesResidentEXT GLEW_GET_FUN(__glewAreTexturesResidentEXT) +#define glBindTextureEXT GLEW_GET_FUN(__glewBindTextureEXT) +#define glDeleteTexturesEXT GLEW_GET_FUN(__glewDeleteTexturesEXT) +#define glGenTexturesEXT GLEW_GET_FUN(__glewGenTexturesEXT) +#define glIsTextureEXT GLEW_GET_FUN(__glewIsTextureEXT) +#define glPrioritizeTexturesEXT GLEW_GET_FUN(__glewPrioritizeTexturesEXT) + +#define GLEW_EXT_texture_object GLEW_GET_VAR(__GLEW_EXT_texture_object) + +#endif /* GL_EXT_texture_object */ + +/* --------------------- GL_EXT_texture_perturb_normal --------------------- */ + +#ifndef GL_EXT_texture_perturb_normal +#define GL_EXT_texture_perturb_normal 1 + +#define GL_PERTURB_EXT 0x85AE +#define GL_TEXTURE_NORMAL_EXT 0x85AF + +typedef void (GLAPIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode); + +#define glTextureNormalEXT GLEW_GET_FUN(__glewTextureNormalEXT) + +#define GLEW_EXT_texture_perturb_normal GLEW_GET_VAR(__GLEW_EXT_texture_perturb_normal) + +#endif /* GL_EXT_texture_perturb_normal */ + +/* ------------------------ GL_EXT_texture_rectangle ----------------------- */ + +#ifndef GL_EXT_texture_rectangle +#define GL_EXT_texture_rectangle 1 + +#define GL_TEXTURE_RECTANGLE_EXT 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_EXT 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_EXT 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT 0x84F8 + +#define GLEW_EXT_texture_rectangle GLEW_GET_VAR(__GLEW_EXT_texture_rectangle) + +#endif /* GL_EXT_texture_rectangle */ + +/* -------------------------- GL_EXT_texture_sRGB -------------------------- */ + +#ifndef GL_EXT_texture_sRGB +#define GL_EXT_texture_sRGB 1 + +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB8_EXT 0x8C41 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 +#define GL_SLUMINANCE_EXT 0x8C46 +#define GL_SLUMINANCE8_EXT 0x8C47 +#define GL_COMPRESSED_SRGB_EXT 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 +#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B +#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F + +#define GLEW_EXT_texture_sRGB GLEW_GET_VAR(__GLEW_EXT_texture_sRGB) + +#endif /* GL_EXT_texture_sRGB */ + +/* ----------------------- GL_EXT_texture_sRGB_decode ---------------------- */ + +#ifndef GL_EXT_texture_sRGB_decode +#define GL_EXT_texture_sRGB_decode 1 + +#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 +#define GL_DECODE_EXT 0x8A49 +#define GL_SKIP_DECODE_EXT 0x8A4A + +#define GLEW_EXT_texture_sRGB_decode GLEW_GET_VAR(__GLEW_EXT_texture_sRGB_decode) + +#endif /* GL_EXT_texture_sRGB_decode */ + +/* --------------------- GL_EXT_texture_shared_exponent -------------------- */ + +#ifndef GL_EXT_texture_shared_exponent +#define GL_EXT_texture_shared_exponent 1 + +#define GL_RGB9_E5_EXT 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E +#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F + +#define GLEW_EXT_texture_shared_exponent GLEW_GET_VAR(__GLEW_EXT_texture_shared_exponent) + +#endif /* GL_EXT_texture_shared_exponent */ + +/* -------------------------- GL_EXT_texture_snorm ------------------------- */ + +#ifndef GL_EXT_texture_snorm +#define GL_EXT_texture_snorm 1 + +#define GL_RED_SNORM 0x8F90 +#define GL_RG_SNORM 0x8F91 +#define GL_RGB_SNORM 0x8F92 +#define GL_RGBA_SNORM 0x8F93 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM 0x8F98 +#define GL_RG16_SNORM 0x8F99 +#define GL_RGB16_SNORM 0x8F9A +#define GL_RGBA16_SNORM 0x8F9B +#define GL_SIGNED_NORMALIZED 0x8F9C +#define GL_ALPHA_SNORM 0x9010 +#define GL_LUMINANCE_SNORM 0x9011 +#define GL_LUMINANCE_ALPHA_SNORM 0x9012 +#define GL_INTENSITY_SNORM 0x9013 +#define GL_ALPHA8_SNORM 0x9014 +#define GL_LUMINANCE8_SNORM 0x9015 +#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016 +#define GL_INTENSITY8_SNORM 0x9017 +#define GL_ALPHA16_SNORM 0x9018 +#define GL_LUMINANCE16_SNORM 0x9019 +#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A +#define GL_INTENSITY16_SNORM 0x901B + +#define GLEW_EXT_texture_snorm GLEW_GET_VAR(__GLEW_EXT_texture_snorm) + +#endif /* GL_EXT_texture_snorm */ + +/* ------------------------- GL_EXT_texture_swizzle ------------------------ */ + +#ifndef GL_EXT_texture_swizzle +#define GL_EXT_texture_swizzle 1 + +#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 +#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 +#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 +#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 + +#define GLEW_EXT_texture_swizzle GLEW_GET_VAR(__GLEW_EXT_texture_swizzle) + +#endif /* GL_EXT_texture_swizzle */ + +/* --------------------------- GL_EXT_timer_query -------------------------- */ + +#ifndef GL_EXT_timer_query +#define GL_EXT_timer_query 1 + +#define GL_TIME_ELAPSED_EXT 0x88BF + +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params); + +#define glGetQueryObjecti64vEXT GLEW_GET_FUN(__glewGetQueryObjecti64vEXT) +#define glGetQueryObjectui64vEXT GLEW_GET_FUN(__glewGetQueryObjectui64vEXT) + +#define GLEW_EXT_timer_query GLEW_GET_VAR(__GLEW_EXT_timer_query) + +#endif /* GL_EXT_timer_query */ + +/* ----------------------- GL_EXT_transform_feedback ----------------------- */ + +#ifndef GL_EXT_transform_feedback +#define GL_EXT_transform_feedback 1 + +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 +#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 +#define GL_RASTERIZER_DISCARD_EXT 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B +#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C +#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F + +typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar * const* varyings, GLenum bufferMode); + +#define glBeginTransformFeedbackEXT GLEW_GET_FUN(__glewBeginTransformFeedbackEXT) +#define glBindBufferBaseEXT GLEW_GET_FUN(__glewBindBufferBaseEXT) +#define glBindBufferOffsetEXT GLEW_GET_FUN(__glewBindBufferOffsetEXT) +#define glBindBufferRangeEXT GLEW_GET_FUN(__glewBindBufferRangeEXT) +#define glEndTransformFeedbackEXT GLEW_GET_FUN(__glewEndTransformFeedbackEXT) +#define glGetTransformFeedbackVaryingEXT GLEW_GET_FUN(__glewGetTransformFeedbackVaryingEXT) +#define glTransformFeedbackVaryingsEXT GLEW_GET_FUN(__glewTransformFeedbackVaryingsEXT) + +#define GLEW_EXT_transform_feedback GLEW_GET_VAR(__GLEW_EXT_transform_feedback) + +#endif /* GL_EXT_transform_feedback */ + +/* -------------------------- GL_EXT_vertex_array -------------------------- */ + +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 + +#define GL_DOUBLE_EXT 0x140A +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 + +typedef void (GLAPIENTRY * PFNGLARRAYELEMENTEXTPROC) (GLint i); +typedef void (GLAPIENTRY * PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean* pointer); +typedef void (GLAPIENTRY * PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); + +#define glArrayElementEXT GLEW_GET_FUN(__glewArrayElementEXT) +#define glColorPointerEXT GLEW_GET_FUN(__glewColorPointerEXT) +#define glDrawArraysEXT GLEW_GET_FUN(__glewDrawArraysEXT) +#define glEdgeFlagPointerEXT GLEW_GET_FUN(__glewEdgeFlagPointerEXT) +#define glIndexPointerEXT GLEW_GET_FUN(__glewIndexPointerEXT) +#define glNormalPointerEXT GLEW_GET_FUN(__glewNormalPointerEXT) +#define glTexCoordPointerEXT GLEW_GET_FUN(__glewTexCoordPointerEXT) +#define glVertexPointerEXT GLEW_GET_FUN(__glewVertexPointerEXT) + +#define GLEW_EXT_vertex_array GLEW_GET_VAR(__GLEW_EXT_vertex_array) + +#endif /* GL_EXT_vertex_array */ + +/* ------------------------ GL_EXT_vertex_array_bgra ----------------------- */ + +#ifndef GL_EXT_vertex_array_bgra +#define GL_EXT_vertex_array_bgra 1 + +#define GL_BGRA 0x80E1 + +#define GLEW_EXT_vertex_array_bgra GLEW_GET_VAR(__GLEW_EXT_vertex_array_bgra) + +#endif /* GL_EXT_vertex_array_bgra */ + +/* ----------------------- GL_EXT_vertex_attrib_64bit ---------------------- */ + +#ifndef GL_EXT_vertex_attrib_64bit +#define GL_EXT_vertex_attrib_64bit 1 + +#define GL_DOUBLE_MAT2_EXT 0x8F46 +#define GL_DOUBLE_MAT3_EXT 0x8F47 +#define GL_DOUBLE_MAT4_EXT 0x8F48 +#define GL_DOUBLE_MAT2x3_EXT 0x8F49 +#define GL_DOUBLE_MAT2x4_EXT 0x8F4A +#define GL_DOUBLE_MAT3x2_EXT 0x8F4B +#define GL_DOUBLE_MAT3x4_EXT 0x8F4C +#define GL_DOUBLE_MAT4x2_EXT 0x8F4D +#define GL_DOUBLE_MAT4x3_EXT 0x8F4E +#define GL_DOUBLE_VEC2_EXT 0x8FFC +#define GL_DOUBLE_VEC3_EXT 0x8FFD +#define GL_DOUBLE_VEC4_EXT 0x8FFE + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); + +#define glGetVertexAttribLdvEXT GLEW_GET_FUN(__glewGetVertexAttribLdvEXT) +#define glVertexArrayVertexAttribLOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribLOffsetEXT) +#define glVertexAttribL1dEXT GLEW_GET_FUN(__glewVertexAttribL1dEXT) +#define glVertexAttribL1dvEXT GLEW_GET_FUN(__glewVertexAttribL1dvEXT) +#define glVertexAttribL2dEXT GLEW_GET_FUN(__glewVertexAttribL2dEXT) +#define glVertexAttribL2dvEXT GLEW_GET_FUN(__glewVertexAttribL2dvEXT) +#define glVertexAttribL3dEXT GLEW_GET_FUN(__glewVertexAttribL3dEXT) +#define glVertexAttribL3dvEXT GLEW_GET_FUN(__glewVertexAttribL3dvEXT) +#define glVertexAttribL4dEXT GLEW_GET_FUN(__glewVertexAttribL4dEXT) +#define glVertexAttribL4dvEXT GLEW_GET_FUN(__glewVertexAttribL4dvEXT) +#define glVertexAttribLPointerEXT GLEW_GET_FUN(__glewVertexAttribLPointerEXT) + +#define GLEW_EXT_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_EXT_vertex_attrib_64bit) + +#endif /* GL_EXT_vertex_attrib_64bit */ + +/* -------------------------- GL_EXT_vertex_shader ------------------------- */ + +#ifndef GL_EXT_vertex_shader +#define GL_EXT_vertex_shader 1 + +#define GL_VERTEX_SHADER_EXT 0x8780 +#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 +#define GL_OP_INDEX_EXT 0x8782 +#define GL_OP_NEGATE_EXT 0x8783 +#define GL_OP_DOT3_EXT 0x8784 +#define GL_OP_DOT4_EXT 0x8785 +#define GL_OP_MUL_EXT 0x8786 +#define GL_OP_ADD_EXT 0x8787 +#define GL_OP_MADD_EXT 0x8788 +#define GL_OP_FRAC_EXT 0x8789 +#define GL_OP_MAX_EXT 0x878A +#define GL_OP_MIN_EXT 0x878B +#define GL_OP_SET_GE_EXT 0x878C +#define GL_OP_SET_LT_EXT 0x878D +#define GL_OP_CLAMP_EXT 0x878E +#define GL_OP_FLOOR_EXT 0x878F +#define GL_OP_ROUND_EXT 0x8790 +#define GL_OP_EXP_BASE_2_EXT 0x8791 +#define GL_OP_LOG_BASE_2_EXT 0x8792 +#define GL_OP_POWER_EXT 0x8793 +#define GL_OP_RECIP_EXT 0x8794 +#define GL_OP_RECIP_SQRT_EXT 0x8795 +#define GL_OP_SUB_EXT 0x8796 +#define GL_OP_CROSS_PRODUCT_EXT 0x8797 +#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 +#define GL_OP_MOV_EXT 0x8799 +#define GL_OUTPUT_VERTEX_EXT 0x879A +#define GL_OUTPUT_COLOR0_EXT 0x879B +#define GL_OUTPUT_COLOR1_EXT 0x879C +#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D +#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E +#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F +#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 +#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 +#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 +#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 +#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 +#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 +#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 +#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 +#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 +#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 +#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA +#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB +#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC +#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD +#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE +#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF +#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 +#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 +#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 +#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 +#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 +#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 +#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 +#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 +#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 +#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 +#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA +#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB +#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC +#define GL_OUTPUT_FOG_EXT 0x87BD +#define GL_SCALAR_EXT 0x87BE +#define GL_VECTOR_EXT 0x87BF +#define GL_MATRIX_EXT 0x87C0 +#define GL_VARIANT_EXT 0x87C1 +#define GL_INVARIANT_EXT 0x87C2 +#define GL_LOCAL_CONSTANT_EXT 0x87C3 +#define GL_LOCAL_EXT 0x87C4 +#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 +#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 +#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 +#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 +#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CC +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CD +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE +#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF +#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 +#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 +#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 +#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 +#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 +#define GL_X_EXT 0x87D5 +#define GL_Y_EXT 0x87D6 +#define GL_Z_EXT 0x87D7 +#define GL_W_EXT 0x87D8 +#define GL_NEGATIVE_X_EXT 0x87D9 +#define GL_NEGATIVE_Y_EXT 0x87DA +#define GL_NEGATIVE_Z_EXT 0x87DB +#define GL_NEGATIVE_W_EXT 0x87DC +#define GL_ZERO_EXT 0x87DD +#define GL_ONE_EXT 0x87DE +#define GL_NEGATIVE_ONE_EXT 0x87DF +#define GL_NORMALIZED_RANGE_EXT 0x87E0 +#define GL_FULL_RANGE_EXT 0x87E1 +#define GL_CURRENT_VERTEX_EXT 0x87E2 +#define GL_MVP_MATRIX_EXT 0x87E3 +#define GL_VARIANT_VALUE_EXT 0x87E4 +#define GL_VARIANT_DATATYPE_EXT 0x87E5 +#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 +#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 +#define GL_VARIANT_ARRAY_EXT 0x87E8 +#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 +#define GL_INVARIANT_VALUE_EXT 0x87EA +#define GL_INVARIANT_DATATYPE_EXT 0x87EB +#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC +#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED + +typedef void (GLAPIENTRY * PFNGLBEGINVERTEXSHADEREXTPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDPARAMETEREXTPROC) (GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); +typedef void (GLAPIENTRY * PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENDVERTEXSHADEREXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLuint (GLAPIENTRY * PFNGLGENSYMBOLSEXTPROC) (GLenum dataType, GLenum storageType, GLenum range, GLuint components); +typedef GLuint (GLAPIENTRY * PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid **data); +typedef void (GLAPIENTRY * PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLboolean (GLAPIENTRY * PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); +typedef void (GLAPIENTRY * PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, GLvoid *addr); +typedef void (GLAPIENTRY * PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, GLvoid *addr); +typedef void (GLAPIENTRY * PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); +typedef void (GLAPIENTRY * PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +typedef void (GLAPIENTRY * PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +typedef void (GLAPIENTRY * PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (GLAPIENTRY * PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, GLvoid *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTBVEXTPROC) (GLuint id, GLbyte *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTDVEXTPROC) (GLuint id, GLdouble *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTFVEXTPROC) (GLuint id, GLfloat *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTIVEXTPROC) (GLuint id, GLint *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTSVEXTPROC) (GLuint id, GLshort *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUBVEXTPROC) (GLuint id, GLubyte *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUIVEXTPROC) (GLuint id, GLuint *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUSVEXTPROC) (GLuint id, GLushort *addr); +typedef void (GLAPIENTRY * PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); + +#define glBeginVertexShaderEXT GLEW_GET_FUN(__glewBeginVertexShaderEXT) +#define glBindLightParameterEXT GLEW_GET_FUN(__glewBindLightParameterEXT) +#define glBindMaterialParameterEXT GLEW_GET_FUN(__glewBindMaterialParameterEXT) +#define glBindParameterEXT GLEW_GET_FUN(__glewBindParameterEXT) +#define glBindTexGenParameterEXT GLEW_GET_FUN(__glewBindTexGenParameterEXT) +#define glBindTextureUnitParameterEXT GLEW_GET_FUN(__glewBindTextureUnitParameterEXT) +#define glBindVertexShaderEXT GLEW_GET_FUN(__glewBindVertexShaderEXT) +#define glDeleteVertexShaderEXT GLEW_GET_FUN(__glewDeleteVertexShaderEXT) +#define glDisableVariantClientStateEXT GLEW_GET_FUN(__glewDisableVariantClientStateEXT) +#define glEnableVariantClientStateEXT GLEW_GET_FUN(__glewEnableVariantClientStateEXT) +#define glEndVertexShaderEXT GLEW_GET_FUN(__glewEndVertexShaderEXT) +#define glExtractComponentEXT GLEW_GET_FUN(__glewExtractComponentEXT) +#define glGenSymbolsEXT GLEW_GET_FUN(__glewGenSymbolsEXT) +#define glGenVertexShadersEXT GLEW_GET_FUN(__glewGenVertexShadersEXT) +#define glGetInvariantBooleanvEXT GLEW_GET_FUN(__glewGetInvariantBooleanvEXT) +#define glGetInvariantFloatvEXT GLEW_GET_FUN(__glewGetInvariantFloatvEXT) +#define glGetInvariantIntegervEXT GLEW_GET_FUN(__glewGetInvariantIntegervEXT) +#define glGetLocalConstantBooleanvEXT GLEW_GET_FUN(__glewGetLocalConstantBooleanvEXT) +#define glGetLocalConstantFloatvEXT GLEW_GET_FUN(__glewGetLocalConstantFloatvEXT) +#define glGetLocalConstantIntegervEXT GLEW_GET_FUN(__glewGetLocalConstantIntegervEXT) +#define glGetVariantBooleanvEXT GLEW_GET_FUN(__glewGetVariantBooleanvEXT) +#define glGetVariantFloatvEXT GLEW_GET_FUN(__glewGetVariantFloatvEXT) +#define glGetVariantIntegervEXT GLEW_GET_FUN(__glewGetVariantIntegervEXT) +#define glGetVariantPointervEXT GLEW_GET_FUN(__glewGetVariantPointervEXT) +#define glInsertComponentEXT GLEW_GET_FUN(__glewInsertComponentEXT) +#define glIsVariantEnabledEXT GLEW_GET_FUN(__glewIsVariantEnabledEXT) +#define glSetInvariantEXT GLEW_GET_FUN(__glewSetInvariantEXT) +#define glSetLocalConstantEXT GLEW_GET_FUN(__glewSetLocalConstantEXT) +#define glShaderOp1EXT GLEW_GET_FUN(__glewShaderOp1EXT) +#define glShaderOp2EXT GLEW_GET_FUN(__glewShaderOp2EXT) +#define glShaderOp3EXT GLEW_GET_FUN(__glewShaderOp3EXT) +#define glSwizzleEXT GLEW_GET_FUN(__glewSwizzleEXT) +#define glVariantPointerEXT GLEW_GET_FUN(__glewVariantPointerEXT) +#define glVariantbvEXT GLEW_GET_FUN(__glewVariantbvEXT) +#define glVariantdvEXT GLEW_GET_FUN(__glewVariantdvEXT) +#define glVariantfvEXT GLEW_GET_FUN(__glewVariantfvEXT) +#define glVariantivEXT GLEW_GET_FUN(__glewVariantivEXT) +#define glVariantsvEXT GLEW_GET_FUN(__glewVariantsvEXT) +#define glVariantubvEXT GLEW_GET_FUN(__glewVariantubvEXT) +#define glVariantuivEXT GLEW_GET_FUN(__glewVariantuivEXT) +#define glVariantusvEXT GLEW_GET_FUN(__glewVariantusvEXT) +#define glWriteMaskEXT GLEW_GET_FUN(__glewWriteMaskEXT) + +#define GLEW_EXT_vertex_shader GLEW_GET_VAR(__GLEW_EXT_vertex_shader) + +#endif /* GL_EXT_vertex_shader */ + +/* ------------------------ GL_EXT_vertex_weighting ------------------------ */ + +#ifndef GL_EXT_vertex_weighting +#define GL_EXT_vertex_weighting 1 + +#define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3 +#define GL_MODELVIEW0_MATRIX_EXT 0x0BA6 +#define GL_MODELVIEW0_EXT 0x1700 +#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 +#define GL_MODELVIEW1_MATRIX_EXT 0x8506 +#define GL_VERTEX_WEIGHTING_EXT 0x8509 +#define GL_MODELVIEW1_EXT 0x850A +#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B +#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C +#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D +#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E +#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F +#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 + +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (GLfloat* weight); + +#define glVertexWeightPointerEXT GLEW_GET_FUN(__glewVertexWeightPointerEXT) +#define glVertexWeightfEXT GLEW_GET_FUN(__glewVertexWeightfEXT) +#define glVertexWeightfvEXT GLEW_GET_FUN(__glewVertexWeightfvEXT) + +#define GLEW_EXT_vertex_weighting GLEW_GET_VAR(__GLEW_EXT_vertex_weighting) + +#endif /* GL_EXT_vertex_weighting */ + +/* ------------------------- GL_EXT_x11_sync_object ------------------------ */ + +#ifndef GL_EXT_x11_sync_object +#define GL_EXT_x11_sync_object 1 + +#define GL_SYNC_X11_FENCE_EXT 0x90E1 + +typedef GLsync (GLAPIENTRY * PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); + +#define glImportSyncEXT GLEW_GET_FUN(__glewImportSyncEXT) + +#define GLEW_EXT_x11_sync_object GLEW_GET_VAR(__GLEW_EXT_x11_sync_object) + +#endif /* GL_EXT_x11_sync_object */ + +/* ---------------------- GL_GREMEDY_frame_terminator ---------------------- */ + +#ifndef GL_GREMEDY_frame_terminator +#define GL_GREMEDY_frame_terminator 1 + +typedef void (GLAPIENTRY * PFNGLFRAMETERMINATORGREMEDYPROC) (void); + +#define glFrameTerminatorGREMEDY GLEW_GET_FUN(__glewFrameTerminatorGREMEDY) + +#define GLEW_GREMEDY_frame_terminator GLEW_GET_VAR(__GLEW_GREMEDY_frame_terminator) + +#endif /* GL_GREMEDY_frame_terminator */ + +/* ------------------------ GL_GREMEDY_string_marker ----------------------- */ + +#ifndef GL_GREMEDY_string_marker +#define GL_GREMEDY_string_marker 1 + +typedef void (GLAPIENTRY * PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string); + +#define glStringMarkerGREMEDY GLEW_GET_FUN(__glewStringMarkerGREMEDY) + +#define GLEW_GREMEDY_string_marker GLEW_GET_VAR(__GLEW_GREMEDY_string_marker) + +#endif /* GL_GREMEDY_string_marker */ + +/* --------------------- GL_HP_convolution_border_modes -------------------- */ + +#ifndef GL_HP_convolution_border_modes +#define GL_HP_convolution_border_modes 1 + +#define GLEW_HP_convolution_border_modes GLEW_GET_VAR(__GLEW_HP_convolution_border_modes) + +#endif /* GL_HP_convolution_border_modes */ + +/* ------------------------- GL_HP_image_transform ------------------------- */ + +#ifndef GL_HP_image_transform +#define GL_HP_image_transform 1 + +typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glGetImageTransformParameterfvHP GLEW_GET_FUN(__glewGetImageTransformParameterfvHP) +#define glGetImageTransformParameterivHP GLEW_GET_FUN(__glewGetImageTransformParameterivHP) +#define glImageTransformParameterfHP GLEW_GET_FUN(__glewImageTransformParameterfHP) +#define glImageTransformParameterfvHP GLEW_GET_FUN(__glewImageTransformParameterfvHP) +#define glImageTransformParameteriHP GLEW_GET_FUN(__glewImageTransformParameteriHP) +#define glImageTransformParameterivHP GLEW_GET_FUN(__glewImageTransformParameterivHP) + +#define GLEW_HP_image_transform GLEW_GET_VAR(__GLEW_HP_image_transform) + +#endif /* GL_HP_image_transform */ + +/* -------------------------- GL_HP_occlusion_test ------------------------- */ + +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 + +#define GLEW_HP_occlusion_test GLEW_GET_VAR(__GLEW_HP_occlusion_test) + +#endif /* GL_HP_occlusion_test */ + +/* ------------------------- GL_HP_texture_lighting ------------------------ */ + +#ifndef GL_HP_texture_lighting +#define GL_HP_texture_lighting 1 + +#define GLEW_HP_texture_lighting GLEW_GET_VAR(__GLEW_HP_texture_lighting) + +#endif /* GL_HP_texture_lighting */ + +/* --------------------------- GL_IBM_cull_vertex -------------------------- */ + +#ifndef GL_IBM_cull_vertex +#define GL_IBM_cull_vertex 1 + +#define GL_CULL_VERTEX_IBM 103050 + +#define GLEW_IBM_cull_vertex GLEW_GET_VAR(__GLEW_IBM_cull_vertex) + +#endif /* GL_IBM_cull_vertex */ + +/* ---------------------- GL_IBM_multimode_draw_arrays --------------------- */ + +#ifndef GL_IBM_multimode_draw_arrays +#define GL_IBM_multimode_draw_arrays 1 + +typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum* mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum* mode, const GLsizei *count, GLenum type, const GLvoid * const *indices, GLsizei primcount, GLint modestride); + +#define glMultiModeDrawArraysIBM GLEW_GET_FUN(__glewMultiModeDrawArraysIBM) +#define glMultiModeDrawElementsIBM GLEW_GET_FUN(__glewMultiModeDrawElementsIBM) + +#define GLEW_IBM_multimode_draw_arrays GLEW_GET_VAR(__GLEW_IBM_multimode_draw_arrays) + +#endif /* GL_IBM_multimode_draw_arrays */ + +/* ------------------------- GL_IBM_rasterpos_clip ------------------------- */ + +#ifndef GL_IBM_rasterpos_clip +#define GL_IBM_rasterpos_clip 1 + +#define GL_RASTER_POSITION_UNCLIPPED_IBM 103010 + +#define GLEW_IBM_rasterpos_clip GLEW_GET_VAR(__GLEW_IBM_rasterpos_clip) + +#endif /* GL_IBM_rasterpos_clip */ + +/* --------------------------- GL_IBM_static_data -------------------------- */ + +#ifndef GL_IBM_static_data +#define GL_IBM_static_data 1 + +#define GL_ALL_STATIC_DATA_IBM 103060 +#define GL_STATIC_VERTEX_ARRAY_IBM 103061 + +#define GLEW_IBM_static_data GLEW_GET_VAR(__GLEW_IBM_static_data) + +#endif /* GL_IBM_static_data */ + +/* --------------------- GL_IBM_texture_mirrored_repeat -------------------- */ + +#ifndef GL_IBM_texture_mirrored_repeat +#define GL_IBM_texture_mirrored_repeat 1 + +#define GL_MIRRORED_REPEAT_IBM 0x8370 + +#define GLEW_IBM_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_IBM_texture_mirrored_repeat) + +#endif /* GL_IBM_texture_mirrored_repeat */ + +/* ----------------------- GL_IBM_vertex_array_lists ----------------------- */ + +#ifndef GL_IBM_vertex_array_lists +#define GL_IBM_vertex_array_lists 1 + +#define GL_VERTEX_ARRAY_LIST_IBM 103070 +#define GL_NORMAL_ARRAY_LIST_IBM 103071 +#define GL_COLOR_ARRAY_LIST_IBM 103072 +#define GL_INDEX_ARRAY_LIST_IBM 103073 +#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 +#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 +#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 +#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 +#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 +#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 +#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 +#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 +#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 +#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 +#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 +#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 + +typedef void (GLAPIENTRY * PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); + +#define glColorPointerListIBM GLEW_GET_FUN(__glewColorPointerListIBM) +#define glEdgeFlagPointerListIBM GLEW_GET_FUN(__glewEdgeFlagPointerListIBM) +#define glFogCoordPointerListIBM GLEW_GET_FUN(__glewFogCoordPointerListIBM) +#define glIndexPointerListIBM GLEW_GET_FUN(__glewIndexPointerListIBM) +#define glNormalPointerListIBM GLEW_GET_FUN(__glewNormalPointerListIBM) +#define glSecondaryColorPointerListIBM GLEW_GET_FUN(__glewSecondaryColorPointerListIBM) +#define glTexCoordPointerListIBM GLEW_GET_FUN(__glewTexCoordPointerListIBM) +#define glVertexPointerListIBM GLEW_GET_FUN(__glewVertexPointerListIBM) + +#define GLEW_IBM_vertex_array_lists GLEW_GET_VAR(__GLEW_IBM_vertex_array_lists) + +#endif /* GL_IBM_vertex_array_lists */ + +/* -------------------------- GL_INGR_color_clamp -------------------------- */ + +#ifndef GL_INGR_color_clamp +#define GL_INGR_color_clamp 1 + +#define GL_RED_MIN_CLAMP_INGR 0x8560 +#define GL_GREEN_MIN_CLAMP_INGR 0x8561 +#define GL_BLUE_MIN_CLAMP_INGR 0x8562 +#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 +#define GL_RED_MAX_CLAMP_INGR 0x8564 +#define GL_GREEN_MAX_CLAMP_INGR 0x8565 +#define GL_BLUE_MAX_CLAMP_INGR 0x8566 +#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 + +#define GLEW_INGR_color_clamp GLEW_GET_VAR(__GLEW_INGR_color_clamp) + +#endif /* GL_INGR_color_clamp */ + +/* ------------------------- GL_INGR_interlace_read ------------------------ */ + +#ifndef GL_INGR_interlace_read +#define GL_INGR_interlace_read 1 + +#define GL_INTERLACE_READ_INGR 0x8568 + +#define GLEW_INGR_interlace_read GLEW_GET_VAR(__GLEW_INGR_interlace_read) + +#endif /* GL_INGR_interlace_read */ + +/* -------------------------- GL_INTEL_map_texture ------------------------- */ + +#ifndef GL_INTEL_map_texture +#define GL_INTEL_map_texture 1 + +#define GL_LAYOUT_DEFAULT_INTEL 0 +#define GL_LAYOUT_LINEAR_INTEL 1 +#define GL_LAYOUT_LINEAR_CPU_CACHED_INTEL 2 +#define GL_TEXTURE_MEMORY_LAYOUT_INTEL 0x83FF + +typedef GLvoid * (GLAPIENTRY * PFNGLMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level, GLbitfield access, GLint* stride, GLenum *layout); +typedef void (GLAPIENTRY * PFNGLSYNCTEXTUREINTELPROC) (GLuint texture); +typedef void (GLAPIENTRY * PFNGLUNMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level); + +#define glMapTexture2DINTEL GLEW_GET_FUN(__glewMapTexture2DINTEL) +#define glSyncTextureINTEL GLEW_GET_FUN(__glewSyncTextureINTEL) +#define glUnmapTexture2DINTEL GLEW_GET_FUN(__glewUnmapTexture2DINTEL) + +#define GLEW_INTEL_map_texture GLEW_GET_VAR(__GLEW_INTEL_map_texture) + +#endif /* GL_INTEL_map_texture */ + +/* ------------------------ GL_INTEL_parallel_arrays ----------------------- */ + +#ifndef GL_INTEL_parallel_arrays +#define GL_INTEL_parallel_arrays 1 + +#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 +#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 +#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 +#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 +#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 + +typedef void (GLAPIENTRY * PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); + +#define glColorPointervINTEL GLEW_GET_FUN(__glewColorPointervINTEL) +#define glNormalPointervINTEL GLEW_GET_FUN(__glewNormalPointervINTEL) +#define glTexCoordPointervINTEL GLEW_GET_FUN(__glewTexCoordPointervINTEL) +#define glVertexPointervINTEL GLEW_GET_FUN(__glewVertexPointervINTEL) + +#define GLEW_INTEL_parallel_arrays GLEW_GET_VAR(__GLEW_INTEL_parallel_arrays) + +#endif /* GL_INTEL_parallel_arrays */ + +/* ------------------------ GL_INTEL_texture_scissor ----------------------- */ + +#ifndef GL_INTEL_texture_scissor +#define GL_INTEL_texture_scissor 1 + +typedef void (GLAPIENTRY * PFNGLTEXSCISSORFUNCINTELPROC) (GLenum target, GLenum lfunc, GLenum hfunc); +typedef void (GLAPIENTRY * PFNGLTEXSCISSORINTELPROC) (GLenum target, GLclampf tlow, GLclampf thigh); + +#define glTexScissorFuncINTEL GLEW_GET_FUN(__glewTexScissorFuncINTEL) +#define glTexScissorINTEL GLEW_GET_FUN(__glewTexScissorINTEL) + +#define GLEW_INTEL_texture_scissor GLEW_GET_VAR(__GLEW_INTEL_texture_scissor) + +#endif /* GL_INTEL_texture_scissor */ + +/* ------------------------------ GL_KHR_debug ----------------------------- */ + +#ifndef GL_KHR_debug +#define GL_KHR_debug 1 + +#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245 +#define GL_DEBUG_SOURCE_API 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION 0x824A +#define GL_DEBUG_SOURCE_OTHER 0x824B +#define GL_DEBUG_TYPE_ERROR 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E +#define GL_DEBUG_TYPE_PORTABILITY 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE 0x8250 +#define GL_DEBUG_TYPE_OTHER 0x8251 +#define GL_DEBUG_TYPE_MARKER 0x8268 +#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269 +#define GL_DEBUG_TYPE_POP_GROUP 0x826A +#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B +#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C +#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D +#define GL_BUFFER 0x82E0 +#define GL_SHADER 0x82E1 +#define GL_PROGRAM 0x82E2 +#define GL_QUERY 0x82E3 +#define GL_PROGRAM_PIPELINE 0x82E4 +#define GL_SAMPLER 0x82E6 +#define GL_DISPLAY_LIST 0x82E7 +#define GL_MAX_LABEL_LENGTH 0x82E8 +#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES 0x9145 +#define GL_DEBUG_SEVERITY_HIGH 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM 0x9147 +#define GL_DEBUG_SEVERITY_LOW 0x9148 +#define GL_DEBUG_OUTPUT 0x92E0 + +typedef void (APIENTRY *GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const GLvoid *userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufsize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); +typedef void (GLAPIENTRY * PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar *label); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPTRLABELPROC) (void* ptr, GLsizei bufSize, GLsizei* length, GLchar *label); +typedef void (GLAPIENTRY * PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar* label); +typedef void (GLAPIENTRY * PFNGLOBJECTPTRLABELPROC) (void* ptr, GLsizei length, const GLchar* label); +typedef void (GLAPIENTRY * PFNGLPOPDEBUGGROUPPROC) (void); +typedef void (GLAPIENTRY * PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar * message); + +#define glDebugMessageCallback GLEW_GET_FUN(__glewDebugMessageCallback) +#define glDebugMessageControl GLEW_GET_FUN(__glewDebugMessageControl) +#define glDebugMessageInsert GLEW_GET_FUN(__glewDebugMessageInsert) +#define glGetDebugMessageLog GLEW_GET_FUN(__glewGetDebugMessageLog) +#define glGetObjectLabel GLEW_GET_FUN(__glewGetObjectLabel) +#define glGetObjectPtrLabel GLEW_GET_FUN(__glewGetObjectPtrLabel) +#define glObjectLabel GLEW_GET_FUN(__glewObjectLabel) +#define glObjectPtrLabel GLEW_GET_FUN(__glewObjectPtrLabel) +#define glPopDebugGroup GLEW_GET_FUN(__glewPopDebugGroup) +#define glPushDebugGroup GLEW_GET_FUN(__glewPushDebugGroup) + +#define GLEW_KHR_debug GLEW_GET_VAR(__GLEW_KHR_debug) + +#endif /* GL_KHR_debug */ + +/* ------------------ GL_KHR_texture_compression_astc_ldr ------------------ */ + +#ifndef GL_KHR_texture_compression_astc_ldr +#define GL_KHR_texture_compression_astc_ldr 1 + +#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 +#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 +#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 +#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 +#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 +#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 +#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 +#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 +#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 +#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 +#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA +#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB +#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC +#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC +#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD + +#define GLEW_KHR_texture_compression_astc_ldr GLEW_GET_VAR(__GLEW_KHR_texture_compression_astc_ldr) + +#endif /* GL_KHR_texture_compression_astc_ldr */ + +/* -------------------------- GL_KTX_buffer_region ------------------------- */ + +#ifndef GL_KTX_buffer_region +#define GL_KTX_buffer_region 1 + +#define GL_KTX_FRONT_REGION 0x0 +#define GL_KTX_BACK_REGION 0x1 +#define GL_KTX_Z_REGION 0x2 +#define GL_KTX_STENCIL_REGION 0x3 + +typedef GLuint (GLAPIENTRY * PFNGLBUFFERREGIONENABLEDPROC) (void); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERREGIONPROC) (GLenum region); +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height, GLint xDest, GLint yDest); +typedef GLuint (GLAPIENTRY * PFNGLNEWBUFFERREGIONPROC) (GLenum region); +typedef void (GLAPIENTRY * PFNGLREADBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height); + +#define glBufferRegionEnabled GLEW_GET_FUN(__glewBufferRegionEnabled) +#define glDeleteBufferRegion GLEW_GET_FUN(__glewDeleteBufferRegion) +#define glDrawBufferRegion GLEW_GET_FUN(__glewDrawBufferRegion) +#define glNewBufferRegion GLEW_GET_FUN(__glewNewBufferRegion) +#define glReadBufferRegion GLEW_GET_FUN(__glewReadBufferRegion) + +#define GLEW_KTX_buffer_region GLEW_GET_VAR(__GLEW_KTX_buffer_region) + +#endif /* GL_KTX_buffer_region */ + +/* ------------------------- GL_MESAX_texture_stack ------------------------ */ + +#ifndef GL_MESAX_texture_stack +#define GL_MESAX_texture_stack 1 + +#define GL_TEXTURE_1D_STACK_MESAX 0x8759 +#define GL_TEXTURE_2D_STACK_MESAX 0x875A +#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B +#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C +#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D +#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E + +#define GLEW_MESAX_texture_stack GLEW_GET_VAR(__GLEW_MESAX_texture_stack) + +#endif /* GL_MESAX_texture_stack */ + +/* -------------------------- GL_MESA_pack_invert -------------------------- */ + +#ifndef GL_MESA_pack_invert +#define GL_MESA_pack_invert 1 + +#define GL_PACK_INVERT_MESA 0x8758 + +#define GLEW_MESA_pack_invert GLEW_GET_VAR(__GLEW_MESA_pack_invert) + +#endif /* GL_MESA_pack_invert */ + +/* ------------------------- GL_MESA_resize_buffers ------------------------ */ + +#ifndef GL_MESA_resize_buffers +#define GL_MESA_resize_buffers 1 + +typedef void (GLAPIENTRY * PFNGLRESIZEBUFFERSMESAPROC) (void); + +#define glResizeBuffersMESA GLEW_GET_FUN(__glewResizeBuffersMESA) + +#define GLEW_MESA_resize_buffers GLEW_GET_VAR(__GLEW_MESA_resize_buffers) + +#endif /* GL_MESA_resize_buffers */ + +/* --------------------------- GL_MESA_window_pos -------------------------- */ + +#ifndef GL_MESA_window_pos +#define GL_MESA_window_pos 1 + +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVMESAPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVMESAPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort* p); + +#define glWindowPos2dMESA GLEW_GET_FUN(__glewWindowPos2dMESA) +#define glWindowPos2dvMESA GLEW_GET_FUN(__glewWindowPos2dvMESA) +#define glWindowPos2fMESA GLEW_GET_FUN(__glewWindowPos2fMESA) +#define glWindowPos2fvMESA GLEW_GET_FUN(__glewWindowPos2fvMESA) +#define glWindowPos2iMESA GLEW_GET_FUN(__glewWindowPos2iMESA) +#define glWindowPos2ivMESA GLEW_GET_FUN(__glewWindowPos2ivMESA) +#define glWindowPos2sMESA GLEW_GET_FUN(__glewWindowPos2sMESA) +#define glWindowPos2svMESA GLEW_GET_FUN(__glewWindowPos2svMESA) +#define glWindowPos3dMESA GLEW_GET_FUN(__glewWindowPos3dMESA) +#define glWindowPos3dvMESA GLEW_GET_FUN(__glewWindowPos3dvMESA) +#define glWindowPos3fMESA GLEW_GET_FUN(__glewWindowPos3fMESA) +#define glWindowPos3fvMESA GLEW_GET_FUN(__glewWindowPos3fvMESA) +#define glWindowPos3iMESA GLEW_GET_FUN(__glewWindowPos3iMESA) +#define glWindowPos3ivMESA GLEW_GET_FUN(__glewWindowPos3ivMESA) +#define glWindowPos3sMESA GLEW_GET_FUN(__glewWindowPos3sMESA) +#define glWindowPos3svMESA GLEW_GET_FUN(__glewWindowPos3svMESA) +#define glWindowPos4dMESA GLEW_GET_FUN(__glewWindowPos4dMESA) +#define glWindowPos4dvMESA GLEW_GET_FUN(__glewWindowPos4dvMESA) +#define glWindowPos4fMESA GLEW_GET_FUN(__glewWindowPos4fMESA) +#define glWindowPos4fvMESA GLEW_GET_FUN(__glewWindowPos4fvMESA) +#define glWindowPos4iMESA GLEW_GET_FUN(__glewWindowPos4iMESA) +#define glWindowPos4ivMESA GLEW_GET_FUN(__glewWindowPos4ivMESA) +#define glWindowPos4sMESA GLEW_GET_FUN(__glewWindowPos4sMESA) +#define glWindowPos4svMESA GLEW_GET_FUN(__glewWindowPos4svMESA) + +#define GLEW_MESA_window_pos GLEW_GET_VAR(__GLEW_MESA_window_pos) + +#endif /* GL_MESA_window_pos */ + +/* ------------------------- GL_MESA_ycbcr_texture ------------------------- */ + +#ifndef GL_MESA_ycbcr_texture +#define GL_MESA_ycbcr_texture 1 + +#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB +#define GL_YCBCR_MESA 0x8757 + +#define GLEW_MESA_ycbcr_texture GLEW_GET_VAR(__GLEW_MESA_ycbcr_texture) + +#endif /* GL_MESA_ycbcr_texture */ + +/* ----------------------- GL_NVX_conditional_render ----------------------- */ + +#ifndef GL_NVX_conditional_render +#define GL_NVX_conditional_render 1 + +typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERNVXPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVXPROC) (void); + +#define glBeginConditionalRenderNVX GLEW_GET_FUN(__glewBeginConditionalRenderNVX) +#define glEndConditionalRenderNVX GLEW_GET_FUN(__glewEndConditionalRenderNVX) + +#define GLEW_NVX_conditional_render GLEW_GET_VAR(__GLEW_NVX_conditional_render) + +#endif /* GL_NVX_conditional_render */ + +/* ------------------------- GL_NVX_gpu_memory_info ------------------------ */ + +#ifndef GL_NVX_gpu_memory_info +#define GL_NVX_gpu_memory_info 1 + +#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 +#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 +#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 +#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A +#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B + +#define GLEW_NVX_gpu_memory_info GLEW_GET_VAR(__GLEW_NVX_gpu_memory_info) + +#endif /* GL_NVX_gpu_memory_info */ + +/* ------------------- GL_NV_bindless_multi_draw_indirect ------------------ */ + +#ifndef GL_NV_bindless_multi_draw_indirect +#define GL_NV_bindless_multi_draw_indirect 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC) (GLenum mode, const GLvoid *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); + +#define glMultiDrawArraysIndirectBindlessNV GLEW_GET_FUN(__glewMultiDrawArraysIndirectBindlessNV) +#define glMultiDrawElementsIndirectBindlessNV GLEW_GET_FUN(__glewMultiDrawElementsIndirectBindlessNV) + +#define GLEW_NV_bindless_multi_draw_indirect GLEW_GET_VAR(__GLEW_NV_bindless_multi_draw_indirect) + +#endif /* GL_NV_bindless_multi_draw_indirect */ + +/* ------------------------- GL_NV_bindless_texture ------------------------ */ + +#ifndef GL_NV_bindless_texture +#define GL_NV_bindless_texture 1 + +typedef GLuint64 (GLAPIENTRY * PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture); +typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler); +typedef GLboolean (GLAPIENTRY * PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* values); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value); +typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64* value); + +#define glGetImageHandleNV GLEW_GET_FUN(__glewGetImageHandleNV) +#define glGetTextureHandleNV GLEW_GET_FUN(__glewGetTextureHandleNV) +#define glGetTextureSamplerHandleNV GLEW_GET_FUN(__glewGetTextureSamplerHandleNV) +#define glIsImageHandleResidentNV GLEW_GET_FUN(__glewIsImageHandleResidentNV) +#define glIsTextureHandleResidentNV GLEW_GET_FUN(__glewIsTextureHandleResidentNV) +#define glMakeImageHandleNonResidentNV GLEW_GET_FUN(__glewMakeImageHandleNonResidentNV) +#define glMakeImageHandleResidentNV GLEW_GET_FUN(__glewMakeImageHandleResidentNV) +#define glMakeTextureHandleNonResidentNV GLEW_GET_FUN(__glewMakeTextureHandleNonResidentNV) +#define glMakeTextureHandleResidentNV GLEW_GET_FUN(__glewMakeTextureHandleResidentNV) +#define glProgramUniformHandleui64NV GLEW_GET_FUN(__glewProgramUniformHandleui64NV) +#define glProgramUniformHandleui64vNV GLEW_GET_FUN(__glewProgramUniformHandleui64vNV) +#define glUniformHandleui64NV GLEW_GET_FUN(__glewUniformHandleui64NV) +#define glUniformHandleui64vNV GLEW_GET_FUN(__glewUniformHandleui64vNV) + +#define GLEW_NV_bindless_texture GLEW_GET_VAR(__GLEW_NV_bindless_texture) + +#endif /* GL_NV_bindless_texture */ + +/* --------------------- GL_NV_blend_equation_advanced --------------------- */ + +#ifndef GL_NV_blend_equation_advanced +#define GL_NV_blend_equation_advanced 1 + +#define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280 +#define GL_BLEND_OVERLAP_NV 0x9281 +#define GL_UNCORRELATED_NV 0x9282 +#define GL_DISJOINT_NV 0x9283 +#define GL_CONJOINT_NV 0x9284 +#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285 +#define GL_SRC_NV 0x9286 +#define GL_DST_NV 0x9287 +#define GL_SRC_OVER_NV 0x9288 +#define GL_DST_OVER_NV 0x9289 +#define GL_SRC_IN_NV 0x928A +#define GL_DST_IN_NV 0x928B +#define GL_SRC_OUT_NV 0x928C +#define GL_DST_OUT_NV 0x928D +#define GL_SRC_ATOP_NV 0x928E +#define GL_DST_ATOP_NV 0x928F +#define GL_PLUS_NV 0x9291 +#define GL_PLUS_DARKER_NV 0x9292 +#define GL_MULTIPLY_NV 0x9294 +#define GL_SCREEN_NV 0x9295 +#define GL_OVERLAY_NV 0x9296 +#define GL_DARKEN_NV 0x9297 +#define GL_LIGHTEN_NV 0x9298 +#define GL_COLORDODGE_NV 0x9299 +#define GL_COLORBURN_NV 0x929A +#define GL_HARDLIGHT_NV 0x929B +#define GL_SOFTLIGHT_NV 0x929C +#define GL_DIFFERENCE_NV 0x929E +#define GL_MINUS_NV 0x929F +#define GL_EXCLUSION_NV 0x92A0 +#define GL_CONTRAST_NV 0x92A1 +#define GL_INVERT_RGB_NV 0x92A3 +#define GL_LINEARDODGE_NV 0x92A4 +#define GL_LINEARBURN_NV 0x92A5 +#define GL_VIVIDLIGHT_NV 0x92A6 +#define GL_LINEARLIGHT_NV 0x92A7 +#define GL_PINLIGHT_NV 0x92A8 +#define GL_HARDMIX_NV 0x92A9 +#define GL_HSL_HUE_NV 0x92AD +#define GL_HSL_SATURATION_NV 0x92AE +#define GL_HSL_COLOR_NV 0x92AF +#define GL_HSL_LUMINOSITY_NV 0x92B0 +#define GL_PLUS_CLAMPED_NV 0x92B1 +#define GL_PLUS_CLAMPED_ALPHA_NV 0x92B2 +#define GL_MINUS_CLAMPED_NV 0x92B3 +#define GL_INVERT_OVG_NV 0x92B4 + +typedef void (GLAPIENTRY * PFNGLBLENDBARRIERNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value); + +#define glBlendBarrierNV GLEW_GET_FUN(__glewBlendBarrierNV) +#define glBlendParameteriNV GLEW_GET_FUN(__glewBlendParameteriNV) + +#define GLEW_NV_blend_equation_advanced GLEW_GET_VAR(__GLEW_NV_blend_equation_advanced) + +#endif /* GL_NV_blend_equation_advanced */ + +/* ----------------- GL_NV_blend_equation_advanced_coherent ---------------- */ + +#ifndef GL_NV_blend_equation_advanced_coherent +#define GL_NV_blend_equation_advanced_coherent 1 + +#define GLEW_NV_blend_equation_advanced_coherent GLEW_GET_VAR(__GLEW_NV_blend_equation_advanced_coherent) + +#endif /* GL_NV_blend_equation_advanced_coherent */ + +/* --------------------------- GL_NV_blend_square -------------------------- */ + +#ifndef GL_NV_blend_square +#define GL_NV_blend_square 1 + +#define GLEW_NV_blend_square GLEW_GET_VAR(__GLEW_NV_blend_square) + +#endif /* GL_NV_blend_square */ + +/* ------------------------- GL_NV_compute_program5 ------------------------ */ + +#ifndef GL_NV_compute_program5 +#define GL_NV_compute_program5 1 + +#define GL_COMPUTE_PROGRAM_NV 0x90FB +#define GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV 0x90FC + +#define GLEW_NV_compute_program5 GLEW_GET_VAR(__GLEW_NV_compute_program5) + +#endif /* GL_NV_compute_program5 */ + +/* ------------------------ GL_NV_conditional_render ----------------------- */ + +#ifndef GL_NV_conditional_render +#define GL_NV_conditional_render 1 + +#define GL_QUERY_WAIT_NV 0x8E13 +#define GL_QUERY_NO_WAIT_NV 0x8E14 +#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 + +typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); +typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVPROC) (void); + +#define glBeginConditionalRenderNV GLEW_GET_FUN(__glewBeginConditionalRenderNV) +#define glEndConditionalRenderNV GLEW_GET_FUN(__glewEndConditionalRenderNV) + +#define GLEW_NV_conditional_render GLEW_GET_VAR(__GLEW_NV_conditional_render) + +#endif /* GL_NV_conditional_render */ + +/* ----------------------- GL_NV_copy_depth_to_color ----------------------- */ + +#ifndef GL_NV_copy_depth_to_color +#define GL_NV_copy_depth_to_color 1 + +#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E +#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F + +#define GLEW_NV_copy_depth_to_color GLEW_GET_VAR(__GLEW_NV_copy_depth_to_color) + +#endif /* GL_NV_copy_depth_to_color */ + +/* ---------------------------- GL_NV_copy_image --------------------------- */ + +#ifndef GL_NV_copy_image +#define GL_NV_copy_image 1 + +typedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); + +#define glCopyImageSubDataNV GLEW_GET_FUN(__glewCopyImageSubDataNV) + +#define GLEW_NV_copy_image GLEW_GET_VAR(__GLEW_NV_copy_image) + +#endif /* GL_NV_copy_image */ + +/* -------------------------- GL_NV_deep_texture3D ------------------------- */ + +#ifndef GL_NV_deep_texture3D +#define GL_NV_deep_texture3D 1 + +#define GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV 0x90D0 +#define GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV 0x90D1 + +#define GLEW_NV_deep_texture3D GLEW_GET_VAR(__GLEW_NV_deep_texture3D) + +#endif /* GL_NV_deep_texture3D */ + +/* ------------------------ GL_NV_depth_buffer_float ----------------------- */ + +#ifndef GL_NV_depth_buffer_float +#define GL_NV_depth_buffer_float 1 + +#define GL_DEPTH_COMPONENT32F_NV 0x8DAB +#define GL_DEPTH32F_STENCIL8_NV 0x8DAC +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD +#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF + +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); +typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); + +#define glClearDepthdNV GLEW_GET_FUN(__glewClearDepthdNV) +#define glDepthBoundsdNV GLEW_GET_FUN(__glewDepthBoundsdNV) +#define glDepthRangedNV GLEW_GET_FUN(__glewDepthRangedNV) + +#define GLEW_NV_depth_buffer_float GLEW_GET_VAR(__GLEW_NV_depth_buffer_float) + +#endif /* GL_NV_depth_buffer_float */ + +/* --------------------------- GL_NV_depth_clamp --------------------------- */ + +#ifndef GL_NV_depth_clamp +#define GL_NV_depth_clamp 1 + +#define GL_DEPTH_CLAMP_NV 0x864F + +#define GLEW_NV_depth_clamp GLEW_GET_VAR(__GLEW_NV_depth_clamp) + +#endif /* GL_NV_depth_clamp */ + +/* ---------------------- GL_NV_depth_range_unclamped ---------------------- */ + +#ifndef GL_NV_depth_range_unclamped +#define GL_NV_depth_range_unclamped 1 + +#define GL_SAMPLE_COUNT_BITS_NV 0x8864 +#define GL_CURRENT_SAMPLE_COUNT_QUERY_NV 0x8865 +#define GL_QUERY_RESULT_NV 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_NV 0x8867 +#define GL_SAMPLE_COUNT_NV 0x8914 + +#define GLEW_NV_depth_range_unclamped GLEW_GET_VAR(__GLEW_NV_depth_range_unclamped) + +#endif /* GL_NV_depth_range_unclamped */ + +/* --------------------------- GL_NV_draw_texture -------------------------- */ + +#ifndef GL_NV_draw_texture +#define GL_NV_draw_texture 1 + +typedef void (GLAPIENTRY * PFNGLDRAWTEXTURENVPROC) (GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); + +#define glDrawTextureNV GLEW_GET_FUN(__glewDrawTextureNV) + +#define GLEW_NV_draw_texture GLEW_GET_VAR(__GLEW_NV_draw_texture) + +#endif /* GL_NV_draw_texture */ + +/* ---------------------------- GL_NV_evaluators --------------------------- */ + +#ifndef GL_NV_evaluators +#define GL_NV_evaluators 1 + +#define GL_EVAL_2D_NV 0x86C0 +#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 +#define GL_MAP_TESSELLATION_NV 0x86C2 +#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 +#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 +#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 +#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 +#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 +#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 +#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 +#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA +#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB +#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC +#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD +#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE +#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF +#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 +#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 +#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 +#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 +#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 +#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 +#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 +#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 + +typedef void (GLAPIENTRY * PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); +typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points); +typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); +typedef void (GLAPIENTRY * PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glEvalMapsNV GLEW_GET_FUN(__glewEvalMapsNV) +#define glGetMapAttribParameterfvNV GLEW_GET_FUN(__glewGetMapAttribParameterfvNV) +#define glGetMapAttribParameterivNV GLEW_GET_FUN(__glewGetMapAttribParameterivNV) +#define glGetMapControlPointsNV GLEW_GET_FUN(__glewGetMapControlPointsNV) +#define glGetMapParameterfvNV GLEW_GET_FUN(__glewGetMapParameterfvNV) +#define glGetMapParameterivNV GLEW_GET_FUN(__glewGetMapParameterivNV) +#define glMapControlPointsNV GLEW_GET_FUN(__glewMapControlPointsNV) +#define glMapParameterfvNV GLEW_GET_FUN(__glewMapParameterfvNV) +#define glMapParameterivNV GLEW_GET_FUN(__glewMapParameterivNV) + +#define GLEW_NV_evaluators GLEW_GET_VAR(__GLEW_NV_evaluators) + +#endif /* GL_NV_evaluators */ + +/* ----------------------- GL_NV_explicit_multisample ---------------------- */ + +#ifndef GL_NV_explicit_multisample +#define GL_NV_explicit_multisample 1 + +#define GL_SAMPLE_POSITION_NV 0x8E50 +#define GL_SAMPLE_MASK_NV 0x8E51 +#define GL_SAMPLE_MASK_VALUE_NV 0x8E52 +#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 +#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 +#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 +#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 +#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 +#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 +#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 + +typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat* val); +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer); + +#define glGetMultisamplefvNV GLEW_GET_FUN(__glewGetMultisamplefvNV) +#define glSampleMaskIndexedNV GLEW_GET_FUN(__glewSampleMaskIndexedNV) +#define glTexRenderbufferNV GLEW_GET_FUN(__glewTexRenderbufferNV) + +#define GLEW_NV_explicit_multisample GLEW_GET_VAR(__GLEW_NV_explicit_multisample) + +#endif /* GL_NV_explicit_multisample */ + +/* ------------------------------ GL_NV_fence ------------------------------ */ + +#ifndef GL_NV_fence +#define GL_NV_fence 1 + +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 + +typedef void (GLAPIENTRY * PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint* fences); +typedef void (GLAPIENTRY * PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLGENFENCESNVPROC) (GLsizei n, GLuint* fences); +typedef void (GLAPIENTRY * PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISFENCENVPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCENVPROC) (GLuint fence); + +#define glDeleteFencesNV GLEW_GET_FUN(__glewDeleteFencesNV) +#define glFinishFenceNV GLEW_GET_FUN(__glewFinishFenceNV) +#define glGenFencesNV GLEW_GET_FUN(__glewGenFencesNV) +#define glGetFenceivNV GLEW_GET_FUN(__glewGetFenceivNV) +#define glIsFenceNV GLEW_GET_FUN(__glewIsFenceNV) +#define glSetFenceNV GLEW_GET_FUN(__glewSetFenceNV) +#define glTestFenceNV GLEW_GET_FUN(__glewTestFenceNV) + +#define GLEW_NV_fence GLEW_GET_VAR(__GLEW_NV_fence) + +#endif /* GL_NV_fence */ + +/* --------------------------- GL_NV_float_buffer -------------------------- */ + +#ifndef GL_NV_float_buffer +#define GL_NV_float_buffer 1 + +#define GL_FLOAT_R_NV 0x8880 +#define GL_FLOAT_RG_NV 0x8881 +#define GL_FLOAT_RGB_NV 0x8882 +#define GL_FLOAT_RGBA_NV 0x8883 +#define GL_FLOAT_R16_NV 0x8884 +#define GL_FLOAT_R32_NV 0x8885 +#define GL_FLOAT_RG16_NV 0x8886 +#define GL_FLOAT_RG32_NV 0x8887 +#define GL_FLOAT_RGB16_NV 0x8888 +#define GL_FLOAT_RGB32_NV 0x8889 +#define GL_FLOAT_RGBA16_NV 0x888A +#define GL_FLOAT_RGBA32_NV 0x888B +#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C +#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D +#define GL_FLOAT_RGBA_MODE_NV 0x888E + +#define GLEW_NV_float_buffer GLEW_GET_VAR(__GLEW_NV_float_buffer) + +#endif /* GL_NV_float_buffer */ + +/* --------------------------- GL_NV_fog_distance -------------------------- */ + +#ifndef GL_NV_fog_distance +#define GL_NV_fog_distance 1 + +#define GL_FOG_DISTANCE_MODE_NV 0x855A +#define GL_EYE_RADIAL_NV 0x855B +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C + +#define GLEW_NV_fog_distance GLEW_GET_VAR(__GLEW_NV_fog_distance) + +#endif /* GL_NV_fog_distance */ + +/* ------------------------- GL_NV_fragment_program ------------------------ */ + +#ifndef GL_NV_fragment_program +#define GL_NV_fragment_program 1 + +#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 +#define GL_FRAGMENT_PROGRAM_NV 0x8870 +#define GL_MAX_TEXTURE_COORDS_NV 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 +#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 +#define GL_PROGRAM_ERROR_STRING_NV 0x8874 + +typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble *params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLdouble v[]); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLfloat v[]); + +#define glGetProgramNamedParameterdvNV GLEW_GET_FUN(__glewGetProgramNamedParameterdvNV) +#define glGetProgramNamedParameterfvNV GLEW_GET_FUN(__glewGetProgramNamedParameterfvNV) +#define glProgramNamedParameter4dNV GLEW_GET_FUN(__glewProgramNamedParameter4dNV) +#define glProgramNamedParameter4dvNV GLEW_GET_FUN(__glewProgramNamedParameter4dvNV) +#define glProgramNamedParameter4fNV GLEW_GET_FUN(__glewProgramNamedParameter4fNV) +#define glProgramNamedParameter4fvNV GLEW_GET_FUN(__glewProgramNamedParameter4fvNV) + +#define GLEW_NV_fragment_program GLEW_GET_VAR(__GLEW_NV_fragment_program) + +#endif /* GL_NV_fragment_program */ + +/* ------------------------ GL_NV_fragment_program2 ------------------------ */ + +#ifndef GL_NV_fragment_program2 +#define GL_NV_fragment_program2 1 + +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 +#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 +#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 +#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 + +#define GLEW_NV_fragment_program2 GLEW_GET_VAR(__GLEW_NV_fragment_program2) + +#endif /* GL_NV_fragment_program2 */ + +/* ------------------------ GL_NV_fragment_program4 ------------------------ */ + +#ifndef GL_NV_fragment_program4 +#define GL_NV_fragment_program4 1 + +#define GLEW_NV_fragment_program4 GLEW_GET_VAR(__GLEW_NV_fragment_program4) + +#endif /* GL_NV_fragment_program4 */ + +/* --------------------- GL_NV_fragment_program_option --------------------- */ + +#ifndef GL_NV_fragment_program_option +#define GL_NV_fragment_program_option 1 + +#define GLEW_NV_fragment_program_option GLEW_GET_VAR(__GLEW_NV_fragment_program_option) + +#endif /* GL_NV_fragment_program_option */ + +/* ----------------- GL_NV_framebuffer_multisample_coverage ---------------- */ + +#ifndef GL_NV_framebuffer_multisample_coverage +#define GL_NV_framebuffer_multisample_coverage 1 + +#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB +#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 +#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 +#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleCoverageNV GLEW_GET_FUN(__glewRenderbufferStorageMultisampleCoverageNV) + +#define GLEW_NV_framebuffer_multisample_coverage GLEW_GET_VAR(__GLEW_NV_framebuffer_multisample_coverage) + +#endif /* GL_NV_framebuffer_multisample_coverage */ + +/* ------------------------ GL_NV_geometry_program4 ------------------------ */ + +#ifndef GL_NV_geometry_program4 +#define GL_NV_geometry_program4 1 + +#define GL_GEOMETRY_PROGRAM_NV 0x8C26 +#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 +#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 + +typedef void (GLAPIENTRY * PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); + +#define glProgramVertexLimitNV GLEW_GET_FUN(__glewProgramVertexLimitNV) + +#define GLEW_NV_geometry_program4 GLEW_GET_VAR(__GLEW_NV_geometry_program4) + +#endif /* GL_NV_geometry_program4 */ + +/* ------------------------- GL_NV_geometry_shader4 ------------------------ */ + +#ifndef GL_NV_geometry_shader4 +#define GL_NV_geometry_shader4 1 + +#define GLEW_NV_geometry_shader4 GLEW_GET_VAR(__GLEW_NV_geometry_shader4) + +#endif /* GL_NV_geometry_shader4 */ + +/* --------------------------- GL_NV_gpu_program4 -------------------------- */ + +#ifndef GL_NV_gpu_program4 +#define GL_NV_gpu_program4 1 + +#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 +#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 +#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 +#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 +#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 +#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 +#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 + +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); + +#define glProgramEnvParameterI4iNV GLEW_GET_FUN(__glewProgramEnvParameterI4iNV) +#define glProgramEnvParameterI4ivNV GLEW_GET_FUN(__glewProgramEnvParameterI4ivNV) +#define glProgramEnvParameterI4uiNV GLEW_GET_FUN(__glewProgramEnvParameterI4uiNV) +#define glProgramEnvParameterI4uivNV GLEW_GET_FUN(__glewProgramEnvParameterI4uivNV) +#define glProgramEnvParametersI4ivNV GLEW_GET_FUN(__glewProgramEnvParametersI4ivNV) +#define glProgramEnvParametersI4uivNV GLEW_GET_FUN(__glewProgramEnvParametersI4uivNV) +#define glProgramLocalParameterI4iNV GLEW_GET_FUN(__glewProgramLocalParameterI4iNV) +#define glProgramLocalParameterI4ivNV GLEW_GET_FUN(__glewProgramLocalParameterI4ivNV) +#define glProgramLocalParameterI4uiNV GLEW_GET_FUN(__glewProgramLocalParameterI4uiNV) +#define glProgramLocalParameterI4uivNV GLEW_GET_FUN(__glewProgramLocalParameterI4uivNV) +#define glProgramLocalParametersI4ivNV GLEW_GET_FUN(__glewProgramLocalParametersI4ivNV) +#define glProgramLocalParametersI4uivNV GLEW_GET_FUN(__glewProgramLocalParametersI4uivNV) + +#define GLEW_NV_gpu_program4 GLEW_GET_VAR(__GLEW_NV_gpu_program4) + +#endif /* GL_NV_gpu_program4 */ + +/* --------------------------- GL_NV_gpu_program5 -------------------------- */ + +#ifndef GL_NV_gpu_program5 +#define GL_NV_gpu_program5 1 + +#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C +#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F + +#define GLEW_NV_gpu_program5 GLEW_GET_VAR(__GLEW_NV_gpu_program5) + +#endif /* GL_NV_gpu_program5 */ + +/* -------------------- GL_NV_gpu_program5_mem_extended -------------------- */ + +#ifndef GL_NV_gpu_program5_mem_extended +#define GL_NV_gpu_program5_mem_extended 1 + +#define GLEW_NV_gpu_program5_mem_extended GLEW_GET_VAR(__GLEW_NV_gpu_program5_mem_extended) + +#endif /* GL_NV_gpu_program5_mem_extended */ + +/* ------------------------- GL_NV_gpu_program_fp64 ------------------------ */ + +#ifndef GL_NV_gpu_program_fp64 +#define GL_NV_gpu_program_fp64 1 + +#define GLEW_NV_gpu_program_fp64 GLEW_GET_VAR(__GLEW_NV_gpu_program_fp64) + +#endif /* GL_NV_gpu_program_fp64 */ + +/* --------------------------- GL_NV_gpu_shader5 --------------------------- */ + +#ifndef GL_NV_gpu_shader5 +#define GL_NV_gpu_shader5 1 + +#define GL_INT64_NV 0x140E +#define GL_UNSIGNED_INT64_NV 0x140F +#define GL_INT8_NV 0x8FE0 +#define GL_INT8_VEC2_NV 0x8FE1 +#define GL_INT8_VEC3_NV 0x8FE2 +#define GL_INT8_VEC4_NV 0x8FE3 +#define GL_INT16_NV 0x8FE4 +#define GL_INT16_VEC2_NV 0x8FE5 +#define GL_INT16_VEC3_NV 0x8FE6 +#define GL_INT16_VEC4_NV 0x8FE7 +#define GL_INT64_VEC2_NV 0x8FE9 +#define GL_INT64_VEC3_NV 0x8FEA +#define GL_INT64_VEC4_NV 0x8FEB +#define GL_UNSIGNED_INT8_NV 0x8FEC +#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED +#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE +#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF +#define GL_UNSIGNED_INT16_NV 0x8FF0 +#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 +#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 +#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 +#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 +#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 +#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 +#define GL_FLOAT16_NV 0x8FF8 +#define GL_FLOAT16_VEC2_NV 0x8FF9 +#define GL_FLOAT16_VEC3_NV 0x8FFA +#define GL_FLOAT16_VEC4_NV 0x8FFB + +typedef void (GLAPIENTRY * PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); + +#define glGetUniformi64vNV GLEW_GET_FUN(__glewGetUniformi64vNV) +#define glGetUniformui64vNV GLEW_GET_FUN(__glewGetUniformui64vNV) +#define glProgramUniform1i64NV GLEW_GET_FUN(__glewProgramUniform1i64NV) +#define glProgramUniform1i64vNV GLEW_GET_FUN(__glewProgramUniform1i64vNV) +#define glProgramUniform1ui64NV GLEW_GET_FUN(__glewProgramUniform1ui64NV) +#define glProgramUniform1ui64vNV GLEW_GET_FUN(__glewProgramUniform1ui64vNV) +#define glProgramUniform2i64NV GLEW_GET_FUN(__glewProgramUniform2i64NV) +#define glProgramUniform2i64vNV GLEW_GET_FUN(__glewProgramUniform2i64vNV) +#define glProgramUniform2ui64NV GLEW_GET_FUN(__glewProgramUniform2ui64NV) +#define glProgramUniform2ui64vNV GLEW_GET_FUN(__glewProgramUniform2ui64vNV) +#define glProgramUniform3i64NV GLEW_GET_FUN(__glewProgramUniform3i64NV) +#define glProgramUniform3i64vNV GLEW_GET_FUN(__glewProgramUniform3i64vNV) +#define glProgramUniform3ui64NV GLEW_GET_FUN(__glewProgramUniform3ui64NV) +#define glProgramUniform3ui64vNV GLEW_GET_FUN(__glewProgramUniform3ui64vNV) +#define glProgramUniform4i64NV GLEW_GET_FUN(__glewProgramUniform4i64NV) +#define glProgramUniform4i64vNV GLEW_GET_FUN(__glewProgramUniform4i64vNV) +#define glProgramUniform4ui64NV GLEW_GET_FUN(__glewProgramUniform4ui64NV) +#define glProgramUniform4ui64vNV GLEW_GET_FUN(__glewProgramUniform4ui64vNV) +#define glUniform1i64NV GLEW_GET_FUN(__glewUniform1i64NV) +#define glUniform1i64vNV GLEW_GET_FUN(__glewUniform1i64vNV) +#define glUniform1ui64NV GLEW_GET_FUN(__glewUniform1ui64NV) +#define glUniform1ui64vNV GLEW_GET_FUN(__glewUniform1ui64vNV) +#define glUniform2i64NV GLEW_GET_FUN(__glewUniform2i64NV) +#define glUniform2i64vNV GLEW_GET_FUN(__glewUniform2i64vNV) +#define glUniform2ui64NV GLEW_GET_FUN(__glewUniform2ui64NV) +#define glUniform2ui64vNV GLEW_GET_FUN(__glewUniform2ui64vNV) +#define glUniform3i64NV GLEW_GET_FUN(__glewUniform3i64NV) +#define glUniform3i64vNV GLEW_GET_FUN(__glewUniform3i64vNV) +#define glUniform3ui64NV GLEW_GET_FUN(__glewUniform3ui64NV) +#define glUniform3ui64vNV GLEW_GET_FUN(__glewUniform3ui64vNV) +#define glUniform4i64NV GLEW_GET_FUN(__glewUniform4i64NV) +#define glUniform4i64vNV GLEW_GET_FUN(__glewUniform4i64vNV) +#define glUniform4ui64NV GLEW_GET_FUN(__glewUniform4ui64NV) +#define glUniform4ui64vNV GLEW_GET_FUN(__glewUniform4ui64vNV) + +#define GLEW_NV_gpu_shader5 GLEW_GET_VAR(__GLEW_NV_gpu_shader5) + +#endif /* GL_NV_gpu_shader5 */ + +/* ---------------------------- GL_NV_half_float --------------------------- */ + +#ifndef GL_NV_half_float +#define GL_NV_half_float 1 + +#define GL_HALF_FLOAT_NV 0x140B + +typedef unsigned short GLhalf; + +typedef void (GLAPIENTRY * PFNGLCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); +typedef void (GLAPIENTRY * PFNGLCOLOR3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLCOLOR4HNVPROC) (GLhalf red, GLhalf green, GLhalf blue, GLhalf alpha); +typedef void (GLAPIENTRY * PFNGLCOLOR4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLFOGCOORDHNVPROC) (GLhalf fog); +typedef void (GLAPIENTRY * PFNGLFOGCOORDHVNVPROC) (const GLhalf* fog); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalf s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalf s, GLhalf t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r, GLhalf q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLNORMAL3HNVPROC) (GLhalf nx, GLhalf ny, GLhalf nz); +typedef void (GLAPIENTRY * PFNGLNORMAL3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD1HNVPROC) (GLhalf s); +typedef void (GLAPIENTRY * PFNGLTEXCOORD1HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2HNVPROC) (GLhalf s, GLhalf t); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD3HNVPROC) (GLhalf s, GLhalf t, GLhalf r); +typedef void (GLAPIENTRY * PFNGLTEXCOORD3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4HNVPROC) (GLhalf s, GLhalf t, GLhalf r, GLhalf q); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX2HNVPROC) (GLhalf x, GLhalf y); +typedef void (GLAPIENTRY * PFNGLVERTEX2HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX3HNVPROC) (GLhalf x, GLhalf y, GLhalf z); +typedef void (GLAPIENTRY * PFNGLVERTEX3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX4HNVPROC) (GLhalf x, GLhalf y, GLhalf z, GLhalf w); +typedef void (GLAPIENTRY * PFNGLVERTEX4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalf x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalf x, GLhalf y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z, GLhalf w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHNVPROC) (GLhalf weight); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalf* weight); + +#define glColor3hNV GLEW_GET_FUN(__glewColor3hNV) +#define glColor3hvNV GLEW_GET_FUN(__glewColor3hvNV) +#define glColor4hNV GLEW_GET_FUN(__glewColor4hNV) +#define glColor4hvNV GLEW_GET_FUN(__glewColor4hvNV) +#define glFogCoordhNV GLEW_GET_FUN(__glewFogCoordhNV) +#define glFogCoordhvNV GLEW_GET_FUN(__glewFogCoordhvNV) +#define glMultiTexCoord1hNV GLEW_GET_FUN(__glewMultiTexCoord1hNV) +#define glMultiTexCoord1hvNV GLEW_GET_FUN(__glewMultiTexCoord1hvNV) +#define glMultiTexCoord2hNV GLEW_GET_FUN(__glewMultiTexCoord2hNV) +#define glMultiTexCoord2hvNV GLEW_GET_FUN(__glewMultiTexCoord2hvNV) +#define glMultiTexCoord3hNV GLEW_GET_FUN(__glewMultiTexCoord3hNV) +#define glMultiTexCoord3hvNV GLEW_GET_FUN(__glewMultiTexCoord3hvNV) +#define glMultiTexCoord4hNV GLEW_GET_FUN(__glewMultiTexCoord4hNV) +#define glMultiTexCoord4hvNV GLEW_GET_FUN(__glewMultiTexCoord4hvNV) +#define glNormal3hNV GLEW_GET_FUN(__glewNormal3hNV) +#define glNormal3hvNV GLEW_GET_FUN(__glewNormal3hvNV) +#define glSecondaryColor3hNV GLEW_GET_FUN(__glewSecondaryColor3hNV) +#define glSecondaryColor3hvNV GLEW_GET_FUN(__glewSecondaryColor3hvNV) +#define glTexCoord1hNV GLEW_GET_FUN(__glewTexCoord1hNV) +#define glTexCoord1hvNV GLEW_GET_FUN(__glewTexCoord1hvNV) +#define glTexCoord2hNV GLEW_GET_FUN(__glewTexCoord2hNV) +#define glTexCoord2hvNV GLEW_GET_FUN(__glewTexCoord2hvNV) +#define glTexCoord3hNV GLEW_GET_FUN(__glewTexCoord3hNV) +#define glTexCoord3hvNV GLEW_GET_FUN(__glewTexCoord3hvNV) +#define glTexCoord4hNV GLEW_GET_FUN(__glewTexCoord4hNV) +#define glTexCoord4hvNV GLEW_GET_FUN(__glewTexCoord4hvNV) +#define glVertex2hNV GLEW_GET_FUN(__glewVertex2hNV) +#define glVertex2hvNV GLEW_GET_FUN(__glewVertex2hvNV) +#define glVertex3hNV GLEW_GET_FUN(__glewVertex3hNV) +#define glVertex3hvNV GLEW_GET_FUN(__glewVertex3hvNV) +#define glVertex4hNV GLEW_GET_FUN(__glewVertex4hNV) +#define glVertex4hvNV GLEW_GET_FUN(__glewVertex4hvNV) +#define glVertexAttrib1hNV GLEW_GET_FUN(__glewVertexAttrib1hNV) +#define glVertexAttrib1hvNV GLEW_GET_FUN(__glewVertexAttrib1hvNV) +#define glVertexAttrib2hNV GLEW_GET_FUN(__glewVertexAttrib2hNV) +#define glVertexAttrib2hvNV GLEW_GET_FUN(__glewVertexAttrib2hvNV) +#define glVertexAttrib3hNV GLEW_GET_FUN(__glewVertexAttrib3hNV) +#define glVertexAttrib3hvNV GLEW_GET_FUN(__glewVertexAttrib3hvNV) +#define glVertexAttrib4hNV GLEW_GET_FUN(__glewVertexAttrib4hNV) +#define glVertexAttrib4hvNV GLEW_GET_FUN(__glewVertexAttrib4hvNV) +#define glVertexAttribs1hvNV GLEW_GET_FUN(__glewVertexAttribs1hvNV) +#define glVertexAttribs2hvNV GLEW_GET_FUN(__glewVertexAttribs2hvNV) +#define glVertexAttribs3hvNV GLEW_GET_FUN(__glewVertexAttribs3hvNV) +#define glVertexAttribs4hvNV GLEW_GET_FUN(__glewVertexAttribs4hvNV) +#define glVertexWeighthNV GLEW_GET_FUN(__glewVertexWeighthNV) +#define glVertexWeighthvNV GLEW_GET_FUN(__glewVertexWeighthvNV) + +#define GLEW_NV_half_float GLEW_GET_VAR(__GLEW_NV_half_float) + +#endif /* GL_NV_half_float */ + +/* ------------------------ GL_NV_light_max_exponent ----------------------- */ + +#ifndef GL_NV_light_max_exponent +#define GL_NV_light_max_exponent 1 + +#define GL_MAX_SHININESS_NV 0x8504 +#define GL_MAX_SPOT_EXPONENT_NV 0x8505 + +#define GLEW_NV_light_max_exponent GLEW_GET_VAR(__GLEW_NV_light_max_exponent) + +#endif /* GL_NV_light_max_exponent */ + +/* ----------------------- GL_NV_multisample_coverage ---------------------- */ + +#ifndef GL_NV_multisample_coverage +#define GL_NV_multisample_coverage 1 + +#define GL_COLOR_SAMPLES_NV 0x8E20 + +#define GLEW_NV_multisample_coverage GLEW_GET_VAR(__GLEW_NV_multisample_coverage) + +#endif /* GL_NV_multisample_coverage */ + +/* --------------------- GL_NV_multisample_filter_hint --------------------- */ + +#ifndef GL_NV_multisample_filter_hint +#define GL_NV_multisample_filter_hint 1 + +#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 + +#define GLEW_NV_multisample_filter_hint GLEW_GET_VAR(__GLEW_NV_multisample_filter_hint) + +#endif /* GL_NV_multisample_filter_hint */ + +/* ------------------------- GL_NV_occlusion_query ------------------------- */ + +#ifndef GL_NV_occlusion_query +#define GL_NV_occlusion_query 1 + +#define GL_PIXEL_COUNTER_BITS_NV 0x8864 +#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 +#define GL_PIXEL_COUNT_NV 0x8866 +#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 + +typedef void (GLAPIENTRY * PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDOCCLUSIONQUERYNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); + +#define glBeginOcclusionQueryNV GLEW_GET_FUN(__glewBeginOcclusionQueryNV) +#define glDeleteOcclusionQueriesNV GLEW_GET_FUN(__glewDeleteOcclusionQueriesNV) +#define glEndOcclusionQueryNV GLEW_GET_FUN(__glewEndOcclusionQueryNV) +#define glGenOcclusionQueriesNV GLEW_GET_FUN(__glewGenOcclusionQueriesNV) +#define glGetOcclusionQueryivNV GLEW_GET_FUN(__glewGetOcclusionQueryivNV) +#define glGetOcclusionQueryuivNV GLEW_GET_FUN(__glewGetOcclusionQueryuivNV) +#define glIsOcclusionQueryNV GLEW_GET_FUN(__glewIsOcclusionQueryNV) + +#define GLEW_NV_occlusion_query GLEW_GET_VAR(__GLEW_NV_occlusion_query) + +#endif /* GL_NV_occlusion_query */ + +/* ----------------------- GL_NV_packed_depth_stencil ---------------------- */ + +#ifndef GL_NV_packed_depth_stencil +#define GL_NV_packed_depth_stencil 1 + +#define GL_DEPTH_STENCIL_NV 0x84F9 +#define GL_UNSIGNED_INT_24_8_NV 0x84FA + +#define GLEW_NV_packed_depth_stencil GLEW_GET_VAR(__GLEW_NV_packed_depth_stencil) + +#endif /* GL_NV_packed_depth_stencil */ + +/* --------------------- GL_NV_parameter_buffer_object --------------------- */ + +#ifndef GL_NV_parameter_buffer_object +#define GL_NV_parameter_buffer_object 1 + +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 +#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 +#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 +#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 + +typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params); + +#define glProgramBufferParametersIivNV GLEW_GET_FUN(__glewProgramBufferParametersIivNV) +#define glProgramBufferParametersIuivNV GLEW_GET_FUN(__glewProgramBufferParametersIuivNV) +#define glProgramBufferParametersfvNV GLEW_GET_FUN(__glewProgramBufferParametersfvNV) + +#define GLEW_NV_parameter_buffer_object GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object) + +#endif /* GL_NV_parameter_buffer_object */ + +/* --------------------- GL_NV_parameter_buffer_object2 -------------------- */ + +#ifndef GL_NV_parameter_buffer_object2 +#define GL_NV_parameter_buffer_object2 1 + +#define GLEW_NV_parameter_buffer_object2 GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object2) + +#endif /* GL_NV_parameter_buffer_object2 */ + +/* -------------------------- GL_NV_path_rendering ------------------------- */ + +#ifndef GL_NV_path_rendering +#define GL_NV_path_rendering 1 + +#define GL_CLOSE_PATH_NV 0x00 +#define GL_BOLD_BIT_NV 0x01 +#define GL_GLYPH_WIDTH_BIT_NV 0x01 +#define GL_GLYPH_HEIGHT_BIT_NV 0x02 +#define GL_ITALIC_BIT_NV 0x02 +#define GL_MOVE_TO_NV 0x02 +#define GL_RELATIVE_MOVE_TO_NV 0x03 +#define GL_LINE_TO_NV 0x04 +#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 +#define GL_RELATIVE_LINE_TO_NV 0x05 +#define GL_HORIZONTAL_LINE_TO_NV 0x06 +#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 +#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 +#define GL_VERTICAL_LINE_TO_NV 0x08 +#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 +#define GL_QUADRATIC_CURVE_TO_NV 0x0A +#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B +#define GL_CUBIC_CURVE_TO_NV 0x0C +#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D +#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E +#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F +#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 +#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 +#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 +#define GL_SMALL_CCW_ARC_TO_NV 0x12 +#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 +#define GL_SMALL_CW_ARC_TO_NV 0x14 +#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 +#define GL_LARGE_CCW_ARC_TO_NV 0x16 +#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 +#define GL_LARGE_CW_ARC_TO_NV 0x18 +#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 +#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 +#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 +#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 +#define GL_RESTART_PATH_NV 0xF0 +#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 +#define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 +#define GL_RECT_NV 0xF6 +#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 +#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA +#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC +#define GL_ARC_TO_NV 0xFE +#define GL_RELATIVE_ARC_TO_NV 0xFF +#define GL_GLYPH_HAS_KERNING_BIT_NV 0x100 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PATH_FORMAT_SVG_NV 0x9070 +#define GL_PATH_FORMAT_PS_NV 0x9071 +#define GL_STANDARD_FONT_NAME_NV 0x9072 +#define GL_SYSTEM_FONT_NAME_NV 0x9073 +#define GL_FILE_NAME_NV 0x9074 +#define GL_PATH_STROKE_WIDTH_NV 0x9075 +#define GL_PATH_END_CAPS_NV 0x9076 +#define GL_PATH_INITIAL_END_CAP_NV 0x9077 +#define GL_PATH_TERMINAL_END_CAP_NV 0x9078 +#define GL_PATH_JOIN_STYLE_NV 0x9079 +#define GL_PATH_MITER_LIMIT_NV 0x907A +#define GL_PATH_DASH_CAPS_NV 0x907B +#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C +#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D +#define GL_PATH_DASH_OFFSET_NV 0x907E +#define GL_PATH_CLIENT_LENGTH_NV 0x907F +#define GL_PATH_FILL_MODE_NV 0x9080 +#define GL_PATH_FILL_MASK_NV 0x9081 +#define GL_PATH_FILL_COVER_MODE_NV 0x9082 +#define GL_PATH_STROKE_COVER_MODE_NV 0x9083 +#define GL_PATH_STROKE_MASK_NV 0x9084 +#define GL_COUNT_UP_NV 0x9088 +#define GL_COUNT_DOWN_NV 0x9089 +#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A +#define GL_CONVEX_HULL_NV 0x908B +#define GL_BOUNDING_BOX_NV 0x908D +#define GL_TRANSLATE_X_NV 0x908E +#define GL_TRANSLATE_Y_NV 0x908F +#define GL_TRANSLATE_2D_NV 0x9090 +#define GL_TRANSLATE_3D_NV 0x9091 +#define GL_AFFINE_2D_NV 0x9092 +#define GL_AFFINE_3D_NV 0x9094 +#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096 +#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098 +#define GL_UTF8_NV 0x909A +#define GL_UTF16_NV 0x909B +#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C +#define GL_PATH_COMMAND_COUNT_NV 0x909D +#define GL_PATH_COORD_COUNT_NV 0x909E +#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F +#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0 +#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 +#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 +#define GL_SQUARE_NV 0x90A3 +#define GL_ROUND_NV 0x90A4 +#define GL_TRIANGULAR_NV 0x90A5 +#define GL_BEVEL_NV 0x90A6 +#define GL_MITER_REVERT_NV 0x90A7 +#define GL_MITER_TRUNCATE_NV 0x90A8 +#define GL_SKIP_MISSING_GLYPH_NV 0x90A9 +#define GL_USE_MISSING_GLYPH_NV 0x90AA +#define GL_PATH_ERROR_POSITION_NV 0x90AB +#define GL_PATH_FOG_GEN_MODE_NV 0x90AC +#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD +#define GL_ADJACENT_PAIRS_NV 0x90AE +#define GL_FIRST_TO_REST_NV 0x90AF +#define GL_PATH_GEN_MODE_NV 0x90B0 +#define GL_PATH_GEN_COEFF_NV 0x90B1 +#define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2 +#define GL_PATH_GEN_COMPONENTS_NV 0x90B3 +#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 +#define GL_MOVE_TO_RESETS_NV 0x90B5 +#define GL_MOVE_TO_CONTINUES_NV 0x90B6 +#define GL_PATH_STENCIL_FUNC_NV 0x90B7 +#define GL_PATH_STENCIL_REF_NV 0x90B8 +#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 +#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD +#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE +#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF +#define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000 +#define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000 +#define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000 +#define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000 +#define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000 +#define GL_FONT_ASCENDER_BIT_NV 0x00200000 +#define GL_FONT_DESCENDER_BIT_NV 0x00400000 +#define GL_FONT_HEIGHT_BIT_NV 0x00800000 +#define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000 +#define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000 +#define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000 +#define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000 +#define GL_FONT_HAS_KERNING_BIT_NV 0x10000000 + +typedef void (GLAPIENTRY * PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath); +typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHNVPROC) (GLuint name, GLenum coverMode); +typedef void (GLAPIENTRY * PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range); +typedef GLuint (GLAPIENTRY * PFNGLGENPATHSNVPROC) (GLsizei range); +typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint* value); +typedef void (GLAPIENTRY * PFNGLGETPATHCOMMANDSNVPROC) (GLuint name, GLubyte* commands); +typedef void (GLAPIENTRY * PFNGLGETPATHCOORDSNVPROC) (GLuint name, GLfloat* coords); +typedef void (GLAPIENTRY * PFNGLGETPATHDASHARRAYNVPROC) (GLuint name, GLfloat* dashArray); +typedef GLfloat (GLAPIENTRY * PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments); +typedef void (GLAPIENTRY * PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint fistPathName, GLsizei numPaths, GLsizei stride, GLfloat* metrics); +typedef void (GLAPIENTRY * PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); +typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERFVNVPROC) (GLuint name, GLenum param, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERIVNVPROC) (GLuint name, GLenum param, GLint* value); +typedef void (GLAPIENTRY * PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); +typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat* value); +typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint* value); +typedef void (GLAPIENTRY * PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); +typedef GLboolean (GLAPIENTRY * PFNGLISPATHNVPROC) (GLuint path); +typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y); +typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat* coeffs); +typedef void (GLAPIENTRY * PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const GLvoid*coords); +typedef void (GLAPIENTRY * PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void* coords); +typedef void (GLAPIENTRY * PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum zfunc); +typedef void (GLAPIENTRY * PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat* dashArray); +typedef void (GLAPIENTRY * PFNGLPATHFOGGENNVPROC) (GLenum genMode); +typedef void (GLAPIENTRY * PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (GLAPIENTRY * PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const GLvoid*charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value); +typedef void (GLAPIENTRY * PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units); +typedef void (GLAPIENTRY * PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void* pathString); +typedef void (GLAPIENTRY * PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const GLvoid*coords); +typedef void (GLAPIENTRY * PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void* coords); +typedef void (GLAPIENTRY * PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat* coeffs); +typedef GLboolean (GLAPIENTRY * PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat* x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); +typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); +typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask); +typedef void (GLAPIENTRY * PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat* transformValues); +typedef void (GLAPIENTRY * PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint paths[], const GLfloat weights[]); + +#define glCopyPathNV GLEW_GET_FUN(__glewCopyPathNV) +#define glCoverFillPathInstancedNV GLEW_GET_FUN(__glewCoverFillPathInstancedNV) +#define glCoverFillPathNV GLEW_GET_FUN(__glewCoverFillPathNV) +#define glCoverStrokePathInstancedNV GLEW_GET_FUN(__glewCoverStrokePathInstancedNV) +#define glCoverStrokePathNV GLEW_GET_FUN(__glewCoverStrokePathNV) +#define glDeletePathsNV GLEW_GET_FUN(__glewDeletePathsNV) +#define glGenPathsNV GLEW_GET_FUN(__glewGenPathsNV) +#define glGetPathColorGenfvNV GLEW_GET_FUN(__glewGetPathColorGenfvNV) +#define glGetPathColorGenivNV GLEW_GET_FUN(__glewGetPathColorGenivNV) +#define glGetPathCommandsNV GLEW_GET_FUN(__glewGetPathCommandsNV) +#define glGetPathCoordsNV GLEW_GET_FUN(__glewGetPathCoordsNV) +#define glGetPathDashArrayNV GLEW_GET_FUN(__glewGetPathDashArrayNV) +#define glGetPathLengthNV GLEW_GET_FUN(__glewGetPathLengthNV) +#define glGetPathMetricRangeNV GLEW_GET_FUN(__glewGetPathMetricRangeNV) +#define glGetPathMetricsNV GLEW_GET_FUN(__glewGetPathMetricsNV) +#define glGetPathParameterfvNV GLEW_GET_FUN(__glewGetPathParameterfvNV) +#define glGetPathParameterivNV GLEW_GET_FUN(__glewGetPathParameterivNV) +#define glGetPathSpacingNV GLEW_GET_FUN(__glewGetPathSpacingNV) +#define glGetPathTexGenfvNV GLEW_GET_FUN(__glewGetPathTexGenfvNV) +#define glGetPathTexGenivNV GLEW_GET_FUN(__glewGetPathTexGenivNV) +#define glInterpolatePathsNV GLEW_GET_FUN(__glewInterpolatePathsNV) +#define glIsPathNV GLEW_GET_FUN(__glewIsPathNV) +#define glIsPointInFillPathNV GLEW_GET_FUN(__glewIsPointInFillPathNV) +#define glIsPointInStrokePathNV GLEW_GET_FUN(__glewIsPointInStrokePathNV) +#define glPathColorGenNV GLEW_GET_FUN(__glewPathColorGenNV) +#define glPathCommandsNV GLEW_GET_FUN(__glewPathCommandsNV) +#define glPathCoordsNV GLEW_GET_FUN(__glewPathCoordsNV) +#define glPathCoverDepthFuncNV GLEW_GET_FUN(__glewPathCoverDepthFuncNV) +#define glPathDashArrayNV GLEW_GET_FUN(__glewPathDashArrayNV) +#define glPathFogGenNV GLEW_GET_FUN(__glewPathFogGenNV) +#define glPathGlyphRangeNV GLEW_GET_FUN(__glewPathGlyphRangeNV) +#define glPathGlyphsNV GLEW_GET_FUN(__glewPathGlyphsNV) +#define glPathParameterfNV GLEW_GET_FUN(__glewPathParameterfNV) +#define glPathParameterfvNV GLEW_GET_FUN(__glewPathParameterfvNV) +#define glPathParameteriNV GLEW_GET_FUN(__glewPathParameteriNV) +#define glPathParameterivNV GLEW_GET_FUN(__glewPathParameterivNV) +#define glPathStencilDepthOffsetNV GLEW_GET_FUN(__glewPathStencilDepthOffsetNV) +#define glPathStencilFuncNV GLEW_GET_FUN(__glewPathStencilFuncNV) +#define glPathStringNV GLEW_GET_FUN(__glewPathStringNV) +#define glPathSubCommandsNV GLEW_GET_FUN(__glewPathSubCommandsNV) +#define glPathSubCoordsNV GLEW_GET_FUN(__glewPathSubCoordsNV) +#define glPathTexGenNV GLEW_GET_FUN(__glewPathTexGenNV) +#define glPointAlongPathNV GLEW_GET_FUN(__glewPointAlongPathNV) +#define glStencilFillPathInstancedNV GLEW_GET_FUN(__glewStencilFillPathInstancedNV) +#define glStencilFillPathNV GLEW_GET_FUN(__glewStencilFillPathNV) +#define glStencilStrokePathInstancedNV GLEW_GET_FUN(__glewStencilStrokePathInstancedNV) +#define glStencilStrokePathNV GLEW_GET_FUN(__glewStencilStrokePathNV) +#define glTransformPathNV GLEW_GET_FUN(__glewTransformPathNV) +#define glWeightPathsNV GLEW_GET_FUN(__glewWeightPathsNV) + +#define GLEW_NV_path_rendering GLEW_GET_VAR(__GLEW_NV_path_rendering) + +#endif /* GL_NV_path_rendering */ + +/* ------------------------- GL_NV_pixel_data_range ------------------------ */ + +#ifndef GL_NV_pixel_data_range +#define GL_NV_pixel_data_range 1 + +#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 +#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 +#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A +#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B +#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C +#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D + +typedef void (GLAPIENTRY * PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer); + +#define glFlushPixelDataRangeNV GLEW_GET_FUN(__glewFlushPixelDataRangeNV) +#define glPixelDataRangeNV GLEW_GET_FUN(__glewPixelDataRangeNV) + +#define GLEW_NV_pixel_data_range GLEW_GET_VAR(__GLEW_NV_pixel_data_range) + +#endif /* GL_NV_pixel_data_range */ + +/* --------------------------- GL_NV_point_sprite -------------------------- */ + +#ifndef GL_NV_point_sprite +#define GL_NV_point_sprite 1 + +#define GL_POINT_SPRITE_NV 0x8861 +#define GL_COORD_REPLACE_NV 0x8862 +#define GL_POINT_SPRITE_R_MODE_NV 0x8863 + +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint* params); + +#define glPointParameteriNV GLEW_GET_FUN(__glewPointParameteriNV) +#define glPointParameterivNV GLEW_GET_FUN(__glewPointParameterivNV) + +#define GLEW_NV_point_sprite GLEW_GET_VAR(__GLEW_NV_point_sprite) + +#endif /* GL_NV_point_sprite */ + +/* -------------------------- GL_NV_present_video -------------------------- */ + +#ifndef GL_NV_present_video +#define GL_NV_present_video 1 + +#define GL_FRAME_NV 0x8E26 +#define GL_FIELDS_NV 0x8E27 +#define GL_CURRENT_TIME_NV 0x8E28 +#define GL_NUM_FILL_STREAMS_NV 0x8E29 +#define GL_PRESENT_TIME_NV 0x8E2A +#define GL_PRESENT_DURATION_NV 0x8E2B + +typedef void (GLAPIENTRY * PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); +typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); + +#define glGetVideoi64vNV GLEW_GET_FUN(__glewGetVideoi64vNV) +#define glGetVideoivNV GLEW_GET_FUN(__glewGetVideoivNV) +#define glGetVideoui64vNV GLEW_GET_FUN(__glewGetVideoui64vNV) +#define glGetVideouivNV GLEW_GET_FUN(__glewGetVideouivNV) +#define glPresentFrameDualFillNV GLEW_GET_FUN(__glewPresentFrameDualFillNV) +#define glPresentFrameKeyedNV GLEW_GET_FUN(__glewPresentFrameKeyedNV) + +#define GLEW_NV_present_video GLEW_GET_VAR(__GLEW_NV_present_video) + +#endif /* GL_NV_present_video */ + +/* ------------------------ GL_NV_primitive_restart ------------------------ */ + +#ifndef GL_NV_primitive_restart +#define GL_NV_primitive_restart 1 + +#define GL_PRIMITIVE_RESTART_NV 0x8558 +#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 + +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTNVPROC) (void); + +#define glPrimitiveRestartIndexNV GLEW_GET_FUN(__glewPrimitiveRestartIndexNV) +#define glPrimitiveRestartNV GLEW_GET_FUN(__glewPrimitiveRestartNV) + +#define GLEW_NV_primitive_restart GLEW_GET_VAR(__GLEW_NV_primitive_restart) + +#endif /* GL_NV_primitive_restart */ + +/* ------------------------ GL_NV_register_combiners ----------------------- */ + +#ifndef GL_NV_register_combiners +#define GL_NV_register_combiners 1 + +#define GL_REGISTER_COMBINERS_NV 0x8522 +#define GL_VARIABLE_A_NV 0x8523 +#define GL_VARIABLE_B_NV 0x8524 +#define GL_VARIABLE_C_NV 0x8525 +#define GL_VARIABLE_D_NV 0x8526 +#define GL_VARIABLE_E_NV 0x8527 +#define GL_VARIABLE_F_NV 0x8528 +#define GL_VARIABLE_G_NV 0x8529 +#define GL_CONSTANT_COLOR0_NV 0x852A +#define GL_CONSTANT_COLOR1_NV 0x852B +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_SPARE0_NV 0x852E +#define GL_SPARE1_NV 0x852F +#define GL_DISCARD_NV 0x8530 +#define GL_E_TIMES_F_NV 0x8531 +#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 +#define GL_UNSIGNED_IDENTITY_NV 0x8536 +#define GL_UNSIGNED_INVERT_NV 0x8537 +#define GL_EXPAND_NORMAL_NV 0x8538 +#define GL_EXPAND_NEGATE_NV 0x8539 +#define GL_HALF_BIAS_NORMAL_NV 0x853A +#define GL_HALF_BIAS_NEGATE_NV 0x853B +#define GL_SIGNED_IDENTITY_NV 0x853C +#define GL_SIGNED_NEGATE_NV 0x853D +#define GL_SCALE_BY_TWO_NV 0x853E +#define GL_SCALE_BY_FOUR_NV 0x853F +#define GL_SCALE_BY_ONE_HALF_NV 0x8540 +#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 +#define GL_COMBINER_INPUT_NV 0x8542 +#define GL_COMBINER_MAPPING_NV 0x8543 +#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 +#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 +#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 +#define GL_COMBINER_MUX_SUM_NV 0x8547 +#define GL_COMBINER_SCALE_NV 0x8548 +#define GL_COMBINER_BIAS_NV 0x8549 +#define GL_COMBINER_AB_OUTPUT_NV 0x854A +#define GL_COMBINER_CD_OUTPUT_NV 0x854B +#define GL_COMBINER_SUM_OUTPUT_NV 0x854C +#define GL_MAX_GENERAL_COMBINERS_NV 0x854D +#define GL_NUM_GENERAL_COMBINERS_NV 0x854E +#define GL_COLOR_SUM_CLAMP_NV 0x854F +#define GL_COMBINER0_NV 0x8550 +#define GL_COMBINER1_NV 0x8551 +#define GL_COMBINER2_NV 0x8552 +#define GL_COMBINER3_NV 0x8553 +#define GL_COMBINER4_NV 0x8554 +#define GL_COMBINER5_NV 0x8555 +#define GL_COMBINER6_NV 0x8556 +#define GL_COMBINER7_NV 0x8557 + +typedef void (GLAPIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (GLAPIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint* params); + +#define glCombinerInputNV GLEW_GET_FUN(__glewCombinerInputNV) +#define glCombinerOutputNV GLEW_GET_FUN(__glewCombinerOutputNV) +#define glCombinerParameterfNV GLEW_GET_FUN(__glewCombinerParameterfNV) +#define glCombinerParameterfvNV GLEW_GET_FUN(__glewCombinerParameterfvNV) +#define glCombinerParameteriNV GLEW_GET_FUN(__glewCombinerParameteriNV) +#define glCombinerParameterivNV GLEW_GET_FUN(__glewCombinerParameterivNV) +#define glFinalCombinerInputNV GLEW_GET_FUN(__glewFinalCombinerInputNV) +#define glGetCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetCombinerInputParameterfvNV) +#define glGetCombinerInputParameterivNV GLEW_GET_FUN(__glewGetCombinerInputParameterivNV) +#define glGetCombinerOutputParameterfvNV GLEW_GET_FUN(__glewGetCombinerOutputParameterfvNV) +#define glGetCombinerOutputParameterivNV GLEW_GET_FUN(__glewGetCombinerOutputParameterivNV) +#define glGetFinalCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterfvNV) +#define glGetFinalCombinerInputParameterivNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterivNV) + +#define GLEW_NV_register_combiners GLEW_GET_VAR(__GLEW_NV_register_combiners) + +#endif /* GL_NV_register_combiners */ + +/* ----------------------- GL_NV_register_combiners2 ----------------------- */ + +#ifndef GL_NV_register_combiners2 +#define GL_NV_register_combiners2 1 + +#define GL_PER_STAGE_CONSTANTS_NV 0x8535 + +typedef void (GLAPIENTRY * PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat* params); + +#define glCombinerStageParameterfvNV GLEW_GET_FUN(__glewCombinerStageParameterfvNV) +#define glGetCombinerStageParameterfvNV GLEW_GET_FUN(__glewGetCombinerStageParameterfvNV) + +#define GLEW_NV_register_combiners2 GLEW_GET_VAR(__GLEW_NV_register_combiners2) + +#endif /* GL_NV_register_combiners2 */ + +/* ---------------------- GL_NV_shader_atomic_counters --------------------- */ + +#ifndef GL_NV_shader_atomic_counters +#define GL_NV_shader_atomic_counters 1 + +#define GLEW_NV_shader_atomic_counters GLEW_GET_VAR(__GLEW_NV_shader_atomic_counters) + +#endif /* GL_NV_shader_atomic_counters */ + +/* ----------------------- GL_NV_shader_atomic_float ----------------------- */ + +#ifndef GL_NV_shader_atomic_float +#define GL_NV_shader_atomic_float 1 + +#define GLEW_NV_shader_atomic_float GLEW_GET_VAR(__GLEW_NV_shader_atomic_float) + +#endif /* GL_NV_shader_atomic_float */ + +/* ------------------------ GL_NV_shader_buffer_load ----------------------- */ + +#ifndef GL_NV_shader_buffer_load +#define GL_NV_shader_buffer_load 1 + +#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D +#define GL_GPU_ADDRESS_NV 0x8F34 +#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 + +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT* result); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT* params); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERRESIDENTNVPROC) (GLenum target); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access); +typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value); +typedef void (GLAPIENTRY * PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); + +#define glGetBufferParameterui64vNV GLEW_GET_FUN(__glewGetBufferParameterui64vNV) +#define glGetIntegerui64vNV GLEW_GET_FUN(__glewGetIntegerui64vNV) +#define glGetNamedBufferParameterui64vNV GLEW_GET_FUN(__glewGetNamedBufferParameterui64vNV) +#define glIsBufferResidentNV GLEW_GET_FUN(__glewIsBufferResidentNV) +#define glIsNamedBufferResidentNV GLEW_GET_FUN(__glewIsNamedBufferResidentNV) +#define glMakeBufferNonResidentNV GLEW_GET_FUN(__glewMakeBufferNonResidentNV) +#define glMakeBufferResidentNV GLEW_GET_FUN(__glewMakeBufferResidentNV) +#define glMakeNamedBufferNonResidentNV GLEW_GET_FUN(__glewMakeNamedBufferNonResidentNV) +#define glMakeNamedBufferResidentNV GLEW_GET_FUN(__glewMakeNamedBufferResidentNV) +#define glProgramUniformui64NV GLEW_GET_FUN(__glewProgramUniformui64NV) +#define glProgramUniformui64vNV GLEW_GET_FUN(__glewProgramUniformui64vNV) +#define glUniformui64NV GLEW_GET_FUN(__glewUniformui64NV) +#define glUniformui64vNV GLEW_GET_FUN(__glewUniformui64vNV) + +#define GLEW_NV_shader_buffer_load GLEW_GET_VAR(__GLEW_NV_shader_buffer_load) + +#endif /* GL_NV_shader_buffer_load */ + +/* ------------------- GL_NV_shader_storage_buffer_object ------------------ */ + +#ifndef GL_NV_shader_storage_buffer_object +#define GL_NV_shader_storage_buffer_object 1 + +#define GLEW_NV_shader_storage_buffer_object GLEW_GET_VAR(__GLEW_NV_shader_storage_buffer_object) + +#endif /* GL_NV_shader_storage_buffer_object */ + +/* ---------------------- GL_NV_tessellation_program5 ---------------------- */ + +#ifndef GL_NV_tessellation_program5 +#define GL_NV_tessellation_program5 1 + +#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 +#define GL_TESS_CONTROL_PROGRAM_NV 0x891E +#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F +#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 +#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 + +#define GLEW_NV_tessellation_program5 GLEW_GET_VAR(__GLEW_NV_tessellation_program5) + +#endif /* GL_NV_tessellation_program5 */ + +/* -------------------------- GL_NV_texgen_emboss -------------------------- */ + +#ifndef GL_NV_texgen_emboss +#define GL_NV_texgen_emboss 1 + +#define GL_EMBOSS_LIGHT_NV 0x855D +#define GL_EMBOSS_CONSTANT_NV 0x855E +#define GL_EMBOSS_MAP_NV 0x855F + +#define GLEW_NV_texgen_emboss GLEW_GET_VAR(__GLEW_NV_texgen_emboss) + +#endif /* GL_NV_texgen_emboss */ + +/* ------------------------ GL_NV_texgen_reflection ------------------------ */ + +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 + +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 + +#define GLEW_NV_texgen_reflection GLEW_GET_VAR(__GLEW_NV_texgen_reflection) + +#endif /* GL_NV_texgen_reflection */ + +/* ------------------------- GL_NV_texture_barrier ------------------------- */ + +#ifndef GL_NV_texture_barrier +#define GL_NV_texture_barrier 1 + +typedef void (GLAPIENTRY * PFNGLTEXTUREBARRIERNVPROC) (void); + +#define glTextureBarrierNV GLEW_GET_FUN(__glewTextureBarrierNV) + +#define GLEW_NV_texture_barrier GLEW_GET_VAR(__GLEW_NV_texture_barrier) + +#endif /* GL_NV_texture_barrier */ + +/* --------------------- GL_NV_texture_compression_vtc --------------------- */ + +#ifndef GL_NV_texture_compression_vtc +#define GL_NV_texture_compression_vtc 1 + +#define GLEW_NV_texture_compression_vtc GLEW_GET_VAR(__GLEW_NV_texture_compression_vtc) + +#endif /* GL_NV_texture_compression_vtc */ + +/* ----------------------- GL_NV_texture_env_combine4 ---------------------- */ + +#ifndef GL_NV_texture_env_combine4 +#define GL_NV_texture_env_combine4 1 + +#define GL_COMBINE4_NV 0x8503 +#define GL_SOURCE3_RGB_NV 0x8583 +#define GL_SOURCE3_ALPHA_NV 0x858B +#define GL_OPERAND3_RGB_NV 0x8593 +#define GL_OPERAND3_ALPHA_NV 0x859B + +#define GLEW_NV_texture_env_combine4 GLEW_GET_VAR(__GLEW_NV_texture_env_combine4) + +#endif /* GL_NV_texture_env_combine4 */ + +/* ---------------------- GL_NV_texture_expand_normal ---------------------- */ + +#ifndef GL_NV_texture_expand_normal +#define GL_NV_texture_expand_normal 1 + +#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F + +#define GLEW_NV_texture_expand_normal GLEW_GET_VAR(__GLEW_NV_texture_expand_normal) + +#endif /* GL_NV_texture_expand_normal */ + +/* ----------------------- GL_NV_texture_multisample ----------------------- */ + +#ifndef GL_NV_texture_multisample +#define GL_NV_texture_multisample 1 + +#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045 +#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046 + +typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); + +#define glTexImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage2DMultisampleCoverageNV) +#define glTexImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage3DMultisampleCoverageNV) +#define glTextureImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage2DMultisampleCoverageNV) +#define glTextureImage2DMultisampleNV GLEW_GET_FUN(__glewTextureImage2DMultisampleNV) +#define glTextureImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage3DMultisampleCoverageNV) +#define glTextureImage3DMultisampleNV GLEW_GET_FUN(__glewTextureImage3DMultisampleNV) + +#define GLEW_NV_texture_multisample GLEW_GET_VAR(__GLEW_NV_texture_multisample) + +#endif /* GL_NV_texture_multisample */ + +/* ------------------------ GL_NV_texture_rectangle ------------------------ */ + +#ifndef GL_NV_texture_rectangle +#define GL_NV_texture_rectangle 1 + +#define GL_TEXTURE_RECTANGLE_NV 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 + +#define GLEW_NV_texture_rectangle GLEW_GET_VAR(__GLEW_NV_texture_rectangle) + +#endif /* GL_NV_texture_rectangle */ + +/* -------------------------- GL_NV_texture_shader ------------------------- */ + +#ifndef GL_NV_texture_shader +#define GL_NV_texture_shader 1 + +#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C +#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D +#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E +#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_SHADER_CONSISTENT_NV 0x86DD +#define GL_TEXTURE_SHADER_NV 0x86DE +#define GL_SHADER_OPERATION_NV 0x86DF +#define GL_CULL_MODES_NV 0x86E0 +#define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 +#define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3 +#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 +#define GL_CONST_EYE_NV 0x86E5 +#define GL_PASS_THROUGH_NV 0x86E6 +#define GL_CULL_FRAGMENT_NV 0x86E7 +#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 +#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 +#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA +#define GL_DOT_PRODUCT_NV 0x86EC +#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED +#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE +#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 +#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 +#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 +#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D +#define GL_HI_SCALE_NV 0x870E +#define GL_LO_SCALE_NV 0x870F +#define GL_DS_SCALE_NV 0x8710 +#define GL_DT_SCALE_NV 0x8711 +#define GL_MAGNITUDE_SCALE_NV 0x8712 +#define GL_VIBRANCE_SCALE_NV 0x8713 +#define GL_HI_BIAS_NV 0x8714 +#define GL_LO_BIAS_NV 0x8715 +#define GL_DS_BIAS_NV 0x8716 +#define GL_DT_BIAS_NV 0x8717 +#define GL_MAGNITUDE_BIAS_NV 0x8718 +#define GL_VIBRANCE_BIAS_NV 0x8719 +#define GL_TEXTURE_BORDER_VALUES_NV 0x871A +#define GL_TEXTURE_HI_SIZE_NV 0x871B +#define GL_TEXTURE_LO_SIZE_NV 0x871C +#define GL_TEXTURE_DS_SIZE_NV 0x871D +#define GL_TEXTURE_DT_SIZE_NV 0x871E +#define GL_TEXTURE_MAG_SIZE_NV 0x871F + +#define GLEW_NV_texture_shader GLEW_GET_VAR(__GLEW_NV_texture_shader) + +#endif /* GL_NV_texture_shader */ + +/* ------------------------- GL_NV_texture_shader2 ------------------------- */ + +#ifndef GL_NV_texture_shader2 +#define GL_NV_texture_shader2 1 + +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D + +#define GLEW_NV_texture_shader2 GLEW_GET_VAR(__GLEW_NV_texture_shader2) + +#endif /* GL_NV_texture_shader2 */ + +/* ------------------------- GL_NV_texture_shader3 ------------------------- */ + +#ifndef GL_NV_texture_shader3 +#define GL_NV_texture_shader3 1 + +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 +#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 +#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 +#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 +#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 +#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A +#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B +#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C +#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D +#define GL_HILO8_NV 0x885E +#define GL_SIGNED_HILO8_NV 0x885F +#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 + +#define GLEW_NV_texture_shader3 GLEW_GET_VAR(__GLEW_NV_texture_shader3) + +#endif /* GL_NV_texture_shader3 */ + +/* ------------------------ GL_NV_transform_feedback ----------------------- */ + +#ifndef GL_NV_transform_feedback +#define GL_NV_transform_feedback 1 + +#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 +#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 +#define GL_TEXTURE_COORD_NV 0x8C79 +#define GL_CLIP_DISTANCE_NV 0x8C7A +#define GL_VERTEX_ID_NV 0x8C7B +#define GL_PRIMITIVE_ID_NV 0x8C7C +#define GL_GENERIC_ATTRIB_NV 0x8C7D +#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 +#define GL_ACTIVE_VARYINGS_NV 0x8C81 +#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 +#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 +#define GL_PRIMITIVES_GENERATED_NV 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 +#define GL_RASTERIZER_DISCARD_NV 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B +#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C +#define GL_SEPARATE_ATTRIBS_NV 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F + +typedef void (GLAPIENTRY * PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); +typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); +typedef GLint (GLAPIENTRY * PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); + +#define glActiveVaryingNV GLEW_GET_FUN(__glewActiveVaryingNV) +#define glBeginTransformFeedbackNV GLEW_GET_FUN(__glewBeginTransformFeedbackNV) +#define glBindBufferBaseNV GLEW_GET_FUN(__glewBindBufferBaseNV) +#define glBindBufferOffsetNV GLEW_GET_FUN(__glewBindBufferOffsetNV) +#define glBindBufferRangeNV GLEW_GET_FUN(__glewBindBufferRangeNV) +#define glEndTransformFeedbackNV GLEW_GET_FUN(__glewEndTransformFeedbackNV) +#define glGetActiveVaryingNV GLEW_GET_FUN(__glewGetActiveVaryingNV) +#define glGetTransformFeedbackVaryingNV GLEW_GET_FUN(__glewGetTransformFeedbackVaryingNV) +#define glGetVaryingLocationNV GLEW_GET_FUN(__glewGetVaryingLocationNV) +#define glTransformFeedbackAttribsNV GLEW_GET_FUN(__glewTransformFeedbackAttribsNV) +#define glTransformFeedbackVaryingsNV GLEW_GET_FUN(__glewTransformFeedbackVaryingsNV) + +#define GLEW_NV_transform_feedback GLEW_GET_VAR(__GLEW_NV_transform_feedback) + +#endif /* GL_NV_transform_feedback */ + +/* ----------------------- GL_NV_transform_feedback2 ----------------------- */ + +#ifndef GL_NV_transform_feedback2 +#define GL_NV_transform_feedback2 1 + +#define GL_TRANSFORM_FEEDBACK_NV 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 + +typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); +typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint* ids); +typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); + +#define glBindTransformFeedbackNV GLEW_GET_FUN(__glewBindTransformFeedbackNV) +#define glDeleteTransformFeedbacksNV GLEW_GET_FUN(__glewDeleteTransformFeedbacksNV) +#define glDrawTransformFeedbackNV GLEW_GET_FUN(__glewDrawTransformFeedbackNV) +#define glGenTransformFeedbacksNV GLEW_GET_FUN(__glewGenTransformFeedbacksNV) +#define glIsTransformFeedbackNV GLEW_GET_FUN(__glewIsTransformFeedbackNV) +#define glPauseTransformFeedbackNV GLEW_GET_FUN(__glewPauseTransformFeedbackNV) +#define glResumeTransformFeedbackNV GLEW_GET_FUN(__glewResumeTransformFeedbackNV) + +#define GLEW_NV_transform_feedback2 GLEW_GET_VAR(__GLEW_NV_transform_feedback2) + +#endif /* GL_NV_transform_feedback2 */ + +/* -------------------------- GL_NV_vdpau_interop -------------------------- */ + +#ifndef GL_NV_vdpau_interop +#define GL_NV_vdpau_interop 1 + +#define GL_SURFACE_STATE_NV 0x86EB +#define GL_SURFACE_REGISTERED_NV 0x86FD +#define GL_SURFACE_MAPPED_NV 0x8700 +#define GL_WRITE_DISCARD_NV 0x88BE + +typedef GLintptr GLvdpauSurfaceNV; + +typedef void (GLAPIENTRY * PFNGLVDPAUFININVPROC) (void); +typedef void (GLAPIENTRY * PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei* length, GLint *values); +typedef void (GLAPIENTRY * PFNGLVDPAUINITNVPROC) (const void* vdpDevice, const GLvoid*getProcAddress); +typedef void (GLAPIENTRY * PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); +typedef void (GLAPIENTRY * PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV* surfaces); +typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef void (GLAPIENTRY * PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access); +typedef void (GLAPIENTRY * PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV* surfaces); +typedef void (GLAPIENTRY * PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface); + +#define glVDPAUFiniNV GLEW_GET_FUN(__glewVDPAUFiniNV) +#define glVDPAUGetSurfaceivNV GLEW_GET_FUN(__glewVDPAUGetSurfaceivNV) +#define glVDPAUInitNV GLEW_GET_FUN(__glewVDPAUInitNV) +#define glVDPAUIsSurfaceNV GLEW_GET_FUN(__glewVDPAUIsSurfaceNV) +#define glVDPAUMapSurfacesNV GLEW_GET_FUN(__glewVDPAUMapSurfacesNV) +#define glVDPAURegisterOutputSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterOutputSurfaceNV) +#define glVDPAURegisterVideoSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterVideoSurfaceNV) +#define glVDPAUSurfaceAccessNV GLEW_GET_FUN(__glewVDPAUSurfaceAccessNV) +#define glVDPAUUnmapSurfacesNV GLEW_GET_FUN(__glewVDPAUUnmapSurfacesNV) +#define glVDPAUUnregisterSurfaceNV GLEW_GET_FUN(__glewVDPAUUnregisterSurfaceNV) + +#define GLEW_NV_vdpau_interop GLEW_GET_VAR(__GLEW_NV_vdpau_interop) + +#endif /* GL_NV_vdpau_interop */ + +/* ------------------------ GL_NV_vertex_array_range ----------------------- */ + +#ifndef GL_NV_vertex_array_range +#define GL_NV_vertex_array_range 1 + +#define GL_VERTEX_ARRAY_RANGE_NV 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E +#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 + +typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, GLvoid *pointer); + +#define glFlushVertexArrayRangeNV GLEW_GET_FUN(__glewFlushVertexArrayRangeNV) +#define glVertexArrayRangeNV GLEW_GET_FUN(__glewVertexArrayRangeNV) + +#define GLEW_NV_vertex_array_range GLEW_GET_VAR(__GLEW_NV_vertex_array_range) + +#endif /* GL_NV_vertex_array_range */ + +/* ----------------------- GL_NV_vertex_array_range2 ----------------------- */ + +#ifndef GL_NV_vertex_array_range2 +#define GL_NV_vertex_array_range2 1 + +#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 + +#define GLEW_NV_vertex_array_range2 GLEW_GET_VAR(__GLEW_NV_vertex_array_range2) + +#endif /* GL_NV_vertex_array_range2 */ + +/* ------------------- GL_NV_vertex_attrib_integer_64bit ------------------- */ + +#ifndef GL_NV_vertex_attrib_integer_64bit +#define GL_NV_vertex_attrib_integer_64bit 1 + +#define GL_INT64_NV 0x140E +#define GL_UNSIGNED_INT64_NV 0x140F + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); + +#define glGetVertexAttribLi64vNV GLEW_GET_FUN(__glewGetVertexAttribLi64vNV) +#define glGetVertexAttribLui64vNV GLEW_GET_FUN(__glewGetVertexAttribLui64vNV) +#define glVertexAttribL1i64NV GLEW_GET_FUN(__glewVertexAttribL1i64NV) +#define glVertexAttribL1i64vNV GLEW_GET_FUN(__glewVertexAttribL1i64vNV) +#define glVertexAttribL1ui64NV GLEW_GET_FUN(__glewVertexAttribL1ui64NV) +#define glVertexAttribL1ui64vNV GLEW_GET_FUN(__glewVertexAttribL1ui64vNV) +#define glVertexAttribL2i64NV GLEW_GET_FUN(__glewVertexAttribL2i64NV) +#define glVertexAttribL2i64vNV GLEW_GET_FUN(__glewVertexAttribL2i64vNV) +#define glVertexAttribL2ui64NV GLEW_GET_FUN(__glewVertexAttribL2ui64NV) +#define glVertexAttribL2ui64vNV GLEW_GET_FUN(__glewVertexAttribL2ui64vNV) +#define glVertexAttribL3i64NV GLEW_GET_FUN(__glewVertexAttribL3i64NV) +#define glVertexAttribL3i64vNV GLEW_GET_FUN(__glewVertexAttribL3i64vNV) +#define glVertexAttribL3ui64NV GLEW_GET_FUN(__glewVertexAttribL3ui64NV) +#define glVertexAttribL3ui64vNV GLEW_GET_FUN(__glewVertexAttribL3ui64vNV) +#define glVertexAttribL4i64NV GLEW_GET_FUN(__glewVertexAttribL4i64NV) +#define glVertexAttribL4i64vNV GLEW_GET_FUN(__glewVertexAttribL4i64vNV) +#define glVertexAttribL4ui64NV GLEW_GET_FUN(__glewVertexAttribL4ui64NV) +#define glVertexAttribL4ui64vNV GLEW_GET_FUN(__glewVertexAttribL4ui64vNV) +#define glVertexAttribLFormatNV GLEW_GET_FUN(__glewVertexAttribLFormatNV) + +#define GLEW_NV_vertex_attrib_integer_64bit GLEW_GET_VAR(__GLEW_NV_vertex_attrib_integer_64bit) + +#endif /* GL_NV_vertex_attrib_integer_64bit */ + +/* ------------------- GL_NV_vertex_buffer_unified_memory ------------------ */ + +#ifndef GL_NV_vertex_buffer_unified_memory +#define GL_NV_vertex_buffer_unified_memory 1 + +#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E +#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F +#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 +#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 +#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 +#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 +#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 +#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 +#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 +#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 +#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 +#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 +#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A +#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B +#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C +#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D +#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E +#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F +#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 +#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 +#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 +#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 +#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40 +#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41 +#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42 + +typedef void (GLAPIENTRY * PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT result[]); +typedef void (GLAPIENTRY * PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); + +#define glBufferAddressRangeNV GLEW_GET_FUN(__glewBufferAddressRangeNV) +#define glColorFormatNV GLEW_GET_FUN(__glewColorFormatNV) +#define glEdgeFlagFormatNV GLEW_GET_FUN(__glewEdgeFlagFormatNV) +#define glFogCoordFormatNV GLEW_GET_FUN(__glewFogCoordFormatNV) +#define glGetIntegerui64i_vNV GLEW_GET_FUN(__glewGetIntegerui64i_vNV) +#define glIndexFormatNV GLEW_GET_FUN(__glewIndexFormatNV) +#define glNormalFormatNV GLEW_GET_FUN(__glewNormalFormatNV) +#define glSecondaryColorFormatNV GLEW_GET_FUN(__glewSecondaryColorFormatNV) +#define glTexCoordFormatNV GLEW_GET_FUN(__glewTexCoordFormatNV) +#define glVertexAttribFormatNV GLEW_GET_FUN(__glewVertexAttribFormatNV) +#define glVertexAttribIFormatNV GLEW_GET_FUN(__glewVertexAttribIFormatNV) +#define glVertexFormatNV GLEW_GET_FUN(__glewVertexFormatNV) + +#define GLEW_NV_vertex_buffer_unified_memory GLEW_GET_VAR(__GLEW_NV_vertex_buffer_unified_memory) + +#endif /* GL_NV_vertex_buffer_unified_memory */ + +/* -------------------------- GL_NV_vertex_program ------------------------- */ + +#ifndef GL_NV_vertex_program +#define GL_NV_vertex_program 1 + +#define GL_VERTEX_PROGRAM_NV 0x8620 +#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 +#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 +#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 +#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 +#define GL_CURRENT_ATTRIB_NV 0x8626 +#define GL_PROGRAM_LENGTH_NV 0x8627 +#define GL_PROGRAM_STRING_NV 0x8628 +#define GL_MODELVIEW_PROJECTION_NV 0x8629 +#define GL_IDENTITY_NV 0x862A +#define GL_INVERSE_NV 0x862B +#define GL_TRANSPOSE_NV 0x862C +#define GL_INVERSE_TRANSPOSE_NV 0x862D +#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E +#define GL_MAX_TRACK_MATRICES_NV 0x862F +#define GL_MATRIX0_NV 0x8630 +#define GL_MATRIX1_NV 0x8631 +#define GL_MATRIX2_NV 0x8632 +#define GL_MATRIX3_NV 0x8633 +#define GL_MATRIX4_NV 0x8634 +#define GL_MATRIX5_NV 0x8635 +#define GL_MATRIX6_NV 0x8636 +#define GL_MATRIX7_NV 0x8637 +#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 +#define GL_CURRENT_MATRIX_NV 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 +#define GL_PROGRAM_PARAMETER_NV 0x8644 +#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 +#define GL_PROGRAM_TARGET_NV 0x8646 +#define GL_PROGRAM_RESIDENT_NV 0x8647 +#define GL_TRACK_MATRIX_NV 0x8648 +#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 +#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A +#define GL_PROGRAM_ERROR_POSITION_NV 0x864B +#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 +#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 +#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 +#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 +#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 +#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 +#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 +#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 +#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 +#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 +#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A +#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B +#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C +#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D +#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E +#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F +#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 +#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 +#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 +#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 +#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 +#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 +#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 +#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 +#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 +#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 +#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A +#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B +#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C +#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D +#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E +#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F +#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 +#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 +#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 +#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 +#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 +#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 +#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 +#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 +#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 +#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 +#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A +#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B +#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C +#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D +#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E +#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F + +typedef GLboolean (GLAPIENTRY * PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint* ids, GLboolean *residences); +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte* program); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid** pointer); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte* program); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei n, const GLubyte* v); + +#define glAreProgramsResidentNV GLEW_GET_FUN(__glewAreProgramsResidentNV) +#define glBindProgramNV GLEW_GET_FUN(__glewBindProgramNV) +#define glDeleteProgramsNV GLEW_GET_FUN(__glewDeleteProgramsNV) +#define glExecuteProgramNV GLEW_GET_FUN(__glewExecuteProgramNV) +#define glGenProgramsNV GLEW_GET_FUN(__glewGenProgramsNV) +#define glGetProgramParameterdvNV GLEW_GET_FUN(__glewGetProgramParameterdvNV) +#define glGetProgramParameterfvNV GLEW_GET_FUN(__glewGetProgramParameterfvNV) +#define glGetProgramStringNV GLEW_GET_FUN(__glewGetProgramStringNV) +#define glGetProgramivNV GLEW_GET_FUN(__glewGetProgramivNV) +#define glGetTrackMatrixivNV GLEW_GET_FUN(__glewGetTrackMatrixivNV) +#define glGetVertexAttribPointervNV GLEW_GET_FUN(__glewGetVertexAttribPointervNV) +#define glGetVertexAttribdvNV GLEW_GET_FUN(__glewGetVertexAttribdvNV) +#define glGetVertexAttribfvNV GLEW_GET_FUN(__glewGetVertexAttribfvNV) +#define glGetVertexAttribivNV GLEW_GET_FUN(__glewGetVertexAttribivNV) +#define glIsProgramNV GLEW_GET_FUN(__glewIsProgramNV) +#define glLoadProgramNV GLEW_GET_FUN(__glewLoadProgramNV) +#define glProgramParameter4dNV GLEW_GET_FUN(__glewProgramParameter4dNV) +#define glProgramParameter4dvNV GLEW_GET_FUN(__glewProgramParameter4dvNV) +#define glProgramParameter4fNV GLEW_GET_FUN(__glewProgramParameter4fNV) +#define glProgramParameter4fvNV GLEW_GET_FUN(__glewProgramParameter4fvNV) +#define glProgramParameters4dvNV GLEW_GET_FUN(__glewProgramParameters4dvNV) +#define glProgramParameters4fvNV GLEW_GET_FUN(__glewProgramParameters4fvNV) +#define glRequestResidentProgramsNV GLEW_GET_FUN(__glewRequestResidentProgramsNV) +#define glTrackMatrixNV GLEW_GET_FUN(__glewTrackMatrixNV) +#define glVertexAttrib1dNV GLEW_GET_FUN(__glewVertexAttrib1dNV) +#define glVertexAttrib1dvNV GLEW_GET_FUN(__glewVertexAttrib1dvNV) +#define glVertexAttrib1fNV GLEW_GET_FUN(__glewVertexAttrib1fNV) +#define glVertexAttrib1fvNV GLEW_GET_FUN(__glewVertexAttrib1fvNV) +#define glVertexAttrib1sNV GLEW_GET_FUN(__glewVertexAttrib1sNV) +#define glVertexAttrib1svNV GLEW_GET_FUN(__glewVertexAttrib1svNV) +#define glVertexAttrib2dNV GLEW_GET_FUN(__glewVertexAttrib2dNV) +#define glVertexAttrib2dvNV GLEW_GET_FUN(__glewVertexAttrib2dvNV) +#define glVertexAttrib2fNV GLEW_GET_FUN(__glewVertexAttrib2fNV) +#define glVertexAttrib2fvNV GLEW_GET_FUN(__glewVertexAttrib2fvNV) +#define glVertexAttrib2sNV GLEW_GET_FUN(__glewVertexAttrib2sNV) +#define glVertexAttrib2svNV GLEW_GET_FUN(__glewVertexAttrib2svNV) +#define glVertexAttrib3dNV GLEW_GET_FUN(__glewVertexAttrib3dNV) +#define glVertexAttrib3dvNV GLEW_GET_FUN(__glewVertexAttrib3dvNV) +#define glVertexAttrib3fNV GLEW_GET_FUN(__glewVertexAttrib3fNV) +#define glVertexAttrib3fvNV GLEW_GET_FUN(__glewVertexAttrib3fvNV) +#define glVertexAttrib3sNV GLEW_GET_FUN(__glewVertexAttrib3sNV) +#define glVertexAttrib3svNV GLEW_GET_FUN(__glewVertexAttrib3svNV) +#define glVertexAttrib4dNV GLEW_GET_FUN(__glewVertexAttrib4dNV) +#define glVertexAttrib4dvNV GLEW_GET_FUN(__glewVertexAttrib4dvNV) +#define glVertexAttrib4fNV GLEW_GET_FUN(__glewVertexAttrib4fNV) +#define glVertexAttrib4fvNV GLEW_GET_FUN(__glewVertexAttrib4fvNV) +#define glVertexAttrib4sNV GLEW_GET_FUN(__glewVertexAttrib4sNV) +#define glVertexAttrib4svNV GLEW_GET_FUN(__glewVertexAttrib4svNV) +#define glVertexAttrib4ubNV GLEW_GET_FUN(__glewVertexAttrib4ubNV) +#define glVertexAttrib4ubvNV GLEW_GET_FUN(__glewVertexAttrib4ubvNV) +#define glVertexAttribPointerNV GLEW_GET_FUN(__glewVertexAttribPointerNV) +#define glVertexAttribs1dvNV GLEW_GET_FUN(__glewVertexAttribs1dvNV) +#define glVertexAttribs1fvNV GLEW_GET_FUN(__glewVertexAttribs1fvNV) +#define glVertexAttribs1svNV GLEW_GET_FUN(__glewVertexAttribs1svNV) +#define glVertexAttribs2dvNV GLEW_GET_FUN(__glewVertexAttribs2dvNV) +#define glVertexAttribs2fvNV GLEW_GET_FUN(__glewVertexAttribs2fvNV) +#define glVertexAttribs2svNV GLEW_GET_FUN(__glewVertexAttribs2svNV) +#define glVertexAttribs3dvNV GLEW_GET_FUN(__glewVertexAttribs3dvNV) +#define glVertexAttribs3fvNV GLEW_GET_FUN(__glewVertexAttribs3fvNV) +#define glVertexAttribs3svNV GLEW_GET_FUN(__glewVertexAttribs3svNV) +#define glVertexAttribs4dvNV GLEW_GET_FUN(__glewVertexAttribs4dvNV) +#define glVertexAttribs4fvNV GLEW_GET_FUN(__glewVertexAttribs4fvNV) +#define glVertexAttribs4svNV GLEW_GET_FUN(__glewVertexAttribs4svNV) +#define glVertexAttribs4ubvNV GLEW_GET_FUN(__glewVertexAttribs4ubvNV) + +#define GLEW_NV_vertex_program GLEW_GET_VAR(__GLEW_NV_vertex_program) + +#endif /* GL_NV_vertex_program */ + +/* ------------------------ GL_NV_vertex_program1_1 ------------------------ */ + +#ifndef GL_NV_vertex_program1_1 +#define GL_NV_vertex_program1_1 1 + +#define GLEW_NV_vertex_program1_1 GLEW_GET_VAR(__GLEW_NV_vertex_program1_1) + +#endif /* GL_NV_vertex_program1_1 */ + +/* ------------------------- GL_NV_vertex_program2 ------------------------- */ + +#ifndef GL_NV_vertex_program2 +#define GL_NV_vertex_program2 1 + +#define GLEW_NV_vertex_program2 GLEW_GET_VAR(__GLEW_NV_vertex_program2) + +#endif /* GL_NV_vertex_program2 */ + +/* ---------------------- GL_NV_vertex_program2_option --------------------- */ + +#ifndef GL_NV_vertex_program2_option +#define GL_NV_vertex_program2_option 1 + +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 + +#define GLEW_NV_vertex_program2_option GLEW_GET_VAR(__GLEW_NV_vertex_program2_option) + +#endif /* GL_NV_vertex_program2_option */ + +/* ------------------------- GL_NV_vertex_program3 ------------------------- */ + +#ifndef GL_NV_vertex_program3 +#define GL_NV_vertex_program3 1 + +#define MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C + +#define GLEW_NV_vertex_program3 GLEW_GET_VAR(__GLEW_NV_vertex_program3) + +#endif /* GL_NV_vertex_program3 */ + +/* ------------------------- GL_NV_vertex_program4 ------------------------- */ + +#ifndef GL_NV_vertex_program4 +#define GL_NV_vertex_program4 1 + +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD + +#define GLEW_NV_vertex_program4 GLEW_GET_VAR(__GLEW_NV_vertex_program4) + +#endif /* GL_NV_vertex_program4 */ + +/* -------------------------- GL_NV_video_capture -------------------------- */ + +#ifndef GL_NV_video_capture +#define GL_NV_video_capture 1 + +#define GL_VIDEO_BUFFER_NV 0x9020 +#define GL_VIDEO_BUFFER_BINDING_NV 0x9021 +#define GL_FIELD_UPPER_NV 0x9022 +#define GL_FIELD_LOWER_NV 0x9023 +#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 +#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 +#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 +#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 +#define GL_VIDEO_BUFFER_PITCH_NV 0x9028 +#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 +#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A +#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B +#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C +#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D +#define GL_PARTIAL_SUCCESS_NV 0x902E +#define GL_SUCCESS_NV 0x902F +#define GL_FAILURE_NV 0x9030 +#define GL_YCBYCR8_422_NV 0x9031 +#define GL_YCBAYCR8A_4224_NV 0x9032 +#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 +#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 +#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 +#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 +#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037 +#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 +#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 +#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A +#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B +#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C + +typedef void (GLAPIENTRY * PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); +typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); +typedef void (GLAPIENTRY * PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint* params); +typedef GLenum (GLAPIENTRY * PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint* sequence_num, GLuint64EXT *capture_time); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint* params); + +#define glBeginVideoCaptureNV GLEW_GET_FUN(__glewBeginVideoCaptureNV) +#define glBindVideoCaptureStreamBufferNV GLEW_GET_FUN(__glewBindVideoCaptureStreamBufferNV) +#define glBindVideoCaptureStreamTextureNV GLEW_GET_FUN(__glewBindVideoCaptureStreamTextureNV) +#define glEndVideoCaptureNV GLEW_GET_FUN(__glewEndVideoCaptureNV) +#define glGetVideoCaptureStreamdvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamdvNV) +#define glGetVideoCaptureStreamfvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamfvNV) +#define glGetVideoCaptureStreamivNV GLEW_GET_FUN(__glewGetVideoCaptureStreamivNV) +#define glGetVideoCaptureivNV GLEW_GET_FUN(__glewGetVideoCaptureivNV) +#define glVideoCaptureNV GLEW_GET_FUN(__glewVideoCaptureNV) +#define glVideoCaptureStreamParameterdvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterdvNV) +#define glVideoCaptureStreamParameterfvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterfvNV) +#define glVideoCaptureStreamParameterivNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterivNV) + +#define GLEW_NV_video_capture GLEW_GET_VAR(__GLEW_NV_video_capture) + +#endif /* GL_NV_video_capture */ + +/* ------------------------ GL_OES_byte_coordinates ------------------------ */ + +#ifndef GL_OES_byte_coordinates +#define GL_OES_byte_coordinates 1 + +#define GLEW_OES_byte_coordinates GLEW_GET_VAR(__GLEW_OES_byte_coordinates) + +#endif /* GL_OES_byte_coordinates */ + +/* ------------------- GL_OES_compressed_paletted_texture ------------------ */ + +#ifndef GL_OES_compressed_paletted_texture +#define GL_OES_compressed_paletted_texture 1 + +#define GL_PALETTE4_RGB8_OES 0x8B90 +#define GL_PALETTE4_RGBA8_OES 0x8B91 +#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 +#define GL_PALETTE4_RGBA4_OES 0x8B93 +#define GL_PALETTE4_RGB5_A1_OES 0x8B94 +#define GL_PALETTE8_RGB8_OES 0x8B95 +#define GL_PALETTE8_RGBA8_OES 0x8B96 +#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 +#define GL_PALETTE8_RGBA4_OES 0x8B98 +#define GL_PALETTE8_RGB5_A1_OES 0x8B99 + +#define GLEW_OES_compressed_paletted_texture GLEW_GET_VAR(__GLEW_OES_compressed_paletted_texture) + +#endif /* GL_OES_compressed_paletted_texture */ + +/* --------------------------- GL_OES_read_format -------------------------- */ + +#ifndef GL_OES_read_format +#define GL_OES_read_format 1 + +#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B + +#define GLEW_OES_read_format GLEW_GET_VAR(__GLEW_OES_read_format) + +#endif /* GL_OES_read_format */ + +/* ------------------------ GL_OES_single_precision ------------------------ */ + +#ifndef GL_OES_single_precision +#define GL_OES_single_precision 1 + +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFOESPROC) (GLclampd depth); +typedef void (GLAPIENTRY * PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat* equation); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFOESPROC) (GLclampf n, GLclampf f); +typedef void (GLAPIENTRY * PFNGLFRUSTUMFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); +typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEFOESPROC) (GLenum plane, GLfloat* equation); +typedef void (GLAPIENTRY * PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); + +#define glClearDepthfOES GLEW_GET_FUN(__glewClearDepthfOES) +#define glClipPlanefOES GLEW_GET_FUN(__glewClipPlanefOES) +#define glDepthRangefOES GLEW_GET_FUN(__glewDepthRangefOES) +#define glFrustumfOES GLEW_GET_FUN(__glewFrustumfOES) +#define glGetClipPlanefOES GLEW_GET_FUN(__glewGetClipPlanefOES) +#define glOrthofOES GLEW_GET_FUN(__glewOrthofOES) + +#define GLEW_OES_single_precision GLEW_GET_VAR(__GLEW_OES_single_precision) + +#endif /* GL_OES_single_precision */ + +/* ---------------------------- GL_OML_interlace --------------------------- */ + +#ifndef GL_OML_interlace +#define GL_OML_interlace 1 + +#define GL_INTERLACE_OML 0x8980 +#define GL_INTERLACE_READ_OML 0x8981 + +#define GLEW_OML_interlace GLEW_GET_VAR(__GLEW_OML_interlace) + +#endif /* GL_OML_interlace */ + +/* ---------------------------- GL_OML_resample ---------------------------- */ + +#ifndef GL_OML_resample +#define GL_OML_resample 1 + +#define GL_PACK_RESAMPLE_OML 0x8984 +#define GL_UNPACK_RESAMPLE_OML 0x8985 +#define GL_RESAMPLE_REPLICATE_OML 0x8986 +#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 +#define GL_RESAMPLE_AVERAGE_OML 0x8988 +#define GL_RESAMPLE_DECIMATE_OML 0x8989 + +#define GLEW_OML_resample GLEW_GET_VAR(__GLEW_OML_resample) + +#endif /* GL_OML_resample */ + +/* ---------------------------- GL_OML_subsample --------------------------- */ + +#ifndef GL_OML_subsample +#define GL_OML_subsample 1 + +#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 +#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 + +#define GLEW_OML_subsample GLEW_GET_VAR(__GLEW_OML_subsample) + +#endif /* GL_OML_subsample */ + +/* --------------------------- GL_PGI_misc_hints --------------------------- */ + +#ifndef GL_PGI_misc_hints +#define GL_PGI_misc_hints 1 + +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 107000 +#define GL_CONSERVE_MEMORY_HINT_PGI 107005 +#define GL_RECLAIM_MEMORY_HINT_PGI 107006 +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 107010 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 107011 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 107012 +#define GL_ALWAYS_FAST_HINT_PGI 107020 +#define GL_ALWAYS_SOFT_HINT_PGI 107021 +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 107022 +#define GL_ALLOW_DRAW_WIN_HINT_PGI 107023 +#define GL_ALLOW_DRAW_FRG_HINT_PGI 107024 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 107025 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 107030 +#define GL_STRICT_LIGHTING_HINT_PGI 107031 +#define GL_STRICT_SCISSOR_HINT_PGI 107032 +#define GL_FULL_STIPPLE_HINT_PGI 107033 +#define GL_CLIP_NEAR_HINT_PGI 107040 +#define GL_CLIP_FAR_HINT_PGI 107041 +#define GL_WIDE_LINE_HINT_PGI 107042 +#define GL_BACK_NORMALS_HINT_PGI 107043 + +#define GLEW_PGI_misc_hints GLEW_GET_VAR(__GLEW_PGI_misc_hints) + +#endif /* GL_PGI_misc_hints */ + +/* -------------------------- GL_PGI_vertex_hints -------------------------- */ + +#ifndef GL_PGI_vertex_hints +#define GL_PGI_vertex_hints 1 + +#define GL_VERTEX23_BIT_PGI 0x00000004 +#define GL_VERTEX4_BIT_PGI 0x00000008 +#define GL_COLOR3_BIT_PGI 0x00010000 +#define GL_COLOR4_BIT_PGI 0x00020000 +#define GL_EDGEFLAG_BIT_PGI 0x00040000 +#define GL_INDEX_BIT_PGI 0x00080000 +#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 +#define GL_VERTEX_DATA_HINT_PGI 107050 +#define GL_VERTEX_CONSISTENT_HINT_PGI 107051 +#define GL_MATERIAL_SIDE_HINT_PGI 107052 +#define GL_MAX_VERTEX_HINT_PGI 107053 +#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 +#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 +#define GL_MAT_EMISSION_BIT_PGI 0x00800000 +#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 +#define GL_MAT_SHININESS_BIT_PGI 0x02000000 +#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 +#define GL_NORMAL_BIT_PGI 0x08000000 +#define GL_TEXCOORD1_BIT_PGI 0x10000000 +#define GL_TEXCOORD2_BIT_PGI 0x20000000 +#define GL_TEXCOORD3_BIT_PGI 0x40000000 +#define GL_TEXCOORD4_BIT_PGI 0x80000000 + +#define GLEW_PGI_vertex_hints GLEW_GET_VAR(__GLEW_PGI_vertex_hints) + +#endif /* GL_PGI_vertex_hints */ + +/* ---------------------- GL_REGAL_ES1_0_compatibility --------------------- */ + +#ifndef GL_REGAL_ES1_0_compatibility +#define GL_REGAL_ES1_0_compatibility 1 + +typedef int GLclampx; + +typedef void (GLAPIENTRY * PFNGLALPHAFUNCXPROC) (GLenum func, GLclampx ref); +typedef void (GLAPIENTRY * PFNGLCLEARCOLORXPROC) (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha); +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHXPROC) (GLclampx depth); +typedef void (GLAPIENTRY * PFNGLCOLOR4XPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEXPROC) (GLclampx zNear, GLclampx zFar); +typedef void (GLAPIENTRY * PFNGLFOGXPROC) (GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLFOGXVPROC) (GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLFRUSTUMFPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +typedef void (GLAPIENTRY * PFNGLFRUSTUMXPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +typedef void (GLAPIENTRY * PFNGLLIGHTMODELXPROC) (GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLLIGHTMODELXVPROC) (GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLLIGHTXPROC) (GLenum light, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLLIGHTXVPROC) (GLenum light, GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLLINEWIDTHXPROC) (GLfixed width); +typedef void (GLAPIENTRY * PFNGLLOADMATRIXXPROC) (const GLfixed* m); +typedef void (GLAPIENTRY * PFNGLMATERIALXPROC) (GLenum face, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLMATERIALXVPROC) (GLenum face, GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLMULTMATRIXXPROC) (const GLfixed* m); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4XPROC) (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q); +typedef void (GLAPIENTRY * PFNGLNORMAL3XPROC) (GLfixed nx, GLfixed ny, GLfixed nz); +typedef void (GLAPIENTRY * PFNGLORTHOFPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); +typedef void (GLAPIENTRY * PFNGLORTHOXPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); +typedef void (GLAPIENTRY * PFNGLPOINTSIZEXPROC) (GLfixed size); +typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETXPROC) (GLfixed factor, GLfixed units); +typedef void (GLAPIENTRY * PFNGLROTATEXPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); +typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEXPROC) (GLclampx value, GLboolean invert); +typedef void (GLAPIENTRY * PFNGLSCALEXPROC) (GLfixed x, GLfixed y, GLfixed z); +typedef void (GLAPIENTRY * PFNGLTEXENVXPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLTEXENVXVPROC) (GLenum target, GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERXPROC) (GLenum target, GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLTRANSLATEXPROC) (GLfixed x, GLfixed y, GLfixed z); + +#define glAlphaFuncx GLEW_GET_FUN(__glewAlphaFuncx) +#define glClearColorx GLEW_GET_FUN(__glewClearColorx) +#define glClearDepthx GLEW_GET_FUN(__glewClearDepthx) +#define glColor4x GLEW_GET_FUN(__glewColor4x) +#define glDepthRangex GLEW_GET_FUN(__glewDepthRangex) +#define glFogx GLEW_GET_FUN(__glewFogx) +#define glFogxv GLEW_GET_FUN(__glewFogxv) +#define glFrustumf GLEW_GET_FUN(__glewFrustumf) +#define glFrustumx GLEW_GET_FUN(__glewFrustumx) +#define glLightModelx GLEW_GET_FUN(__glewLightModelx) +#define glLightModelxv GLEW_GET_FUN(__glewLightModelxv) +#define glLightx GLEW_GET_FUN(__glewLightx) +#define glLightxv GLEW_GET_FUN(__glewLightxv) +#define glLineWidthx GLEW_GET_FUN(__glewLineWidthx) +#define glLoadMatrixx GLEW_GET_FUN(__glewLoadMatrixx) +#define glMaterialx GLEW_GET_FUN(__glewMaterialx) +#define glMaterialxv GLEW_GET_FUN(__glewMaterialxv) +#define glMultMatrixx GLEW_GET_FUN(__glewMultMatrixx) +#define glMultiTexCoord4x GLEW_GET_FUN(__glewMultiTexCoord4x) +#define glNormal3x GLEW_GET_FUN(__glewNormal3x) +#define glOrthof GLEW_GET_FUN(__glewOrthof) +#define glOrthox GLEW_GET_FUN(__glewOrthox) +#define glPointSizex GLEW_GET_FUN(__glewPointSizex) +#define glPolygonOffsetx GLEW_GET_FUN(__glewPolygonOffsetx) +#define glRotatex GLEW_GET_FUN(__glewRotatex) +#define glSampleCoveragex GLEW_GET_FUN(__glewSampleCoveragex) +#define glScalex GLEW_GET_FUN(__glewScalex) +#define glTexEnvx GLEW_GET_FUN(__glewTexEnvx) +#define glTexEnvxv GLEW_GET_FUN(__glewTexEnvxv) +#define glTexParameterx GLEW_GET_FUN(__glewTexParameterx) +#define glTranslatex GLEW_GET_FUN(__glewTranslatex) + +#define GLEW_REGAL_ES1_0_compatibility GLEW_GET_VAR(__GLEW_REGAL_ES1_0_compatibility) + +#endif /* GL_REGAL_ES1_0_compatibility */ + +/* ---------------------- GL_REGAL_ES1_1_compatibility --------------------- */ + +#ifndef GL_REGAL_ES1_1_compatibility +#define GL_REGAL_ES1_1_compatibility 1 + +typedef void (GLAPIENTRY * PFNGLCLIPPLANEFPROC) (GLenum plane, const GLfloat* equation); +typedef void (GLAPIENTRY * PFNGLCLIPPLANEXPROC) (GLenum plane, const GLfixed* equation); +typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEFPROC) (GLenum pname, GLfloat eqn[4]); +typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEXPROC) (GLenum pname, GLfixed eqn[4]); +typedef void (GLAPIENTRY * PFNGLGETFIXEDVPROC) (GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETLIGHTXVPROC) (GLenum light, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETMATERIALXVPROC) (GLenum face, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETTEXENVXVPROC) (GLenum env, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERXVPROC) (GLenum target, GLenum pname, GLfixed* params); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERXPROC) (GLenum pname, GLfixed param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERXVPROC) (GLenum pname, const GLfixed* params); +typedef void (GLAPIENTRY * PFNGLPOINTSIZEPOINTEROESPROC) (GLenum type, GLsizei stride, const GLvoid* pointer); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERXVPROC) (GLenum target, GLenum pname, const GLfixed* params); + +#define glClipPlanef GLEW_GET_FUN(__glewClipPlanef) +#define glClipPlanex GLEW_GET_FUN(__glewClipPlanex) +#define glGetClipPlanef GLEW_GET_FUN(__glewGetClipPlanef) +#define glGetClipPlanex GLEW_GET_FUN(__glewGetClipPlanex) +#define glGetFixedv GLEW_GET_FUN(__glewGetFixedv) +#define glGetLightxv GLEW_GET_FUN(__glewGetLightxv) +#define glGetMaterialxv GLEW_GET_FUN(__glewGetMaterialxv) +#define glGetTexEnvxv GLEW_GET_FUN(__glewGetTexEnvxv) +#define glGetTexParameterxv GLEW_GET_FUN(__glewGetTexParameterxv) +#define glPointParameterx GLEW_GET_FUN(__glewPointParameterx) +#define glPointParameterxv GLEW_GET_FUN(__glewPointParameterxv) +#define glPointSizePointerOES GLEW_GET_FUN(__glewPointSizePointerOES) +#define glTexParameterxv GLEW_GET_FUN(__glewTexParameterxv) + +#define GLEW_REGAL_ES1_1_compatibility GLEW_GET_VAR(__GLEW_REGAL_ES1_1_compatibility) + +#endif /* GL_REGAL_ES1_1_compatibility */ + +/* ---------------------------- GL_REGAL_enable ---------------------------- */ + +#ifndef GL_REGAL_enable +#define GL_REGAL_enable 1 + +#define GL_ERROR_REGAL 0x9322 +#define GL_DEBUG_REGAL 0x9323 +#define GL_LOG_REGAL 0x9324 +#define GL_EMULATION_REGAL 0x9325 +#define GL_DRIVER_REGAL 0x9326 +#define GL_MISSING_REGAL 0x9360 +#define GL_TRACE_REGAL 0x9361 +#define GL_CACHE_REGAL 0x9362 +#define GL_CODE_REGAL 0x9363 +#define GL_STATISTICS_REGAL 0x9364 + +#define GLEW_REGAL_enable GLEW_GET_VAR(__GLEW_REGAL_enable) + +#endif /* GL_REGAL_enable */ + +/* ------------------------- GL_REGAL_error_string ------------------------- */ + +#ifndef GL_REGAL_error_string +#define GL_REGAL_error_string 1 + +typedef const GLchar* (GLAPIENTRY * PFNGLERRORSTRINGREGALPROC) (GLenum error); + +#define glErrorStringREGAL GLEW_GET_FUN(__glewErrorStringREGAL) + +#define GLEW_REGAL_error_string GLEW_GET_VAR(__GLEW_REGAL_error_string) + +#endif /* GL_REGAL_error_string */ + +/* ------------------------ GL_REGAL_extension_query ----------------------- */ + +#ifndef GL_REGAL_extension_query +#define GL_REGAL_extension_query 1 + +typedef GLboolean (GLAPIENTRY * PFNGLGETEXTENSIONREGALPROC) (const GLchar* ext); +typedef GLboolean (GLAPIENTRY * PFNGLISSUPPORTEDREGALPROC) (const GLchar* ext); + +#define glGetExtensionREGAL GLEW_GET_FUN(__glewGetExtensionREGAL) +#define glIsSupportedREGAL GLEW_GET_FUN(__glewIsSupportedREGAL) + +#define GLEW_REGAL_extension_query GLEW_GET_VAR(__GLEW_REGAL_extension_query) + +#endif /* GL_REGAL_extension_query */ + +/* ------------------------------ GL_REGAL_log ----------------------------- */ + +#ifndef GL_REGAL_log +#define GL_REGAL_log 1 + +#define GL_LOG_ERROR_REGAL 0x9319 +#define GL_LOG_WARNING_REGAL 0x931A +#define GL_LOG_INFO_REGAL 0x931B +#define GL_LOG_APP_REGAL 0x931C +#define GL_LOG_DRIVER_REGAL 0x931D +#define GL_LOG_INTERNAL_REGAL 0x931E +#define GL_LOG_DEBUG_REGAL 0x931F +#define GL_LOG_STATUS_REGAL 0x9320 +#define GL_LOG_HTTP_REGAL 0x9321 + +typedef void (APIENTRY *GLLOGPROCREGAL)(GLenum stream, GLsizei length, const GLchar *message, GLvoid *context); + +typedef void (GLAPIENTRY * PFNGLLOGMESSAGECALLBACKREGALPROC) (GLLOGPROCREGAL callback); + +#define glLogMessageCallbackREGAL GLEW_GET_FUN(__glewLogMessageCallbackREGAL) + +#define GLEW_REGAL_log GLEW_GET_VAR(__GLEW_REGAL_log) + +#endif /* GL_REGAL_log */ + +/* ----------------------- GL_REND_screen_coordinates ---------------------- */ + +#ifndef GL_REND_screen_coordinates +#define GL_REND_screen_coordinates 1 + +#define GL_SCREEN_COORDINATES_REND 0x8490 +#define GL_INVERTED_SCREEN_W_REND 0x8491 + +#define GLEW_REND_screen_coordinates GLEW_GET_VAR(__GLEW_REND_screen_coordinates) + +#endif /* GL_REND_screen_coordinates */ + +/* ------------------------------- GL_S3_s3tc ------------------------------ */ + +#ifndef GL_S3_s3tc +#define GL_S3_s3tc 1 + +#define GL_RGB_S3TC 0x83A0 +#define GL_RGB4_S3TC 0x83A1 +#define GL_RGBA_S3TC 0x83A2 +#define GL_RGBA4_S3TC 0x83A3 +#define GL_RGBA_DXT5_S3TC 0x83A4 +#define GL_RGBA4_DXT5_S3TC 0x83A5 + +#define GLEW_S3_s3tc GLEW_GET_VAR(__GLEW_S3_s3tc) + +#endif /* GL_S3_s3tc */ + +/* -------------------------- GL_SGIS_color_range -------------------------- */ + +#ifndef GL_SGIS_color_range +#define GL_SGIS_color_range 1 + +#define GL_EXTENDED_RANGE_SGIS 0x85A5 +#define GL_MIN_RED_SGIS 0x85A6 +#define GL_MAX_RED_SGIS 0x85A7 +#define GL_MIN_GREEN_SGIS 0x85A8 +#define GL_MAX_GREEN_SGIS 0x85A9 +#define GL_MIN_BLUE_SGIS 0x85AA +#define GL_MAX_BLUE_SGIS 0x85AB +#define GL_MIN_ALPHA_SGIS 0x85AC +#define GL_MAX_ALPHA_SGIS 0x85AD + +#define GLEW_SGIS_color_range GLEW_GET_VAR(__GLEW_SGIS_color_range) + +#endif /* GL_SGIS_color_range */ + +/* ------------------------- GL_SGIS_detail_texture ------------------------ */ + +#ifndef GL_SGIS_detail_texture +#define GL_SGIS_detail_texture 1 + +typedef void (GLAPIENTRY * PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat* points); + +#define glDetailTexFuncSGIS GLEW_GET_FUN(__glewDetailTexFuncSGIS) +#define glGetDetailTexFuncSGIS GLEW_GET_FUN(__glewGetDetailTexFuncSGIS) + +#define GLEW_SGIS_detail_texture GLEW_GET_VAR(__GLEW_SGIS_detail_texture) + +#endif /* GL_SGIS_detail_texture */ + +/* -------------------------- GL_SGIS_fog_function ------------------------- */ + +#ifndef GL_SGIS_fog_function +#define GL_SGIS_fog_function 1 + +typedef void (GLAPIENTRY * PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLGETFOGFUNCSGISPROC) (GLfloat* points); + +#define glFogFuncSGIS GLEW_GET_FUN(__glewFogFuncSGIS) +#define glGetFogFuncSGIS GLEW_GET_FUN(__glewGetFogFuncSGIS) + +#define GLEW_SGIS_fog_function GLEW_GET_VAR(__GLEW_SGIS_fog_function) + +#endif /* GL_SGIS_fog_function */ + +/* ------------------------ GL_SGIS_generate_mipmap ------------------------ */ + +#ifndef GL_SGIS_generate_mipmap +#define GL_SGIS_generate_mipmap 1 + +#define GL_GENERATE_MIPMAP_SGIS 0x8191 +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 + +#define GLEW_SGIS_generate_mipmap GLEW_GET_VAR(__GLEW_SGIS_generate_mipmap) + +#endif /* GL_SGIS_generate_mipmap */ + +/* -------------------------- GL_SGIS_multisample -------------------------- */ + +#ifndef GL_SGIS_multisample +#define GL_SGIS_multisample 1 + +#define GL_MULTISAMPLE_SGIS 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F +#define GL_SAMPLE_MASK_SGIS 0x80A0 +#define GL_1PASS_SGIS 0x80A1 +#define GL_2PASS_0_SGIS 0x80A2 +#define GL_2PASS_1_SGIS 0x80A3 +#define GL_4PASS_0_SGIS 0x80A4 +#define GL_4PASS_1_SGIS 0x80A5 +#define GL_4PASS_2_SGIS 0x80A6 +#define GL_4PASS_3_SGIS 0x80A7 +#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 +#define GL_SAMPLES_SGIS 0x80A9 +#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA +#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB +#define GL_SAMPLE_PATTERN_SGIS 0x80AC + +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); +typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); + +#define glSampleMaskSGIS GLEW_GET_FUN(__glewSampleMaskSGIS) +#define glSamplePatternSGIS GLEW_GET_FUN(__glewSamplePatternSGIS) + +#define GLEW_SGIS_multisample GLEW_GET_VAR(__GLEW_SGIS_multisample) + +#endif /* GL_SGIS_multisample */ + +/* ------------------------- GL_SGIS_pixel_texture ------------------------- */ + +#ifndef GL_SGIS_pixel_texture +#define GL_SGIS_pixel_texture 1 + +#define GLEW_SGIS_pixel_texture GLEW_GET_VAR(__GLEW_SGIS_pixel_texture) + +#endif /* GL_SGIS_pixel_texture */ + +/* ----------------------- GL_SGIS_point_line_texgen ----------------------- */ + +#ifndef GL_SGIS_point_line_texgen +#define GL_SGIS_point_line_texgen 1 + +#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 +#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 +#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 +#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 +#define GL_EYE_POINT_SGIS 0x81F4 +#define GL_OBJECT_POINT_SGIS 0x81F5 +#define GL_EYE_LINE_SGIS 0x81F6 +#define GL_OBJECT_LINE_SGIS 0x81F7 + +#define GLEW_SGIS_point_line_texgen GLEW_GET_VAR(__GLEW_SGIS_point_line_texgen) + +#endif /* GL_SGIS_point_line_texgen */ + +/* ------------------------ GL_SGIS_sharpen_texture ------------------------ */ + +#ifndef GL_SGIS_sharpen_texture +#define GL_SGIS_sharpen_texture 1 + +typedef void (GLAPIENTRY * PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat* points); +typedef void (GLAPIENTRY * PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points); + +#define glGetSharpenTexFuncSGIS GLEW_GET_FUN(__glewGetSharpenTexFuncSGIS) +#define glSharpenTexFuncSGIS GLEW_GET_FUN(__glewSharpenTexFuncSGIS) + +#define GLEW_SGIS_sharpen_texture GLEW_GET_VAR(__GLEW_SGIS_sharpen_texture) + +#endif /* GL_SGIS_sharpen_texture */ + +/* --------------------------- GL_SGIS_texture4D --------------------------- */ + +#ifndef GL_SGIS_texture4D +#define GL_SGIS_texture4D 1 + +typedef void (GLAPIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const GLvoid *pixels); + +#define glTexImage4DSGIS GLEW_GET_FUN(__glewTexImage4DSGIS) +#define glTexSubImage4DSGIS GLEW_GET_FUN(__glewTexSubImage4DSGIS) + +#define GLEW_SGIS_texture4D GLEW_GET_VAR(__GLEW_SGIS_texture4D) + +#endif /* GL_SGIS_texture4D */ + +/* ---------------------- GL_SGIS_texture_border_clamp --------------------- */ + +#ifndef GL_SGIS_texture_border_clamp +#define GL_SGIS_texture_border_clamp 1 + +#define GL_CLAMP_TO_BORDER_SGIS 0x812D + +#define GLEW_SGIS_texture_border_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_border_clamp) + +#endif /* GL_SGIS_texture_border_clamp */ + +/* ----------------------- GL_SGIS_texture_edge_clamp ---------------------- */ + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_SGIS_texture_edge_clamp 1 + +#define GL_CLAMP_TO_EDGE_SGIS 0x812F + +#define GLEW_SGIS_texture_edge_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_edge_clamp) + +#endif /* GL_SGIS_texture_edge_clamp */ + +/* ------------------------ GL_SGIS_texture_filter4 ------------------------ */ + +#ifndef GL_SGIS_texture_filter4 +#define GL_SGIS_texture_filter4 1 + +typedef void (GLAPIENTRY * PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat* weights); +typedef void (GLAPIENTRY * PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat* weights); + +#define glGetTexFilterFuncSGIS GLEW_GET_FUN(__glewGetTexFilterFuncSGIS) +#define glTexFilterFuncSGIS GLEW_GET_FUN(__glewTexFilterFuncSGIS) + +#define GLEW_SGIS_texture_filter4 GLEW_GET_VAR(__GLEW_SGIS_texture_filter4) + +#endif /* GL_SGIS_texture_filter4 */ + +/* -------------------------- GL_SGIS_texture_lod -------------------------- */ + +#ifndef GL_SGIS_texture_lod +#define GL_SGIS_texture_lod 1 + +#define GL_TEXTURE_MIN_LOD_SGIS 0x813A +#define GL_TEXTURE_MAX_LOD_SGIS 0x813B +#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C +#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D + +#define GLEW_SGIS_texture_lod GLEW_GET_VAR(__GLEW_SGIS_texture_lod) + +#endif /* GL_SGIS_texture_lod */ + +/* ------------------------- GL_SGIS_texture_select ------------------------ */ + +#ifndef GL_SGIS_texture_select +#define GL_SGIS_texture_select 1 + +#define GLEW_SGIS_texture_select GLEW_GET_VAR(__GLEW_SGIS_texture_select) + +#endif /* GL_SGIS_texture_select */ + +/* ----------------------------- GL_SGIX_async ----------------------------- */ + +#ifndef GL_SGIX_async +#define GL_SGIX_async 1 + +#define GL_ASYNC_MARKER_SGIX 0x8329 + +typedef void (GLAPIENTRY * PFNGLASYNCMARKERSGIXPROC) (GLuint marker); +typedef void (GLAPIENTRY * PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); +typedef GLint (GLAPIENTRY * PFNGLFINISHASYNCSGIXPROC) (GLuint* markerp); +typedef GLuint (GLAPIENTRY * PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); +typedef GLboolean (GLAPIENTRY * PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); +typedef GLint (GLAPIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint* markerp); + +#define glAsyncMarkerSGIX GLEW_GET_FUN(__glewAsyncMarkerSGIX) +#define glDeleteAsyncMarkersSGIX GLEW_GET_FUN(__glewDeleteAsyncMarkersSGIX) +#define glFinishAsyncSGIX GLEW_GET_FUN(__glewFinishAsyncSGIX) +#define glGenAsyncMarkersSGIX GLEW_GET_FUN(__glewGenAsyncMarkersSGIX) +#define glIsAsyncMarkerSGIX GLEW_GET_FUN(__glewIsAsyncMarkerSGIX) +#define glPollAsyncSGIX GLEW_GET_FUN(__glewPollAsyncSGIX) + +#define GLEW_SGIX_async GLEW_GET_VAR(__GLEW_SGIX_async) + +#endif /* GL_SGIX_async */ + +/* ------------------------ GL_SGIX_async_histogram ------------------------ */ + +#ifndef GL_SGIX_async_histogram +#define GL_SGIX_async_histogram 1 + +#define GL_ASYNC_HISTOGRAM_SGIX 0x832C +#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D + +#define GLEW_SGIX_async_histogram GLEW_GET_VAR(__GLEW_SGIX_async_histogram) + +#endif /* GL_SGIX_async_histogram */ + +/* -------------------------- GL_SGIX_async_pixel -------------------------- */ + +#ifndef GL_SGIX_async_pixel +#define GL_SGIX_async_pixel 1 + +#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C +#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D +#define GL_ASYNC_READ_PIXELS_SGIX 0x835E +#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F +#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 +#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 + +#define GLEW_SGIX_async_pixel GLEW_GET_VAR(__GLEW_SGIX_async_pixel) + +#endif /* GL_SGIX_async_pixel */ + +/* ----------------------- GL_SGIX_blend_alpha_minmax ---------------------- */ + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_SGIX_blend_alpha_minmax 1 + +#define GL_ALPHA_MIN_SGIX 0x8320 +#define GL_ALPHA_MAX_SGIX 0x8321 + +#define GLEW_SGIX_blend_alpha_minmax GLEW_GET_VAR(__GLEW_SGIX_blend_alpha_minmax) + +#endif /* GL_SGIX_blend_alpha_minmax */ + +/* ---------------------------- GL_SGIX_clipmap ---------------------------- */ + +#ifndef GL_SGIX_clipmap +#define GL_SGIX_clipmap 1 + +#define GLEW_SGIX_clipmap GLEW_GET_VAR(__GLEW_SGIX_clipmap) + +#endif /* GL_SGIX_clipmap */ + +/* ---------------------- GL_SGIX_convolution_accuracy --------------------- */ + +#ifndef GL_SGIX_convolution_accuracy +#define GL_SGIX_convolution_accuracy 1 + +#define GL_CONVOLUTION_HINT_SGIX 0x8316 + +#define GLEW_SGIX_convolution_accuracy GLEW_GET_VAR(__GLEW_SGIX_convolution_accuracy) + +#endif /* GL_SGIX_convolution_accuracy */ + +/* ------------------------- GL_SGIX_depth_texture ------------------------- */ + +#ifndef GL_SGIX_depth_texture +#define GL_SGIX_depth_texture 1 + +#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 +#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 +#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 + +#define GLEW_SGIX_depth_texture GLEW_GET_VAR(__GLEW_SGIX_depth_texture) + +#endif /* GL_SGIX_depth_texture */ + +/* -------------------------- GL_SGIX_flush_raster ------------------------- */ + +#ifndef GL_SGIX_flush_raster +#define GL_SGIX_flush_raster 1 + +typedef void (GLAPIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void); + +#define glFlushRasterSGIX GLEW_GET_FUN(__glewFlushRasterSGIX) + +#define GLEW_SGIX_flush_raster GLEW_GET_VAR(__GLEW_SGIX_flush_raster) + +#endif /* GL_SGIX_flush_raster */ + +/* --------------------------- GL_SGIX_fog_offset -------------------------- */ + +#ifndef GL_SGIX_fog_offset +#define GL_SGIX_fog_offset 1 + +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 + +#define GLEW_SGIX_fog_offset GLEW_GET_VAR(__GLEW_SGIX_fog_offset) + +#endif /* GL_SGIX_fog_offset */ + +/* -------------------------- GL_SGIX_fog_texture -------------------------- */ + +#ifndef GL_SGIX_fog_texture +#define GL_SGIX_fog_texture 1 + +#define GL_TEXTURE_FOG_SGIX 0 +#define GL_FOG_PATCHY_FACTOR_SGIX 0 +#define GL_FRAGMENT_FOG_SGIX 0 + +typedef void (GLAPIENTRY * PFNGLTEXTUREFOGSGIXPROC) (GLenum pname); + +#define glTextureFogSGIX GLEW_GET_FUN(__glewTextureFogSGIX) + +#define GLEW_SGIX_fog_texture GLEW_GET_VAR(__GLEW_SGIX_fog_texture) + +#endif /* GL_SGIX_fog_texture */ + +/* ------------------- GL_SGIX_fragment_specular_lighting ------------------ */ + +#ifndef GL_SGIX_fragment_specular_lighting +#define GL_SGIX_fragment_specular_lighting 1 + +typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum value, GLfloat* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum value, GLint* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* data); + +#define glFragmentColorMaterialSGIX GLEW_GET_FUN(__glewFragmentColorMaterialSGIX) +#define glFragmentLightModelfSGIX GLEW_GET_FUN(__glewFragmentLightModelfSGIX) +#define glFragmentLightModelfvSGIX GLEW_GET_FUN(__glewFragmentLightModelfvSGIX) +#define glFragmentLightModeliSGIX GLEW_GET_FUN(__glewFragmentLightModeliSGIX) +#define glFragmentLightModelivSGIX GLEW_GET_FUN(__glewFragmentLightModelivSGIX) +#define glFragmentLightfSGIX GLEW_GET_FUN(__glewFragmentLightfSGIX) +#define glFragmentLightfvSGIX GLEW_GET_FUN(__glewFragmentLightfvSGIX) +#define glFragmentLightiSGIX GLEW_GET_FUN(__glewFragmentLightiSGIX) +#define glFragmentLightivSGIX GLEW_GET_FUN(__glewFragmentLightivSGIX) +#define glFragmentMaterialfSGIX GLEW_GET_FUN(__glewFragmentMaterialfSGIX) +#define glFragmentMaterialfvSGIX GLEW_GET_FUN(__glewFragmentMaterialfvSGIX) +#define glFragmentMaterialiSGIX GLEW_GET_FUN(__glewFragmentMaterialiSGIX) +#define glFragmentMaterialivSGIX GLEW_GET_FUN(__glewFragmentMaterialivSGIX) +#define glGetFragmentLightfvSGIX GLEW_GET_FUN(__glewGetFragmentLightfvSGIX) +#define glGetFragmentLightivSGIX GLEW_GET_FUN(__glewGetFragmentLightivSGIX) +#define glGetFragmentMaterialfvSGIX GLEW_GET_FUN(__glewGetFragmentMaterialfvSGIX) +#define glGetFragmentMaterialivSGIX GLEW_GET_FUN(__glewGetFragmentMaterialivSGIX) + +#define GLEW_SGIX_fragment_specular_lighting GLEW_GET_VAR(__GLEW_SGIX_fragment_specular_lighting) + +#endif /* GL_SGIX_fragment_specular_lighting */ + +/* --------------------------- GL_SGIX_framezoom --------------------------- */ + +#ifndef GL_SGIX_framezoom +#define GL_SGIX_framezoom 1 + +typedef void (GLAPIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor); + +#define glFrameZoomSGIX GLEW_GET_FUN(__glewFrameZoomSGIX) + +#define GLEW_SGIX_framezoom GLEW_GET_VAR(__GLEW_SGIX_framezoom) + +#endif /* GL_SGIX_framezoom */ + +/* --------------------------- GL_SGIX_interlace --------------------------- */ + +#ifndef GL_SGIX_interlace +#define GL_SGIX_interlace 1 + +#define GL_INTERLACE_SGIX 0x8094 + +#define GLEW_SGIX_interlace GLEW_GET_VAR(__GLEW_SGIX_interlace) + +#endif /* GL_SGIX_interlace */ + +/* ------------------------- GL_SGIX_ir_instrument1 ------------------------ */ + +#ifndef GL_SGIX_ir_instrument1 +#define GL_SGIX_ir_instrument1 1 + +#define GLEW_SGIX_ir_instrument1 GLEW_GET_VAR(__GLEW_SGIX_ir_instrument1) + +#endif /* GL_SGIX_ir_instrument1 */ + +/* ------------------------- GL_SGIX_list_priority ------------------------- */ + +#ifndef GL_SGIX_list_priority +#define GL_SGIX_list_priority 1 + +#define GLEW_SGIX_list_priority GLEW_GET_VAR(__GLEW_SGIX_list_priority) + +#endif /* GL_SGIX_list_priority */ + +/* ------------------------- GL_SGIX_pixel_texture ------------------------- */ + +#ifndef GL_SGIX_pixel_texture +#define GL_SGIX_pixel_texture 1 + +typedef void (GLAPIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); + +#define glPixelTexGenSGIX GLEW_GET_FUN(__glewPixelTexGenSGIX) + +#define GLEW_SGIX_pixel_texture GLEW_GET_VAR(__GLEW_SGIX_pixel_texture) + +#endif /* GL_SGIX_pixel_texture */ + +/* ----------------------- GL_SGIX_pixel_texture_bits ---------------------- */ + +#ifndef GL_SGIX_pixel_texture_bits +#define GL_SGIX_pixel_texture_bits 1 + +#define GLEW_SGIX_pixel_texture_bits GLEW_GET_VAR(__GLEW_SGIX_pixel_texture_bits) + +#endif /* GL_SGIX_pixel_texture_bits */ + +/* ------------------------ GL_SGIX_reference_plane ------------------------ */ + +#ifndef GL_SGIX_reference_plane +#define GL_SGIX_reference_plane 1 + +typedef void (GLAPIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble* equation); + +#define glReferencePlaneSGIX GLEW_GET_FUN(__glewReferencePlaneSGIX) + +#define GLEW_SGIX_reference_plane GLEW_GET_VAR(__GLEW_SGIX_reference_plane) + +#endif /* GL_SGIX_reference_plane */ + +/* ---------------------------- GL_SGIX_resample --------------------------- */ + +#ifndef GL_SGIX_resample +#define GL_SGIX_resample 1 + +#define GL_PACK_RESAMPLE_SGIX 0x842E +#define GL_UNPACK_RESAMPLE_SGIX 0x842F +#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 +#define GL_RESAMPLE_REPLICATE_SGIX 0x8433 +#define GL_RESAMPLE_ZERO_FILL_SGIX 0x8434 + +#define GLEW_SGIX_resample GLEW_GET_VAR(__GLEW_SGIX_resample) + +#endif /* GL_SGIX_resample */ + +/* ----------------------------- GL_SGIX_shadow ---------------------------- */ + +#ifndef GL_SGIX_shadow +#define GL_SGIX_shadow 1 + +#define GL_TEXTURE_COMPARE_SGIX 0x819A +#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B +#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C +#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D + +#define GLEW_SGIX_shadow GLEW_GET_VAR(__GLEW_SGIX_shadow) + +#endif /* GL_SGIX_shadow */ + +/* ------------------------- GL_SGIX_shadow_ambient ------------------------ */ + +#ifndef GL_SGIX_shadow_ambient +#define GL_SGIX_shadow_ambient 1 + +#define GL_SHADOW_AMBIENT_SGIX 0x80BF + +#define GLEW_SGIX_shadow_ambient GLEW_GET_VAR(__GLEW_SGIX_shadow_ambient) + +#endif /* GL_SGIX_shadow_ambient */ + +/* ----------------------------- GL_SGIX_sprite ---------------------------- */ + +#ifndef GL_SGIX_sprite +#define GL_SGIX_sprite 1 + +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, GLint* params); + +#define glSpriteParameterfSGIX GLEW_GET_FUN(__glewSpriteParameterfSGIX) +#define glSpriteParameterfvSGIX GLEW_GET_FUN(__glewSpriteParameterfvSGIX) +#define glSpriteParameteriSGIX GLEW_GET_FUN(__glewSpriteParameteriSGIX) +#define glSpriteParameterivSGIX GLEW_GET_FUN(__glewSpriteParameterivSGIX) + +#define GLEW_SGIX_sprite GLEW_GET_VAR(__GLEW_SGIX_sprite) + +#endif /* GL_SGIX_sprite */ + +/* ----------------------- GL_SGIX_tag_sample_buffer ----------------------- */ + +#ifndef GL_SGIX_tag_sample_buffer +#define GL_SGIX_tag_sample_buffer 1 + +typedef void (GLAPIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); + +#define glTagSampleBufferSGIX GLEW_GET_FUN(__glewTagSampleBufferSGIX) + +#define GLEW_SGIX_tag_sample_buffer GLEW_GET_VAR(__GLEW_SGIX_tag_sample_buffer) + +#endif /* GL_SGIX_tag_sample_buffer */ + +/* ------------------------ GL_SGIX_texture_add_env ------------------------ */ + +#ifndef GL_SGIX_texture_add_env +#define GL_SGIX_texture_add_env 1 + +#define GLEW_SGIX_texture_add_env GLEW_GET_VAR(__GLEW_SGIX_texture_add_env) + +#endif /* GL_SGIX_texture_add_env */ + +/* -------------------- GL_SGIX_texture_coordinate_clamp ------------------- */ + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_SGIX_texture_coordinate_clamp 1 + +#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 +#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A +#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B + +#define GLEW_SGIX_texture_coordinate_clamp GLEW_GET_VAR(__GLEW_SGIX_texture_coordinate_clamp) + +#endif /* GL_SGIX_texture_coordinate_clamp */ + +/* ------------------------ GL_SGIX_texture_lod_bias ----------------------- */ + +#ifndef GL_SGIX_texture_lod_bias +#define GL_SGIX_texture_lod_bias 1 + +#define GLEW_SGIX_texture_lod_bias GLEW_GET_VAR(__GLEW_SGIX_texture_lod_bias) + +#endif /* GL_SGIX_texture_lod_bias */ + +/* ---------------------- GL_SGIX_texture_multi_buffer --------------------- */ + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_SGIX_texture_multi_buffer 1 + +#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E + +#define GLEW_SGIX_texture_multi_buffer GLEW_GET_VAR(__GLEW_SGIX_texture_multi_buffer) + +#endif /* GL_SGIX_texture_multi_buffer */ + +/* ------------------------- GL_SGIX_texture_range ------------------------- */ + +#ifndef GL_SGIX_texture_range +#define GL_SGIX_texture_range 1 + +#define GL_RGB_SIGNED_SGIX 0x85E0 +#define GL_RGBA_SIGNED_SGIX 0x85E1 +#define GL_ALPHA_SIGNED_SGIX 0x85E2 +#define GL_LUMINANCE_SIGNED_SGIX 0x85E3 +#define GL_INTENSITY_SIGNED_SGIX 0x85E4 +#define GL_LUMINANCE_ALPHA_SIGNED_SGIX 0x85E5 +#define GL_RGB16_SIGNED_SGIX 0x85E6 +#define GL_RGBA16_SIGNED_SGIX 0x85E7 +#define GL_ALPHA16_SIGNED_SGIX 0x85E8 +#define GL_LUMINANCE16_SIGNED_SGIX 0x85E9 +#define GL_INTENSITY16_SIGNED_SGIX 0x85EA +#define GL_LUMINANCE16_ALPHA16_SIGNED_SGIX 0x85EB +#define GL_RGB_EXTENDED_RANGE_SGIX 0x85EC +#define GL_RGBA_EXTENDED_RANGE_SGIX 0x85ED +#define GL_ALPHA_EXTENDED_RANGE_SGIX 0x85EE +#define GL_LUMINANCE_EXTENDED_RANGE_SGIX 0x85EF +#define GL_INTENSITY_EXTENDED_RANGE_SGIX 0x85F0 +#define GL_LUMINANCE_ALPHA_EXTENDED_RANGE_SGIX 0x85F1 +#define GL_RGB16_EXTENDED_RANGE_SGIX 0x85F2 +#define GL_RGBA16_EXTENDED_RANGE_SGIX 0x85F3 +#define GL_ALPHA16_EXTENDED_RANGE_SGIX 0x85F4 +#define GL_LUMINANCE16_EXTENDED_RANGE_SGIX 0x85F5 +#define GL_INTENSITY16_EXTENDED_RANGE_SGIX 0x85F6 +#define GL_LUMINANCE16_ALPHA16_EXTENDED_RANGE_SGIX 0x85F7 +#define GL_MIN_LUMINANCE_SGIS 0x85F8 +#define GL_MAX_LUMINANCE_SGIS 0x85F9 +#define GL_MIN_INTENSITY_SGIS 0x85FA +#define GL_MAX_INTENSITY_SGIS 0x85FB + +#define GLEW_SGIX_texture_range GLEW_GET_VAR(__GLEW_SGIX_texture_range) + +#endif /* GL_SGIX_texture_range */ + +/* ----------------------- GL_SGIX_texture_scale_bias ---------------------- */ + +#ifndef GL_SGIX_texture_scale_bias +#define GL_SGIX_texture_scale_bias 1 + +#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 +#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A +#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B +#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C + +#define GLEW_SGIX_texture_scale_bias GLEW_GET_VAR(__GLEW_SGIX_texture_scale_bias) + +#endif /* GL_SGIX_texture_scale_bias */ + +/* ------------------------- GL_SGIX_vertex_preclip ------------------------ */ + +#ifndef GL_SGIX_vertex_preclip +#define GL_SGIX_vertex_preclip 1 + +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF + +#define GLEW_SGIX_vertex_preclip GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip) + +#endif /* GL_SGIX_vertex_preclip */ + +/* ---------------------- GL_SGIX_vertex_preclip_hint ---------------------- */ + +#ifndef GL_SGIX_vertex_preclip_hint +#define GL_SGIX_vertex_preclip_hint 1 + +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF + +#define GLEW_SGIX_vertex_preclip_hint GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip_hint) + +#endif /* GL_SGIX_vertex_preclip_hint */ + +/* ----------------------------- GL_SGIX_ycrcb ----------------------------- */ + +#ifndef GL_SGIX_ycrcb +#define GL_SGIX_ycrcb 1 + +#define GLEW_SGIX_ycrcb GLEW_GET_VAR(__GLEW_SGIX_ycrcb) + +#endif /* GL_SGIX_ycrcb */ + +/* -------------------------- GL_SGI_color_matrix -------------------------- */ + +#ifndef GL_SGI_color_matrix +#define GL_SGI_color_matrix 1 + +#define GL_COLOR_MATRIX_SGI 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB + +#define GLEW_SGI_color_matrix GLEW_GET_VAR(__GLEW_SGI_color_matrix) + +#endif /* GL_SGI_color_matrix */ + +/* --------------------------- GL_SGI_color_table -------------------------- */ + +#ifndef GL_SGI_color_table +#define GL_SGI_color_table 1 + +#define GL_COLOR_TABLE_SGI 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 +#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 +#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 +#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 +#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 +#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF + +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); + +#define glColorTableParameterfvSGI GLEW_GET_FUN(__glewColorTableParameterfvSGI) +#define glColorTableParameterivSGI GLEW_GET_FUN(__glewColorTableParameterivSGI) +#define glColorTableSGI GLEW_GET_FUN(__glewColorTableSGI) +#define glCopyColorTableSGI GLEW_GET_FUN(__glewCopyColorTableSGI) +#define glGetColorTableParameterfvSGI GLEW_GET_FUN(__glewGetColorTableParameterfvSGI) +#define glGetColorTableParameterivSGI GLEW_GET_FUN(__glewGetColorTableParameterivSGI) +#define glGetColorTableSGI GLEW_GET_FUN(__glewGetColorTableSGI) + +#define GLEW_SGI_color_table GLEW_GET_VAR(__GLEW_SGI_color_table) + +#endif /* GL_SGI_color_table */ + +/* ----------------------- GL_SGI_texture_color_table ---------------------- */ + +#ifndef GL_SGI_texture_color_table +#define GL_SGI_texture_color_table 1 + +#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC +#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD + +#define GLEW_SGI_texture_color_table GLEW_GET_VAR(__GLEW_SGI_texture_color_table) + +#endif /* GL_SGI_texture_color_table */ + +/* ------------------------- GL_SUNX_constant_data ------------------------- */ + +#ifndef GL_SUNX_constant_data +#define GL_SUNX_constant_data 1 + +#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 +#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 + +typedef void (GLAPIENTRY * PFNGLFINISHTEXTURESUNXPROC) (void); + +#define glFinishTextureSUNX GLEW_GET_FUN(__glewFinishTextureSUNX) + +#define GLEW_SUNX_constant_data GLEW_GET_VAR(__GLEW_SUNX_constant_data) + +#endif /* GL_SUNX_constant_data */ + +/* -------------------- GL_SUN_convolution_border_modes -------------------- */ + +#ifndef GL_SUN_convolution_border_modes +#define GL_SUN_convolution_border_modes 1 + +#define GL_WRAP_BORDER_SUN 0x81D4 + +#define GLEW_SUN_convolution_border_modes GLEW_GET_VAR(__GLEW_SUN_convolution_border_modes) + +#endif /* GL_SUN_convolution_border_modes */ + +/* -------------------------- GL_SUN_global_alpha -------------------------- */ + +#ifndef GL_SUN_global_alpha +#define GL_SUN_global_alpha 1 + +#define GL_GLOBAL_ALPHA_SUN 0x81D9 +#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA + +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); + +#define glGlobalAlphaFactorbSUN GLEW_GET_FUN(__glewGlobalAlphaFactorbSUN) +#define glGlobalAlphaFactordSUN GLEW_GET_FUN(__glewGlobalAlphaFactordSUN) +#define glGlobalAlphaFactorfSUN GLEW_GET_FUN(__glewGlobalAlphaFactorfSUN) +#define glGlobalAlphaFactoriSUN GLEW_GET_FUN(__glewGlobalAlphaFactoriSUN) +#define glGlobalAlphaFactorsSUN GLEW_GET_FUN(__glewGlobalAlphaFactorsSUN) +#define glGlobalAlphaFactorubSUN GLEW_GET_FUN(__glewGlobalAlphaFactorubSUN) +#define glGlobalAlphaFactoruiSUN GLEW_GET_FUN(__glewGlobalAlphaFactoruiSUN) +#define glGlobalAlphaFactorusSUN GLEW_GET_FUN(__glewGlobalAlphaFactorusSUN) + +#define GLEW_SUN_global_alpha GLEW_GET_VAR(__GLEW_SUN_global_alpha) + +#endif /* GL_SUN_global_alpha */ + +/* --------------------------- GL_SUN_mesh_array --------------------------- */ + +#ifndef GL_SUN_mesh_array +#define GL_SUN_mesh_array 1 + +#define GL_QUAD_MESH_SUN 0x8614 +#define GL_TRIANGLE_MESH_SUN 0x8615 + +#define GLEW_SUN_mesh_array GLEW_GET_VAR(__GLEW_SUN_mesh_array) + +#endif /* GL_SUN_mesh_array */ + +/* ------------------------ GL_SUN_read_video_pixels ----------------------- */ + +#ifndef GL_SUN_read_video_pixels +#define GL_SUN_read_video_pixels 1 + +typedef void (GLAPIENTRY * PFNGLREADVIDEOPIXELSSUNPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels); + +#define glReadVideoPixelsSUN GLEW_GET_FUN(__glewReadVideoPixelsSUN) + +#define GLEW_SUN_read_video_pixels GLEW_GET_VAR(__GLEW_SUN_read_video_pixels) + +#endif /* GL_SUN_read_video_pixels */ + +/* --------------------------- GL_SUN_slice_accum -------------------------- */ + +#ifndef GL_SUN_slice_accum +#define GL_SUN_slice_accum 1 + +#define GL_SLICE_ACCUM_SUN 0x85CC + +#define GLEW_SUN_slice_accum GLEW_GET_VAR(__GLEW_SUN_slice_accum) + +#endif /* GL_SUN_slice_accum */ + +/* -------------------------- GL_SUN_triangle_list ------------------------- */ + +#ifndef GL_SUN_triangle_list +#define GL_SUN_triangle_list 1 + +#define GL_RESTART_SUN 0x01 +#define GL_REPLACE_MIDDLE_SUN 0x02 +#define GL_REPLACE_OLDEST_SUN 0x03 +#define GL_TRIANGLE_LIST_SUN 0x81D7 +#define GL_REPLACEMENT_CODE_SUN 0x81D8 +#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 +#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 +#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 +#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 +#define GL_R1UI_V3F_SUN 0x85C4 +#define GL_R1UI_C4UB_V3F_SUN 0x85C5 +#define GL_R1UI_C3F_V3F_SUN 0x85C6 +#define GL_R1UI_N3F_V3F_SUN 0x85C7 +#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 +#define GL_R1UI_T2F_V3F_SUN 0x85C9 +#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA +#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB + +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte* code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint* code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort* code); + +#define glReplacementCodePointerSUN GLEW_GET_FUN(__glewReplacementCodePointerSUN) +#define glReplacementCodeubSUN GLEW_GET_FUN(__glewReplacementCodeubSUN) +#define glReplacementCodeubvSUN GLEW_GET_FUN(__glewReplacementCodeubvSUN) +#define glReplacementCodeuiSUN GLEW_GET_FUN(__glewReplacementCodeuiSUN) +#define glReplacementCodeuivSUN GLEW_GET_FUN(__glewReplacementCodeuivSUN) +#define glReplacementCodeusSUN GLEW_GET_FUN(__glewReplacementCodeusSUN) +#define glReplacementCodeusvSUN GLEW_GET_FUN(__glewReplacementCodeusvSUN) + +#define GLEW_SUN_triangle_list GLEW_GET_VAR(__GLEW_SUN_triangle_list) + +#endif /* GL_SUN_triangle_list */ + +/* ----------------------------- GL_SUN_vertex ----------------------------- */ + +#ifndef GL_SUN_vertex +#define GL_SUN_vertex 1 + +typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint* rc, const GLubyte *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat* tc, const GLubyte *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *v); + +#define glColor3fVertex3fSUN GLEW_GET_FUN(__glewColor3fVertex3fSUN) +#define glColor3fVertex3fvSUN GLEW_GET_FUN(__glewColor3fVertex3fvSUN) +#define glColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fSUN) +#define glColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fvSUN) +#define glColor4ubVertex2fSUN GLEW_GET_FUN(__glewColor4ubVertex2fSUN) +#define glColor4ubVertex2fvSUN GLEW_GET_FUN(__glewColor4ubVertex2fvSUN) +#define glColor4ubVertex3fSUN GLEW_GET_FUN(__glewColor4ubVertex3fSUN) +#define glColor4ubVertex3fvSUN GLEW_GET_FUN(__glewColor4ubVertex3fvSUN) +#define glNormal3fVertex3fSUN GLEW_GET_FUN(__glewNormal3fVertex3fSUN) +#define glNormal3fVertex3fvSUN GLEW_GET_FUN(__glewNormal3fVertex3fvSUN) +#define glReplacementCodeuiColor3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fSUN) +#define glReplacementCodeuiColor3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fvSUN) +#define glReplacementCodeuiColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fSUN) +#define glReplacementCodeuiColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fvSUN) +#define glReplacementCodeuiColor4ubVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fSUN) +#define glReplacementCodeuiColor4ubVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fvSUN) +#define glReplacementCodeuiNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fSUN) +#define glReplacementCodeuiNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fvSUN) +#define glReplacementCodeuiVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fSUN) +#define glReplacementCodeuiVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fvSUN) +#define glTexCoord2fColor3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fSUN) +#define glTexCoord2fColor3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fvSUN) +#define glTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fSUN) +#define glTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fvSUN) +#define glTexCoord2fColor4ubVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fSUN) +#define glTexCoord2fColor4ubVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fvSUN) +#define glTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fSUN) +#define glTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fvSUN) +#define glTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fSUN) +#define glTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fvSUN) +#define glTexCoord4fColor4fNormal3fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fSUN) +#define glTexCoord4fColor4fNormal3fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fvSUN) +#define glTexCoord4fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fSUN) +#define glTexCoord4fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fvSUN) + +#define GLEW_SUN_vertex GLEW_GET_VAR(__GLEW_SUN_vertex) + +#endif /* GL_SUN_vertex */ + +/* -------------------------- GL_WIN_phong_shading ------------------------- */ + +#ifndef GL_WIN_phong_shading +#define GL_WIN_phong_shading 1 + +#define GL_PHONG_WIN 0x80EA +#define GL_PHONG_HINT_WIN 0x80EB + +#define GLEW_WIN_phong_shading GLEW_GET_VAR(__GLEW_WIN_phong_shading) + +#endif /* GL_WIN_phong_shading */ + +/* -------------------------- GL_WIN_specular_fog -------------------------- */ + +#ifndef GL_WIN_specular_fog +#define GL_WIN_specular_fog 1 + +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC + +#define GLEW_WIN_specular_fog GLEW_GET_VAR(__GLEW_WIN_specular_fog) + +#endif /* GL_WIN_specular_fog */ + +/* ---------------------------- GL_WIN_swap_hint --------------------------- */ + +#ifndef GL_WIN_swap_hint +#define GL_WIN_swap_hint 1 + +typedef void (GLAPIENTRY * PFNGLADDSWAPHINTRECTWINPROC) (GLint x, GLint y, GLsizei width, GLsizei height); + +#define glAddSwapHintRectWIN GLEW_GET_FUN(__glewAddSwapHintRectWIN) + +#define GLEW_WIN_swap_hint GLEW_GET_VAR(__GLEW_WIN_swap_hint) + +#endif /* GL_WIN_swap_hint */ + +/* ------------------------------------------------------------------------- */ + +#if defined(GLEW_MX) && defined(_WIN32) +#define GLEW_FUN_EXPORT +#else +#define GLEW_FUN_EXPORT GLEWAPI +#endif /* GLEW_MX */ + +#if defined(GLEW_MX) +#define GLEW_VAR_EXPORT +#else +#define GLEW_VAR_EXPORT GLEWAPI +#endif /* GLEW_MX */ + +#if defined(GLEW_MX) && defined(_WIN32) +struct GLEWContextStruct +{ +#endif /* GLEW_MX */ + +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DPROC __glewTexImage3D; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DPROC __glewTexSubImage3D; + +GLEW_FUN_EXPORT PFNGLACTIVETEXTUREPROC __glewActiveTexture; +GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREPROC __glewClientActiveTexture; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DPROC __glewCompressedTexImage1D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DPROC __glewCompressedTexImage3D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC __glewCompressedTexSubImage1D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC __glewCompressedTexSubImage3D; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEPROC __glewGetCompressedTexImage; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDPROC __glewLoadTransposeMatrixd; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFPROC __glewLoadTransposeMatrixf; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDPROC __glewMultTransposeMatrixd; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFPROC __glewMultTransposeMatrixf; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DPROC __glewMultiTexCoord1d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVPROC __glewMultiTexCoord1dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FPROC __glewMultiTexCoord1f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVPROC __glewMultiTexCoord1fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IPROC __glewMultiTexCoord1i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVPROC __glewMultiTexCoord1iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SPROC __glewMultiTexCoord1s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVPROC __glewMultiTexCoord1sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DPROC __glewMultiTexCoord2d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVPROC __glewMultiTexCoord2dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FPROC __glewMultiTexCoord2f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVPROC __glewMultiTexCoord2fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IPROC __glewMultiTexCoord2i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVPROC __glewMultiTexCoord2iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SPROC __glewMultiTexCoord2s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVPROC __glewMultiTexCoord2sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DPROC __glewMultiTexCoord3d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVPROC __glewMultiTexCoord3dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FPROC __glewMultiTexCoord3f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVPROC __glewMultiTexCoord3fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IPROC __glewMultiTexCoord3i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVPROC __glewMultiTexCoord3iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SPROC __glewMultiTexCoord3s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVPROC __glewMultiTexCoord3sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DPROC __glewMultiTexCoord4d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVPROC __glewMultiTexCoord4dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FPROC __glewMultiTexCoord4f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVPROC __glewMultiTexCoord4fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IPROC __glewMultiTexCoord4i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVPROC __glewMultiTexCoord4iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SPROC __glewMultiTexCoord4s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVPROC __glewMultiTexCoord4sv; +GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEPROC __glewSampleCoverage; + +GLEW_FUN_EXPORT PFNGLBLENDCOLORPROC __glewBlendColor; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONPROC __glewBlendEquation; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate; +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERPROC __glewFogCoordPointer; +GLEW_FUN_EXPORT PFNGLFOGCOORDDPROC __glewFogCoordd; +GLEW_FUN_EXPORT PFNGLFOGCOORDDVPROC __glewFogCoorddv; +GLEW_FUN_EXPORT PFNGLFOGCOORDFPROC __glewFogCoordf; +GLEW_FUN_EXPORT PFNGLFOGCOORDFVPROC __glewFogCoordfv; +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFPROC __glewPointParameterf; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIPROC __glewPointParameteri; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVPROC __glewPointParameteriv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVPROC __glewSecondaryColor3dv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FPROC __glewSecondaryColor3f; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVPROC __glewSecondaryColor3fv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IPROC __glewSecondaryColor3i; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVPROC __glewSecondaryColor3iv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SPROC __glewSecondaryColor3s; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVPROC __glewSecondaryColor3sv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBPROC __glewSecondaryColor3ub; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVPROC __glewSecondaryColor3ubv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIPROC __glewSecondaryColor3ui; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVPROC __glewSecondaryColor3uiv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USPROC __glewSecondaryColor3us; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVPROC __glewSecondaryColor3usv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERPROC __glewSecondaryColorPointer; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DPROC __glewWindowPos2d; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVPROC __glewWindowPos2dv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FPROC __glewWindowPos2f; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVPROC __glewWindowPos2fv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IPROC __glewWindowPos2i; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVPROC __glewWindowPos2iv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SPROC __glewWindowPos2s; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVPROC __glewWindowPos2sv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DPROC __glewWindowPos3d; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVPROC __glewWindowPos3dv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FPROC __glewWindowPos3f; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVPROC __glewWindowPos3fv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IPROC __glewWindowPos3i; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVPROC __glewWindowPos3iv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SPROC __glewWindowPos3s; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVPROC __glewWindowPos3sv; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYPROC __glewBeginQuery; +GLEW_FUN_EXPORT PFNGLBINDBUFFERPROC __glewBindBuffer; +GLEW_FUN_EXPORT PFNGLBUFFERDATAPROC __glewBufferData; +GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAPROC __glewBufferSubData; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERSPROC __glewDeleteBuffers; +GLEW_FUN_EXPORT PFNGLDELETEQUERIESPROC __glewDeleteQueries; +GLEW_FUN_EXPORT PFNGLENDQUERYPROC __glewEndQuery; +GLEW_FUN_EXPORT PFNGLGENBUFFERSPROC __glewGenBuffers; +GLEW_FUN_EXPORT PFNGLGENQUERIESPROC __glewGenQueries; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVPROC __glewGetBufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVPROC __glewGetBufferPointerv; +GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAPROC __glewGetBufferSubData; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVPROC __glewGetQueryObjectiv; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVPROC __glewGetQueryObjectuiv; +GLEW_FUN_EXPORT PFNGLGETQUERYIVPROC __glewGetQueryiv; +GLEW_FUN_EXPORT PFNGLISBUFFERPROC __glewIsBuffer; +GLEW_FUN_EXPORT PFNGLISQUERYPROC __glewIsQuery; +GLEW_FUN_EXPORT PFNGLMAPBUFFERPROC __glewMapBuffer; +GLEW_FUN_EXPORT PFNGLUNMAPBUFFERPROC __glewUnmapBuffer; + +GLEW_FUN_EXPORT PFNGLATTACHSHADERPROC __glewAttachShader; +GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate; +GLEW_FUN_EXPORT PFNGLCOMPILESHADERPROC __glewCompileShader; +GLEW_FUN_EXPORT PFNGLCREATEPROGRAMPROC __glewCreateProgram; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROC __glewCreateShader; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPROC __glewDeleteProgram; +GLEW_FUN_EXPORT PFNGLDELETESHADERPROC __glewDeleteShader; +GLEW_FUN_EXPORT PFNGLDETACHSHADERPROC __glewDetachShader; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray; +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSPROC __glewDrawBuffers; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray; +GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform; +GLEW_FUN_EXPORT PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders; +GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation; +GLEW_FUN_EXPORT PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVPROC __glewGetProgramiv; +GLEW_FUN_EXPORT PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog; +GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEPROC __glewGetShaderSource; +GLEW_FUN_EXPORT PFNGLGETSHADERIVPROC __glewGetShaderiv; +GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation; +GLEW_FUN_EXPORT PFNGLGETUNIFORMFVPROC __glewGetUniformfv; +GLEW_FUN_EXPORT PFNGLGETUNIFORMIVPROC __glewGetUniformiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv; +GLEW_FUN_EXPORT PFNGLISPROGRAMPROC __glewIsProgram; +GLEW_FUN_EXPORT PFNGLISSHADERPROC __glewIsShader; +GLEW_FUN_EXPORT PFNGLLINKPROGRAMPROC __glewLinkProgram; +GLEW_FUN_EXPORT PFNGLSHADERSOURCEPROC __glewShaderSource; +GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate; +GLEW_FUN_EXPORT PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate; +GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate; +GLEW_FUN_EXPORT PFNGLUNIFORM1FPROC __glewUniform1f; +GLEW_FUN_EXPORT PFNGLUNIFORM1FVPROC __glewUniform1fv; +GLEW_FUN_EXPORT PFNGLUNIFORM1IPROC __glewUniform1i; +GLEW_FUN_EXPORT PFNGLUNIFORM1IVPROC __glewUniform1iv; +GLEW_FUN_EXPORT PFNGLUNIFORM2FPROC __glewUniform2f; +GLEW_FUN_EXPORT PFNGLUNIFORM2FVPROC __glewUniform2fv; +GLEW_FUN_EXPORT PFNGLUNIFORM2IPROC __glewUniform2i; +GLEW_FUN_EXPORT PFNGLUNIFORM2IVPROC __glewUniform2iv; +GLEW_FUN_EXPORT PFNGLUNIFORM3FPROC __glewUniform3f; +GLEW_FUN_EXPORT PFNGLUNIFORM3FVPROC __glewUniform3fv; +GLEW_FUN_EXPORT PFNGLUNIFORM3IPROC __glewUniform3i; +GLEW_FUN_EXPORT PFNGLUNIFORM3IVPROC __glewUniform3iv; +GLEW_FUN_EXPORT PFNGLUNIFORM4FPROC __glewUniform4f; +GLEW_FUN_EXPORT PFNGLUNIFORM4FVPROC __glewUniform4fv; +GLEW_FUN_EXPORT PFNGLUNIFORM4IPROC __glewUniform4i; +GLEW_FUN_EXPORT PFNGLUNIFORM4IVPROC __glewUniform4iv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMPROC __glewUseProgram; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPROC __glewValidateProgram; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer; + +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3FVPROC __glewUniformMatrix2x3fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4FVPROC __glewUniformMatrix2x4fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2FVPROC __glewUniformMatrix3x2fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv; + +GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERPROC __glewBeginConditionalRender; +GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback; +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONPROC __glewBindFragDataLocation; +GLEW_FUN_EXPORT PFNGLCLAMPCOLORPROC __glewClampColor; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERFIPROC __glewClearBufferfi; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERFVPROC __glewClearBufferfv; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERIVPROC __glewClearBufferiv; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERUIVPROC __glewClearBufferuiv; +GLEW_FUN_EXPORT PFNGLCOLORMASKIPROC __glewColorMaski; +GLEW_FUN_EXPORT PFNGLDISABLEIPROC __glewDisablei; +GLEW_FUN_EXPORT PFNGLENABLEIPROC __glewEnablei; +GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERPROC __glewEndConditionalRender; +GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback; +GLEW_FUN_EXPORT PFNGLGETBOOLEANI_VPROC __glewGetBooleani_v; +GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONPROC __glewGetFragDataLocation; +GLEW_FUN_EXPORT PFNGLGETSTRINGIPROC __glewGetStringi; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVPROC __glewGetTexParameterIiv; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVPROC __glewGetTexParameterIuiv; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGPROC __glewGetTransformFeedbackVarying; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVPROC __glewGetUniformuiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVPROC __glewGetVertexAttribIiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVPROC __glewGetVertexAttribIuiv; +GLEW_FUN_EXPORT PFNGLISENABLEDIPROC __glewIsEnabledi; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVPROC __glewTexParameterIiv; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVPROC __glewTexParameterIuiv; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSPROC __glewTransformFeedbackVaryings; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIPROC __glewUniform1ui; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIVPROC __glewUniform1uiv; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIPROC __glewUniform2ui; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIVPROC __glewUniform2uiv; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIPROC __glewUniform3ui; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIVPROC __glewUniform3uiv; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIPROC __glewUniform4ui; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIVPROC __glewUniform4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IPROC __glewVertexAttribI1i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVPROC __glewVertexAttribI1iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIPROC __glewVertexAttribI1ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVPROC __glewVertexAttribI1uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IPROC __glewVertexAttribI2i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVPROC __glewVertexAttribI2iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIPROC __glewVertexAttribI2ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVPROC __glewVertexAttribI2uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IPROC __glewVertexAttribI3i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVPROC __glewVertexAttribI3iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIPROC __glewVertexAttribI3ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVPROC __glewVertexAttribI3uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVPROC __glewVertexAttribI4bv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IPROC __glewVertexAttribI4i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVPROC __glewVertexAttribI4iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVPROC __glewVertexAttribI4sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVPROC __glewVertexAttribI4ubv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIPROC __glewVertexAttribI4ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVPROC __glewVertexAttribI4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVPROC __glewVertexAttribI4usv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTERPROC __glewVertexAttribIPointer; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDPROC __glewDrawArraysInstanced; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDPROC __glewDrawElementsInstanced; +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXPROC __glewPrimitiveRestartIndex; +GLEW_FUN_EXPORT PFNGLTEXBUFFERPROC __glewTexBuffer; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREPROC __glewFramebufferTexture; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERI64VPROC __glewGetBufferParameteri64v; +GLEW_FUN_EXPORT PFNGLGETINTEGER64I_VPROC __glewGetInteger64i_v; + +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORPROC __glewVertexAttribDivisor; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIPROC __glewBlendEquationSeparatei; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIPROC __glewBlendEquationi; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIPROC __glewBlendFuncSeparatei; +GLEW_FUN_EXPORT PFNGLBLENDFUNCIPROC __glewBlendFunci; +GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGPROC __glewMinSampleShading; + +GLEW_FUN_EXPORT PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKAMDPROC __glewDebugMessageCallbackAMD; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEENABLEAMDPROC __glewDebugMessageEnableAMD; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTAMDPROC __glewDebugMessageInsertAMD; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGAMDPROC __glewGetDebugMessageLogAMD; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONINDEXEDAMDPROC __glewBlendEquationIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC __glewBlendEquationSeparateIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDFUNCINDEXEDAMDPROC __glewBlendFuncIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC __glewBlendFuncSeparateIndexedAMD; + +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPARAMETERIAMDPROC __glewVertexAttribParameteriAMD; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC __glewMultiDrawArraysIndirectAMD; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC __glewMultiDrawElementsIndirectAMD; + +GLEW_FUN_EXPORT PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD; +GLEW_FUN_EXPORT PFNGLGENNAMESAMDPROC __glewGenNamesAMD; +GLEW_FUN_EXPORT PFNGLISNAMEAMDPROC __glewIsNameAMD; + +GLEW_FUN_EXPORT PFNGLBEGINPERFMONITORAMDPROC __glewBeginPerfMonitorAMD; +GLEW_FUN_EXPORT PFNGLDELETEPERFMONITORSAMDPROC __glewDeletePerfMonitorsAMD; +GLEW_FUN_EXPORT PFNGLENDPERFMONITORAMDPROC __glewEndPerfMonitorAMD; +GLEW_FUN_EXPORT PFNGLGENPERFMONITORSAMDPROC __glewGenPerfMonitorsAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERDATAAMDPROC __glewGetPerfMonitorCounterDataAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERINFOAMDPROC __glewGetPerfMonitorCounterInfoAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC __glewGetPerfMonitorCounterStringAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSAMDPROC __glewGetPerfMonitorCountersAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSTRINGAMDPROC __glewGetPerfMonitorGroupStringAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSAMDPROC __glewGetPerfMonitorGroupsAMD; +GLEW_FUN_EXPORT PFNGLSELECTPERFMONITORCOUNTERSAMDPROC __glewSelectPerfMonitorCountersAMD; + +GLEW_FUN_EXPORT PFNGLSETMULTISAMPLEFVAMDPROC __glewSetMultisamplefvAMD; + +GLEW_FUN_EXPORT PFNGLTEXSTORAGESPARSEAMDPROC __glewTexStorageSparseAMD; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGESPARSEAMDPROC __glewTextureStorageSparseAMD; + +GLEW_FUN_EXPORT PFNGLSTENCILOPVALUEAMDPROC __glewStencilOpValueAMD; + +GLEW_FUN_EXPORT PFNGLTESSELLATIONFACTORAMDPROC __glewTessellationFactorAMD; +GLEW_FUN_EXPORT PFNGLTESSELLATIONMODEAMDPROC __glewTessellationModeAMD; + +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERANGLEPROC __glewBlitFramebufferANGLE; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC __glewRenderbufferStorageMultisampleANGLE; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDANGLEPROC __glewDrawArraysInstancedANGLE; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDANGLEPROC __glewDrawElementsInstancedANGLE; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORANGLEPROC __glewVertexAttribDivisorANGLE; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYANGLEPROC __glewBeginQueryANGLE; +GLEW_FUN_EXPORT PFNGLDELETEQUERIESANGLEPROC __glewDeleteQueriesANGLE; +GLEW_FUN_EXPORT PFNGLENDQUERYANGLEPROC __glewEndQueryANGLE; +GLEW_FUN_EXPORT PFNGLGENQUERIESANGLEPROC __glewGenQueriesANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VANGLEPROC __glewGetQueryObjecti64vANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVANGLEPROC __glewGetQueryObjectivANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VANGLEPROC __glewGetQueryObjectui64vANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVANGLEPROC __glewGetQueryObjectuivANGLE; +GLEW_FUN_EXPORT PFNGLGETQUERYIVANGLEPROC __glewGetQueryivANGLE; +GLEW_FUN_EXPORT PFNGLISQUERYANGLEPROC __glewIsQueryANGLE; +GLEW_FUN_EXPORT PFNGLQUERYCOUNTERANGLEPROC __glewQueryCounterANGLE; + +GLEW_FUN_EXPORT PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC __glewGetTranslatedShaderSourceANGLE; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC __glewDrawRangeElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLELEMENTPOINTERAPPLEPROC __glewElementPointerAPPLE; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC __glewMultiDrawElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC __glewMultiDrawRangeElementArrayAPPLE; + +GLEW_FUN_EXPORT PFNGLDELETEFENCESAPPLEPROC __glewDeleteFencesAPPLE; +GLEW_FUN_EXPORT PFNGLFINISHFENCEAPPLEPROC __glewFinishFenceAPPLE; +GLEW_FUN_EXPORT PFNGLFINISHOBJECTAPPLEPROC __glewFinishObjectAPPLE; +GLEW_FUN_EXPORT PFNGLGENFENCESAPPLEPROC __glewGenFencesAPPLE; +GLEW_FUN_EXPORT PFNGLISFENCEAPPLEPROC __glewIsFenceAPPLE; +GLEW_FUN_EXPORT PFNGLSETFENCEAPPLEPROC __glewSetFenceAPPLE; +GLEW_FUN_EXPORT PFNGLTESTFENCEAPPLEPROC __glewTestFenceAPPLE; +GLEW_FUN_EXPORT PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE; + +GLEW_FUN_EXPORT PFNGLBUFFERPARAMETERIAPPLEPROC __glewBufferParameteriAPPLE; +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC __glewFlushMappedBufferRangeAPPLE; + +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVAPPLEPROC __glewGetObjectParameterivAPPLE; +GLEW_FUN_EXPORT PFNGLOBJECTPURGEABLEAPPLEPROC __glewObjectPurgeableAPPLE; +GLEW_FUN_EXPORT PFNGLOBJECTUNPURGEABLEAPPLEPROC __glewObjectUnpurgeableAPPLE; + +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE; +GLEW_FUN_EXPORT PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE; + +GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYAPPLEPROC __glewBindVertexArrayAPPLE; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSAPPLEPROC __glewDeleteVertexArraysAPPLE; +GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSAPPLEPROC __glewGenVertexArraysAPPLE; +GLEW_FUN_EXPORT PFNGLISVERTEXARRAYAPPLEPROC __glewIsVertexArrayAPPLE; + +GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC __glewFlushVertexArrayRangeAPPLE; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYPARAMETERIAPPLEPROC __glewVertexArrayParameteriAPPLE; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGEAPPLEPROC __glewVertexArrayRangeAPPLE; + +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBAPPLEPROC __glewDisableVertexAttribAPPLE; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBAPPLEPROC __glewEnableVertexAttribAPPLE; +GLEW_FUN_EXPORT PFNGLISVERTEXATTRIBENABLEDAPPLEPROC __glewIsVertexAttribEnabledAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1DAPPLEPROC __glewMapVertexAttrib1dAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1FAPPLEPROC __glewMapVertexAttrib1fAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2DAPPLEPROC __glewMapVertexAttrib2dAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2FAPPLEPROC __glewMapVertexAttrib2fAPPLE; + +GLEW_FUN_EXPORT PFNGLCLEARDEPTHFPROC __glewClearDepthf; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEFPROC __glewDepthRangef; +GLEW_FUN_EXPORT PFNGLGETSHADERPRECISIONFORMATPROC __glewGetShaderPrecisionFormat; +GLEW_FUN_EXPORT PFNGLRELEASESHADERCOMPILERPROC __glewReleaseShaderCompiler; +GLEW_FUN_EXPORT PFNGLSHADERBINARYPROC __glewShaderBinary; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC __glewDrawArraysInstancedBaseInstance; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC __glewDrawElementsInstancedBaseInstance; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC __glewDrawElementsInstancedBaseVertexBaseInstance; + +GLEW_FUN_EXPORT PFNGLGETIMAGEHANDLEARBPROC __glewGetImageHandleARB; +GLEW_FUN_EXPORT PFNGLGETTEXTUREHANDLEARBPROC __glewGetTextureHandleARB; +GLEW_FUN_EXPORT PFNGLGETTEXTURESAMPLERHANDLEARBPROC __glewGetTextureSamplerHandleARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLUI64VARBPROC __glewGetVertexAttribLui64vARB; +GLEW_FUN_EXPORT PFNGLISIMAGEHANDLERESIDENTARBPROC __glewIsImageHandleResidentARB; +GLEW_FUN_EXPORT PFNGLISTEXTUREHANDLERESIDENTARBPROC __glewIsTextureHandleResidentARB; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC __glewMakeImageHandleNonResidentARB; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLERESIDENTARBPROC __glewMakeImageHandleResidentARB; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC __glewMakeTextureHandleNonResidentARB; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLERESIDENTARBPROC __glewMakeTextureHandleResidentARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC __glewProgramUniformHandleui64ARB; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC __glewProgramUniformHandleui64vARB; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64ARBPROC __glewUniformHandleui64ARB; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64VARBPROC __glewUniformHandleui64vARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64ARBPROC __glewVertexAttribL1ui64ARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64VARBPROC __glewVertexAttribL1ui64vARB; + +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed; +GLEW_FUN_EXPORT PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex; + +GLEW_FUN_EXPORT PFNGLBUFFERSTORAGEPROC __glewBufferStorage; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSTORAGEEXTPROC __glewNamedBufferStorageEXT; + +GLEW_FUN_EXPORT PFNGLCREATESYNCFROMCLEVENTARBPROC __glewCreateSyncFromCLeventARB; + +GLEW_FUN_EXPORT PFNGLCLEARBUFFERDATAPROC __glewClearBufferData; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERSUBDATAPROC __glewClearBufferSubData; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERDATAEXTPROC __glewClearNamedBufferDataEXT; +GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC __glewClearNamedBufferSubDataEXT; + +GLEW_FUN_EXPORT PFNGLCLEARTEXIMAGEPROC __glewClearTexImage; +GLEW_FUN_EXPORT PFNGLCLEARTEXSUBIMAGEPROC __glewClearTexSubImage; + +GLEW_FUN_EXPORT PFNGLCLAMPCOLORARBPROC __glewClampColorARB; + +GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEPROC __glewDispatchCompute; +GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEINDIRECTPROC __glewDispatchComputeIndirect; + +GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC __glewDispatchComputeGroupSizeARB; + +GLEW_FUN_EXPORT PFNGLCOPYBUFFERSUBDATAPROC __glewCopyBufferSubData; + +GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATAPROC __glewCopyImageSubData; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKARBPROC __glewDebugMessageCallbackARB; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLARBPROC __glewDebugMessageControlARB; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTARBPROC __glewDebugMessageInsertARB; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGARBPROC __glewGetDebugMessageLogARB; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIARBPROC __glewBlendEquationSeparateiARB; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIARBPROC __glewBlendEquationiARB; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIARBPROC __glewBlendFuncSeparateiARB; +GLEW_FUN_EXPORT PFNGLBLENDFUNCIARBPROC __glewBlendFunciARB; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSBASEVERTEXPROC __glewDrawElementsBaseVertex; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __glewDrawElementsInstancedBaseVertex; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC __glewDrawRangeElementsBaseVertex; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC __glewMultiDrawElementsBaseVertex; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINDIRECTPROC __glewDrawArraysIndirect; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINDIRECTPROC __glewDrawElementsIndirect; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERPARAMETERIPROC __glewFramebufferParameteri; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVPROC __glewGetFramebufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC __glewGetNamedFramebufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC __glewNamedFramebufferParameteriEXT; + +GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer; +GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer; +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERPROC __glewBlitFramebuffer; +GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus; +GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers; +GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer; +GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSPROC __glewGenFramebuffers; +GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSPROC __glewGenRenderbuffers; +GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPPROC __glewGenerateMipmap; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetFramebufferAttachmentParameteriv; +GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVPROC __glewGetRenderbufferParameteriv; +GLEW_FUN_EXPORT PFNGLISFRAMEBUFFERPROC __glewIsFramebuffer; +GLEW_FUN_EXPORT PFNGLISRENDERBUFFERPROC __glewIsRenderbuffer; +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEPROC __glewRenderbufferStorage; +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewRenderbufferStorageMultisample; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREARBPROC __glewFramebufferTextureARB; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEARBPROC __glewFramebufferTextureFaceARB; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERARBPROC __glewFramebufferTextureLayerARB; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIARBPROC __glewProgramParameteriARB; + +GLEW_FUN_EXPORT PFNGLGETPROGRAMBINARYPROC __glewGetProgramBinary; +GLEW_FUN_EXPORT PFNGLPROGRAMBINARYPROC __glewProgramBinary; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIPROC __glewProgramParameteri; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMDVPROC __glewGetUniformdv; +GLEW_FUN_EXPORT PFNGLUNIFORM1DPROC __glewUniform1d; +GLEW_FUN_EXPORT PFNGLUNIFORM1DVPROC __glewUniform1dv; +GLEW_FUN_EXPORT PFNGLUNIFORM2DPROC __glewUniform2d; +GLEW_FUN_EXPORT PFNGLUNIFORM2DVPROC __glewUniform2dv; +GLEW_FUN_EXPORT PFNGLUNIFORM3DPROC __glewUniform3d; +GLEW_FUN_EXPORT PFNGLUNIFORM3DVPROC __glewUniform3dv; +GLEW_FUN_EXPORT PFNGLUNIFORM4DPROC __glewUniform4d; +GLEW_FUN_EXPORT PFNGLUNIFORM4DVPROC __glewUniform4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2DVPROC __glewUniformMatrix2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3DVPROC __glewUniformMatrix2x3dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4DVPROC __glewUniformMatrix2x4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3DVPROC __glewUniformMatrix3dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2DVPROC __glewUniformMatrix3x2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4DVPROC __glewUniformMatrix3x4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4DVPROC __glewUniformMatrix4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2DVPROC __glewUniformMatrix4x2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3DVPROC __glewUniformMatrix4x3dv; + +GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEPROC __glewColorSubTable; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPROC __glewColorTable; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVPROC __glewColorTableParameteriv; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DPROC __glewConvolutionFilter1D; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DPROC __glewConvolutionFilter2D; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFPROC __glewConvolutionParameterf; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVPROC __glewConvolutionParameterfv; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIPROC __glewConvolutionParameteri; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVPROC __glewConvolutionParameteriv; +GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEPROC __glewCopyColorSubTable; +GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLEPROC __glewCopyColorTable; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DPROC __glewCopyConvolutionFilter1D; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DPROC __glewCopyConvolutionFilter2D; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPROC __glewGetColorTable; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVPROC __glewGetColorTableParameterfv; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVPROC __glewGetColorTableParameteriv; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTERPROC __glewGetConvolutionFilter; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVPROC __glewGetConvolutionParameterfv; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVPROC __glewGetConvolutionParameteriv; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPROC __glewGetHistogram; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVPROC __glewGetHistogramParameterfv; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVPROC __glewGetHistogramParameteriv; +GLEW_FUN_EXPORT PFNGLGETMINMAXPROC __glewGetMinmax; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVPROC __glewGetMinmaxParameterfv; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVPROC __glewGetMinmaxParameteriv; +GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTERPROC __glewGetSeparableFilter; +GLEW_FUN_EXPORT PFNGLHISTOGRAMPROC __glewHistogram; +GLEW_FUN_EXPORT PFNGLMINMAXPROC __glewMinmax; +GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMPROC __glewResetHistogram; +GLEW_FUN_EXPORT PFNGLRESETMINMAXPROC __glewResetMinmax; +GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC __glewMultiDrawArraysIndirectCountARB; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC __glewMultiDrawElementsIndirectCountARB; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB; + +GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATIVPROC __glewGetInternalformativ; + +GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATI64VPROC __glewGetInternalformati64v; + +GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERDATAPROC __glewInvalidateBufferData; +GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERSUBDATAPROC __glewInvalidateBufferSubData; +GLEW_FUN_EXPORT PFNGLINVALIDATEFRAMEBUFFERPROC __glewInvalidateFramebuffer; +GLEW_FUN_EXPORT PFNGLINVALIDATESUBFRAMEBUFFERPROC __glewInvalidateSubFramebuffer; +GLEW_FUN_EXPORT PFNGLINVALIDATETEXIMAGEPROC __glewInvalidateTexImage; +GLEW_FUN_EXPORT PFNGLINVALIDATETEXSUBIMAGEPROC __glewInvalidateTexSubImage; + +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange; +GLEW_FUN_EXPORT PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange; + +GLEW_FUN_EXPORT PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUIVARBPROC __glewMatrixIndexuivARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUSVARBPROC __glewMatrixIndexusvARB; + +GLEW_FUN_EXPORT PFNGLBINDBUFFERSBASEPROC __glewBindBuffersBase; +GLEW_FUN_EXPORT PFNGLBINDBUFFERSRANGEPROC __glewBindBuffersRange; +GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTURESPROC __glewBindImageTextures; +GLEW_FUN_EXPORT PFNGLBINDSAMPLERSPROC __glewBindSamplers; +GLEW_FUN_EXPORT PFNGLBINDTEXTURESPROC __glewBindTextures; +GLEW_FUN_EXPORT PFNGLBINDVERTEXBUFFERSPROC __glewBindVertexBuffers; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTPROC __glewMultiDrawArraysIndirect; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTPROC __glewMultiDrawElementsIndirect; + +GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB; + +GLEW_FUN_EXPORT PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB; +GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREARBPROC __glewClientActiveTextureARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DARBPROC __glewMultiTexCoord1dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVARBPROC __glewMultiTexCoord1dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FARBPROC __glewMultiTexCoord1fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVARBPROC __glewMultiTexCoord1fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IARBPROC __glewMultiTexCoord1iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVARBPROC __glewMultiTexCoord1ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SARBPROC __glewMultiTexCoord1sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVARBPROC __glewMultiTexCoord1svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DARBPROC __glewMultiTexCoord2dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVARBPROC __glewMultiTexCoord2dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVARBPROC __glewMultiTexCoord2fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IARBPROC __glewMultiTexCoord2iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVARBPROC __glewMultiTexCoord2ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SARBPROC __glewMultiTexCoord2sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVARBPROC __glewMultiTexCoord2svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DARBPROC __glewMultiTexCoord3dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVARBPROC __glewMultiTexCoord3dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FARBPROC __glewMultiTexCoord3fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVARBPROC __glewMultiTexCoord3fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IARBPROC __glewMultiTexCoord3iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVARBPROC __glewMultiTexCoord3ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SARBPROC __glewMultiTexCoord3sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVARBPROC __glewMultiTexCoord3svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DARBPROC __glewMultiTexCoord4dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVARBPROC __glewMultiTexCoord4dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FARBPROC __glewMultiTexCoord4fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVARBPROC __glewMultiTexCoord4fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IARBPROC __glewMultiTexCoord4iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVARBPROC __glewMultiTexCoord4ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SARBPROC __glewMultiTexCoord4sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVARBPROC __glewMultiTexCoord4svARB; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYARBPROC __glewBeginQueryARB; +GLEW_FUN_EXPORT PFNGLDELETEQUERIESARBPROC __glewDeleteQueriesARB; +GLEW_FUN_EXPORT PFNGLENDQUERYARBPROC __glewEndQueryARB; +GLEW_FUN_EXPORT PFNGLGENQUERIESARBPROC __glewGenQueriesARB; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVARBPROC __glewGetQueryObjectivARB; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB; +GLEW_FUN_EXPORT PFNGLGETQUERYIVARBPROC __glewGetQueryivARB; +GLEW_FUN_EXPORT PFNGLISQUERYARBPROC __glewIsQueryARB; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB; + +GLEW_FUN_EXPORT PFNGLGETPROGRAMINTERFACEIVPROC __glewGetProgramInterfaceiv; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEINDEXPROC __glewGetProgramResourceIndex; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONPROC __glewGetProgramResourceLocation; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC __glewGetProgramResourceLocationIndex; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCENAMEPROC __glewGetProgramResourceName; +GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEIVPROC __glewGetProgramResourceiv; + +GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex; + +GLEW_FUN_EXPORT PFNGLGETGRAPHICSRESETSTATUSARBPROC __glewGetGraphicsResetStatusARB; +GLEW_FUN_EXPORT PFNGLGETNCOLORTABLEARBPROC __glewGetnColorTableARB; +GLEW_FUN_EXPORT PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC __glewGetnCompressedTexImageARB; +GLEW_FUN_EXPORT PFNGLGETNCONVOLUTIONFILTERARBPROC __glewGetnConvolutionFilterARB; +GLEW_FUN_EXPORT PFNGLGETNHISTOGRAMARBPROC __glewGetnHistogramARB; +GLEW_FUN_EXPORT PFNGLGETNMAPDVARBPROC __glewGetnMapdvARB; +GLEW_FUN_EXPORT PFNGLGETNMAPFVARBPROC __glewGetnMapfvARB; +GLEW_FUN_EXPORT PFNGLGETNMAPIVARBPROC __glewGetnMapivARB; +GLEW_FUN_EXPORT PFNGLGETNMINMAXARBPROC __glewGetnMinmaxARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPFVARBPROC __glewGetnPixelMapfvARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUIVARBPROC __glewGetnPixelMapuivARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUSVARBPROC __glewGetnPixelMapusvARB; +GLEW_FUN_EXPORT PFNGLGETNPOLYGONSTIPPLEARBPROC __glewGetnPolygonStippleARB; +GLEW_FUN_EXPORT PFNGLGETNSEPARABLEFILTERARBPROC __glewGetnSeparableFilterARB; +GLEW_FUN_EXPORT PFNGLGETNTEXIMAGEARBPROC __glewGetnTexImageARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMDVARBPROC __glewGetnUniformdvARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMFVARBPROC __glewGetnUniformfvARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMIVARBPROC __glewGetnUniformivARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMUIVARBPROC __glewGetnUniformuivARB; +GLEW_FUN_EXPORT PFNGLREADNPIXELSARBPROC __glewReadnPixelsARB; + +GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGARBPROC __glewMinSampleShadingARB; + +GLEW_FUN_EXPORT PFNGLBINDSAMPLERPROC __glewBindSampler; +GLEW_FUN_EXPORT PFNGLDELETESAMPLERSPROC __glewDeleteSamplers; +GLEW_FUN_EXPORT PFNGLGENSAMPLERSPROC __glewGenSamplers; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIIVPROC __glewGetSamplerParameterIiv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIUIVPROC __glewGetSamplerParameterIuiv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERFVPROC __glewGetSamplerParameterfv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIVPROC __glewGetSamplerParameteriv; +GLEW_FUN_EXPORT PFNGLISSAMPLERPROC __glewIsSampler; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIIVPROC __glewSamplerParameterIiv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIUIVPROC __glewSamplerParameterIuiv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFPROC __glewSamplerParameterf; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFVPROC __glewSamplerParameterfv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIPROC __glewSamplerParameteri; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIVPROC __glewSamplerParameteriv; + +GLEW_FUN_EXPORT PFNGLACTIVESHADERPROGRAMPROC __glewActiveShaderProgram; +GLEW_FUN_EXPORT PFNGLBINDPROGRAMPIPELINEPROC __glewBindProgramPipeline; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMVPROC __glewCreateShaderProgramv; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPIPELINESPROC __glewDeleteProgramPipelines; +GLEW_FUN_EXPORT PFNGLGENPROGRAMPIPELINESPROC __glewGenProgramPipelines; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEINFOLOGPROC __glewGetProgramPipelineInfoLog; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEIVPROC __glewGetProgramPipelineiv; +GLEW_FUN_EXPORT PFNGLISPROGRAMPIPELINEPROC __glewIsProgramPipeline; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DPROC __glewProgramUniform1d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DVPROC __glewProgramUniform1dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FPROC __glewProgramUniform1f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVPROC __glewProgramUniform1fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IPROC __glewProgramUniform1i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVPROC __glewProgramUniform1iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIPROC __glewProgramUniform1ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVPROC __glewProgramUniform1uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DPROC __glewProgramUniform2d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DVPROC __glewProgramUniform2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FPROC __glewProgramUniform2f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVPROC __glewProgramUniform2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IPROC __glewProgramUniform2i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVPROC __glewProgramUniform2iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIPROC __glewProgramUniform2ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVPROC __glewProgramUniform2uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DPROC __glewProgramUniform3d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DVPROC __glewProgramUniform3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FPROC __glewProgramUniform3f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVPROC __glewProgramUniform3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IPROC __glewProgramUniform3i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVPROC __glewProgramUniform3iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIPROC __glewProgramUniform3ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVPROC __glewProgramUniform3uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DPROC __glewProgramUniform4d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DVPROC __glewProgramUniform4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FPROC __glewProgramUniform4f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVPROC __glewProgramUniform4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IPROC __glewProgramUniform4i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVPROC __glewProgramUniform4iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIPROC __glewProgramUniform4ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVPROC __glewProgramUniform4uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2DVPROC __glewProgramUniformMatrix2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVPROC __glewProgramUniformMatrix2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC __glewProgramUniformMatrix2x3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC __glewProgramUniformMatrix2x3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC __glewProgramUniformMatrix2x4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC __glewProgramUniformMatrix2x4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3DVPROC __glewProgramUniformMatrix3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVPROC __glewProgramUniformMatrix3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC __glewProgramUniformMatrix3x2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC __glewProgramUniformMatrix3x2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC __glewProgramUniformMatrix3x4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC __glewProgramUniformMatrix3x4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4DVPROC __glewProgramUniformMatrix4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVPROC __glewProgramUniformMatrix4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC __glewProgramUniformMatrix4x2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC __glewProgramUniformMatrix4x2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC __glewProgramUniformMatrix4x3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC __glewProgramUniformMatrix4x3fv; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMSTAGESPROC __glewUseProgramStages; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPIPELINEPROC __glewValidateProgramPipeline; + +GLEW_FUN_EXPORT PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC __glewGetActiveAtomicCounterBufferiv; + +GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREPROC __glewBindImageTexture; +GLEW_FUN_EXPORT PFNGLMEMORYBARRIERPROC __glewMemoryBarrier; + +GLEW_FUN_EXPORT PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB; +GLEW_FUN_EXPORT PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB; +GLEW_FUN_EXPORT PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB; +GLEW_FUN_EXPORT PFNGLCREATESHADEROBJECTARBPROC __glewCreateShaderObjectARB; +GLEW_FUN_EXPORT PFNGLDELETEOBJECTARBPROC __glewDeleteObjectARB; +GLEW_FUN_EXPORT PFNGLDETACHOBJECTARBPROC __glewDetachObjectARB; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMARBPROC __glewGetActiveUniformARB; +GLEW_FUN_EXPORT PFNGLGETATTACHEDOBJECTSARBPROC __glewGetAttachedObjectsARB; +GLEW_FUN_EXPORT PFNGLGETHANDLEARBPROC __glewGetHandleARB; +GLEW_FUN_EXPORT PFNGLGETINFOLOGARBPROC __glewGetInfoLogARB; +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERFVARBPROC __glewGetObjectParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVARBPROC __glewGetObjectParameterivARB; +GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEARBPROC __glewGetShaderSourceARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONARBPROC __glewGetUniformLocationARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMFVARBPROC __glewGetUniformfvARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMIVARBPROC __glewGetUniformivARB; +GLEW_FUN_EXPORT PFNGLLINKPROGRAMARBPROC __glewLinkProgramARB; +GLEW_FUN_EXPORT PFNGLSHADERSOURCEARBPROC __glewShaderSourceARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1FARBPROC __glewUniform1fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1FVARBPROC __glewUniform1fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1IARBPROC __glewUniform1iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1IVARBPROC __glewUniform1ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2FARBPROC __glewUniform2fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2FVARBPROC __glewUniform2fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2IARBPROC __glewUniform2iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2IVARBPROC __glewUniform2ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3FARBPROC __glewUniform3fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3FVARBPROC __glewUniform3fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3IARBPROC __glewUniform3iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3IVARBPROC __glewUniform3ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4FARBPROC __glewUniform4fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4FVARBPROC __glewUniform4fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4IARBPROC __glewUniform4iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4IVARBPROC __glewUniform4ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVARBPROC __glewUniformMatrix2fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVARBPROC __glewUniformMatrix3fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB; + +GLEW_FUN_EXPORT PFNGLSHADERSTORAGEBLOCKBINDINGPROC __glewShaderStorageBlockBinding; + +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINENAMEPROC __glewGetActiveSubroutineName; +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC __glewGetActiveSubroutineUniformName; +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC __glewGetActiveSubroutineUniformiv; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTAGEIVPROC __glewGetProgramStageiv; +GLEW_FUN_EXPORT PFNGLGETSUBROUTINEINDEXPROC __glewGetSubroutineIndex; +GLEW_FUN_EXPORT PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC __glewGetSubroutineUniformLocation; +GLEW_FUN_EXPORT PFNGLGETUNIFORMSUBROUTINEUIVPROC __glewGetUniformSubroutineuiv; +GLEW_FUN_EXPORT PFNGLUNIFORMSUBROUTINESUIVPROC __glewUniformSubroutinesuiv; + +GLEW_FUN_EXPORT PFNGLCOMPILESHADERINCLUDEARBPROC __glewCompileShaderIncludeARB; +GLEW_FUN_EXPORT PFNGLDELETENAMEDSTRINGARBPROC __glewDeleteNamedStringARB; +GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGARBPROC __glewGetNamedStringARB; +GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGIVARBPROC __glewGetNamedStringivARB; +GLEW_FUN_EXPORT PFNGLISNAMEDSTRINGARBPROC __glewIsNamedStringARB; +GLEW_FUN_EXPORT PFNGLNAMEDSTRINGARBPROC __glewNamedStringARB; + +GLEW_FUN_EXPORT PFNGLTEXPAGECOMMITMENTARBPROC __glewTexPageCommitmentARB; +GLEW_FUN_EXPORT PFNGLTEXTUREPAGECOMMITMENTEXTPROC __glewTexturePageCommitmentEXT; + +GLEW_FUN_EXPORT PFNGLCLIENTWAITSYNCPROC __glewClientWaitSync; +GLEW_FUN_EXPORT PFNGLDELETESYNCPROC __glewDeleteSync; +GLEW_FUN_EXPORT PFNGLFENCESYNCPROC __glewFenceSync; +GLEW_FUN_EXPORT PFNGLGETINTEGER64VPROC __glewGetInteger64v; +GLEW_FUN_EXPORT PFNGLGETSYNCIVPROC __glewGetSynciv; +GLEW_FUN_EXPORT PFNGLISSYNCPROC __glewIsSync; +GLEW_FUN_EXPORT PFNGLWAITSYNCPROC __glewWaitSync; + +GLEW_FUN_EXPORT PFNGLPATCHPARAMETERFVPROC __glewPatchParameterfv; +GLEW_FUN_EXPORT PFNGLPATCHPARAMETERIPROC __glewPatchParameteri; + +GLEW_FUN_EXPORT PFNGLTEXBUFFERARBPROC __glewTexBufferARB; + +GLEW_FUN_EXPORT PFNGLTEXBUFFERRANGEPROC __glewTexBufferRange; +GLEW_FUN_EXPORT PFNGLTEXTUREBUFFERRANGEEXTPROC __glewTextureBufferRangeEXT; + +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC __glewCompressedTexSubImage1DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB; + +GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVPROC __glewGetMultisamplefv; +GLEW_FUN_EXPORT PFNGLSAMPLEMASKIPROC __glewSampleMaski; +GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLEPROC __glewTexImage2DMultisample; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLEPROC __glewTexImage3DMultisample; + +GLEW_FUN_EXPORT PFNGLTEXSTORAGE1DPROC __glewTexStorage1D; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DPROC __glewTexStorage2D; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DPROC __glewTexStorage3D; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE1DEXTPROC __glewTextureStorage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DEXTPROC __glewTextureStorage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DEXTPROC __glewTextureStorage3DEXT; + +GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DMULTISAMPLEPROC __glewTexStorage2DMultisample; +GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DMULTISAMPLEPROC __glewTexStorage3DMultisample; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC __glewTextureStorage2DMultisampleEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC __glewTextureStorage3DMultisampleEXT; + +GLEW_FUN_EXPORT PFNGLTEXTUREVIEWPROC __glewTextureView; + +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VPROC __glewGetQueryObjecti64v; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VPROC __glewGetQueryObjectui64v; +GLEW_FUN_EXPORT PFNGLQUERYCOUNTERPROC __glewQueryCounter; + +GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKPROC __glewBindTransformFeedback; +GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSPROC __glewDeleteTransformFeedbacks; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKPROC __glewDrawTransformFeedback; +GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSPROC __glewGenTransformFeedbacks; +GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKPROC __glewIsTransformFeedback; +GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKPROC __glewPauseTransformFeedback; +GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKPROC __glewResumeTransformFeedback; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYINDEXEDPROC __glewBeginQueryIndexed; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC __glewDrawTransformFeedbackStream; +GLEW_FUN_EXPORT PFNGLENDQUERYINDEXEDPROC __glewEndQueryIndexed; +GLEW_FUN_EXPORT PFNGLGETQUERYINDEXEDIVPROC __glewGetQueryIndexediv; + +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC __glewDrawTransformFeedbackInstanced; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC __glewDrawTransformFeedbackStreamInstanced; + +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB; + +GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEPROC __glewBindBufferBase; +GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC __glewGetActiveUniformBlockName; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKIVPROC __glewGetActiveUniformBlockiv; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMNAMEPROC __glewGetActiveUniformName; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMSIVPROC __glewGetActiveUniformsiv; +GLEW_FUN_EXPORT PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v; +GLEW_FUN_EXPORT PFNGLGETUNIFORMBLOCKINDEXPROC __glewGetUniformBlockIndex; +GLEW_FUN_EXPORT PFNGLGETUNIFORMINDICESPROC __glewGetUniformIndices; +GLEW_FUN_EXPORT PFNGLUNIFORMBLOCKBINDINGPROC __glewUniformBlockBinding; + +GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYPROC __glewBindVertexArray; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSPROC __glewDeleteVertexArrays; +GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSPROC __glewGenVertexArrays; +GLEW_FUN_EXPORT PFNGLISVERTEXARRAYPROC __glewIsVertexArray; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVPROC __glewGetVertexAttribLdv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DPROC __glewVertexAttribL1d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVPROC __glewVertexAttribL1dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DPROC __glewVertexAttribL2d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVPROC __glewVertexAttribL2dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DPROC __glewVertexAttribL3d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVPROC __glewVertexAttribL3dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DPROC __glewVertexAttribL4d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVPROC __glewVertexAttribL4dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTERPROC __glewVertexAttribLPointer; + +GLEW_FUN_EXPORT PFNGLBINDVERTEXBUFFERPROC __glewBindVertexBuffer; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBBINDINGPROC __glewVertexAttribBinding; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATPROC __glewVertexAttribFormat; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATPROC __glewVertexAttribIFormat; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATPROC __glewVertexAttribLFormat; +GLEW_FUN_EXPORT PFNGLVERTEXBINDINGDIVISORPROC __glewVertexBindingDivisor; + +GLEW_FUN_EXPORT PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB; +GLEW_FUN_EXPORT PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB; +GLEW_FUN_EXPORT PFNGLWEIGHTBVARBPROC __glewWeightbvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTDVARBPROC __glewWeightdvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTFVARBPROC __glewWeightfvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTIVARBPROC __glewWeightivARB; +GLEW_FUN_EXPORT PFNGLWEIGHTSVARBPROC __glewWeightsvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUBVARBPROC __glewWeightubvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUIVARBPROC __glewWeightuivARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUSVARBPROC __glewWeightusvARB; + +GLEW_FUN_EXPORT PFNGLBINDBUFFERARBPROC __glewBindBufferARB; +GLEW_FUN_EXPORT PFNGLBUFFERDATAARBPROC __glewBufferDataARB; +GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAARBPROC __glewBufferSubDataARB; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERSARBPROC __glewDeleteBuffersARB; +GLEW_FUN_EXPORT PFNGLGENBUFFERSARBPROC __glewGenBuffersARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVARBPROC __glewGetBufferParameterivARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVARBPROC __glewGetBufferPointervARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAARBPROC __glewGetBufferSubDataARB; +GLEW_FUN_EXPORT PFNGLISBUFFERARBPROC __glewIsBufferARB; +GLEW_FUN_EXPORT PFNGLMAPBUFFERARBPROC __glewMapBufferARB; +GLEW_FUN_EXPORT PFNGLUNMAPBUFFERARBPROC __glewUnmapBufferARB; + +GLEW_FUN_EXPORT PFNGLBINDPROGRAMARBPROC __glewBindProgramARB; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSARBPROC __glewDeleteProgramsARB; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYARBPROC __glewDisableVertexAttribArrayARB; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYARBPROC __glewEnableVertexAttribArrayARB; +GLEW_FUN_EXPORT PFNGLGENPROGRAMSARBPROC __glewGenProgramsARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERDVARBPROC __glewGetProgramEnvParameterdvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERFVARBPROC __glewGetProgramEnvParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC __glewGetProgramLocalParameterdvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC __glewGetProgramLocalParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGARBPROC __glewGetProgramStringARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVARBPROC __glewGetProgramivARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVARBPROC __glewGetVertexAttribPointervARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVARBPROC __glewGetVertexAttribdvARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVARBPROC __glewGetVertexAttribfvARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVARBPROC __glewGetVertexAttribivARB; +GLEW_FUN_EXPORT PFNGLISPROGRAMARBPROC __glewIsProgramARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DARBPROC __glewProgramEnvParameter4dARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DVARBPROC __glewProgramEnvParameter4dvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FARBPROC __glewProgramEnvParameter4fARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FVARBPROC __glewProgramEnvParameter4fvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DARBPROC __glewProgramLocalParameter4dARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DVARBPROC __glewProgramLocalParameter4dvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FARBPROC __glewProgramLocalParameter4fARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FVARBPROC __glewProgramLocalParameter4fvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMSTRINGARBPROC __glewProgramStringARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DARBPROC __glewVertexAttrib1dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVARBPROC __glewVertexAttrib1dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FARBPROC __glewVertexAttrib1fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVARBPROC __glewVertexAttrib1fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SARBPROC __glewVertexAttrib1sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVARBPROC __glewVertexAttrib1svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DARBPROC __glewVertexAttrib2dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVARBPROC __glewVertexAttrib2dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FARBPROC __glewVertexAttrib2fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVARBPROC __glewVertexAttrib2fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SARBPROC __glewVertexAttrib2sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVARBPROC __glewVertexAttrib2svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DARBPROC __glewVertexAttrib3dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVARBPROC __glewVertexAttrib3dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FARBPROC __glewVertexAttrib3fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVARBPROC __glewVertexAttrib3fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SARBPROC __glewVertexAttrib3sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVARBPROC __glewVertexAttrib3svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVARBPROC __glewVertexAttrib4NbvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVARBPROC __glewVertexAttrib4NivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVARBPROC __glewVertexAttrib4NsvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBARBPROC __glewVertexAttrib4NubARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVARBPROC __glewVertexAttrib4NubvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVARBPROC __glewVertexAttrib4NuivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVARBPROC __glewVertexAttrib4NusvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVARBPROC __glewVertexAttrib4bvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DARBPROC __glewVertexAttrib4dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVARBPROC __glewVertexAttrib4dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FARBPROC __glewVertexAttrib4fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVARBPROC __glewVertexAttrib4fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVARBPROC __glewVertexAttrib4ivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SARBPROC __glewVertexAttrib4sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVARBPROC __glewVertexAttrib4svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVARBPROC __glewVertexAttrib4ubvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVARBPROC __glewVertexAttrib4uivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVARBPROC __glewVertexAttrib4usvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERARBPROC __glewVertexAttribPointerARB; + +GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB; +GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB; +GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB; + +GLEW_FUN_EXPORT PFNGLCOLORP3UIPROC __glewColorP3ui; +GLEW_FUN_EXPORT PFNGLCOLORP3UIVPROC __glewColorP3uiv; +GLEW_FUN_EXPORT PFNGLCOLORP4UIPROC __glewColorP4ui; +GLEW_FUN_EXPORT PFNGLCOLORP4UIVPROC __glewColorP4uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIPROC __glewMultiTexCoordP1ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIVPROC __glewMultiTexCoordP1uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIPROC __glewMultiTexCoordP2ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIVPROC __glewMultiTexCoordP2uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIPROC __glewMultiTexCoordP3ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIVPROC __glewMultiTexCoordP3uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIPROC __glewMultiTexCoordP4ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIVPROC __glewMultiTexCoordP4uiv; +GLEW_FUN_EXPORT PFNGLNORMALP3UIPROC __glewNormalP3ui; +GLEW_FUN_EXPORT PFNGLNORMALP3UIVPROC __glewNormalP3uiv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIPROC __glewSecondaryColorP3ui; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIVPROC __glewSecondaryColorP3uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIPROC __glewTexCoordP1ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIVPROC __glewTexCoordP1uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIPROC __glewTexCoordP2ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIVPROC __glewTexCoordP2uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIPROC __glewTexCoordP3ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIVPROC __glewTexCoordP3uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIPROC __glewTexCoordP4ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIVPROC __glewTexCoordP4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIPROC __glewVertexAttribP1ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIVPROC __glewVertexAttribP1uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIPROC __glewVertexAttribP2ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIVPROC __glewVertexAttribP2uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIPROC __glewVertexAttribP3ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIVPROC __glewVertexAttribP3uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIPROC __glewVertexAttribP4ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIVPROC __glewVertexAttribP4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP2UIPROC __glewVertexP2ui; +GLEW_FUN_EXPORT PFNGLVERTEXP2UIVPROC __glewVertexP2uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP3UIPROC __glewVertexP3ui; +GLEW_FUN_EXPORT PFNGLVERTEXP3UIVPROC __glewVertexP3uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP4UIPROC __glewVertexP4ui; +GLEW_FUN_EXPORT PFNGLVERTEXP4UIVPROC __glewVertexP4uiv; + +GLEW_FUN_EXPORT PFNGLDEPTHRANGEARRAYVPROC __glewDepthRangeArrayv; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEINDEXEDPROC __glewDepthRangeIndexed; +GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VPROC __glewGetDoublei_v; +GLEW_FUN_EXPORT PFNGLGETFLOATI_VPROC __glewGetFloati_v; +GLEW_FUN_EXPORT PFNGLSCISSORARRAYVPROC __glewScissorArrayv; +GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDPROC __glewScissorIndexed; +GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDVPROC __glewScissorIndexedv; +GLEW_FUN_EXPORT PFNGLVIEWPORTARRAYVPROC __glewViewportArrayv; +GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFPROC __glewViewportIndexedf; +GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFVPROC __glewViewportIndexedfv; + +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DARBPROC __glewWindowPos2dARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVARBPROC __glewWindowPos2dvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FARBPROC __glewWindowPos2fARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVARBPROC __glewWindowPos2fvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IARBPROC __glewWindowPos2iARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVARBPROC __glewWindowPos2ivARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SARBPROC __glewWindowPos2sARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVARBPROC __glewWindowPos2svARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DARBPROC __glewWindowPos3dARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVARBPROC __glewWindowPos3dvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FARBPROC __glewWindowPos3fARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVARBPROC __glewWindowPos3fvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IARBPROC __glewWindowPos3iARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVARBPROC __glewWindowPos3ivARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SARBPROC __glewWindowPos3sARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVARBPROC __glewWindowPos3svARB; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSATIPROC __glewDrawBuffersATI; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYATIPROC __glewDrawElementArrayATI; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYATIPROC __glewDrawRangeElementArrayATI; +GLEW_FUN_EXPORT PFNGLELEMENTPOINTERATIPROC __glewElementPointerATI; + +GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERFVATIPROC __glewGetTexBumpParameterfvATI; +GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERIVATIPROC __glewGetTexBumpParameterivATI; +GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERFVATIPROC __glewTexBumpParameterfvATI; +GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERIVATIPROC __glewTexBumpParameterivATI; + +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP1ATIPROC __glewAlphaFragmentOp1ATI; +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP2ATIPROC __glewAlphaFragmentOp2ATI; +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP3ATIPROC __glewAlphaFragmentOp3ATI; +GLEW_FUN_EXPORT PFNGLBEGINFRAGMENTSHADERATIPROC __glewBeginFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLBINDFRAGMENTSHADERATIPROC __glewBindFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP1ATIPROC __glewColorFragmentOp1ATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP2ATIPROC __glewColorFragmentOp2ATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP3ATIPROC __glewColorFragmentOp3ATI; +GLEW_FUN_EXPORT PFNGLDELETEFRAGMENTSHADERATIPROC __glewDeleteFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLENDFRAGMENTSHADERATIPROC __glewEndFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLGENFRAGMENTSHADERSATIPROC __glewGenFragmentShadersATI; +GLEW_FUN_EXPORT PFNGLPASSTEXCOORDATIPROC __glewPassTexCoordATI; +GLEW_FUN_EXPORT PFNGLSAMPLEMAPATIPROC __glewSampleMapATI; +GLEW_FUN_EXPORT PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI; + +GLEW_FUN_EXPORT PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI; +GLEW_FUN_EXPORT PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI; + +GLEW_FUN_EXPORT PFNGLPNTRIANGLESFATIPROC __glewPNTrianglesfATI; +GLEW_FUN_EXPORT PFNGLPNTRIANGLESIATIPROC __glewPNTrianglesiATI; + +GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI; +GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI; + +GLEW_FUN_EXPORT PFNGLARRAYOBJECTATIPROC __glewArrayObjectATI; +GLEW_FUN_EXPORT PFNGLFREEOBJECTBUFFERATIPROC __glewFreeObjectBufferATI; +GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTFVATIPROC __glewGetArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTIVATIPROC __glewGetArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERFVATIPROC __glewGetObjectBufferfvATI; +GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERIVATIPROC __glewGetObjectBufferivATI; +GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTFVATIPROC __glewGetVariantArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTIVATIPROC __glewGetVariantArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLISOBJECTBUFFERATIPROC __glewIsObjectBufferATI; +GLEW_FUN_EXPORT PFNGLNEWOBJECTBUFFERATIPROC __glewNewObjectBufferATI; +GLEW_FUN_EXPORT PFNGLUPDATEOBJECTBUFFERATIPROC __glewUpdateObjectBufferATI; +GLEW_FUN_EXPORT PFNGLVARIANTARRAYOBJECTATIPROC __glewVariantArrayObjectATI; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC __glewGetVertexAttribArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC __glewGetVertexAttribArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBARRAYOBJECTATIPROC __glewVertexAttribArrayObjectATI; + +GLEW_FUN_EXPORT PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC __glewClientActiveVertexStreamATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BATIPROC __glewNormalStream3bATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BVATIPROC __glewNormalStream3bvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DATIPROC __glewNormalStream3dATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DVATIPROC __glewNormalStream3dvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FATIPROC __glewNormalStream3fATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FVATIPROC __glewNormalStream3fvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IATIPROC __glewNormalStream3iATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IVATIPROC __glewNormalStream3ivATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SATIPROC __glewNormalStream3sATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SVATIPROC __glewNormalStream3svATI; +GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVFATIPROC __glewVertexBlendEnvfATI; +GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVIATIPROC __glewVertexBlendEnviATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1DATIPROC __glewVertexStream1dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1DVATIPROC __glewVertexStream1dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FATIPROC __glewVertexStream1fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FVATIPROC __glewVertexStream1fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IATIPROC __glewVertexStream1iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IVATIPROC __glewVertexStream1ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SATIPROC __glewVertexStream1sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SVATIPROC __glewVertexStream1svATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DATIPROC __glewVertexStream2dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DVATIPROC __glewVertexStream2dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FATIPROC __glewVertexStream2fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FVATIPROC __glewVertexStream2fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IATIPROC __glewVertexStream2iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IVATIPROC __glewVertexStream2ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SATIPROC __glewVertexStream2sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SVATIPROC __glewVertexStream2svATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DATIPROC __glewVertexStream3dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DVATIPROC __glewVertexStream3dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FATIPROC __glewVertexStream3fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FVATIPROC __glewVertexStream3fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IATIPROC __glewVertexStream3iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IVATIPROC __glewVertexStream3ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SATIPROC __glewVertexStream3sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SVATIPROC __glewVertexStream3svATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DATIPROC __glewVertexStream4dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DVATIPROC __glewVertexStream4dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FATIPROC __glewVertexStream4fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FVATIPROC __glewVertexStream4fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IATIPROC __glewVertexStream4iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMBUFFERSIZEEXTPROC __glewGetUniformBufferSizeEXT; +GLEW_FUN_EXPORT PFNGLGETUNIFORMOFFSETEXTPROC __glewGetUniformOffsetEXT; +GLEW_FUN_EXPORT PFNGLUNIFORMBUFFEREXTPROC __glewUniformBufferEXT; + +GLEW_FUN_EXPORT PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT; + +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT; + +GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEEXTPROC __glewColorSubTableEXT; +GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEEXTPROC __glewCopyColorSubTableEXT; + +GLEW_FUN_EXPORT PFNGLLOCKARRAYSEXTPROC __glewLockArraysEXT; +GLEW_FUN_EXPORT PFNGLUNLOCKARRAYSEXTPROC __glewUnlockArraysEXT; + +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DEXTPROC __glewConvolutionFilter1DEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DEXTPROC __glewConvolutionFilter2DEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFEXTPROC __glewConvolutionParameterfEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVEXTPROC __glewConvolutionParameterfvEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIEXTPROC __glewConvolutionParameteriEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVEXTPROC __glewConvolutionParameterivEXT; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC __glewCopyConvolutionFilter1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC __glewCopyConvolutionFilter2DEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTEREXTPROC __glewGetConvolutionFilterEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC __glewGetConvolutionParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC __glewGetConvolutionParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTEREXTPROC __glewGetSeparableFilterEXT; +GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DEXTPROC __glewSeparableFilter2DEXT; + +GLEW_FUN_EXPORT PFNGLBINORMALPOINTEREXTPROC __glewBinormalPointerEXT; +GLEW_FUN_EXPORT PFNGLTANGENTPOINTEREXTPROC __glewTangentPointerEXT; + +GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE1DEXTPROC __glewCopyTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE2DEXTPROC __glewCopyTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE1DEXTPROC __glewCopyTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE2DEXTPROC __glewCopyTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DEXTPROC __glewCopyTexSubImage3DEXT; + +GLEW_FUN_EXPORT PFNGLCULLPARAMETERDVEXTPROC __glewCullParameterdvEXT; +GLEW_FUN_EXPORT PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT; + +GLEW_FUN_EXPORT PFNGLINSERTEVENTMARKEREXTPROC __glewInsertEventMarkerEXT; +GLEW_FUN_EXPORT PFNGLPOPGROUPMARKEREXTPROC __glewPopGroupMarkerEXT; +GLEW_FUN_EXPORT PFNGLPUSHGROUPMARKEREXTPROC __glewPushGroupMarkerEXT; + +GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT; + +GLEW_FUN_EXPORT PFNGLBINDMULTITEXTUREEXTPROC __glewBindMultiTextureEXT; +GLEW_FUN_EXPORT PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC __glewCheckNamedFramebufferStatusEXT; +GLEW_FUN_EXPORT PFNGLCLIENTATTRIBDEFAULTEXTPROC __glewClientAttribDefaultEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC __glewCompressedMultiTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC __glewCompressedMultiTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC __glewCompressedMultiTexImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC __glewCompressedMultiTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC __glewCompressedMultiTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC __glewCompressedMultiTexSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC __glewCompressedTextureImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC __glewCompressedTextureImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC __glewCompressedTextureImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC __glewCompressedTextureSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC __glewCompressedTextureSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC __glewCompressedTextureSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE1DEXTPROC __glewCopyMultiTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE2DEXTPROC __glewCopyMultiTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC __glewCopyMultiTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC __glewCopyMultiTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC __glewCopyMultiTexSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE1DEXTPROC __glewCopyTextureImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE2DEXTPROC __glewCopyTextureImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC __glewCopyTextureSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC __glewCopyTextureSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC __glewCopyTextureSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC __glewDisableClientStateIndexedEXT; +GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEIEXTPROC __glewDisableClientStateiEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC __glewDisableVertexArrayAttribEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYEXTPROC __glewDisableVertexArrayEXT; +GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEINDEXEDEXTPROC __glewEnableClientStateIndexedEXT; +GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEIEXTPROC __glewEnableClientStateiEXT; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYATTRIBEXTPROC __glewEnableVertexArrayAttribEXT; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYEXTPROC __glewEnableVertexArrayEXT; +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC __glewFlushMappedNamedBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC __glewFramebufferDrawBufferEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC __glewFramebufferDrawBuffersEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERREADBUFFEREXTPROC __glewFramebufferReadBufferEXT; +GLEW_FUN_EXPORT PFNGLGENERATEMULTITEXMIPMAPEXTPROC __glewGenerateMultiTexMipmapEXT; +GLEW_FUN_EXPORT PFNGLGENERATETEXTUREMIPMAPEXTPROC __glewGenerateTextureMipmapEXT; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC __glewGetCompressedMultiTexImageEXT; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC __glewGetCompressedTextureImageEXT; +GLEW_FUN_EXPORT PFNGLGETDOUBLEINDEXEDVEXTPROC __glewGetDoubleIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VEXTPROC __glewGetDoublei_vEXT; +GLEW_FUN_EXPORT PFNGLGETFLOATINDEXEDVEXTPROC __glewGetFloatIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETFLOATI_VEXTPROC __glewGetFloati_vEXT; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC __glewGetFramebufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXENVFVEXTPROC __glewGetMultiTexEnvfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXENVIVEXTPROC __glewGetMultiTexEnvivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXGENDVEXTPROC __glewGetMultiTexGendvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXGENFVEXTPROC __glewGetMultiTexGenfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXGENIVEXTPROC __glewGetMultiTexGenivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXIMAGEEXTPROC __glewGetMultiTexImageEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC __glewGetMultiTexLevelParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC __glewGetMultiTexLevelParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIIVEXTPROC __glewGetMultiTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIUIVEXTPROC __glewGetMultiTexParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERFVEXTPROC __glewGetMultiTexParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIVEXTPROC __glewGetMultiTexParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC __glewGetNamedBufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPOINTERVEXTPROC __glewGetNamedBufferPointervEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERSUBDATAEXTPROC __glewGetNamedBufferSubDataEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetNamedFramebufferAttachmentParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC __glewGetNamedProgramLocalParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC __glewGetNamedProgramLocalParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC __glewGetNamedProgramLocalParameterdvEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC __glewGetNamedProgramLocalParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMSTRINGEXTPROC __glewGetNamedProgramStringEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMIVEXTPROC __glewGetNamedProgramivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC __glewGetNamedRenderbufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETPOINTERINDEXEDVEXTPROC __glewGetPointerIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETPOINTERI_VEXTPROC __glewGetPointeri_vEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREIMAGEEXTPROC __glewGetTextureImageEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC __glewGetTextureLevelParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC __glewGetTextureLevelParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIIVEXTPROC __glewGetTextureParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIUIVEXTPROC __glewGetTextureParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERFVEXTPROC __glewGetTextureParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIVEXTPROC __glewGetTextureParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC __glewGetVertexArrayIntegeri_vEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERVEXTPROC __glewGetVertexArrayIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC __glewGetVertexArrayPointeri_vEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERVEXTPROC __glewGetVertexArrayPointervEXT; +GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFEREXTPROC __glewMapNamedBufferEXT; +GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERRANGEEXTPROC __glewMapNamedBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLMATRIXFRUSTUMEXTPROC __glewMatrixFrustumEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADIDENTITYEXTPROC __glewMatrixLoadIdentityEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEDEXTPROC __glewMatrixLoadTransposedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEFEXTPROC __glewMatrixLoadTransposefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADDEXTPROC __glewMatrixLoaddEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADFEXTPROC __glewMatrixLoadfEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEDEXTPROC __glewMatrixMultTransposedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEFEXTPROC __glewMatrixMultTransposefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTDEXTPROC __glewMatrixMultdEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTFEXTPROC __glewMatrixMultfEXT; +GLEW_FUN_EXPORT PFNGLMATRIXORTHOEXTPROC __glewMatrixOrthoEXT; +GLEW_FUN_EXPORT PFNGLMATRIXPOPEXTPROC __glewMatrixPopEXT; +GLEW_FUN_EXPORT PFNGLMATRIXPUSHEXTPROC __glewMatrixPushEXT; +GLEW_FUN_EXPORT PFNGLMATRIXROTATEDEXTPROC __glewMatrixRotatedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXROTATEFEXTPROC __glewMatrixRotatefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXSCALEDEXTPROC __glewMatrixScaledEXT; +GLEW_FUN_EXPORT PFNGLMATRIXSCALEFEXTPROC __glewMatrixScalefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEDEXTPROC __glewMatrixTranslatedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEFEXTPROC __glewMatrixTranslatefEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXBUFFEREXTPROC __glewMultiTexBufferEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDPOINTEREXTPROC __glewMultiTexCoordPointerEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVFEXTPROC __glewMultiTexEnvfEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVFVEXTPROC __glewMultiTexEnvfvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVIEXTPROC __glewMultiTexEnviEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVIVEXTPROC __glewMultiTexEnvivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENDEXTPROC __glewMultiTexGendEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENDVEXTPROC __glewMultiTexGendvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENFEXTPROC __glewMultiTexGenfEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENFVEXTPROC __glewMultiTexGenfvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENIEXTPROC __glewMultiTexGeniEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENIVEXTPROC __glewMultiTexGenivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE1DEXTPROC __glewMultiTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE2DEXTPROC __glewMultiTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE3DEXTPROC __glewMultiTexImage3DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIIVEXTPROC __glewMultiTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIUIVEXTPROC __glewMultiTexParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFEXTPROC __glewMultiTexParameterfEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFVEXTPROC __glewMultiTexParameterfvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIEXTPROC __glewMultiTexParameteriEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIVEXTPROC __glewMultiTexParameterivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXRENDERBUFFEREXTPROC __glewMultiTexRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE1DEXTPROC __glewMultiTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE2DEXTPROC __glewMultiTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE3DEXTPROC __glewMultiTexSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERDATAEXTPROC __glewNamedBufferDataEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSUBDATAEXTPROC __glewNamedBufferSubDataEXT; +GLEW_FUN_EXPORT PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC __glewNamedCopyBufferSubDataEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC __glewNamedFramebufferRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC __glewNamedFramebufferTexture1DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC __glewNamedFramebufferTexture2DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC __glewNamedFramebufferTexture3DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC __glewNamedFramebufferTextureEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC __glewNamedFramebufferTextureFaceEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC __glewNamedFramebufferTextureLayerEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC __glewNamedProgramLocalParameter4dEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC __glewNamedProgramLocalParameter4dvEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC __glewNamedProgramLocalParameter4fEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC __glewNamedProgramLocalParameter4fvEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC __glewNamedProgramLocalParameterI4iEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC __glewNamedProgramLocalParameterI4ivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC __glewNamedProgramLocalParameterI4uiEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC __glewNamedProgramLocalParameterI4uivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC __glewNamedProgramLocalParameters4fvEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC __glewNamedProgramLocalParametersI4ivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC __glewNamedProgramLocalParametersI4uivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMSTRINGEXTPROC __glewNamedProgramStringEXT; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC __glewNamedRenderbufferStorageEXT; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC __glewNamedRenderbufferStorageMultisampleCoverageEXT; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewNamedRenderbufferStorageMultisampleEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FEXTPROC __glewProgramUniform1fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVEXTPROC __glewProgramUniform1fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IEXTPROC __glewProgramUniform1iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVEXTPROC __glewProgramUniform1ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIEXTPROC __glewProgramUniform1uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVEXTPROC __glewProgramUniform1uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FEXTPROC __glewProgramUniform2fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVEXTPROC __glewProgramUniform2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IEXTPROC __glewProgramUniform2iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVEXTPROC __glewProgramUniform2ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIEXTPROC __glewProgramUniform2uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVEXTPROC __glewProgramUniform2uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FEXTPROC __glewProgramUniform3fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVEXTPROC __glewProgramUniform3fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IEXTPROC __glewProgramUniform3iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVEXTPROC __glewProgramUniform3ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIEXTPROC __glewProgramUniform3uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVEXTPROC __glewProgramUniform3uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FEXTPROC __glewProgramUniform4fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVEXTPROC __glewProgramUniform4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IEXTPROC __glewProgramUniform4iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVEXTPROC __glewProgramUniform4ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIEXTPROC __glewProgramUniform4uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVEXTPROC __glewProgramUniform4uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC __glewProgramUniformMatrix2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC __glewProgramUniformMatrix2x3fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC __glewProgramUniformMatrix2x4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC __glewProgramUniformMatrix3fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC __glewProgramUniformMatrix3x2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC __glewProgramUniformMatrix3x4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC __glewProgramUniformMatrix4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC __glewProgramUniformMatrix4x2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC __glewProgramUniformMatrix4x3fvEXT; +GLEW_FUN_EXPORT PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC __glewPushClientAttribDefaultEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREBUFFEREXTPROC __glewTextureBufferEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE1DEXTPROC __glewTextureImage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DEXTPROC __glewTextureImage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DEXTPROC __glewTextureImage3DEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIIVEXTPROC __glewTextureParameterIivEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIUIVEXTPROC __glewTextureParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFEXTPROC __glewTextureParameterfEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFVEXTPROC __glewTextureParameterfvEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIEXTPROC __glewTextureParameteriEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIVEXTPROC __glewTextureParameterivEXT; +GLEW_FUN_EXPORT PFNGLTEXTURERENDERBUFFEREXTPROC __glewTextureRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE1DEXTPROC __glewTextureSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE2DEXTPROC __glewTextureSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE3DEXTPROC __glewTextureSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLUNMAPNAMEDBUFFEREXTPROC __glewUnmapNamedBufferEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYCOLOROFFSETEXTPROC __glewVertexArrayColorOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC __glewVertexArrayEdgeFlagOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC __glewVertexArrayFogCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYINDEXOFFSETEXTPROC __glewVertexArrayIndexOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC __glewVertexArrayMultiTexCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYNORMALOFFSETEXTPROC __glewVertexArrayNormalOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC __glewVertexArraySecondaryColorOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC __glewVertexArrayTexCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC __glewVertexArrayVertexAttribIOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC __glewVertexArrayVertexAttribOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC __glewVertexArrayVertexOffsetEXT; + +GLEW_FUN_EXPORT PFNGLCOLORMASKINDEXEDEXTPROC __glewColorMaskIndexedEXT; +GLEW_FUN_EXPORT PFNGLDISABLEINDEXEDEXTPROC __glewDisableIndexedEXT; +GLEW_FUN_EXPORT PFNGLENABLEINDEXEDEXTPROC __glewEnableIndexedEXT; +GLEW_FUN_EXPORT PFNGLGETBOOLEANINDEXEDVEXTPROC __glewGetBooleanIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETINTEGERINDEXEDVEXTPROC __glewGetIntegerIndexedvEXT; +GLEW_FUN_EXPORT PFNGLISENABLEDINDEXEDEXTPROC __glewIsEnabledIndexedEXT; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT; + +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT; + +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDDEXTPROC __glewFogCoorddEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDDVEXTPROC __glewFogCoorddvEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDFEXTPROC __glewFogCoordfEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDFVEXTPROC __glewFogCoordfvEXT; + +GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALEXTPROC __glewFragmentColorMaterialEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFEXTPROC __glewFragmentLightModelfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVEXTPROC __glewFragmentLightModelfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIEXTPROC __glewFragmentLightModeliEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVEXTPROC __glewFragmentLightModelivEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFEXTPROC __glewFragmentLightfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVEXTPROC __glewFragmentLightfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIEXTPROC __glewFragmentLightiEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVEXTPROC __glewFragmentLightivEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFEXTPROC __glewFragmentMaterialfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVEXTPROC __glewFragmentMaterialfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIEXTPROC __glewFragmentMaterialiEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVEXTPROC __glewFragmentMaterialivEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVEXTPROC __glewGetFragmentLightfvEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVEXTPROC __glewGetFragmentLightivEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVEXTPROC __glewGetFragmentMaterialfvEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVEXTPROC __glewGetFragmentMaterialivEXT; +GLEW_FUN_EXPORT PFNGLLIGHTENVIEXTPROC __glewLightEnviEXT; + +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFEREXTPROC __glewBlitFramebufferEXT; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewRenderbufferStorageMultisampleEXT; + +GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT; +GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT; +GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT; +GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT; +GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT; +GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT; +GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT; +GLEW_FUN_EXPORT PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT; + +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC __glewProgramLocalParameters4fvEXT; + +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONEXTPROC __glewBindFragDataLocationEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONEXTPROC __glewGetFragDataLocationEXT; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVEXTPROC __glewGetUniformuivEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVEXTPROC __glewGetVertexAttribIivEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVEXTPROC __glewGetVertexAttribIuivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIEXTPROC __glewUniform1uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIVEXTPROC __glewUniform1uivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIEXTPROC __glewUniform2uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIVEXTPROC __glewUniform2uivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIEXTPROC __glewUniform3uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIVEXTPROC __glewUniform3uivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIEXTPROC __glewUniform4uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIVEXTPROC __glewUniform4uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IEXTPROC __glewVertexAttribI1iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVEXTPROC __glewVertexAttribI1ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIEXTPROC __glewVertexAttribI1uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVEXTPROC __glewVertexAttribI1uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IEXTPROC __glewVertexAttribI2iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVEXTPROC __glewVertexAttribI2ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIEXTPROC __glewVertexAttribI2uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVEXTPROC __glewVertexAttribI2uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IEXTPROC __glewVertexAttribI3iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVEXTPROC __glewVertexAttribI3ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIEXTPROC __glewVertexAttribI3uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVEXTPROC __glewVertexAttribI3uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVEXTPROC __glewVertexAttribI4bvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IEXTPROC __glewVertexAttribI4iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVEXTPROC __glewVertexAttribI4ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVEXTPROC __glewVertexAttribI4svEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVEXTPROC __glewVertexAttribI4ubvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIEXTPROC __glewVertexAttribI4uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVEXTPROC __glewVertexAttribI4uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVEXTPROC __glewVertexAttribI4usvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTEREXTPROC __glewVertexAttribIPointerEXT; + +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVEXTPROC __glewGetHistogramParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXEXTPROC __glewGetMinmaxEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVEXTPROC __glewGetMinmaxParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVEXTPROC __glewGetMinmaxParameterivEXT; +GLEW_FUN_EXPORT PFNGLHISTOGRAMEXTPROC __glewHistogramEXT; +GLEW_FUN_EXPORT PFNGLMINMAXEXTPROC __glewMinmaxEXT; +GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMEXTPROC __glewResetHistogramEXT; +GLEW_FUN_EXPORT PFNGLRESETMINMAXEXTPROC __glewResetMinmaxEXT; + +GLEW_FUN_EXPORT PFNGLINDEXFUNCEXTPROC __glewIndexFuncEXT; + +GLEW_FUN_EXPORT PFNGLINDEXMATERIALEXTPROC __glewIndexMaterialEXT; + +GLEW_FUN_EXPORT PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT; +GLEW_FUN_EXPORT PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT; + +GLEW_FUN_EXPORT PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT; +GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT; + +GLEW_FUN_EXPORT PFNGLCOLORTABLEEXTPROC __glewColorTableEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEEXTPROC __glewGetColorTableEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVEXTPROC __glewGetColorTableParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVEXTPROC __glewGetColorTableParameterivEXT; + +GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC __glewGetPixelTransformParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC __glewGetPixelTransformParameterivEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFEXTPROC __glewPixelTransformParameterfEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC __glewPixelTransformParameterfvEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIEXTPROC __glewPixelTransformParameteriEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC __glewPixelTransformParameterivEXT; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFEXTPROC __glewPointParameterfEXT; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT; + +GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETEXTPROC __glewPolygonOffsetEXT; + +GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXEXTPROC __glewProvokingVertexEXT; + +GLEW_FUN_EXPORT PFNGLBEGINSCENEEXTPROC __glewBeginSceneEXT; +GLEW_FUN_EXPORT PFNGLENDSCENEEXTPROC __glewEndSceneEXT; + +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BEXTPROC __glewSecondaryColor3bEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVEXTPROC __glewSecondaryColor3bvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DEXTPROC __glewSecondaryColor3dEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVEXTPROC __glewSecondaryColor3dvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FEXTPROC __glewSecondaryColor3fEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVEXTPROC __glewSecondaryColor3fvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IEXTPROC __glewSecondaryColor3iEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVEXTPROC __glewSecondaryColor3ivEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SEXTPROC __glewSecondaryColor3sEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVEXTPROC __glewSecondaryColor3svEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBEXTPROC __glewSecondaryColor3ubEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVEXTPROC __glewSecondaryColor3ubvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIEXTPROC __glewSecondaryColor3uiEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVEXTPROC __glewSecondaryColor3uivEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT; + +GLEW_FUN_EXPORT PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT; +GLEW_FUN_EXPORT PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT; + +GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREEXTPROC __glewBindImageTextureEXT; +GLEW_FUN_EXPORT PFNGLMEMORYBARRIEREXTPROC __glewMemoryBarrierEXT; + +GLEW_FUN_EXPORT PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT; + +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE1DEXTPROC __glewTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE2DEXTPROC __glewTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT; + +GLEW_FUN_EXPORT PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT; + +GLEW_FUN_EXPORT PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT; +GLEW_FUN_EXPORT PFNGLCLEARCOLORIUIEXTPROC __glewClearColorIuiEXT; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVEXTPROC __glewGetTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVEXTPROC __glewGetTexParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVEXTPROC __glewTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVEXTPROC __glewTexParameterIuivEXT; + +GLEW_FUN_EXPORT PFNGLARETEXTURESRESIDENTEXTPROC __glewAreTexturesResidentEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXTUREEXTPROC __glewBindTextureEXT; +GLEW_FUN_EXPORT PFNGLDELETETEXTURESEXTPROC __glewDeleteTexturesEXT; +GLEW_FUN_EXPORT PFNGLGENTEXTURESEXTPROC __glewGenTexturesEXT; +GLEW_FUN_EXPORT PFNGLISTEXTUREEXTPROC __glewIsTextureEXT; +GLEW_FUN_EXPORT PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT; + +GLEW_FUN_EXPORT PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT; + +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VEXTPROC __glewGetQueryObjecti64vEXT; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VEXTPROC __glewGetQueryObjectui64vEXT; + +GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKEXTPROC __glewBeginTransformFeedbackEXT; +GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEEXTPROC __glewBindBufferBaseEXT; +GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETEXTPROC __glewBindBufferOffsetEXT; +GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEEXTPROC __glewBindBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKEXTPROC __glewEndTransformFeedbackEXT; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC __glewGetTransformFeedbackVaryingEXT; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC __glewTransformFeedbackVaryingsEXT; + +GLEW_FUN_EXPORT PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT; +GLEW_FUN_EXPORT PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT; +GLEW_FUN_EXPORT PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT; +GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTEREXTPROC __glewEdgeFlagPointerEXT; +GLEW_FUN_EXPORT PFNGLINDEXPOINTEREXTPROC __glewIndexPointerEXT; +GLEW_FUN_EXPORT PFNGLNORMALPOINTEREXTPROC __glewNormalPointerEXT; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTEREXTPROC __glewTexCoordPointerEXT; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTEREXTPROC __glewVertexPointerEXT; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVEXTPROC __glewGetVertexAttribLdvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC __glewVertexArrayVertexAttribLOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DEXTPROC __glewVertexAttribL1dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVEXTPROC __glewVertexAttribL1dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DEXTPROC __glewVertexAttribL2dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVEXTPROC __glewVertexAttribL2dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DEXTPROC __glewVertexAttribL3dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVEXTPROC __glewVertexAttribL3dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DEXTPROC __glewVertexAttribL4dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVEXTPROC __glewVertexAttribL4dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTEREXTPROC __glewVertexAttribLPointerEXT; + +GLEW_FUN_EXPORT PFNGLBEGINVERTEXSHADEREXTPROC __glewBeginVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLBINDLIGHTPARAMETEREXTPROC __glewBindLightParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDMATERIALPARAMETEREXTPROC __glewBindMaterialParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDPARAMETEREXTPROC __glewBindParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXGENPARAMETEREXTPROC __glewBindTexGenParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXTUREUNITPARAMETEREXTPROC __glewBindTextureUnitParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDVERTEXSHADEREXTPROC __glewBindVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXSHADEREXTPROC __glewDeleteVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC __glewDisableVariantClientStateEXT; +GLEW_FUN_EXPORT PFNGLENABLEVARIANTCLIENTSTATEEXTPROC __glewEnableVariantClientStateEXT; +GLEW_FUN_EXPORT PFNGLENDVERTEXSHADEREXTPROC __glewEndVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLEXTRACTCOMPONENTEXTPROC __glewExtractComponentEXT; +GLEW_FUN_EXPORT PFNGLGENSYMBOLSEXTPROC __glewGenSymbolsEXT; +GLEW_FUN_EXPORT PFNGLGENVERTEXSHADERSEXTPROC __glewGenVertexShadersEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTBOOLEANVEXTPROC __glewGetInvariantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTFLOATVEXTPROC __glewGetInvariantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTINTEGERVEXTPROC __glewGetInvariantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC __glewGetLocalConstantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTFLOATVEXTPROC __glewGetLocalConstantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTINTEGERVEXTPROC __glewGetLocalConstantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTBOOLEANVEXTPROC __glewGetVariantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTFLOATVEXTPROC __glewGetVariantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTINTEGERVEXTPROC __glewGetVariantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTPOINTERVEXTPROC __glewGetVariantPointervEXT; +GLEW_FUN_EXPORT PFNGLINSERTCOMPONENTEXTPROC __glewInsertComponentEXT; +GLEW_FUN_EXPORT PFNGLISVARIANTENABLEDEXTPROC __glewIsVariantEnabledEXT; +GLEW_FUN_EXPORT PFNGLSETINVARIANTEXTPROC __glewSetInvariantEXT; +GLEW_FUN_EXPORT PFNGLSETLOCALCONSTANTEXTPROC __glewSetLocalConstantEXT; +GLEW_FUN_EXPORT PFNGLSHADEROP1EXTPROC __glewShaderOp1EXT; +GLEW_FUN_EXPORT PFNGLSHADEROP2EXTPROC __glewShaderOp2EXT; +GLEW_FUN_EXPORT PFNGLSHADEROP3EXTPROC __glewShaderOp3EXT; +GLEW_FUN_EXPORT PFNGLSWIZZLEEXTPROC __glewSwizzleEXT; +GLEW_FUN_EXPORT PFNGLVARIANTPOINTEREXTPROC __glewVariantPointerEXT; +GLEW_FUN_EXPORT PFNGLVARIANTBVEXTPROC __glewVariantbvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTDVEXTPROC __glewVariantdvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTFVEXTPROC __glewVariantfvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTIVEXTPROC __glewVariantivEXT; +GLEW_FUN_EXPORT PFNGLVARIANTSVEXTPROC __glewVariantsvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUBVEXTPROC __glewVariantubvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUIVEXTPROC __glewVariantuivEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUSVEXTPROC __glewVariantusvEXT; +GLEW_FUN_EXPORT PFNGLWRITEMASKEXTPROC __glewWriteMaskEXT; + +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT; + +GLEW_FUN_EXPORT PFNGLIMPORTSYNCEXTPROC __glewImportSyncEXT; + +GLEW_FUN_EXPORT PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY; + +GLEW_FUN_EXPORT PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY; + +GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP; +GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC __glewGetImageTransformParameterivHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFHPPROC __glewImageTransformParameterfHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFVHPPROC __glewImageTransformParameterfvHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIHPPROC __glewImageTransformParameteriHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIVHPPROC __glewImageTransformParameterivHP; + +GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWARRAYSIBMPROC __glewMultiModeDrawArraysIBM; +GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWELEMENTSIBMPROC __glewMultiModeDrawElementsIBM; + +GLEW_FUN_EXPORT PFNGLCOLORPOINTERLISTIBMPROC __glewColorPointerListIBM; +GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTERLISTIBMPROC __glewEdgeFlagPointerListIBM; +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERLISTIBMPROC __glewFogCoordPointerListIBM; +GLEW_FUN_EXPORT PFNGLINDEXPOINTERLISTIBMPROC __glewIndexPointerListIBM; +GLEW_FUN_EXPORT PFNGLNORMALPOINTERLISTIBMPROC __glewNormalPointerListIBM; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERLISTIBMPROC __glewSecondaryColorPointerListIBM; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERLISTIBMPROC __glewTexCoordPointerListIBM; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTERLISTIBMPROC __glewVertexPointerListIBM; + +GLEW_FUN_EXPORT PFNGLMAPTEXTURE2DINTELPROC __glewMapTexture2DINTEL; +GLEW_FUN_EXPORT PFNGLSYNCTEXTUREINTELPROC __glewSyncTextureINTEL; +GLEW_FUN_EXPORT PFNGLUNMAPTEXTURE2DINTELPROC __glewUnmapTexture2DINTEL; + +GLEW_FUN_EXPORT PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL; +GLEW_FUN_EXPORT PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL; + +GLEW_FUN_EXPORT PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL; +GLEW_FUN_EXPORT PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKPROC __glewDebugMessageCallback; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLPROC __glewDebugMessageControl; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTPROC __glewDebugMessageInsert; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGPROC __glewGetDebugMessageLog; +GLEW_FUN_EXPORT PFNGLGETOBJECTLABELPROC __glewGetObjectLabel; +GLEW_FUN_EXPORT PFNGLGETOBJECTPTRLABELPROC __glewGetObjectPtrLabel; +GLEW_FUN_EXPORT PFNGLOBJECTLABELPROC __glewObjectLabel; +GLEW_FUN_EXPORT PFNGLOBJECTPTRLABELPROC __glewObjectPtrLabel; +GLEW_FUN_EXPORT PFNGLPOPDEBUGGROUPPROC __glewPopDebugGroup; +GLEW_FUN_EXPORT PFNGLPUSHDEBUGGROUPPROC __glewPushDebugGroup; + +GLEW_FUN_EXPORT PFNGLBUFFERREGIONENABLEDPROC __glewBufferRegionEnabled; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERREGIONPROC __glewDeleteBufferRegion; +GLEW_FUN_EXPORT PFNGLDRAWBUFFERREGIONPROC __glewDrawBufferRegion; +GLEW_FUN_EXPORT PFNGLNEWBUFFERREGIONPROC __glewNewBufferRegion; +GLEW_FUN_EXPORT PFNGLREADBUFFERREGIONPROC __glewReadBufferRegion; + +GLEW_FUN_EXPORT PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA; + +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DMESAPROC __glewWindowPos2dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVMESAPROC __glewWindowPos2dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FMESAPROC __glewWindowPos2fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVMESAPROC __glewWindowPos2fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IMESAPROC __glewWindowPos2iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVMESAPROC __glewWindowPos2ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SMESAPROC __glewWindowPos2sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVMESAPROC __glewWindowPos2svMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DMESAPROC __glewWindowPos3dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVMESAPROC __glewWindowPos3dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FMESAPROC __glewWindowPos3fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVMESAPROC __glewWindowPos3fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IMESAPROC __glewWindowPos3iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVMESAPROC __glewWindowPos3ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SMESAPROC __glewWindowPos3sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVMESAPROC __glewWindowPos3svMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4DMESAPROC __glewWindowPos4dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4DVMESAPROC __glewWindowPos4dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4FMESAPROC __glewWindowPos4fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4FVMESAPROC __glewWindowPos4fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4IMESAPROC __glewWindowPos4iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA; + +GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVXPROC __glewBeginConditionalRenderNVX; +GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVXPROC __glewEndConditionalRenderNVX; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC __glewMultiDrawArraysIndirectBindlessNV; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC __glewMultiDrawElementsIndirectBindlessNV; + +GLEW_FUN_EXPORT PFNGLGETIMAGEHANDLENVPROC __glewGetImageHandleNV; +GLEW_FUN_EXPORT PFNGLGETTEXTUREHANDLENVPROC __glewGetTextureHandleNV; +GLEW_FUN_EXPORT PFNGLGETTEXTURESAMPLERHANDLENVPROC __glewGetTextureSamplerHandleNV; +GLEW_FUN_EXPORT PFNGLISIMAGEHANDLERESIDENTNVPROC __glewIsImageHandleResidentNV; +GLEW_FUN_EXPORT PFNGLISTEXTUREHANDLERESIDENTNVPROC __glewIsTextureHandleResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC __glewMakeImageHandleNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLERESIDENTNVPROC __glewMakeImageHandleResidentNV; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC __glewMakeTextureHandleNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLERESIDENTNVPROC __glewMakeTextureHandleResidentNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC __glewProgramUniformHandleui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC __glewProgramUniformHandleui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64NVPROC __glewUniformHandleui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64VNVPROC __glewUniformHandleui64vNV; + +GLEW_FUN_EXPORT PFNGLBLENDBARRIERNVPROC __glewBlendBarrierNV; +GLEW_FUN_EXPORT PFNGLBLENDPARAMETERINVPROC __glewBlendParameteriNV; + +GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV; +GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV; + +GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATANVPROC __glewCopyImageSubDataNV; + +GLEW_FUN_EXPORT PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV; +GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV; + +GLEW_FUN_EXPORT PFNGLDRAWTEXTURENVPROC __glewDrawTextureNV; + +GLEW_FUN_EXPORT PFNGLEVALMAPSNVPROC __glewEvalMapsNV; +GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV; +GLEW_FUN_EXPORT PFNGLGETMAPCONTROLPOINTSNVPROC __glewGetMapControlPointsNV; +GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERFVNVPROC __glewGetMapParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERIVNVPROC __glewGetMapParameterivNV; +GLEW_FUN_EXPORT PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV; +GLEW_FUN_EXPORT PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV; +GLEW_FUN_EXPORT PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV; + +GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVNVPROC __glewGetMultisamplefvNV; +GLEW_FUN_EXPORT PFNGLSAMPLEMASKINDEXEDNVPROC __glewSampleMaskIndexedNV; +GLEW_FUN_EXPORT PFNGLTEXRENDERBUFFERNVPROC __glewTexRenderbufferNV; + +GLEW_FUN_EXPORT PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV; +GLEW_FUN_EXPORT PFNGLFINISHFENCENVPROC __glewFinishFenceNV; +GLEW_FUN_EXPORT PFNGLGENFENCESNVPROC __glewGenFencesNV; +GLEW_FUN_EXPORT PFNGLGETFENCEIVNVPROC __glewGetFenceivNV; +GLEW_FUN_EXPORT PFNGLISFENCENVPROC __glewIsFenceNV; +GLEW_FUN_EXPORT PFNGLSETFENCENVPROC __glewSetFenceNV; +GLEW_FUN_EXPORT PFNGLTESTFENCENVPROC __glewTestFenceNV; + +GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV; + +GLEW_FUN_EXPORT PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV; + +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4INVPROC __glewProgramEnvParameterI4iNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4IVNVPROC __glewProgramEnvParameterI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UINVPROC __glewProgramEnvParameterI4uiNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UIVNVPROC __glewProgramEnvParameterI4uivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4IVNVPROC __glewProgramEnvParametersI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC __glewProgramEnvParametersI4uivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4INVPROC __glewProgramLocalParameterI4iNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC __glewProgramLocalParameterI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UINVPROC __glewProgramLocalParameterI4uiNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC __glewProgramLocalParameterI4uivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC __glewProgramLocalParametersI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC __glewProgramLocalParametersI4uivNV; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMI64VNVPROC __glewGetUniformi64vNV; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUI64VNVPROC __glewGetUniformui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64NVPROC __glewProgramUniform1i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64VNVPROC __glewProgramUniform1i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64NVPROC __glewProgramUniform1ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64VNVPROC __glewProgramUniform1ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64NVPROC __glewProgramUniform2i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64VNVPROC __glewProgramUniform2i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64NVPROC __glewProgramUniform2ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64VNVPROC __glewProgramUniform2ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64NVPROC __glewProgramUniform3i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64VNVPROC __glewProgramUniform3i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64NVPROC __glewProgramUniform3ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64VNVPROC __glewProgramUniform3ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64NVPROC __glewProgramUniform4i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64VNVPROC __glewProgramUniform4i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64NVPROC __glewProgramUniform4ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64VNVPROC __glewProgramUniform4ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM1I64NVPROC __glewUniform1i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM1I64VNVPROC __glewUniform1i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM1UI64NVPROC __glewUniform1ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM1UI64VNVPROC __glewUniform1ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM2I64NVPROC __glewUniform2i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM2I64VNVPROC __glewUniform2i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM2UI64NVPROC __glewUniform2ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM2UI64VNVPROC __glewUniform2ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM3I64NVPROC __glewUniform3i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM3I64VNVPROC __glewUniform3i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM3UI64NVPROC __glewUniform3ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM3UI64VNVPROC __glewUniform3ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM4I64NVPROC __glewUniform4i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM4I64VNVPROC __glewUniform4i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM4UI64NVPROC __glewUniform4ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM4UI64VNVPROC __glewUniform4ui64vNV; + +GLEW_FUN_EXPORT PFNGLCOLOR3HNVPROC __glewColor3hNV; +GLEW_FUN_EXPORT PFNGLCOLOR3HVNVPROC __glewColor3hvNV; +GLEW_FUN_EXPORT PFNGLCOLOR4HNVPROC __glewColor4hNV; +GLEW_FUN_EXPORT PFNGLCOLOR4HVNVPROC __glewColor4hvNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDHNVPROC __glewFogCoordhNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDHVNVPROC __glewFogCoordhvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HNVPROC __glewMultiTexCoord1hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HVNVPROC __glewMultiTexCoord1hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HNVPROC __glewMultiTexCoord2hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HVNVPROC __glewMultiTexCoord2hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HNVPROC __glewMultiTexCoord3hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HVNVPROC __glewMultiTexCoord3hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HNVPROC __glewMultiTexCoord4hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HVNVPROC __glewMultiTexCoord4hvNV; +GLEW_FUN_EXPORT PFNGLNORMAL3HNVPROC __glewNormal3hNV; +GLEW_FUN_EXPORT PFNGLNORMAL3HVNVPROC __glewNormal3hvNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HNVPROC __glewSecondaryColor3hNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HVNVPROC __glewSecondaryColor3hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD1HNVPROC __glewTexCoord1hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD1HVNVPROC __glewTexCoord1hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD2HNVPROC __glewTexCoord2hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD2HVNVPROC __glewTexCoord2hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD3HNVPROC __glewTexCoord3hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD3HVNVPROC __glewTexCoord3hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD4HNVPROC __glewTexCoord4hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD4HVNVPROC __glewTexCoord4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX2HNVPROC __glewVertex2hNV; +GLEW_FUN_EXPORT PFNGLVERTEX2HVNVPROC __glewVertex2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX3HNVPROC __glewVertex3hNV; +GLEW_FUN_EXPORT PFNGLVERTEX3HVNVPROC __glewVertex3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX4HNVPROC __glewVertex4hNV; +GLEW_FUN_EXPORT PFNGLVERTEX4HVNVPROC __glewVertex4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HNVPROC __glewVertexAttrib1hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HVNVPROC __glewVertexAttrib1hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HNVPROC __glewVertexAttrib2hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HVNVPROC __glewVertexAttrib2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HNVPROC __glewVertexAttrib3hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HVNVPROC __glewVertexAttrib3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HNVPROC __glewVertexAttrib4hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HVNVPROC __glewVertexAttrib4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1HVNVPROC __glewVertexAttribs1hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2HVNVPROC __glewVertexAttribs2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3HVNVPROC __glewVertexAttribs3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4HVNVPROC __glewVertexAttribs4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHNVPROC __glewVertexWeighthNV; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHVNVPROC __glewVertexWeighthvNV; + +GLEW_FUN_EXPORT PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV; +GLEW_FUN_EXPORT PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV; +GLEW_FUN_EXPORT PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV; +GLEW_FUN_EXPORT PFNGLGENOCCLUSIONQUERIESNVPROC __glewGenOcclusionQueriesNV; +GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV; +GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV; +GLEW_FUN_EXPORT PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV; + +GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParametersIivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV; + +GLEW_FUN_EXPORT PFNGLCOPYPATHNVPROC __glewCopyPathNV; +GLEW_FUN_EXPORT PFNGLCOVERFILLPATHINSTANCEDNVPROC __glewCoverFillPathInstancedNV; +GLEW_FUN_EXPORT PFNGLCOVERFILLPATHNVPROC __glewCoverFillPathNV; +GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHINSTANCEDNVPROC __glewCoverStrokePathInstancedNV; +GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHNVPROC __glewCoverStrokePathNV; +GLEW_FUN_EXPORT PFNGLDELETEPATHSNVPROC __glewDeletePathsNV; +GLEW_FUN_EXPORT PFNGLGENPATHSNVPROC __glewGenPathsNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENFVNVPROC __glewGetPathColorGenfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENIVNVPROC __glewGetPathColorGenivNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOMMANDSNVPROC __glewGetPathCommandsNV; +GLEW_FUN_EXPORT PFNGLGETPATHCOORDSNVPROC __glewGetPathCoordsNV; +GLEW_FUN_EXPORT PFNGLGETPATHDASHARRAYNVPROC __glewGetPathDashArrayNV; +GLEW_FUN_EXPORT PFNGLGETPATHLENGTHNVPROC __glewGetPathLengthNV; +GLEW_FUN_EXPORT PFNGLGETPATHMETRICRANGENVPROC __glewGetPathMetricRangeNV; +GLEW_FUN_EXPORT PFNGLGETPATHMETRICSNVPROC __glewGetPathMetricsNV; +GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERFVNVPROC __glewGetPathParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERIVNVPROC __glewGetPathParameterivNV; +GLEW_FUN_EXPORT PFNGLGETPATHSPACINGNVPROC __glewGetPathSpacingNV; +GLEW_FUN_EXPORT PFNGLGETPATHTEXGENFVNVPROC __glewGetPathTexGenfvNV; +GLEW_FUN_EXPORT PFNGLGETPATHTEXGENIVNVPROC __glewGetPathTexGenivNV; +GLEW_FUN_EXPORT PFNGLINTERPOLATEPATHSNVPROC __glewInterpolatePathsNV; +GLEW_FUN_EXPORT PFNGLISPATHNVPROC __glewIsPathNV; +GLEW_FUN_EXPORT PFNGLISPOINTINFILLPATHNVPROC __glewIsPointInFillPathNV; +GLEW_FUN_EXPORT PFNGLISPOINTINSTROKEPATHNVPROC __glewIsPointInStrokePathNV; +GLEW_FUN_EXPORT PFNGLPATHCOLORGENNVPROC __glewPathColorGenNV; +GLEW_FUN_EXPORT PFNGLPATHCOMMANDSNVPROC __glewPathCommandsNV; +GLEW_FUN_EXPORT PFNGLPATHCOORDSNVPROC __glewPathCoordsNV; +GLEW_FUN_EXPORT PFNGLPATHCOVERDEPTHFUNCNVPROC __glewPathCoverDepthFuncNV; +GLEW_FUN_EXPORT PFNGLPATHDASHARRAYNVPROC __glewPathDashArrayNV; +GLEW_FUN_EXPORT PFNGLPATHFOGGENNVPROC __glewPathFogGenNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHRANGENVPROC __glewPathGlyphRangeNV; +GLEW_FUN_EXPORT PFNGLPATHGLYPHSNVPROC __glewPathGlyphsNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERFNVPROC __glewPathParameterfNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERFVNVPROC __glewPathParameterfvNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERINVPROC __glewPathParameteriNV; +GLEW_FUN_EXPORT PFNGLPATHPARAMETERIVNVPROC __glewPathParameterivNV; +GLEW_FUN_EXPORT PFNGLPATHSTENCILDEPTHOFFSETNVPROC __glewPathStencilDepthOffsetNV; +GLEW_FUN_EXPORT PFNGLPATHSTENCILFUNCNVPROC __glewPathStencilFuncNV; +GLEW_FUN_EXPORT PFNGLPATHSTRINGNVPROC __glewPathStringNV; +GLEW_FUN_EXPORT PFNGLPATHSUBCOMMANDSNVPROC __glewPathSubCommandsNV; +GLEW_FUN_EXPORT PFNGLPATHSUBCOORDSNVPROC __glewPathSubCoordsNV; +GLEW_FUN_EXPORT PFNGLPATHTEXGENNVPROC __glewPathTexGenNV; +GLEW_FUN_EXPORT PFNGLPOINTALONGPATHNVPROC __glewPointAlongPathNV; +GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHINSTANCEDNVPROC __glewStencilFillPathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHNVPROC __glewStencilFillPathNV; +GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC __glewStencilStrokePathInstancedNV; +GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHNVPROC __glewStencilStrokePathNV; +GLEW_FUN_EXPORT PFNGLTRANSFORMPATHNVPROC __glewTransformPathNV; +GLEW_FUN_EXPORT PFNGLWEIGHTPATHSNVPROC __glewWeightPathsNV; + +GLEW_FUN_EXPORT PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV; +GLEW_FUN_EXPORT PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV; + +GLEW_FUN_EXPORT PFNGLGETVIDEOI64VNVPROC __glewGetVideoi64vNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOIVNVPROC __glewGetVideoivNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV; +GLEW_FUN_EXPORT PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV; +GLEW_FUN_EXPORT PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV; + +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV; +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV; + +GLEW_FUN_EXPORT PFNGLCOMBINERINPUTNVPROC __glewCombinerInputNV; +GLEW_FUN_EXPORT PFNGLCOMBINEROUTPUTNVPROC __glewCombinerOutputNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFNVPROC __glewCombinerParameterfNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFVNVPROC __glewCombinerParameterfvNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERINVPROC __glewCombinerParameteriNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERIVNVPROC __glewCombinerParameterivNV; +GLEW_FUN_EXPORT PFNGLFINALCOMBINERINPUTNVPROC __glewFinalCombinerInputNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC __glewGetCombinerInputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC __glewGetCombinerInputParameterivNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC __glewGetCombinerOutputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC __glewGetCombinerOutputParameterivNV; +GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC __glewGetFinalCombinerInputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameterivNV; + +GLEW_FUN_EXPORT PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV; + +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERUI64VNVPROC __glewGetBufferParameterui64vNV; +GLEW_FUN_EXPORT PFNGLGETINTEGERUI64VNVPROC __glewGetIntegerui64vNV; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC __glewGetNamedBufferParameterui64vNV; +GLEW_FUN_EXPORT PFNGLISBUFFERRESIDENTNVPROC __glewIsBufferResidentNV; +GLEW_FUN_EXPORT PFNGLISNAMEDBUFFERRESIDENTNVPROC __glewIsNamedBufferResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEBUFFERNONRESIDENTNVPROC __glewMakeBufferNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEBUFFERRESIDENTNVPROC __glewMakeBufferResidentNV; +GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC __glewMakeNamedBufferNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERRESIDENTNVPROC __glewMakeNamedBufferResidentNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64NVPROC __glewProgramUniformui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64VNVPROC __glewProgramUniformui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORMUI64NVPROC __glewUniformui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORMUI64VNVPROC __glewUniformui64vNV; + +GLEW_FUN_EXPORT PFNGLTEXTUREBARRIERNVPROC __glewTextureBarrierNV; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTexImage2DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTexImage3DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTextureImage2DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC __glewTextureImage2DMultisampleNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTextureImage3DMultisampleCoverageNV; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC __glewTextureImage3DMultisampleNV; + +GLEW_FUN_EXPORT PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV; +GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV; +GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETNVPROC __glewBindBufferOffsetNV; +GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGENVPROC __glewBindBufferRangeNV; +GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKNVPROC __glewEndTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLGETACTIVEVARYINGNVPROC __glewGetActiveVaryingNV; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC __glewGetTransformFeedbackVaryingNV; +GLEW_FUN_EXPORT PFNGLGETVARYINGLOCATIONNVPROC __glewGetVaryingLocationNV; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC __glewTransformFeedbackAttribsNV; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC __glewTransformFeedbackVaryingsNV; + +GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKNVPROC __glewBindTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSNVPROC __glewDeleteTransformFeedbacksNV; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKNVPROC __glewDrawTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSNVPROC __glewGenTransformFeedbacksNV; +GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKNVPROC __glewIsTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKNVPROC __glewPauseTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKNVPROC __glewResumeTransformFeedbackNV; + +GLEW_FUN_EXPORT PFNGLVDPAUFININVPROC __glewVDPAUFiniNV; +GLEW_FUN_EXPORT PFNGLVDPAUGETSURFACEIVNVPROC __glewVDPAUGetSurfaceivNV; +GLEW_FUN_EXPORT PFNGLVDPAUINITNVPROC __glewVDPAUInitNV; +GLEW_FUN_EXPORT PFNGLVDPAUISSURFACENVPROC __glewVDPAUIsSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUMAPSURFACESNVPROC __glewVDPAUMapSurfacesNV; +GLEW_FUN_EXPORT PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC __glewVDPAURegisterOutputSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUREGISTERVIDEOSURFACENVPROC __glewVDPAURegisterVideoSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUSURFACEACCESSNVPROC __glewVDPAUSurfaceAccessNV; +GLEW_FUN_EXPORT PFNGLVDPAUUNMAPSURFACESNVPROC __glewVDPAUUnmapSurfacesNV; +GLEW_FUN_EXPORT PFNGLVDPAUUNREGISTERSURFACENVPROC __glewVDPAUUnregisterSurfaceNV; + +GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLI64VNVPROC __glewGetVertexAttribLi64vNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLUI64VNVPROC __glewGetVertexAttribLui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64NVPROC __glewVertexAttribL1i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64VNVPROC __glewVertexAttribL1i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64NVPROC __glewVertexAttribL1ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64VNVPROC __glewVertexAttribL1ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64NVPROC __glewVertexAttribL2i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64VNVPROC __glewVertexAttribL2i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64NVPROC __glewVertexAttribL2ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64VNVPROC __glewVertexAttribL2ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64NVPROC __glewVertexAttribL3i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64VNVPROC __glewVertexAttribL3i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64NVPROC __glewVertexAttribL3ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64VNVPROC __glewVertexAttribL3ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64NVPROC __glewVertexAttribL4i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64VNVPROC __glewVertexAttribL4i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64NVPROC __glewVertexAttribL4ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64VNVPROC __glewVertexAttribL4ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATNVPROC __glewVertexAttribLFormatNV; + +GLEW_FUN_EXPORT PFNGLBUFFERADDRESSRANGENVPROC __glewBufferAddressRangeNV; +GLEW_FUN_EXPORT PFNGLCOLORFORMATNVPROC __glewColorFormatNV; +GLEW_FUN_EXPORT PFNGLEDGEFLAGFORMATNVPROC __glewEdgeFlagFormatNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDFORMATNVPROC __glewFogCoordFormatNV; +GLEW_FUN_EXPORT PFNGLGETINTEGERUI64I_VNVPROC __glewGetIntegerui64i_vNV; +GLEW_FUN_EXPORT PFNGLINDEXFORMATNVPROC __glewIndexFormatNV; +GLEW_FUN_EXPORT PFNGLNORMALFORMATNVPROC __glewNormalFormatNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORFORMATNVPROC __glewSecondaryColorFormatNV; +GLEW_FUN_EXPORT PFNGLTEXCOORDFORMATNVPROC __glewTexCoordFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATNVPROC __glewVertexAttribFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATNVPROC __glewVertexAttribIFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXFORMATNVPROC __glewVertexFormatNV; + +GLEW_FUN_EXPORT PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV; +GLEW_FUN_EXPORT PFNGLBINDPROGRAMNVPROC __glewBindProgramNV; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV; +GLEW_FUN_EXPORT PFNGLEXECUTEPROGRAMNVPROC __glewExecuteProgramNV; +GLEW_FUN_EXPORT PFNGLGENPROGRAMSNVPROC __glewGenProgramsNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERDVNVPROC __glewGetProgramParameterdvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERFVNVPROC __glewGetProgramParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGNVPROC __glewGetProgramStringNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVNVPROC __glewGetProgramivNV; +GLEW_FUN_EXPORT PFNGLGETTRACKMATRIXIVNVPROC __glewGetTrackMatrixivNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVNVPROC __glewGetVertexAttribPointervNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVNVPROC __glewGetVertexAttribdvNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVNVPROC __glewGetVertexAttribfvNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVNVPROC __glewGetVertexAttribivNV; +GLEW_FUN_EXPORT PFNGLISPROGRAMNVPROC __glewIsProgramNV; +GLEW_FUN_EXPORT PFNGLLOADPROGRAMNVPROC __glewLoadProgramNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DNVPROC __glewProgramParameter4dNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DVNVPROC __glewProgramParameter4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FNVPROC __glewProgramParameter4fNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FVNVPROC __glewProgramParameter4fvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4DVNVPROC __glewProgramParameters4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4FVNVPROC __glewProgramParameters4fvNV; +GLEW_FUN_EXPORT PFNGLREQUESTRESIDENTPROGRAMSNVPROC __glewRequestResidentProgramsNV; +GLEW_FUN_EXPORT PFNGLTRACKMATRIXNVPROC __glewTrackMatrixNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DNVPROC __glewVertexAttrib1dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVNVPROC __glewVertexAttrib1dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FNVPROC __glewVertexAttrib1fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVNVPROC __glewVertexAttrib1fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SNVPROC __glewVertexAttrib1sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVNVPROC __glewVertexAttrib1svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DNVPROC __glewVertexAttrib2dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVNVPROC __glewVertexAttrib2dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FNVPROC __glewVertexAttrib2fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVNVPROC __glewVertexAttrib2fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SNVPROC __glewVertexAttrib2sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVNVPROC __glewVertexAttrib2svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DNVPROC __glewVertexAttrib3dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVNVPROC __glewVertexAttrib3dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FNVPROC __glewVertexAttrib3fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVNVPROC __glewVertexAttrib3fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SNVPROC __glewVertexAttrib3sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVNVPROC __glewVertexAttrib3svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DNVPROC __glewVertexAttrib4dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVNVPROC __glewVertexAttrib4dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FNVPROC __glewVertexAttrib4fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVNVPROC __glewVertexAttrib4fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SNVPROC __glewVertexAttrib4sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVNVPROC __glewVertexAttrib4svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBNVPROC __glewVertexAttrib4ubNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVNVPROC __glewVertexAttrib4ubvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERNVPROC __glewVertexAttribPointerNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1DVNVPROC __glewVertexAttribs1dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1FVNVPROC __glewVertexAttribs1fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1SVNVPROC __glewVertexAttribs1svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2DVNVPROC __glewVertexAttribs2dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2FVNVPROC __glewVertexAttribs2fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2SVNVPROC __glewVertexAttribs2svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3DVNVPROC __glewVertexAttribs3dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3FVNVPROC __glewVertexAttribs3fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3SVNVPROC __glewVertexAttribs3svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4DVNVPROC __glewVertexAttribs4dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV; + +GLEW_FUN_EXPORT PFNGLBEGINVIDEOCAPTURENVPROC __glewBeginVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC __glewBindVideoCaptureStreamBufferNV; +GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC __glewBindVideoCaptureStreamTextureNV; +GLEW_FUN_EXPORT PFNGLENDVIDEOCAPTURENVPROC __glewEndVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMDVNVPROC __glewGetVideoCaptureStreamdvNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMFVNVPROC __glewGetVideoCaptureStreamfvNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMIVNVPROC __glewGetVideoCaptureStreamivNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTUREIVNVPROC __glewGetVideoCaptureivNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURENVPROC __glewVideoCaptureNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC __glewVideoCaptureStreamParameterdvNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC __glewVideoCaptureStreamParameterfvNV; +GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC __glewVideoCaptureStreamParameterivNV; + +GLEW_FUN_EXPORT PFNGLCLEARDEPTHFOESPROC __glewClearDepthfOES; +GLEW_FUN_EXPORT PFNGLCLIPPLANEFOESPROC __glewClipPlanefOES; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEFOESPROC __glewDepthRangefOES; +GLEW_FUN_EXPORT PFNGLFRUSTUMFOESPROC __glewFrustumfOES; +GLEW_FUN_EXPORT PFNGLGETCLIPPLANEFOESPROC __glewGetClipPlanefOES; +GLEW_FUN_EXPORT PFNGLORTHOFOESPROC __glewOrthofOES; + +GLEW_FUN_EXPORT PFNGLALPHAFUNCXPROC __glewAlphaFuncx; +GLEW_FUN_EXPORT PFNGLCLEARCOLORXPROC __glewClearColorx; +GLEW_FUN_EXPORT PFNGLCLEARDEPTHXPROC __glewClearDepthx; +GLEW_FUN_EXPORT PFNGLCOLOR4XPROC __glewColor4x; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEXPROC __glewDepthRangex; +GLEW_FUN_EXPORT PFNGLFOGXPROC __glewFogx; +GLEW_FUN_EXPORT PFNGLFOGXVPROC __glewFogxv; +GLEW_FUN_EXPORT PFNGLFRUSTUMFPROC __glewFrustumf; +GLEW_FUN_EXPORT PFNGLFRUSTUMXPROC __glewFrustumx; +GLEW_FUN_EXPORT PFNGLLIGHTMODELXPROC __glewLightModelx; +GLEW_FUN_EXPORT PFNGLLIGHTMODELXVPROC __glewLightModelxv; +GLEW_FUN_EXPORT PFNGLLIGHTXPROC __glewLightx; +GLEW_FUN_EXPORT PFNGLLIGHTXVPROC __glewLightxv; +GLEW_FUN_EXPORT PFNGLLINEWIDTHXPROC __glewLineWidthx; +GLEW_FUN_EXPORT PFNGLLOADMATRIXXPROC __glewLoadMatrixx; +GLEW_FUN_EXPORT PFNGLMATERIALXPROC __glewMaterialx; +GLEW_FUN_EXPORT PFNGLMATERIALXVPROC __glewMaterialxv; +GLEW_FUN_EXPORT PFNGLMULTMATRIXXPROC __glewMultMatrixx; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4XPROC __glewMultiTexCoord4x; +GLEW_FUN_EXPORT PFNGLNORMAL3XPROC __glewNormal3x; +GLEW_FUN_EXPORT PFNGLORTHOFPROC __glewOrthof; +GLEW_FUN_EXPORT PFNGLORTHOXPROC __glewOrthox; +GLEW_FUN_EXPORT PFNGLPOINTSIZEXPROC __glewPointSizex; +GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETXPROC __glewPolygonOffsetx; +GLEW_FUN_EXPORT PFNGLROTATEXPROC __glewRotatex; +GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEXPROC __glewSampleCoveragex; +GLEW_FUN_EXPORT PFNGLSCALEXPROC __glewScalex; +GLEW_FUN_EXPORT PFNGLTEXENVXPROC __glewTexEnvx; +GLEW_FUN_EXPORT PFNGLTEXENVXVPROC __glewTexEnvxv; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERXPROC __glewTexParameterx; +GLEW_FUN_EXPORT PFNGLTRANSLATEXPROC __glewTranslatex; + +GLEW_FUN_EXPORT PFNGLCLIPPLANEFPROC __glewClipPlanef; +GLEW_FUN_EXPORT PFNGLCLIPPLANEXPROC __glewClipPlanex; +GLEW_FUN_EXPORT PFNGLGETCLIPPLANEFPROC __glewGetClipPlanef; +GLEW_FUN_EXPORT PFNGLGETCLIPPLANEXPROC __glewGetClipPlanex; +GLEW_FUN_EXPORT PFNGLGETFIXEDVPROC __glewGetFixedv; +GLEW_FUN_EXPORT PFNGLGETLIGHTXVPROC __glewGetLightxv; +GLEW_FUN_EXPORT PFNGLGETMATERIALXVPROC __glewGetMaterialxv; +GLEW_FUN_EXPORT PFNGLGETTEXENVXVPROC __glewGetTexEnvxv; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERXVPROC __glewGetTexParameterxv; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERXPROC __glewPointParameterx; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERXVPROC __glewPointParameterxv; +GLEW_FUN_EXPORT PFNGLPOINTSIZEPOINTEROESPROC __glewPointSizePointerOES; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERXVPROC __glewTexParameterxv; + +GLEW_FUN_EXPORT PFNGLERRORSTRINGREGALPROC __glewErrorStringREGAL; + +GLEW_FUN_EXPORT PFNGLGETEXTENSIONREGALPROC __glewGetExtensionREGAL; +GLEW_FUN_EXPORT PFNGLISSUPPORTEDREGALPROC __glewIsSupportedREGAL; + +GLEW_FUN_EXPORT PFNGLLOGMESSAGECALLBACKREGALPROC __glewLogMessageCallbackREGAL; + +GLEW_FUN_EXPORT PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS; +GLEW_FUN_EXPORT PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS; + +GLEW_FUN_EXPORT PFNGLFOGFUNCSGISPROC __glewFogFuncSGIS; +GLEW_FUN_EXPORT PFNGLGETFOGFUNCSGISPROC __glewGetFogFuncSGIS; + +GLEW_FUN_EXPORT PFNGLSAMPLEMASKSGISPROC __glewSampleMaskSGIS; +GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNSGISPROC __glewSamplePatternSGIS; + +GLEW_FUN_EXPORT PFNGLGETSHARPENTEXFUNCSGISPROC __glewGetSharpenTexFuncSGIS; +GLEW_FUN_EXPORT PFNGLSHARPENTEXFUNCSGISPROC __glewSharpenTexFuncSGIS; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE4DSGISPROC __glewTexImage4DSGIS; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE4DSGISPROC __glewTexSubImage4DSGIS; + +GLEW_FUN_EXPORT PFNGLGETTEXFILTERFUNCSGISPROC __glewGetTexFilterFuncSGIS; +GLEW_FUN_EXPORT PFNGLTEXFILTERFUNCSGISPROC __glewTexFilterFuncSGIS; + +GLEW_FUN_EXPORT PFNGLASYNCMARKERSGIXPROC __glewAsyncMarkerSGIX; +GLEW_FUN_EXPORT PFNGLDELETEASYNCMARKERSSGIXPROC __glewDeleteAsyncMarkersSGIX; +GLEW_FUN_EXPORT PFNGLFINISHASYNCSGIXPROC __glewFinishAsyncSGIX; +GLEW_FUN_EXPORT PFNGLGENASYNCMARKERSSGIXPROC __glewGenAsyncMarkersSGIX; +GLEW_FUN_EXPORT PFNGLISASYNCMARKERSGIXPROC __glewIsAsyncMarkerSGIX; +GLEW_FUN_EXPORT PFNGLPOLLASYNCSGIXPROC __glewPollAsyncSGIX; + +GLEW_FUN_EXPORT PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX; + +GLEW_FUN_EXPORT PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX; + +GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFSGIXPROC __glewFragmentLightModelfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVSGIXPROC __glewFragmentLightModelfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELISGIXPROC __glewFragmentLightModeliSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVSGIXPROC __glewFragmentLightModelivSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFSGIXPROC __glewFragmentLightfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVSGIXPROC __glewFragmentLightfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTISGIXPROC __glewFragmentLightiSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVSGIXPROC __glewFragmentLightivSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFSGIXPROC __glewFragmentMaterialfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVSGIXPROC __glewFragmentMaterialfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALISGIXPROC __glewFragmentMaterialiSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVSGIXPROC __glewFragmentMaterialivSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVSGIXPROC __glewGetFragmentLightfvSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVSGIXPROC __glewGetFragmentLightivSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVSGIXPROC __glewGetFragmentMaterialfvSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX; + +GLEW_FUN_EXPORT PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX; + +GLEW_FUN_EXPORT PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX; + +GLEW_FUN_EXPORT PFNGLREFERENCEPLANESGIXPROC __glewReferencePlaneSGIX; + +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFSGIXPROC __glewSpriteParameterfSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFVSGIXPROC __glewSpriteParameterfvSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERISGIXPROC __glewSpriteParameteriSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERIVSGIXPROC __glewSpriteParameterivSGIX; + +GLEW_FUN_EXPORT PFNGLTAGSAMPLEBUFFERSGIXPROC __glewTagSampleBufferSGIX; + +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVSGIPROC __glewColorTableParameterfvSGI; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVSGIPROC __glewColorTableParameterivSGI; +GLEW_FUN_EXPORT PFNGLCOLORTABLESGIPROC __glewColorTableSGI; +GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLESGIPROC __glewCopyColorTableSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVSGIPROC __glewGetColorTableParameterfvSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVSGIPROC __glewGetColorTableParameterivSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLESGIPROC __glewGetColorTableSGI; + +GLEW_FUN_EXPORT PFNGLFINISHTEXTURESUNXPROC __glewFinishTextureSUNX; + +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORBSUNPROC __glewGlobalAlphaFactorbSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORDSUNPROC __glewGlobalAlphaFactordSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORFSUNPROC __glewGlobalAlphaFactorfSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORISUNPROC __glewGlobalAlphaFactoriSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORSSUNPROC __glewGlobalAlphaFactorsSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUBSUNPROC __glewGlobalAlphaFactorubSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUISUNPROC __glewGlobalAlphaFactoruiSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUSSUNPROC __glewGlobalAlphaFactorusSUN; + +GLEW_FUN_EXPORT PFNGLREADVIDEOPIXELSSUNPROC __glewReadVideoPixelsSUN; + +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEPOINTERSUNPROC __glewReplacementCodePointerSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBSUNPROC __glewReplacementCodeubSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBVSUNPROC __glewReplacementCodeubvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUISUNPROC __glewReplacementCodeuiSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVSUNPROC __glewReplacementCodeuivSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSSUNPROC __glewReplacementCodeusSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSVSUNPROC __glewReplacementCodeusvSUN; + +GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FSUNPROC __glewColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FVSUNPROC __glewColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FSUNPROC __glewColor4ubVertex2fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FVSUNPROC __glewColor4ubVertex2fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FSUNPROC __glewColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FVSUNPROC __glewColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FSUNPROC __glewNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FVSUNPROC __glewNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC __glewReplacementCodeuiColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC __glewReplacementCodeuiColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC __glewReplacementCodeuiColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC __glewReplacementCodeuiVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC __glewReplacementCodeuiVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC __glewTexCoord2fColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC __glewTexCoord2fColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC __glewTexCoord2fColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC __glewTexCoord2fColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FSUNPROC __glewTexCoord2fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FVSUNPROC __glewTexCoord2fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FSUNPROC __glewTexCoord4fVertex4fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FVSUNPROC __glewTexCoord4fVertex4fvSUN; + +GLEW_FUN_EXPORT PFNGLADDSWAPHINTRECTWINPROC __glewAddSwapHintRectWIN; + +#if defined(GLEW_MX) && !defined(_WIN32) +struct GLEWContextStruct +{ +#endif /* GLEW_MX */ + +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_3; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_4; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_5; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_0; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_0; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_3; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_0; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_3; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_4; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_tbuffer; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_texture_compression_FXT1; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_blend_minmax_factor; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_conservative_depth; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_debug_output; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_depth_clamp_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_draw_buffers_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_interleaved_elements; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_name_gen_delete; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_performance_monitor; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_pinned_memory; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_query_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sample_positions; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_seamless_cubemap_per_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_stencil_export; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_trinary_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sparse_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_stencil_operation_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_texture_texture4; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_transform_feedback3_lines_triangles; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_layer; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_tessellator; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_viewport_index; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_framebuffer_blit; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_framebuffer_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_instanced_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_pack_reverse_row_order; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_program_binary; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt1; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt3; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt5; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_usage; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_timer_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_translated_shader_source; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_aux_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_client_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_element_array; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_fence; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_float_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_flush_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_object_purgeable; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_pixel_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_rgb_422; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_row_bytes; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_specular_vector; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_transform_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_program_evaluators; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_ycbcr_422; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES2_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES3_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_arrays_of_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_base_instance; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_bindless_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_blend_func_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_buffer_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_cl_event; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clear_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clear_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_color_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compressed_texture_pixel_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compute_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compute_variable_group_size; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_conservative_depth; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_image; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_debug_output; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_elements_base_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_enhanced_layouts; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_attrib_location; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_uniform_location; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_coord_conventions; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_layer_viewport; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_no_attachments; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_get_program_binary; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader5; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader_fp64; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_pixel; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_imaging; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_indirect_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_instanced_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_invalidate_subdata; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_alignment; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_matrix_palette; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multi_bind; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multitexture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_pixel_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_program_interface_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_provoking_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_query_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robust_buffer_access_behavior; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_application_isolation; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_share_group_isolation; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sample_shading; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sampler_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cubemap_per_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_separate_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_atomic_counters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_bit_encoding; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_draw_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_group_vote; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_load_store; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_size; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_precision; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_stencil_export; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_storage_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_subroutine; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_100; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_420pack; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_include; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_packing; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow_ambient; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_stencil_texturing; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sync; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_tessellation_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_border_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object_rgb32; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_bptc; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_rgtc; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_add; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_combine; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_crossbar; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_dot3; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_gather; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirror_clamp_to_edge; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirrored_repeat; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_non_power_of_two; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_levels; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rg; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rgb10_a2ui; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_stencil8; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_swizzle; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_view; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_timer_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback3; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transpose_matrix; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_uniform_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_64bit; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_binding; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_program; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_type_10f_11f_11f_rev; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_type_2_10_10_10_rev; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_viewport_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_window_pos; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_point_sprites; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_combine3; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_route; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_vertex_shader_output_point_size; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_element_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_envmap_bumpmap; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_map_object_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_meminfo; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_pn_triangles; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_separate_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_shader_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_text_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_compression_3dc; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_env_combine3; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_mirror_once; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_attrib_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_streams; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_422_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_Cg_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_abgr; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bindable_uniform; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_equation_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_func_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_logic_op; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_subtract; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_clip_volume_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cmyka; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_color_subtable; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_compiled_vertex_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_convolution; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_coordinate_frame; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_copy_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cull_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_debug_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_depth_bounds_test; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_direct_state_access; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_buffers2; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_range_elements; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fog_coord; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fragment_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_blit; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample_blit_scaled; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_program_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_histogram; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_array_formats; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_func; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_material; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_light_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_misc_attribute; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multi_draw_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_float; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_paletted_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_point_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_polygon_offset; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_provoking_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_rescale_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_scene_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_secondary_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_specular_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_image_load_store; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shadow_funcs; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shared_texture_palette; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_clear_tag; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_two_side; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_wrap; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_subtexture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture3D; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_dxt1; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_latc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_rgtc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_s3tc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_edge_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_add; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_combine; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_dot3; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_filter_anisotropic; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_integer; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_lod_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_mirror_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_perturb_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB_decode; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_shared_exponent; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_snorm; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_swizzle; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_timer_query; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_transform_feedback; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_attrib_64bit; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_weighting; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_x11_sync_object; +GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_frame_terminator; +GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_string_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_convolution_border_modes; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_image_transform; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_occlusion_test; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_texture_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_cull_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_multimode_draw_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_rasterpos_clip; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_static_data; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_texture_mirrored_repeat; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_vertex_array_lists; +GLEW_VAR_EXPORT GLboolean __GLEW_INGR_color_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_INGR_interlace_read; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_map_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_parallel_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_texture_scissor; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_debug; +GLEW_VAR_EXPORT GLboolean __GLEW_KHR_texture_compression_astc_ldr; +GLEW_VAR_EXPORT GLboolean __GLEW_KTX_buffer_region; +GLEW_VAR_EXPORT GLboolean __GLEW_MESAX_texture_stack; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_pack_invert; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_resize_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_window_pos; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_ycbcr_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NVX_conditional_render; +GLEW_VAR_EXPORT GLboolean __GLEW_NVX_gpu_memory_info; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_multi_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_equation_advanced; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_equation_advanced_coherent; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_square; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_compute_program5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_conditional_render; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_depth_to_color; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_image; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_deep_texture3D; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_range_unclamped; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_draw_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_evaluators; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_explicit_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fence; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_float_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fog_distance; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program_option; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_multisample_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5_mem_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program_fp64; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_shader5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_half_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_light_max_exponent; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_filter_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_occlusion_query; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_packed_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_path_rendering; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_pixel_data_range; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_point_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_present_video; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_primitive_restart; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_counters; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_buffer_load; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_storage_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_tessellation_program5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_emboss; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_reflection; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_barrier; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_vtc; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_env_combine4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_expand_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader3; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vdpau_interop; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_attrib_integer_64bit; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_buffer_unified_memory; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program1_1; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2_option; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program3; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_video_capture; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_byte_coordinates; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_compressed_paletted_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_read_format; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_single_precision; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_interlace; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_resample; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_subsample; +GLEW_VAR_EXPORT GLboolean __GLEW_PGI_misc_hints; +GLEW_VAR_EXPORT GLboolean __GLEW_PGI_vertex_hints; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_ES1_0_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_ES1_1_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_enable; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_error_string; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_extension_query; +GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_log; +GLEW_VAR_EXPORT GLboolean __GLEW_REND_screen_coordinates; +GLEW_VAR_EXPORT GLboolean __GLEW_S3_s3tc; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_color_range; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_detail_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_fog_function; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_generate_mipmap; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_pixel_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_point_line_texgen; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_sharpen_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture4D; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_border_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_edge_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_filter4; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_select; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_histogram; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_pixel; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_blend_alpha_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_clipmap; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_convolution_accuracy; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_flush_raster; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_offset; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fragment_specular_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_framezoom; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_interlace; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ir_instrument1; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_list_priority; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture_bits; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_reference_plane; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_resample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow_ambient; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_tag_sample_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_add_env; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_coordinate_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_lod_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_multi_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_range; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_scale_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ycrcb; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_matrix; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_texture_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_SUNX_constant_data; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_convolution_border_modes; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_global_alpha; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_mesh_array; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_read_video_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_slice_accum; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_triangle_list; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_phong_shading; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_specular_fog; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_swap_hint; + +#ifdef GLEW_MX +}; /* GLEWContextStruct */ +#endif /* GLEW_MX */ + +/* ------------------------------------------------------------------------- */ + +/* error codes */ +#define GLEW_OK 0 +#define GLEW_NO_ERROR 0 +#define GLEW_ERROR_NO_GL_VERSION 1 /* missing GL version */ +#define GLEW_ERROR_GL_VERSION_10_ONLY 2 /* Need at least OpenGL 1.1 */ +#define GLEW_ERROR_GLX_VERSION_11_ONLY 3 /* Need at least GLX 1.2 */ + +/* string codes */ +#define GLEW_VERSION 1 +#define GLEW_VERSION_MAJOR 2 +#define GLEW_VERSION_MINOR 3 +#define GLEW_VERSION_MICRO 4 + +/* API */ +#ifdef GLEW_MX + +typedef struct GLEWContextStruct GLEWContext; +GLEWAPI GLenum GLEWAPIENTRY glewContextInit (GLEWContext *ctx); +GLEWAPI GLboolean GLEWAPIENTRY glewContextIsSupported (const GLEWContext *ctx, const char *name); + +#define glewInit() glewContextInit(glewGetContext()) +#define glewIsSupported(x) glewContextIsSupported(glewGetContext(), x) +#define glewIsExtensionSupported(x) glewIsSupported(x) + +#define GLEW_GET_VAR(x) (*(const GLboolean*)&(glewGetContext()->x)) +#ifdef _WIN32 +# define GLEW_GET_FUN(x) glewGetContext()->x +#else +# define GLEW_GET_FUN(x) x +#endif + +#else /* GLEW_MX */ + +GLEWAPI GLenum GLEWAPIENTRY glewInit (void); +GLEWAPI GLboolean GLEWAPIENTRY glewIsSupported (const char *name); +#define glewIsExtensionSupported(x) glewIsSupported(x) + +#define GLEW_GET_VAR(x) (*(const GLboolean*)&x) +#define GLEW_GET_FUN(x) x + +#endif /* GLEW_MX */ + +GLEWAPI GLboolean glewExperimental; +GLEWAPI GLboolean GLEWAPIENTRY glewGetExtension (const char *name); +GLEWAPI const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error); +GLEWAPI const GLubyte * GLEWAPIENTRY glewGetString (GLenum name); + +#ifdef __cplusplus +} +#endif + +#ifdef GLEW_APIENTRY_DEFINED +#undef GLEW_APIENTRY_DEFINED +#undef APIENTRY +#undef GLAPIENTRY +#define GLAPIENTRY +#endif + +#ifdef GLEW_CALLBACK_DEFINED +#undef GLEW_CALLBACK_DEFINED +#undef CALLBACK +#endif + +#ifdef GLEW_WINGDIAPI_DEFINED +#undef GLEW_WINGDIAPI_DEFINED +#undef WINGDIAPI +#endif + +#undef GLAPI +/* #undef GLEWAPI */ + +#endif /* __glew_h__ */ diff --git a/native/cocos/renderer/gfx-gl/gl/wglew.h b/native/cocos/renderer/gfx-gl/gl/wglew.h new file mode 100644 index 0000000000..8659841d35 --- /dev/null +++ b/native/cocos/renderer/gfx-gl/gl/wglew.h @@ -0,0 +1,1421 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are met: +** +** * Redistributions of source code must retain the above copyright notice, +** this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright notice, +** this list of conditions and the following disclaimer in the documentation +** and/or other materials provided with the distribution. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +** THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* +** Copyright (c) 2007 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#ifndef __wglew_h__ +#define __wglew_h__ +#define __WGLEW_H__ + +#ifdef __wglext_h_ +#error wglext.h included before wglew.h +#endif + +#define __wglext_h_ + +#if !defined(WINAPI) +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN 1 +# endif +#include +# undef WIN32_LEAN_AND_MEAN +#endif + +/* + * GLEW_STATIC needs to be set when using the static version. + * GLEW_BUILD is set when building the DLL version. + */ +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# ifdef GLEW_BUILD +# define GLEWAPI extern __declspec(dllexport) +# else +# define GLEWAPI extern __declspec(dllimport) +# endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* -------------------------- WGL_3DFX_multisample ------------------------- */ + +#ifndef WGL_3DFX_multisample +#define WGL_3DFX_multisample 1 + +#define WGL_SAMPLE_BUFFERS_3DFX 0x2060 +#define WGL_SAMPLES_3DFX 0x2061 + +#define WGLEW_3DFX_multisample WGLEW_GET_VAR(__WGLEW_3DFX_multisample) + +#endif /* WGL_3DFX_multisample */ + +/* ------------------------- WGL_3DL_stereo_control ------------------------ */ + +#ifndef WGL_3DL_stereo_control +#define WGL_3DL_stereo_control 1 + +#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055 +#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056 +#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057 +#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058 + +typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState); + +#define wglSetStereoEmitterState3DL WGLEW_GET_FUN(__wglewSetStereoEmitterState3DL) + +#define WGLEW_3DL_stereo_control WGLEW_GET_VAR(__WGLEW_3DL_stereo_control) + +#endif /* WGL_3DL_stereo_control */ + +/* ------------------------ WGL_AMD_gpu_association ------------------------ */ + +#ifndef WGL_AMD_gpu_association +#define WGL_AMD_gpu_association 1 + +#define WGL_GPU_VENDOR_AMD 0x1F00 +#define WGL_GPU_RENDERER_STRING_AMD 0x1F01 +#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 +#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 +#define WGL_GPU_RAM_AMD 0x21A3 +#define WGL_GPU_CLOCK_AMD 0x21A4 +#define WGL_GPU_NUM_PIPES_AMD 0x21A5 +#define WGL_GPU_NUM_SIMD_AMD 0x21A6 +#define WGL_GPU_NUM_RB_AMD 0x21A7 +#define WGL_GPU_NUM_SPI_AMD 0x21A8 + +typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id); +typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int* attribList); +typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc); +typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc); +typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void); +typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT* ids); +typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, INT property, GLenum dataType, UINT size, void* data); +typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc); + +#define wglBlitContextFramebufferAMD WGLEW_GET_FUN(__wglewBlitContextFramebufferAMD) +#define wglCreateAssociatedContextAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAMD) +#define wglCreateAssociatedContextAttribsAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAttribsAMD) +#define wglDeleteAssociatedContextAMD WGLEW_GET_FUN(__wglewDeleteAssociatedContextAMD) +#define wglGetContextGPUIDAMD WGLEW_GET_FUN(__wglewGetContextGPUIDAMD) +#define wglGetCurrentAssociatedContextAMD WGLEW_GET_FUN(__wglewGetCurrentAssociatedContextAMD) +#define wglGetGPUIDsAMD WGLEW_GET_FUN(__wglewGetGPUIDsAMD) +#define wglGetGPUInfoAMD WGLEW_GET_FUN(__wglewGetGPUInfoAMD) +#define wglMakeAssociatedContextCurrentAMD WGLEW_GET_FUN(__wglewMakeAssociatedContextCurrentAMD) + +#define WGLEW_AMD_gpu_association WGLEW_GET_VAR(__WGLEW_AMD_gpu_association) + +#endif /* WGL_AMD_gpu_association */ + +/* ------------------------- WGL_ARB_buffer_region ------------------------- */ + +#ifndef WGL_ARB_buffer_region +#define WGL_ARB_buffer_region 1 + +#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001 +#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002 +#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004 +#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008 + +typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType); +typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion); +typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc); +typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height); + +#define wglCreateBufferRegionARB WGLEW_GET_FUN(__wglewCreateBufferRegionARB) +#define wglDeleteBufferRegionARB WGLEW_GET_FUN(__wglewDeleteBufferRegionARB) +#define wglRestoreBufferRegionARB WGLEW_GET_FUN(__wglewRestoreBufferRegionARB) +#define wglSaveBufferRegionARB WGLEW_GET_FUN(__wglewSaveBufferRegionARB) + +#define WGLEW_ARB_buffer_region WGLEW_GET_VAR(__WGLEW_ARB_buffer_region) + +#endif /* WGL_ARB_buffer_region */ + +/* ------------------------- WGL_ARB_create_context ------------------------ */ + +#ifndef WGL_ARB_create_context +#define WGL_ARB_create_context 1 + +#define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 +#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 +#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 +#define WGL_CONTEXT_FLAGS_ARB 0x2094 +#define ERROR_INVALID_VERSION_ARB 0x2095 +#define ERROR_INVALID_PROFILE_ARB 0x2096 + +typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int* attribList); + +#define wglCreateContextAttribsARB WGLEW_GET_FUN(__wglewCreateContextAttribsARB) + +#define WGLEW_ARB_create_context WGLEW_GET_VAR(__WGLEW_ARB_create_context) + +#endif /* WGL_ARB_create_context */ + +/* --------------------- WGL_ARB_create_context_profile -------------------- */ + +#ifndef WGL_ARB_create_context_profile +#define WGL_ARB_create_context_profile 1 + +#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 +#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 +#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 + +#define WGLEW_ARB_create_context_profile WGLEW_GET_VAR(__WGLEW_ARB_create_context_profile) + +#endif /* WGL_ARB_create_context_profile */ + +/* ------------------- WGL_ARB_create_context_robustness ------------------- */ + +#ifndef WGL_ARB_create_context_robustness +#define WGL_ARB_create_context_robustness 1 + +#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261 + +#define WGLEW_ARB_create_context_robustness WGLEW_GET_VAR(__WGLEW_ARB_create_context_robustness) + +#endif /* WGL_ARB_create_context_robustness */ + +/* ----------------------- WGL_ARB_extensions_string ----------------------- */ + +#ifndef WGL_ARB_extensions_string +#define WGL_ARB_extensions_string 1 + +typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc); + +#define wglGetExtensionsStringARB WGLEW_GET_FUN(__wglewGetExtensionsStringARB) + +#define WGLEW_ARB_extensions_string WGLEW_GET_VAR(__WGLEW_ARB_extensions_string) + +#endif /* WGL_ARB_extensions_string */ + +/* ------------------------ WGL_ARB_framebuffer_sRGB ----------------------- */ + +#ifndef WGL_ARB_framebuffer_sRGB +#define WGL_ARB_framebuffer_sRGB 1 + +#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9 + +#define WGLEW_ARB_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_ARB_framebuffer_sRGB) + +#endif /* WGL_ARB_framebuffer_sRGB */ + +/* ----------------------- WGL_ARB_make_current_read ----------------------- */ + +#ifndef WGL_ARB_make_current_read +#define WGL_ARB_make_current_read 1 + +#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043 +#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054 + +typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); + +#define wglGetCurrentReadDCARB WGLEW_GET_FUN(__wglewGetCurrentReadDCARB) +#define wglMakeContextCurrentARB WGLEW_GET_FUN(__wglewMakeContextCurrentARB) + +#define WGLEW_ARB_make_current_read WGLEW_GET_VAR(__WGLEW_ARB_make_current_read) + +#endif /* WGL_ARB_make_current_read */ + +/* -------------------------- WGL_ARB_multisample -------------------------- */ + +#ifndef WGL_ARB_multisample +#define WGL_ARB_multisample 1 + +#define WGL_SAMPLE_BUFFERS_ARB 0x2041 +#define WGL_SAMPLES_ARB 0x2042 + +#define WGLEW_ARB_multisample WGLEW_GET_VAR(__WGLEW_ARB_multisample) + +#endif /* WGL_ARB_multisample */ + +/* ---------------------------- WGL_ARB_pbuffer ---------------------------- */ + +#ifndef WGL_ARB_pbuffer +#define WGL_ARB_pbuffer 1 + +#define WGL_DRAW_TO_PBUFFER_ARB 0x202D +#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E +#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F +#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030 +#define WGL_PBUFFER_LARGEST_ARB 0x2033 +#define WGL_PBUFFER_WIDTH_ARB 0x2034 +#define WGL_PBUFFER_HEIGHT_ARB 0x2035 +#define WGL_PBUFFER_LOST_ARB 0x2036 + +DECLARE_HANDLE(HPBUFFERARB); + +typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList); +typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer); +typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer); +typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int* piValue); +typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC); + +#define wglCreatePbufferARB WGLEW_GET_FUN(__wglewCreatePbufferARB) +#define wglDestroyPbufferARB WGLEW_GET_FUN(__wglewDestroyPbufferARB) +#define wglGetPbufferDCARB WGLEW_GET_FUN(__wglewGetPbufferDCARB) +#define wglQueryPbufferARB WGLEW_GET_FUN(__wglewQueryPbufferARB) +#define wglReleasePbufferDCARB WGLEW_GET_FUN(__wglewReleasePbufferDCARB) + +#define WGLEW_ARB_pbuffer WGLEW_GET_VAR(__WGLEW_ARB_pbuffer) + +#endif /* WGL_ARB_pbuffer */ + +/* -------------------------- WGL_ARB_pixel_format ------------------------- */ + +#ifndef WGL_ARB_pixel_format +#define WGL_ARB_pixel_format 1 + +#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 +#define WGL_DRAW_TO_WINDOW_ARB 0x2001 +#define WGL_DRAW_TO_BITMAP_ARB 0x2002 +#define WGL_ACCELERATION_ARB 0x2003 +#define WGL_NEED_PALETTE_ARB 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006 +#define WGL_SWAP_METHOD_ARB 0x2007 +#define WGL_NUMBER_OVERLAYS_ARB 0x2008 +#define WGL_NUMBER_UNDERLAYS_ARB 0x2009 +#define WGL_TRANSPARENT_ARB 0x200A +#define WGL_SHARE_DEPTH_ARB 0x200C +#define WGL_SHARE_STENCIL_ARB 0x200D +#define WGL_SHARE_ACCUM_ARB 0x200E +#define WGL_SUPPORT_GDI_ARB 0x200F +#define WGL_SUPPORT_OPENGL_ARB 0x2010 +#define WGL_DOUBLE_BUFFER_ARB 0x2011 +#define WGL_STEREO_ARB 0x2012 +#define WGL_PIXEL_TYPE_ARB 0x2013 +#define WGL_COLOR_BITS_ARB 0x2014 +#define WGL_RED_BITS_ARB 0x2015 +#define WGL_RED_SHIFT_ARB 0x2016 +#define WGL_GREEN_BITS_ARB 0x2017 +#define WGL_GREEN_SHIFT_ARB 0x2018 +#define WGL_BLUE_BITS_ARB 0x2019 +#define WGL_BLUE_SHIFT_ARB 0x201A +#define WGL_ALPHA_BITS_ARB 0x201B +#define WGL_ALPHA_SHIFT_ARB 0x201C +#define WGL_ACCUM_BITS_ARB 0x201D +#define WGL_ACCUM_RED_BITS_ARB 0x201E +#define WGL_ACCUM_GREEN_BITS_ARB 0x201F +#define WGL_ACCUM_BLUE_BITS_ARB 0x2020 +#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 +#define WGL_DEPTH_BITS_ARB 0x2022 +#define WGL_STENCIL_BITS_ARB 0x2023 +#define WGL_AUX_BUFFERS_ARB 0x2024 +#define WGL_NO_ACCELERATION_ARB 0x2025 +#define WGL_GENERIC_ACCELERATION_ARB 0x2026 +#define WGL_FULL_ACCELERATION_ARB 0x2027 +#define WGL_SWAP_EXCHANGE_ARB 0x2028 +#define WGL_SWAP_COPY_ARB 0x2029 +#define WGL_SWAP_UNDEFINED_ARB 0x202A +#define WGL_TYPE_RGBA_ARB 0x202B +#define WGL_TYPE_COLORINDEX_ARB 0x202C +#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037 +#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038 +#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039 +#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A +#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B + +typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, FLOAT *pfValues); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, int *piValues); + +#define wglChoosePixelFormatARB WGLEW_GET_FUN(__wglewChoosePixelFormatARB) +#define wglGetPixelFormatAttribfvARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvARB) +#define wglGetPixelFormatAttribivARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribivARB) + +#define WGLEW_ARB_pixel_format WGLEW_GET_VAR(__WGLEW_ARB_pixel_format) + +#endif /* WGL_ARB_pixel_format */ + +/* ----------------------- WGL_ARB_pixel_format_float ---------------------- */ + +#ifndef WGL_ARB_pixel_format_float +#define WGL_ARB_pixel_format_float 1 + +#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0 + +#define WGLEW_ARB_pixel_format_float WGLEW_GET_VAR(__WGLEW_ARB_pixel_format_float) + +#endif /* WGL_ARB_pixel_format_float */ + +/* ------------------------- WGL_ARB_render_texture ------------------------ */ + +#ifndef WGL_ARB_render_texture +#define WGL_ARB_render_texture 1 + +#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070 +#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071 +#define WGL_TEXTURE_FORMAT_ARB 0x2072 +#define WGL_TEXTURE_TARGET_ARB 0x2073 +#define WGL_MIPMAP_TEXTURE_ARB 0x2074 +#define WGL_TEXTURE_RGB_ARB 0x2075 +#define WGL_TEXTURE_RGBA_ARB 0x2076 +#define WGL_NO_TEXTURE_ARB 0x2077 +#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078 +#define WGL_TEXTURE_1D_ARB 0x2079 +#define WGL_TEXTURE_2D_ARB 0x207A +#define WGL_MIPMAP_LEVEL_ARB 0x207B +#define WGL_CUBE_MAP_FACE_ARB 0x207C +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080 +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081 +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082 +#define WGL_FRONT_LEFT_ARB 0x2083 +#define WGL_FRONT_RIGHT_ARB 0x2084 +#define WGL_BACK_LEFT_ARB 0x2085 +#define WGL_BACK_RIGHT_ARB 0x2086 +#define WGL_AUX0_ARB 0x2087 +#define WGL_AUX1_ARB 0x2088 +#define WGL_AUX2_ARB 0x2089 +#define WGL_AUX3_ARB 0x208A +#define WGL_AUX4_ARB 0x208B +#define WGL_AUX5_ARB 0x208C +#define WGL_AUX6_ARB 0x208D +#define WGL_AUX7_ARB 0x208E +#define WGL_AUX8_ARB 0x208F +#define WGL_AUX9_ARB 0x2090 + +typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); +typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); +typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int* piAttribList); + +#define wglBindTexImageARB WGLEW_GET_FUN(__wglewBindTexImageARB) +#define wglReleaseTexImageARB WGLEW_GET_FUN(__wglewReleaseTexImageARB) +#define wglSetPbufferAttribARB WGLEW_GET_FUN(__wglewSetPbufferAttribARB) + +#define WGLEW_ARB_render_texture WGLEW_GET_VAR(__WGLEW_ARB_render_texture) + +#endif /* WGL_ARB_render_texture */ + +/* ---------------- WGL_ARB_robustness_application_isolation --------------- */ + +#ifndef WGL_ARB_robustness_application_isolation +#define WGL_ARB_robustness_application_isolation 1 + +#define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define WGLEW_ARB_robustness_application_isolation WGLEW_GET_VAR(__WGLEW_ARB_robustness_application_isolation) + +#endif /* WGL_ARB_robustness_application_isolation */ + +/* ---------------- WGL_ARB_robustness_share_group_isolation --------------- */ + +#ifndef WGL_ARB_robustness_share_group_isolation +#define WGL_ARB_robustness_share_group_isolation 1 + +#define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 + +#define WGLEW_ARB_robustness_share_group_isolation WGLEW_GET_VAR(__WGLEW_ARB_robustness_share_group_isolation) + +#endif /* WGL_ARB_robustness_share_group_isolation */ + +/* ----------------------- WGL_ATI_pixel_format_float ---------------------- */ + +#ifndef WGL_ATI_pixel_format_float +#define WGL_ATI_pixel_format_float 1 + +#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0 +#define GL_RGBA_FLOAT_MODE_ATI 0x8820 +#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 + +#define WGLEW_ATI_pixel_format_float WGLEW_GET_VAR(__WGLEW_ATI_pixel_format_float) + +#endif /* WGL_ATI_pixel_format_float */ + +/* -------------------- WGL_ATI_render_texture_rectangle ------------------- */ + +#ifndef WGL_ATI_render_texture_rectangle +#define WGL_ATI_render_texture_rectangle 1 + +#define WGL_TEXTURE_RECTANGLE_ATI 0x21A5 + +#define WGLEW_ATI_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_ATI_render_texture_rectangle) + +#endif /* WGL_ATI_render_texture_rectangle */ + +/* ------------------- WGL_EXT_create_context_es2_profile ------------------ */ + +#ifndef WGL_EXT_create_context_es2_profile +#define WGL_EXT_create_context_es2_profile 1 + +#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 + +#define WGLEW_EXT_create_context_es2_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es2_profile) + +#endif /* WGL_EXT_create_context_es2_profile */ + +/* ------------------- WGL_EXT_create_context_es_profile ------------------- */ + +#ifndef WGL_EXT_create_context_es_profile +#define WGL_EXT_create_context_es_profile 1 + +#define WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 + +#define WGLEW_EXT_create_context_es_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es_profile) + +#endif /* WGL_EXT_create_context_es_profile */ + +/* -------------------------- WGL_EXT_depth_float -------------------------- */ + +#ifndef WGL_EXT_depth_float +#define WGL_EXT_depth_float 1 + +#define WGL_DEPTH_FLOAT_EXT 0x2040 + +#define WGLEW_EXT_depth_float WGLEW_GET_VAR(__WGLEW_EXT_depth_float) + +#endif /* WGL_EXT_depth_float */ + +/* ---------------------- WGL_EXT_display_color_table ---------------------- */ + +#ifndef WGL_EXT_display_color_table +#define WGL_EXT_display_color_table 1 + +typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef void (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (GLushort* table, GLuint length); + +#define wglBindDisplayColorTableEXT WGLEW_GET_FUN(__wglewBindDisplayColorTableEXT) +#define wglCreateDisplayColorTableEXT WGLEW_GET_FUN(__wglewCreateDisplayColorTableEXT) +#define wglDestroyDisplayColorTableEXT WGLEW_GET_FUN(__wglewDestroyDisplayColorTableEXT) +#define wglLoadDisplayColorTableEXT WGLEW_GET_FUN(__wglewLoadDisplayColorTableEXT) + +#define WGLEW_EXT_display_color_table WGLEW_GET_VAR(__WGLEW_EXT_display_color_table) + +#endif /* WGL_EXT_display_color_table */ + +/* ----------------------- WGL_EXT_extensions_string ----------------------- */ + +#ifndef WGL_EXT_extensions_string +#define WGL_EXT_extensions_string 1 + +typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void); + +#define wglGetExtensionsStringEXT WGLEW_GET_FUN(__wglewGetExtensionsStringEXT) + +#define WGLEW_EXT_extensions_string WGLEW_GET_VAR(__WGLEW_EXT_extensions_string) + +#endif /* WGL_EXT_extensions_string */ + +/* ------------------------ WGL_EXT_framebuffer_sRGB ----------------------- */ + +#ifndef WGL_EXT_framebuffer_sRGB +#define WGL_EXT_framebuffer_sRGB 1 + +#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9 + +#define WGLEW_EXT_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_EXT_framebuffer_sRGB) + +#endif /* WGL_EXT_framebuffer_sRGB */ + +/* ----------------------- WGL_EXT_make_current_read ----------------------- */ + +#ifndef WGL_EXT_make_current_read +#define WGL_EXT_make_current_read 1 + +#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043 + +typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); + +#define wglGetCurrentReadDCEXT WGLEW_GET_FUN(__wglewGetCurrentReadDCEXT) +#define wglMakeContextCurrentEXT WGLEW_GET_FUN(__wglewMakeContextCurrentEXT) + +#define WGLEW_EXT_make_current_read WGLEW_GET_VAR(__WGLEW_EXT_make_current_read) + +#endif /* WGL_EXT_make_current_read */ + +/* -------------------------- WGL_EXT_multisample -------------------------- */ + +#ifndef WGL_EXT_multisample +#define WGL_EXT_multisample 1 + +#define WGL_SAMPLE_BUFFERS_EXT 0x2041 +#define WGL_SAMPLES_EXT 0x2042 + +#define WGLEW_EXT_multisample WGLEW_GET_VAR(__WGLEW_EXT_multisample) + +#endif /* WGL_EXT_multisample */ + +/* ---------------------------- WGL_EXT_pbuffer ---------------------------- */ + +#ifndef WGL_EXT_pbuffer +#define WGL_EXT_pbuffer 1 + +#define WGL_DRAW_TO_PBUFFER_EXT 0x202D +#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E +#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F +#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030 +#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031 +#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032 +#define WGL_PBUFFER_LARGEST_EXT 0x2033 +#define WGL_PBUFFER_WIDTH_EXT 0x2034 +#define WGL_PBUFFER_HEIGHT_EXT 0x2035 + +DECLARE_HANDLE(HPBUFFEREXT); + +typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList); +typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer); +typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer); +typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int* piValue); +typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC); + +#define wglCreatePbufferEXT WGLEW_GET_FUN(__wglewCreatePbufferEXT) +#define wglDestroyPbufferEXT WGLEW_GET_FUN(__wglewDestroyPbufferEXT) +#define wglGetPbufferDCEXT WGLEW_GET_FUN(__wglewGetPbufferDCEXT) +#define wglQueryPbufferEXT WGLEW_GET_FUN(__wglewQueryPbufferEXT) +#define wglReleasePbufferDCEXT WGLEW_GET_FUN(__wglewReleasePbufferDCEXT) + +#define WGLEW_EXT_pbuffer WGLEW_GET_VAR(__WGLEW_EXT_pbuffer) + +#endif /* WGL_EXT_pbuffer */ + +/* -------------------------- WGL_EXT_pixel_format ------------------------- */ + +#ifndef WGL_EXT_pixel_format +#define WGL_EXT_pixel_format 1 + +#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000 +#define WGL_DRAW_TO_WINDOW_EXT 0x2001 +#define WGL_DRAW_TO_BITMAP_EXT 0x2002 +#define WGL_ACCELERATION_EXT 0x2003 +#define WGL_NEED_PALETTE_EXT 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006 +#define WGL_SWAP_METHOD_EXT 0x2007 +#define WGL_NUMBER_OVERLAYS_EXT 0x2008 +#define WGL_NUMBER_UNDERLAYS_EXT 0x2009 +#define WGL_TRANSPARENT_EXT 0x200A +#define WGL_TRANSPARENT_VALUE_EXT 0x200B +#define WGL_SHARE_DEPTH_EXT 0x200C +#define WGL_SHARE_STENCIL_EXT 0x200D +#define WGL_SHARE_ACCUM_EXT 0x200E +#define WGL_SUPPORT_GDI_EXT 0x200F +#define WGL_SUPPORT_OPENGL_EXT 0x2010 +#define WGL_DOUBLE_BUFFER_EXT 0x2011 +#define WGL_STEREO_EXT 0x2012 +#define WGL_PIXEL_TYPE_EXT 0x2013 +#define WGL_COLOR_BITS_EXT 0x2014 +#define WGL_RED_BITS_EXT 0x2015 +#define WGL_RED_SHIFT_EXT 0x2016 +#define WGL_GREEN_BITS_EXT 0x2017 +#define WGL_GREEN_SHIFT_EXT 0x2018 +#define WGL_BLUE_BITS_EXT 0x2019 +#define WGL_BLUE_SHIFT_EXT 0x201A +#define WGL_ALPHA_BITS_EXT 0x201B +#define WGL_ALPHA_SHIFT_EXT 0x201C +#define WGL_ACCUM_BITS_EXT 0x201D +#define WGL_ACCUM_RED_BITS_EXT 0x201E +#define WGL_ACCUM_GREEN_BITS_EXT 0x201F +#define WGL_ACCUM_BLUE_BITS_EXT 0x2020 +#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021 +#define WGL_DEPTH_BITS_EXT 0x2022 +#define WGL_STENCIL_BITS_EXT 0x2023 +#define WGL_AUX_BUFFERS_EXT 0x2024 +#define WGL_NO_ACCELERATION_EXT 0x2025 +#define WGL_GENERIC_ACCELERATION_EXT 0x2026 +#define WGL_FULL_ACCELERATION_EXT 0x2027 +#define WGL_SWAP_EXCHANGE_EXT 0x2028 +#define WGL_SWAP_COPY_EXT 0x2029 +#define WGL_SWAP_UNDEFINED_EXT 0x202A +#define WGL_TYPE_RGBA_EXT 0x202B +#define WGL_TYPE_COLORINDEX_EXT 0x202C + +typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, FLOAT *pfValues); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, int *piValues); + +#define wglChoosePixelFormatEXT WGLEW_GET_FUN(__wglewChoosePixelFormatEXT) +#define wglGetPixelFormatAttribfvEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvEXT) +#define wglGetPixelFormatAttribivEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribivEXT) + +#define WGLEW_EXT_pixel_format WGLEW_GET_VAR(__WGLEW_EXT_pixel_format) + +#endif /* WGL_EXT_pixel_format */ + +/* ------------------- WGL_EXT_pixel_format_packed_float ------------------- */ + +#ifndef WGL_EXT_pixel_format_packed_float +#define WGL_EXT_pixel_format_packed_float 1 + +#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8 + +#define WGLEW_EXT_pixel_format_packed_float WGLEW_GET_VAR(__WGLEW_EXT_pixel_format_packed_float) + +#endif /* WGL_EXT_pixel_format_packed_float */ + +/* -------------------------- WGL_EXT_swap_control ------------------------- */ + +#ifndef WGL_EXT_swap_control +#define WGL_EXT_swap_control 1 + +typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void); +typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval); + +#define wglGetSwapIntervalEXT WGLEW_GET_FUN(__wglewGetSwapIntervalEXT) +#define wglSwapIntervalEXT WGLEW_GET_FUN(__wglewSwapIntervalEXT) + +#define WGLEW_EXT_swap_control WGLEW_GET_VAR(__WGLEW_EXT_swap_control) + +#endif /* WGL_EXT_swap_control */ + +/* ----------------------- WGL_EXT_swap_control_tear ----------------------- */ + +#ifndef WGL_EXT_swap_control_tear +#define WGL_EXT_swap_control_tear 1 + +#define WGLEW_EXT_swap_control_tear WGLEW_GET_VAR(__WGLEW_EXT_swap_control_tear) + +#endif /* WGL_EXT_swap_control_tear */ + +/* --------------------- WGL_I3D_digital_video_control --------------------- */ + +#ifndef WGL_I3D_digital_video_control +#define WGL_I3D_digital_video_control 1 + +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050 +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051 +#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052 +#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053 + +typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue); +typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue); + +#define wglGetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewGetDigitalVideoParametersI3D) +#define wglSetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewSetDigitalVideoParametersI3D) + +#define WGLEW_I3D_digital_video_control WGLEW_GET_VAR(__WGLEW_I3D_digital_video_control) + +#endif /* WGL_I3D_digital_video_control */ + +/* ----------------------------- WGL_I3D_gamma ----------------------------- */ + +#ifndef WGL_I3D_gamma +#define WGL_I3D_gamma 1 + +#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E +#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F + +typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT* puRed, USHORT *puGreen, USHORT *puBlue); +typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue); +typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT* puRed, const USHORT *puGreen, const USHORT *puBlue); +typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue); + +#define wglGetGammaTableI3D WGLEW_GET_FUN(__wglewGetGammaTableI3D) +#define wglGetGammaTableParametersI3D WGLEW_GET_FUN(__wglewGetGammaTableParametersI3D) +#define wglSetGammaTableI3D WGLEW_GET_FUN(__wglewSetGammaTableI3D) +#define wglSetGammaTableParametersI3D WGLEW_GET_FUN(__wglewSetGammaTableParametersI3D) + +#define WGLEW_I3D_gamma WGLEW_GET_VAR(__WGLEW_I3D_gamma) + +#endif /* WGL_I3D_gamma */ + +/* ---------------------------- WGL_I3D_genlock ---------------------------- */ + +#ifndef WGL_I3D_genlock +#define WGL_I3D_genlock 1 + +#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044 +#define WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045 +#define WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046 +#define WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047 +#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048 +#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049 +#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A +#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B +#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C + +typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC); +typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC); +typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT* uRate); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT* uDelay); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT* uEdge); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT* uSource); +typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL* pFlag); +typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT* uMaxLineDelay, UINT *uMaxPixelDelay); + +#define wglDisableGenlockI3D WGLEW_GET_FUN(__wglewDisableGenlockI3D) +#define wglEnableGenlockI3D WGLEW_GET_FUN(__wglewEnableGenlockI3D) +#define wglGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGenlockSampleRateI3D) +#define wglGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGenlockSourceDelayI3D) +#define wglGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGenlockSourceEdgeI3D) +#define wglGenlockSourceI3D WGLEW_GET_FUN(__wglewGenlockSourceI3D) +#define wglGetGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGetGenlockSampleRateI3D) +#define wglGetGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGetGenlockSourceDelayI3D) +#define wglGetGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGetGenlockSourceEdgeI3D) +#define wglGetGenlockSourceI3D WGLEW_GET_FUN(__wglewGetGenlockSourceI3D) +#define wglIsEnabledGenlockI3D WGLEW_GET_FUN(__wglewIsEnabledGenlockI3D) +#define wglQueryGenlockMaxSourceDelayI3D WGLEW_GET_FUN(__wglewQueryGenlockMaxSourceDelayI3D) + +#define WGLEW_I3D_genlock WGLEW_GET_VAR(__WGLEW_I3D_genlock) + +#endif /* WGL_I3D_genlock */ + +/* -------------------------- WGL_I3D_image_buffer ------------------------- */ + +#ifndef WGL_I3D_image_buffer +#define WGL_I3D_image_buffer 1 + +#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001 +#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002 + +typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, HANDLE* pEvent, LPVOID *pAddress, DWORD *pSize, UINT count); +typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags); +typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress); +typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, LPVOID* pAddress, UINT count); + +#define wglAssociateImageBufferEventsI3D WGLEW_GET_FUN(__wglewAssociateImageBufferEventsI3D) +#define wglCreateImageBufferI3D WGLEW_GET_FUN(__wglewCreateImageBufferI3D) +#define wglDestroyImageBufferI3D WGLEW_GET_FUN(__wglewDestroyImageBufferI3D) +#define wglReleaseImageBufferEventsI3D WGLEW_GET_FUN(__wglewReleaseImageBufferEventsI3D) + +#define WGLEW_I3D_image_buffer WGLEW_GET_VAR(__WGLEW_I3D_image_buffer) + +#endif /* WGL_I3D_image_buffer */ + +/* ------------------------ WGL_I3D_swap_frame_lock ------------------------ */ + +#ifndef WGL_I3D_swap_frame_lock +#define WGL_I3D_swap_frame_lock 1 + +typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL* pFlag); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL* pFlag); + +#define wglDisableFrameLockI3D WGLEW_GET_FUN(__wglewDisableFrameLockI3D) +#define wglEnableFrameLockI3D WGLEW_GET_FUN(__wglewEnableFrameLockI3D) +#define wglIsEnabledFrameLockI3D WGLEW_GET_FUN(__wglewIsEnabledFrameLockI3D) +#define wglQueryFrameLockMasterI3D WGLEW_GET_FUN(__wglewQueryFrameLockMasterI3D) + +#define WGLEW_I3D_swap_frame_lock WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_lock) + +#endif /* WGL_I3D_swap_frame_lock */ + +/* ------------------------ WGL_I3D_swap_frame_usage ----------------------- */ + +#ifndef WGL_I3D_swap_frame_usage +#define WGL_I3D_swap_frame_usage 1 + +typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float* pUsage); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD* pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage); + +#define wglBeginFrameTrackingI3D WGLEW_GET_FUN(__wglewBeginFrameTrackingI3D) +#define wglEndFrameTrackingI3D WGLEW_GET_FUN(__wglewEndFrameTrackingI3D) +#define wglGetFrameUsageI3D WGLEW_GET_FUN(__wglewGetFrameUsageI3D) +#define wglQueryFrameTrackingI3D WGLEW_GET_FUN(__wglewQueryFrameTrackingI3D) + +#define WGLEW_I3D_swap_frame_usage WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_usage) + +#endif /* WGL_I3D_swap_frame_usage */ + +/* --------------------------- WGL_NV_DX_interop --------------------------- */ + +#ifndef WGL_NV_DX_interop +#define WGL_NV_DX_interop 1 + +#define WGL_ACCESS_READ_ONLY_NV 0x0000 +#define WGL_ACCESS_READ_WRITE_NV 0x0001 +#define WGL_ACCESS_WRITE_DISCARD_NV 0x0002 + +typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice); +typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects); +typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access); +typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void* dxDevice); +typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void* dxObject, GLuint name, GLenum type, GLenum access); +typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void* dxObject, HANDLE shareHandle); +typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects); +typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject); + +#define wglDXCloseDeviceNV WGLEW_GET_FUN(__wglewDXCloseDeviceNV) +#define wglDXLockObjectsNV WGLEW_GET_FUN(__wglewDXLockObjectsNV) +#define wglDXObjectAccessNV WGLEW_GET_FUN(__wglewDXObjectAccessNV) +#define wglDXOpenDeviceNV WGLEW_GET_FUN(__wglewDXOpenDeviceNV) +#define wglDXRegisterObjectNV WGLEW_GET_FUN(__wglewDXRegisterObjectNV) +#define wglDXSetResourceShareHandleNV WGLEW_GET_FUN(__wglewDXSetResourceShareHandleNV) +#define wglDXUnlockObjectsNV WGLEW_GET_FUN(__wglewDXUnlockObjectsNV) +#define wglDXUnregisterObjectNV WGLEW_GET_FUN(__wglewDXUnregisterObjectNV) + +#define WGLEW_NV_DX_interop WGLEW_GET_VAR(__WGLEW_NV_DX_interop) + +#endif /* WGL_NV_DX_interop */ + +/* --------------------------- WGL_NV_DX_interop2 -------------------------- */ + +#ifndef WGL_NV_DX_interop2 +#define WGL_NV_DX_interop2 1 + +#define WGLEW_NV_DX_interop2 WGLEW_GET_VAR(__WGLEW_NV_DX_interop2) + +#endif /* WGL_NV_DX_interop2 */ + +/* --------------------------- WGL_NV_copy_image --------------------------- */ + +#ifndef WGL_NV_copy_image +#define WGL_NV_copy_image 1 + +typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); + +#define wglCopyImageSubDataNV WGLEW_GET_FUN(__wglewCopyImageSubDataNV) + +#define WGLEW_NV_copy_image WGLEW_GET_VAR(__WGLEW_NV_copy_image) + +#endif /* WGL_NV_copy_image */ + +/* -------------------------- WGL_NV_float_buffer -------------------------- */ + +#ifndef WGL_NV_float_buffer +#define WGL_NV_float_buffer 1 + +#define WGL_FLOAT_COMPONENTS_NV 0x20B0 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4 +#define WGL_TEXTURE_FLOAT_R_NV 0x20B5 +#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6 +#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7 +#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8 + +#define WGLEW_NV_float_buffer WGLEW_GET_VAR(__WGLEW_NV_float_buffer) + +#endif /* WGL_NV_float_buffer */ + +/* -------------------------- WGL_NV_gpu_affinity -------------------------- */ + +#ifndef WGL_NV_gpu_affinity +#define WGL_NV_gpu_affinity 1 + +#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0 +#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1 + +DECLARE_HANDLE(HGPUNV); +typedef struct _GPU_DEVICE { + DWORD cb; + CHAR DeviceName[32]; + CHAR DeviceString[128]; + DWORD Flags; + RECT rcVirtualScreen; +} GPU_DEVICE, *PGPU_DEVICE; + +typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList); +typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc); +typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice); +typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu); +typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu); + +#define wglCreateAffinityDCNV WGLEW_GET_FUN(__wglewCreateAffinityDCNV) +#define wglDeleteDCNV WGLEW_GET_FUN(__wglewDeleteDCNV) +#define wglEnumGpuDevicesNV WGLEW_GET_FUN(__wglewEnumGpuDevicesNV) +#define wglEnumGpusFromAffinityDCNV WGLEW_GET_FUN(__wglewEnumGpusFromAffinityDCNV) +#define wglEnumGpusNV WGLEW_GET_FUN(__wglewEnumGpusNV) + +#define WGLEW_NV_gpu_affinity WGLEW_GET_VAR(__WGLEW_NV_gpu_affinity) + +#endif /* WGL_NV_gpu_affinity */ + +/* ---------------------- WGL_NV_multisample_coverage ---------------------- */ + +#ifndef WGL_NV_multisample_coverage +#define WGL_NV_multisample_coverage 1 + +#define WGL_COVERAGE_SAMPLES_NV 0x2042 +#define WGL_COLOR_SAMPLES_NV 0x20B9 + +#define WGLEW_NV_multisample_coverage WGLEW_GET_VAR(__WGLEW_NV_multisample_coverage) + +#endif /* WGL_NV_multisample_coverage */ + +/* -------------------------- WGL_NV_present_video ------------------------- */ + +#ifndef WGL_NV_present_video +#define WGL_NV_present_video 1 + +#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0 + +DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV); + +typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int* piAttribList); +typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDc, HVIDEOOUTPUTDEVICENV* phDeviceList); +typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int* piValue); + +#define wglBindVideoDeviceNV WGLEW_GET_FUN(__wglewBindVideoDeviceNV) +#define wglEnumerateVideoDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoDevicesNV) +#define wglQueryCurrentContextNV WGLEW_GET_FUN(__wglewQueryCurrentContextNV) + +#define WGLEW_NV_present_video WGLEW_GET_VAR(__WGLEW_NV_present_video) + +#endif /* WGL_NV_present_video */ + +/* ---------------------- WGL_NV_render_depth_texture ---------------------- */ + +#ifndef WGL_NV_render_depth_texture +#define WGL_NV_render_depth_texture 1 + +#define WGL_NO_TEXTURE_ARB 0x2077 +#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4 +#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5 +#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6 +#define WGL_DEPTH_COMPONENT_NV 0x20A7 + +#define WGLEW_NV_render_depth_texture WGLEW_GET_VAR(__WGLEW_NV_render_depth_texture) + +#endif /* WGL_NV_render_depth_texture */ + +/* -------------------- WGL_NV_render_texture_rectangle -------------------- */ + +#ifndef WGL_NV_render_texture_rectangle +#define WGL_NV_render_texture_rectangle 1 + +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1 +#define WGL_TEXTURE_RECTANGLE_NV 0x20A2 + +#define WGLEW_NV_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_NV_render_texture_rectangle) + +#endif /* WGL_NV_render_texture_rectangle */ + +/* --------------------------- WGL_NV_swap_group --------------------------- */ + +#ifndef WGL_NV_swap_group +#define WGL_NV_swap_group 1 + +typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier); +typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint* count); +typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint* maxGroups, GLuint *maxBarriers); +typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint* group, GLuint *barrier); +typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC); + +#define wglBindSwapBarrierNV WGLEW_GET_FUN(__wglewBindSwapBarrierNV) +#define wglJoinSwapGroupNV WGLEW_GET_FUN(__wglewJoinSwapGroupNV) +#define wglQueryFrameCountNV WGLEW_GET_FUN(__wglewQueryFrameCountNV) +#define wglQueryMaxSwapGroupsNV WGLEW_GET_FUN(__wglewQueryMaxSwapGroupsNV) +#define wglQuerySwapGroupNV WGLEW_GET_FUN(__wglewQuerySwapGroupNV) +#define wglResetFrameCountNV WGLEW_GET_FUN(__wglewResetFrameCountNV) + +#define WGLEW_NV_swap_group WGLEW_GET_VAR(__WGLEW_NV_swap_group) + +#endif /* WGL_NV_swap_group */ + +/* ----------------------- WGL_NV_vertex_array_range ----------------------- */ + +#ifndef WGL_NV_vertex_array_range +#define WGL_NV_vertex_array_range 1 + +typedef void * (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority); +typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer); + +#define wglAllocateMemoryNV WGLEW_GET_FUN(__wglewAllocateMemoryNV) +#define wglFreeMemoryNV WGLEW_GET_FUN(__wglewFreeMemoryNV) + +#define WGLEW_NV_vertex_array_range WGLEW_GET_VAR(__WGLEW_NV_vertex_array_range) + +#endif /* WGL_NV_vertex_array_range */ + +/* -------------------------- WGL_NV_video_capture ------------------------- */ + +#ifndef WGL_NV_video_capture +#define WGL_NV_video_capture 1 + +#define WGL_UNIQUE_ID_NV 0x20CE +#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF + +DECLARE_HANDLE(HVIDEOINPUTDEVICENV); + +typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice); +typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV* phDeviceList); +typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); +typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int* piValue); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); + +#define wglBindVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewBindVideoCaptureDeviceNV) +#define wglEnumerateVideoCaptureDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoCaptureDevicesNV) +#define wglLockVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewLockVideoCaptureDeviceNV) +#define wglQueryVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewQueryVideoCaptureDeviceNV) +#define wglReleaseVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoCaptureDeviceNV) + +#define WGLEW_NV_video_capture WGLEW_GET_VAR(__WGLEW_NV_video_capture) + +#endif /* WGL_NV_video_capture */ + +/* -------------------------- WGL_NV_video_output -------------------------- */ + +#ifndef WGL_NV_video_output +#define WGL_NV_video_output 1 + +#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0 +#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1 +#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2 +#define WGL_VIDEO_OUT_COLOR_NV 0x20C3 +#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4 +#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5 +#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 +#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 +#define WGL_VIDEO_OUT_FRAME 0x20C8 +#define WGL_VIDEO_OUT_FIELD_1 0x20C9 +#define WGL_VIDEO_OUT_FIELD_2 0x20CA +#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB +#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC + +DECLARE_HANDLE(HPVIDEODEV); + +typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer); +typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV* hVideoDevice); +typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long* pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer); +typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long* pulCounterPbuffer, BOOL bBlock); + +#define wglBindVideoImageNV WGLEW_GET_FUN(__wglewBindVideoImageNV) +#define wglGetVideoDeviceNV WGLEW_GET_FUN(__wglewGetVideoDeviceNV) +#define wglGetVideoInfoNV WGLEW_GET_FUN(__wglewGetVideoInfoNV) +#define wglReleaseVideoDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoDeviceNV) +#define wglReleaseVideoImageNV WGLEW_GET_FUN(__wglewReleaseVideoImageNV) +#define wglSendPbufferToVideoNV WGLEW_GET_FUN(__wglewSendPbufferToVideoNV) + +#define WGLEW_NV_video_output WGLEW_GET_VAR(__WGLEW_NV_video_output) + +#endif /* WGL_NV_video_output */ + +/* -------------------------- WGL_OML_sync_control ------------------------- */ + +#ifndef WGL_OML_sync_control +#define WGL_OML_sync_control 1 + +typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32* numerator, INT32 *denominator); +typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64* ust, INT64 *msc, INT64 *sbc); +typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder); +typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder); +typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64* ust, INT64 *msc, INT64 *sbc); +typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64* ust, INT64 *msc, INT64 *sbc); + +#define wglGetMscRateOML WGLEW_GET_FUN(__wglewGetMscRateOML) +#define wglGetSyncValuesOML WGLEW_GET_FUN(__wglewGetSyncValuesOML) +#define wglSwapBuffersMscOML WGLEW_GET_FUN(__wglewSwapBuffersMscOML) +#define wglSwapLayerBuffersMscOML WGLEW_GET_FUN(__wglewSwapLayerBuffersMscOML) +#define wglWaitForMscOML WGLEW_GET_FUN(__wglewWaitForMscOML) +#define wglWaitForSbcOML WGLEW_GET_FUN(__wglewWaitForSbcOML) + +#define WGLEW_OML_sync_control WGLEW_GET_VAR(__WGLEW_OML_sync_control) + +#endif /* WGL_OML_sync_control */ + +/* ------------------------------------------------------------------------- */ + +#ifdef GLEW_MX +#define WGLEW_FUN_EXPORT +#define WGLEW_VAR_EXPORT +#else +#define WGLEW_FUN_EXPORT GLEW_FUN_EXPORT +#define WGLEW_VAR_EXPORT GLEW_VAR_EXPORT +#endif /* GLEW_MX */ + +#ifdef GLEW_MX +struct WGLEWContextStruct +{ +#endif /* GLEW_MX */ + +WGLEW_FUN_EXPORT PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL; + +WGLEW_FUN_EXPORT PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD; +WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD; +WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD; +WGLEW_FUN_EXPORT PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD; +WGLEW_FUN_EXPORT PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD; +WGLEW_FUN_EXPORT PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD; +WGLEW_FUN_EXPORT PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD; +WGLEW_FUN_EXPORT PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD; +WGLEW_FUN_EXPORT PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD; + +WGLEW_FUN_EXPORT PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB; +WGLEW_FUN_EXPORT PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB; +WGLEW_FUN_EXPORT PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB; +WGLEW_FUN_EXPORT PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB; + +WGLEW_FUN_EXPORT PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB; + +WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB; + +WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB; +WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB; + +WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB; +WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB; +WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB; +WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB; +WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB; + +WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB; + +WGLEW_FUN_EXPORT PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB; +WGLEW_FUN_EXPORT PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB; +WGLEW_FUN_EXPORT PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB; + +WGLEW_FUN_EXPORT PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT; +WGLEW_FUN_EXPORT PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT; +WGLEW_FUN_EXPORT PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT; +WGLEW_FUN_EXPORT PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT; + +WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT; + +WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT; +WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT; + +WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT; +WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT; +WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT; +WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT; +WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT; + +WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT; +WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT; + +WGLEW_FUN_EXPORT PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT; +WGLEW_FUN_EXPORT PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT; + +WGLEW_FUN_EXPORT PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D; +WGLEW_FUN_EXPORT PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D; + +WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D; +WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D; +WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D; +WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D; + +WGLEW_FUN_EXPORT PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D; +WGLEW_FUN_EXPORT PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D; +WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D; +WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D; +WGLEW_FUN_EXPORT PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D; +WGLEW_FUN_EXPORT PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D; + +WGLEW_FUN_EXPORT PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D; +WGLEW_FUN_EXPORT PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D; +WGLEW_FUN_EXPORT PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D; +WGLEW_FUN_EXPORT PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D; + +WGLEW_FUN_EXPORT PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D; +WGLEW_FUN_EXPORT PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D; +WGLEW_FUN_EXPORT PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D; +WGLEW_FUN_EXPORT PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D; + +WGLEW_FUN_EXPORT PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D; +WGLEW_FUN_EXPORT PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D; +WGLEW_FUN_EXPORT PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D; +WGLEW_FUN_EXPORT PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D; + +WGLEW_FUN_EXPORT PFNWGLDXCLOSEDEVICENVPROC __wglewDXCloseDeviceNV; +WGLEW_FUN_EXPORT PFNWGLDXLOCKOBJECTSNVPROC __wglewDXLockObjectsNV; +WGLEW_FUN_EXPORT PFNWGLDXOBJECTACCESSNVPROC __wglewDXObjectAccessNV; +WGLEW_FUN_EXPORT PFNWGLDXOPENDEVICENVPROC __wglewDXOpenDeviceNV; +WGLEW_FUN_EXPORT PFNWGLDXREGISTEROBJECTNVPROC __wglewDXRegisterObjectNV; +WGLEW_FUN_EXPORT PFNWGLDXSETRESOURCESHAREHANDLENVPROC __wglewDXSetResourceShareHandleNV; +WGLEW_FUN_EXPORT PFNWGLDXUNLOCKOBJECTSNVPROC __wglewDXUnlockObjectsNV; +WGLEW_FUN_EXPORT PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV; + +WGLEW_FUN_EXPORT PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV; + +WGLEW_FUN_EXPORT PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV; +WGLEW_FUN_EXPORT PFNWGLDELETEDCNVPROC __wglewDeleteDCNV; +WGLEW_FUN_EXPORT PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV; +WGLEW_FUN_EXPORT PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV; +WGLEW_FUN_EXPORT PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV; + +WGLEW_FUN_EXPORT PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV; +WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV; +WGLEW_FUN_EXPORT PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV; + +WGLEW_FUN_EXPORT PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV; +WGLEW_FUN_EXPORT PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV; +WGLEW_FUN_EXPORT PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV; +WGLEW_FUN_EXPORT PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV; +WGLEW_FUN_EXPORT PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV; +WGLEW_FUN_EXPORT PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV; + +WGLEW_FUN_EXPORT PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV; +WGLEW_FUN_EXPORT PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV; + +WGLEW_FUN_EXPORT PFNWGLBINDVIDEOCAPTUREDEVICENVPROC __wglewBindVideoCaptureDeviceNV; +WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC __wglewEnumerateVideoCaptureDevicesNV; +WGLEW_FUN_EXPORT PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC __wglewLockVideoCaptureDeviceNV; +WGLEW_FUN_EXPORT PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC __wglewQueryVideoCaptureDeviceNV; +WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC __wglewReleaseVideoCaptureDeviceNV; + +WGLEW_FUN_EXPORT PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV; +WGLEW_FUN_EXPORT PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV; +WGLEW_FUN_EXPORT PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV; +WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV; +WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV; +WGLEW_FUN_EXPORT PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV; + +WGLEW_FUN_EXPORT PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML; +WGLEW_FUN_EXPORT PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML; +WGLEW_FUN_EXPORT PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML; +WGLEW_FUN_EXPORT PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML; +WGLEW_FUN_EXPORT PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML; +WGLEW_FUN_EXPORT PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML; +WGLEW_VAR_EXPORT GLboolean __WGLEW_3DFX_multisample; +WGLEW_VAR_EXPORT GLboolean __WGLEW_3DL_stereo_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_AMD_gpu_association; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_buffer_region; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_profile; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_robustness; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_extensions_string; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_framebuffer_sRGB; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_make_current_read; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_multisample; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pbuffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_render_texture; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_robustness_application_isolation; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_robustness_share_group_isolation; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_pixel_format_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_render_texture_rectangle; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es2_profile; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es_profile; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_depth_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_display_color_table; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_extensions_string; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_framebuffer_sRGB; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_make_current_read; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_multisample; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pbuffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format_packed_float; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control_tear; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_digital_video_control; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_gamma; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_genlock; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_image_buffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_lock; +WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_usage; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop2; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_copy_image; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_float_buffer; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_gpu_affinity; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_multisample_coverage; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_present_video; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_depth_texture; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_texture_rectangle; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_swap_group; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_vertex_array_range; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_capture; +WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_output; +WGLEW_VAR_EXPORT GLboolean __WGLEW_OML_sync_control; + +#ifdef GLEW_MX +}; /* WGLEWContextStruct */ +#endif /* GLEW_MX */ + +/* ------------------------------------------------------------------------- */ + +#ifdef GLEW_MX + +typedef struct WGLEWContextStruct WGLEWContext; +GLEWAPI GLenum GLEWAPIENTRY wglewContextInit (WGLEWContext *ctx); +GLEWAPI GLboolean GLEWAPIENTRY wglewContextIsSupported (const WGLEWContext *ctx, const char *name); + +#define wglewInit() wglewContextInit(wglewGetContext()) +#define wglewIsSupported(x) wglewContextIsSupported(wglewGetContext(), x) + +#define WGLEW_GET_VAR(x) (*(const GLboolean*)&(wglewGetContext()->x)) +#define WGLEW_GET_FUN(x) wglewGetContext()->x + +#else /* GLEW_MX */ + +#define WGLEW_GET_VAR(x) (*(const GLboolean*)&x) +#define WGLEW_GET_FUN(x) x + +GLEWAPI GLboolean GLEWAPIENTRY wglewIsSupported (const char *name); + +#endif /* GLEW_MX */ + +GLEWAPI GLboolean GLEWAPIENTRY wglewGetExtension (const char *name); + +#ifdef __cplusplus +} +#endif + +#undef GLEWAPI + +#endif /* __wglew_h__ */ diff --git a/native/cocos/renderer/gfx-gles2/GFXGLES2.h b/native/cocos/renderer/gfx-gles2/GFXGLES2.h new file mode 100644 index 0000000000..10ed8ce571 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GFXGLES2.h @@ -0,0 +1,7 @@ +#ifndef CC_GFXGLES2_GLES2_H_ +#define CC_GFXGLES2_GLES2_H_ + +#include "GLES2Std.h" +#include "GLES2Device.h" + +#endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2BindingLayout.cc b/native/cocos/renderer/gfx-gles2/GLES2BindingLayout.cc new file mode 100644 index 0000000000..772a74ddad --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2BindingLayout.cc @@ -0,0 +1,78 @@ +#include "GLES2Std.h" +#include "GLES2BindingLayout.h" +#include "GLES2Commands.h" +#include "GLES2Buffer.h" +#include "GLES2TextureView.h" +#include "GLES2Sampler.h" + +CC_NAMESPACE_BEGIN + +GLES2BindingLayout::GLES2BindingLayout(GFXDevice* device) + : GFXBindingLayout(device), + gpu_binding_layout_(nullptr) { +} + +GLES2BindingLayout::~GLES2BindingLayout() { +} + +bool GLES2BindingLayout::Initialize(const GFXBindingLayoutInfo &info) { + + if (info.bindings.size()) { + binding_units_.resize(info.bindings.size()); + for (size_t i = 0; i < binding_units_.size(); ++i) { + GFXBindingUnit& binding_unit = binding_units_[i]; + const GFXBinding& binding = info.bindings[i]; + binding_unit.binding = binding.binding; + binding_unit.type = binding.type; + binding_unit.name = binding.name; + } + } + + gpu_binding_layout_ = CC_NEW(GLES2GPUBindingLayout); + gpu_binding_layout_->gpu_bindings.resize(binding_units_.size()); + for (size_t i = 0; i < gpu_binding_layout_->gpu_bindings.size(); ++i) { + GLES2GPUBinding& gpu_binding = gpu_binding_layout_->gpu_bindings[i]; + const GFXBindingUnit& binding_unit = binding_units_[i]; + gpu_binding.binding = binding_unit.binding; + gpu_binding.type = binding_unit.type; + gpu_binding.name = binding_unit.name; + } + + return true; +} + +void GLES2BindingLayout::Destroy() { + if (gpu_binding_layout_) { + CC_DELETE(gpu_binding_layout_); + gpu_binding_layout_ = nullptr; + } +} + +void GLES2BindingLayout::Update() { + if (is_dirty_ && gpu_binding_layout_) { + for (size_t i = 0; i < binding_units_.size(); ++i) { + GFXBindingUnit& binding_unit = binding_units_[i]; + switch (binding_unit.type) { + case GFXBindingType::UNIFORM_BUFFER: { + if (binding_unit.buffer) { + gpu_binding_layout_->gpu_bindings[i].gpu_buffer = ((GLES2Buffer*)binding_unit.buffer)->gpu_buffer(); + } + break; + } + case GFXBindingType::SAMPLER: { + if (binding_unit.tex_view) { + gpu_binding_layout_->gpu_bindings[i].gpu_tex_view = ((GLES2TextureView*)binding_unit.tex_view)->gpu_tex_view(); + } + if (binding_unit.sampler) { + gpu_binding_layout_->gpu_bindings[i].gpu_sampler = ((GLES2Sampler*)binding_unit.sampler)->gpu_sampler(); + } + break; + } + default:; + } + } + is_dirty_ = false; + } +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles2/GLES2BindingLayout.h b/native/cocos/renderer/gfx-gles2/GLES2BindingLayout.h new file mode 100644 index 0000000000..7e6c212c4d --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2BindingLayout.h @@ -0,0 +1,26 @@ +#ifndef CC_GFXGLES2_GLES2_BINDING_LAYOUT_H_ +#define CC_GFXGLES2_GLES2_BINDING_LAYOUT_H_ + +CC_NAMESPACE_BEGIN + +class GLES2GPUBindingLayout; + +class CC_GLES2_API GLES2BindingLayout : public GFXBindingLayout { + public: + GLES2BindingLayout(GFXDevice* device); + ~GLES2BindingLayout(); + + public: + bool Initialize(const GFXBindingLayoutInfo& info); + void Destroy(); + void Update(); + + CC_INLINE GLES2GPUBindingLayout* gpu_binding_layout() const { return gpu_binding_layout_; } + + private: + GLES2GPUBindingLayout* gpu_binding_layout_; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2Buffer.cc b/native/cocos/renderer/gfx-gles2/GLES2Buffer.cc new file mode 100644 index 0000000000..305f2e9ba9 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2Buffer.cc @@ -0,0 +1,92 @@ +#include "GLES2Std.h" +#include "GLES2Buffer.h" +#include "GLES2Commands.h" + +CC_NAMESPACE_BEGIN + +GLES2Buffer::GLES2Buffer(GFXDevice* device) + : GFXBuffer(device), + gpu_buffer_(nullptr) { +} + +GLES2Buffer::~GLES2Buffer() { +} + +bool GLES2Buffer::Initialize(const GFXBufferInfo& info) { + + usage_ = info.usage; + mem_usage_ = info.mem_usage; + size_ = info.size; + stride_ = std::max(info.stride, 1U); + count_ = size_ / stride_; + flags_ = info.flags; + + if ((flags_ & GFXBufferFlagBit::BAKUP_BUFFER) && size_ > 0) { + buffer_ = (uint8_t*)CC_MALLOC(size_); + device_->mem_status().buffer_size += size_; + } + + gpu_buffer_ = CC_NEW(GLES2GPUBuffer); + gpu_buffer_->usage = usage_; + gpu_buffer_->mem_usage = mem_usage_; + gpu_buffer_->size = size_; + gpu_buffer_->stride = stride_; + gpu_buffer_->count = count_; + + if (!(usage_ & GFXBufferUsageBit::INDIRECT)) { + gpu_buffer_->buffer = buffer_; + } + + GLES2CmdFuncCreateBuffer((GLES2Device*)device_, gpu_buffer_); + device_->mem_status().buffer_size += size_; + + return true; +} + +void GLES2Buffer::Destroy() { + if (gpu_buffer_) { + GLES2CmdFuncDestroyBuffer((GLES2Device*)device_, gpu_buffer_); + device_->mem_status().buffer_size -= size_; + CC_DELETE(gpu_buffer_); + gpu_buffer_ = nullptr; + } + + if (buffer_) { + CC_FREE(buffer_); + device_->mem_status().buffer_size -= size_; + buffer_ = nullptr; + } +} + +void GLES2Buffer::Resize(uint size) { + if (size_ != size) { + const uint old_size = size_; + size_ = size; + count_ = size_ / stride_; + + GFXMemoryStatus& status = device_->mem_status(); + gpu_buffer_->size = size_; + gpu_buffer_->count = count_; + GLES2CmdFuncResizeBuffer((GLES2Device*)device_, gpu_buffer_); + status.buffer_size -= old_size; + status.buffer_size += size_; + + if (buffer_) { + const uint8_t* old_buff = buffer_; + buffer_ = (uint8_t*)CC_MALLOC(size_); + memcpy(buffer_, old_buff, old_size); + CC_FREE(buffer_); + status.buffer_size -= old_size; + status.buffer_size += size_; + } + } +} + +void GLES2Buffer::Update(void* buffer, uint offset, uint size) { + if (buffer_) { + memcpy(buffer_ + offset, buffer, size); + } + GLES2CmdFuncUpdateBuffer((GLES2Device*)device_, gpu_buffer_, buffer, offset, size); +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles2/GLES2Buffer.h b/native/cocos/renderer/gfx-gles2/GLES2Buffer.h new file mode 100644 index 0000000000..9a0d8d629e --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2Buffer.h @@ -0,0 +1,27 @@ +#ifndef CC_GFXGLES2_GLES2_BUFFER_H_ +#define CC_GFXGLES2_GLES2_BUFFER_H_ + +CC_NAMESPACE_BEGIN + +class GLES2GPUBuffer; + +class CC_GLES2_API GLES2Buffer : public GFXBuffer { +public: + GLES2Buffer(GFXDevice* device); + ~GLES2Buffer(); + +public: + bool Initialize(const GFXBufferInfo& info); + void Destroy(); + void Resize(uint size); + void Update(void* buffer, uint offset, uint size); + + CC_INLINE GLES2GPUBuffer* gpu_buffer() const { return gpu_buffer_; } + +private: + GLES2GPUBuffer* gpu_buffer_; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2CommandAllocator.cc b/native/cocos/renderer/gfx-gles2/GLES2CommandAllocator.cc new file mode 100644 index 0000000000..c32fbe6609 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2CommandAllocator.cc @@ -0,0 +1,40 @@ +#include "GLES2Std.h" +#include "GLES2CommandAllocator.h" + +CC_NAMESPACE_BEGIN + +GLES2CommandAllocator::GLES2CommandAllocator(GFXDevice* device) + : GFXCommandAllocator(device) { +} + +GLES2CommandAllocator::~GLES2CommandAllocator() { +} + +bool GLES2CommandAllocator::Initialize(const GFXCommandAllocatorInfo& info) { + return true; +} + +void GLES2CommandAllocator::Destroy() { +} + +void GLES2CommandAllocator::ClearCmds(GLES2CmdPackage* cmd_package) { + if (cmd_package->begin_render_pass_cmds.Size()) { + begin_render_pass_cmd_pool.FreeCmds(cmd_package->begin_render_pass_cmds); + } + if (cmd_package->bind_states_cmds.Size()) { + bind_states_cmd_pool.FreeCmds(cmd_package->bind_states_cmds); + } + if (cmd_package->draw_cmds.Size()) { + draw_cmd_pool.FreeCmds(cmd_package->draw_cmds); + } + if (cmd_package->update_buffer_cmds.Size()) { + update_buffer_cmd_pool.FreeCmds(cmd_package->update_buffer_cmds); + } + if (cmd_package->copy_buffer_to_texture_cmds.Size()) { + copy_buffer_to_texture_cmd_pool.FreeCmds(cmd_package->copy_buffer_to_texture_cmds); + } + + cmd_package->cmd_types.Clear(); +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles2/GLES2CommandAllocator.h b/native/cocos/renderer/gfx-gles2/GLES2CommandAllocator.h new file mode 100644 index 0000000000..299b5a22a9 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2CommandAllocator.h @@ -0,0 +1,36 @@ +#ifndef CC_GFXGLES2_GLES2_COMMAND_ALLOCATOR_H_ +#define CC_GFXGLES2_GLES2_COMMAND_ALLOCATOR_H_ + +#include "GLES2CommandPool.h" + +CC_NAMESPACE_BEGIN + +class CC_GLES2_API GLES2CommandAllocator : public GFXCommandAllocator { +public: + GLES2CommandAllocator(GFXDevice* device); + ~GLES2CommandAllocator(); + + GLES2CommandPool begin_render_pass_cmd_pool; + GLES2CommandPool bind_states_cmd_pool; + GLES2CommandPool draw_cmd_pool; + GLES2CommandPool update_buffer_cmd_pool; + GLES2CommandPool copy_buffer_to_texture_cmd_pool; + +public: + bool Initialize(const GFXCommandAllocatorInfo& info); + void Destroy(); + + void ClearCmds(GLES2CmdPackage* cmd_package); + + CC_INLINE void ReleaseCmds() { + begin_render_pass_cmd_pool.Release(); + bind_states_cmd_pool.Release(); + draw_cmd_pool.Release(); + update_buffer_cmd_pool.Release(); + copy_buffer_to_texture_cmd_pool.Release(); + } +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2CommandBuffer.cc b/native/cocos/renderer/gfx-gles2/GLES2CommandBuffer.cc new file mode 100644 index 0000000000..c1ce053dac --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2CommandBuffer.cc @@ -0,0 +1,324 @@ +#include "GLES2Std.h" +#include "GLES2CommandBuffer.h" +#include "GLES2CommandAllocator.h" +#include "GLES2Framebuffer.h" +#include "GLES2PipelineState.h" +#include "GLES2BindingLayout.h" +#include "GLES2InputAssembler.h" +#include "GLES2Buffer.h" +#include "GLES2Texture.h" + +CC_NAMESPACE_BEGIN + +GLES2CommandBuffer::GLES2CommandBuffer(GFXDevice* device) + : GFXCommandBuffer(device), + cmd_package_(nullptr), + gles2_allocator_(nullptr), + is_in_render_pass_(false), + cur_gpu_pso_(nullptr), + cur_gpu_bl_(nullptr), + cur_gpu_ia_(nullptr), + cur_line_width_(1.0f), + is_state_invalid_(false) { +} + +GLES2CommandBuffer::~GLES2CommandBuffer() { +} + +bool GLES2CommandBuffer::Initialize(const GFXCommandBufferInfo& info) { + + if (!info.allocator) { + return false; + } + + allocator_ = info.allocator; + gles2_allocator_ = (GLES2CommandAllocator*)info.allocator; + type_ = info.type; + + cmd_package_ = CC_NEW(GLES2CmdPackage); + + return true; +} + +void GLES2CommandBuffer::Destroy() { + if (gles2_allocator_) { + gles2_allocator_->ClearCmds(cmd_package_); + gles2_allocator_ = nullptr; + } + allocator_ = nullptr; + + CC_SAFE_DELETE(cmd_package_); +} + +void GLES2CommandBuffer::Begin() { + gles2_allocator_->ClearCmds(cmd_package_); + cur_gpu_pso_ = nullptr; + cur_gpu_bl_ = nullptr; + cur_gpu_ia_ = nullptr; + num_draw_calls_ = 0; + num_tris_ = 0; +} + +void GLES2CommandBuffer::End() { + if (is_state_invalid_) { + BindStates(); + } + is_in_render_pass_ = false; +} + +void GLES2CommandBuffer::BeginRenderPass(GFXFramebuffer* fbo, const GFXRect& render_area, GFXClearFlags clear_flags, GFXColor* colors, uint count, float depth, int stencil) { + is_in_render_pass_ = true; + + GLES2CmdBeginRenderPass* cmd = gles2_allocator_->begin_render_pass_cmd_pool.Alloc(); + cmd->gpu_fbo = ((GLES2Framebuffer*)fbo)->gpu_fbo(); + cmd->render_area = render_area; + cmd->clear_flags = clear_flags; + cmd->num_clear_colors = count; + for (uint i = 0; i < count; ++i) { + cmd->clear_colors[i] = colors[i]; + } + cmd->clear_depth = depth; + cmd->clear_stencil = stencil; + + cmd_package_->begin_render_pass_cmds.Push(cmd); + cmd_package_->cmd_types.Push(GLES2CmdType::BEGIN_RENDER_PASS); +} + +void GLES2CommandBuffer::EndRenderPass() { + is_in_render_pass_ = false; + cmd_package_->cmd_types.Push(GLES2CmdType::END_RENDER_PASS); +} + +void GLES2CommandBuffer::BindPipelineState(GFXPipelineState* pso) { + cur_gpu_pso_ = ((GLES2PipelineState*)pso)->gpu_pso(); + is_state_invalid_ = true; +} + + +void GLES2CommandBuffer::BindBindingLayout(GFXBindingLayout* layout) { + cur_gpu_bl_ = ((GLES2BindingLayout*)layout)->gpu_binding_layout(); + is_state_invalid_ = true; +} + +void GLES2CommandBuffer::BindInputAssembler(GFXInputAssembler* ia) { + cur_gpu_ia_ = ((GLES2InputAssembler*)ia)->gpu_input_assembler(); + is_state_invalid_ = true; +} + +void GLES2CommandBuffer::SetViewport(const GFXViewport& vp) { + + if ((cur_viewport_.left != vp.left) || + (cur_viewport_.top != vp.top) || + (cur_viewport_.width != vp.width) || + (cur_viewport_.height != vp.height) || + math::IsNotEqualF(cur_viewport_.minDepth, vp.minDepth) || + math::IsNotEqualF(cur_viewport_.maxDepth, vp.maxDepth)) { + cur_viewport_ = vp; + is_state_invalid_ = true; + } +} + +void GLES2CommandBuffer::SetScissor(const GFXRect& rect) { + if ((cur_scissor_.x != rect.x) || + (cur_scissor_.y != rect.y) || + (cur_scissor_.width != rect.width) || + (cur_scissor_.height != rect.height)) { + cur_scissor_ = rect; + is_state_invalid_ = true; + } +} + +void GLES2CommandBuffer::SetLineWidth(const float width) { + if (math::IsNotEqualF(cur_line_width_, width)) { + cur_line_width_ = width; + is_state_invalid_ = true; + } +} + +void GLES2CommandBuffer::SetDepthBias(float constant, float clamp, float slope) { + if (math::IsNotEqualF(cur_depth_bias_.constant, constant) || + math::IsNotEqualF(cur_depth_bias_.clamp, clamp) || + math::IsNotEqualF(cur_depth_bias_.slope, slope)) { + cur_depth_bias_.constant = constant; + cur_depth_bias_.clamp = clamp; + cur_depth_bias_.slope = slope; + is_state_invalid_ = true; + } +} + +void GLES2CommandBuffer::SetBlendConstants(const GFXColor& constants) { + if (math::IsNotEqualF(cur_blend_constants_.r, constants.r) || + math::IsNotEqualF(cur_blend_constants_.g, constants.g) || + math::IsNotEqualF(cur_blend_constants_.b, constants.b) || + math::IsNotEqualF(cur_blend_constants_.a, constants.a)) { + cur_blend_constants_.r = constants.r; + cur_blend_constants_.g = constants.g; + cur_blend_constants_.b = constants.b; + cur_blend_constants_.a = constants.a; + is_state_invalid_ = true; + } +} + +void GLES2CommandBuffer::SetDepthBounds(float min_bounds, float max_bounds) { + if (math::IsNotEqualF(cur_depth_bounds_.min_bounds, min_bounds) || + math::IsNotEqualF(cur_depth_bounds_.max_bounds, max_bounds)) { + cur_depth_bounds_.min_bounds = min_bounds; + cur_depth_bounds_.max_bounds = max_bounds; + is_state_invalid_ = true; + } +} + +void GLES2CommandBuffer::SetStencilWriteMask(GFXStencilFace face, uint mask) { + if ((cur_stencil_write_mask_.face != face) || + (cur_stencil_write_mask_.write_mask != mask)) { + cur_stencil_write_mask_.face = face; + cur_stencil_write_mask_.write_mask = mask; + is_state_invalid_ = true; + } +} + +void GLES2CommandBuffer::SetStencilCompareMask(GFXStencilFace face, int ref, uint mask) { + if ((cur_stencil_compare_mask_.face != face) || + (cur_stencil_compare_mask_.refrence != ref) || + (cur_stencil_compare_mask_.compare_mask != mask)) { + cur_stencil_compare_mask_.face = face; + cur_stencil_compare_mask_.refrence = ref; + cur_stencil_compare_mask_.compare_mask = mask; + is_state_invalid_ = true; + } +} + +void GLES2CommandBuffer::Draw(GFXInputAssembler* ia) { + if ((type_ == GFXCommandBufferType::PRIMARY && is_in_render_pass_) || + (type_ == GFXCommandBufferType::SECONDARY)) { + if (is_state_invalid_) { + BindStates(); + } + + GLES2CmdDraw* cmd = gles2_allocator_->draw_cmd_pool.Alloc(); + ((GLES2InputAssembler*)ia)->ExtractCmdDraw(cmd); + cmd_package_->draw_cmds.Push(cmd); + cmd_package_->cmd_types.Push(GLES2CmdType::DRAW); + + ++num_draw_calls_; + if(cur_gpu_pso_) { + switch (cur_gpu_pso_->gl_primitive) { + case GL_TRIANGLES: { + num_tris_ += ia->index_count() / 3 * std::max(ia->instance_count(), 1U); + break; + } + case GL_TRIANGLE_STRIP: + case GL_TRIANGLE_FAN: { + num_tris_ += (ia->index_count() - 2) * std::max(ia->instance_count(), 1U); + break; + } + default: + break; + } + } + } else { + CC_LOG_ERROR("Command 'Draw' must be recorded inside a render pass."); + } +} + +void GLES2CommandBuffer::UpdateBuffer(GFXBuffer* buff, void* data, uint size, uint offset) { + if ((type_ == GFXCommandBufferType::PRIMARY && is_in_render_pass_) || + (type_ == GFXCommandBufferType::SECONDARY)) { + GLES2GPUBuffer* gpu_buffer = ((GLES2Buffer*)buff)->gpu_buffer(); + if (gpu_buffer) { + GLES2CmdUpdateBuffer* cmd = gles2_allocator_->update_buffer_cmd_pool.Alloc(); + cmd->gpu_buffer = gpu_buffer; + cmd->buffer = (uint8_t*)data; + cmd->size = size; + cmd->offset = offset; + + cmd_package_->update_buffer_cmds.Push(cmd); + cmd_package_->cmd_types.Push(GLES2CmdType::UPDATE_BUFFER); + } + } else { + CC_LOG_ERROR("Command 'UpdateBuffer' must be recorded inside a render pass."); + } +} + +void GLES2CommandBuffer::CopyBufferToTexture(GFXBuffer* src, GFXTexture* dst, GFXTextureLayout layout, GFXBufferTextureCopy* regions, uint count) { + if ((type_ == GFXCommandBufferType::PRIMARY && is_in_render_pass_) || + (type_ == GFXCommandBufferType::SECONDARY)) { + GLES2GPUBuffer* gpu_buffer = ((GLES2Buffer*)src)->gpu_buffer(); + GLES2GPUTexture* gpu_texture = ((GLES2Texture*)dst)->gpu_texture(); + if (gpu_buffer && gpu_texture) { + GLES2CmdCopyBufferToTexture* cmd = gles2_allocator_->copy_buffer_to_texture_cmd_pool.Alloc(); + cmd->gpu_buffer = gpu_buffer; + cmd->gpu_texture = gpu_texture; + cmd->dst_layout = layout; + cmd->regions.resize(count); + for (uint i = 0; i < count; ++i) { + cmd->regions[i] = regions[i]; + } + + cmd_package_->copy_buffer_to_texture_cmds.Push(cmd); + cmd_package_->cmd_types.Push(GLES2CmdType::COPY_BUFFER_TO_TEXTURE); + } + } else { + CC_LOG_ERROR("Command 'CopyBufferToTexture' must be recorded inside a render pass."); + } +} + +void GLES2CommandBuffer::Execute(GFXCommandBuffer** cmd_buffs, uint count) { + for (uint i = 0; i < count; ++i) { + GLES2CommandBuffer* cmd_buff = (GLES2CommandBuffer*)cmd_buffs[i]; + + for (uint j = 0; j < cmd_buff->cmd_package_->begin_render_pass_cmds.Size(); ++j) { + GLES2CmdBeginRenderPass* cmd = cmd_buff->cmd_package_->begin_render_pass_cmds[j]; + ++cmd->ref_count; + cmd_buff->cmd_package_->begin_render_pass_cmds.Push(cmd); + } + for (uint j = 0; j < cmd_buff->cmd_package_->bind_states_cmds.Size(); ++j) { + GLES2CmdBindStates* cmd = cmd_buff->cmd_package_->bind_states_cmds[j]; + ++cmd->ref_count; + cmd_buff->cmd_package_->bind_states_cmds.Push(cmd); + } + for (uint j = 0; j < cmd_buff->cmd_package_->draw_cmds.Size(); ++j) { + GLES2CmdDraw* cmd = cmd_buff->cmd_package_->draw_cmds[j]; + ++cmd->ref_count; + cmd_buff->cmd_package_->draw_cmds.Push(cmd); + } + for (uint j = 0; j < cmd_buff->cmd_package_->update_buffer_cmds.Size(); ++j) { + GLES2CmdUpdateBuffer* cmd = cmd_buff->cmd_package_->update_buffer_cmds[j]; + ++cmd->ref_count; + cmd_buff->cmd_package_->update_buffer_cmds.Push(cmd); + } + for (uint j = 0; j < cmd_buff->cmd_package_->copy_buffer_to_texture_cmds.Size(); ++j) { + GLES2CmdCopyBufferToTexture* cmd = cmd_buff->cmd_package_->copy_buffer_to_texture_cmds[j]; + ++cmd->ref_count; + cmd_buff->cmd_package_->copy_buffer_to_texture_cmds.Push(cmd); + } + cmd_package_->cmd_types.Concat(cmd_buff->cmd_package_->cmd_types); + + num_draw_calls_ += cmd_buff->num_draw_calls(); + num_tris_ += cmd_buff->num_tris(); + } +} + +void GLES2CommandBuffer::BindStates() { + GLES2CmdBindStates* cmd = gles2_allocator_->bind_states_cmd_pool.Alloc(); + cmd->gpu_pso = cur_gpu_pso_; + cmd->gpu_binding_layout = cur_gpu_bl_; + cmd->gpu_ia = cur_gpu_ia_; + cmd->viewport = cur_viewport_; + cmd->scissor = cur_scissor_; + cmd->line_width = cur_line_width_; + cmd->depth_bias = cur_depth_bias_; + cmd->blend_constants.r = cur_blend_constants_.r; + cmd->blend_constants.g = cur_blend_constants_.g; + cmd->blend_constants.b = cur_blend_constants_.b; + cmd->blend_constants.a = cur_blend_constants_.a; + cmd->depth_bounds = cur_depth_bounds_; + cmd->stencil_write_mask = cur_stencil_write_mask_; + cmd->stencil_compare_mask = cur_stencil_compare_mask_; + + cmd_package_->bind_states_cmds.Push(cmd); + cmd_package_->cmd_types.Push(GLES2CmdType::BIND_STATES); + is_state_invalid_ = false; +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles2/GLES2CommandBuffer.h b/native/cocos/renderer/gfx-gles2/GLES2CommandBuffer.h new file mode 100644 index 0000000000..c96b27cc1b --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2CommandBuffer.h @@ -0,0 +1,64 @@ +#ifndef CC_GFXGLES2_GLES2_COMMAND_BUFFER_H_ +#define CC_GFXGLES2_GLES2_COMMAND_BUFFER_H_ + +#include "GLES2Commands.h" + +CC_NAMESPACE_BEGIN + +class GLES2CommandAllocator; + +class CC_GLES2_API GLES2CommandBuffer : public GFXCommandBuffer { + public: + GLES2CommandBuffer(GFXDevice* device); + ~GLES2CommandBuffer(); + + friend class GLES2Queue; + + public: + bool Initialize(const GFXCommandBufferInfo& info); + void Destroy(); + + void Begin(); + void End(); + void BeginRenderPass(GFXFramebuffer* fbo, const GFXRect& render_area, GFXClearFlags clear_flags, GFXColor* colors, uint count, float depth, int stencil); + void EndRenderPass(); + void BindPipelineState(GFXPipelineState* pso); + void BindBindingLayout(GFXBindingLayout* layout); + void BindInputAssembler(GFXInputAssembler* ia); + void SetViewport(const GFXViewport& vp); + void SetScissor(const GFXRect& rect); + void SetLineWidth(const float width); + void SetDepthBias(float constant, float clamp, float slope); + void SetBlendConstants(const GFXColor& constants); + void SetDepthBounds(float min_bounds, float max_bounds); + void SetStencilWriteMask(GFXStencilFace face, uint mask); + void SetStencilCompareMask(GFXStencilFace face, int ref, uint mask); + void Draw(GFXInputAssembler* ia); + void UpdateBuffer(GFXBuffer* buff, void* data, uint size, uint offset); + void CopyBufferToTexture(GFXBuffer* src, GFXTexture* dst, GFXTextureLayout layout, GFXBufferTextureCopy* regions, uint count); + void Execute(GFXCommandBuffer** cmd_buffs, uint count); + + private: + void BindStates(); + + private: + GLES2CmdPackage* cmd_package_; + GLES2CommandAllocator* gles2_allocator_; + bool is_in_render_pass_; + GLES2GPUPipelineState* cur_gpu_pso_; + GLES2GPUBindingLayout* cur_gpu_bl_; + GLES2GPUInputAssembler* cur_gpu_ia_; + GFXViewport cur_viewport_; + GFXRect cur_scissor_; + float cur_line_width_; + GLES2DepthBias cur_depth_bias_; + GFXColor cur_blend_constants_; + GLES2DepthBounds cur_depth_bounds_; + GLES2StencilWriteMask cur_stencil_write_mask_; + GLES2StencilCompareMask cur_stencil_compare_mask_; + bool is_state_invalid_; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2CommandPool.h b/native/cocos/renderer/gfx-gles2/GLES2CommandPool.h new file mode 100644 index 0000000000..dab92d7dd4 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2CommandPool.h @@ -0,0 +1,89 @@ +#ifndef CC_GFXGLES2_GLES2_COMMAND_POOL_H_ +#define CC_GFXGLES2_GLES2_COMMAND_POOL_H_ + +#include "GLES2Commands.h" + +CC_NAMESPACE_BEGIN + +template ::value>> +class GLES2CommandPool { + public: + GLES2CommandPool(): free_cmds_(1) { + frees_ = new T*[1]; + count_ = 1; + free_idx_ = 0; + for (uint i = 0; i < count_; ++i) { + frees_[i] = CC_NEW(T); + } + } + + ~GLES2CommandPool() { + for (uint i = 0; i < count_; ++i) { + CC_DELETE(frees_[i]); + } + delete [] (frees_); + + for (uint i = 0; i < free_cmds_.Size(); ++i) { + CC_DELETE(free_cmds_[i]); + } + free_cmds_.Clear(); + } + + T* Alloc() { + if (free_idx_ < 0) { + T** old_frees = frees_; + uint size = count_ * 2; + frees_ = new T*[size]; + uint increase = size - count_; + for (uint i = 0; i < increase; ++i) { + frees_[i] = CC_NEW(T); + } + for (uint i = increase, j = 0; i < size; ++i, ++j) { + frees_[i] = old_frees[j]; + } + delete [] (old_frees); + + count_ = size; + free_idx_ += (int)increase; + } + + T* cmd = frees_[free_idx_]; + frees_[free_idx_--] = nullptr; + ++cmd->ref_count; + return cmd; + } + + void Free(T* cmd) { + if (--cmd->ref_count == 0) { + free_cmds_.Push(cmd); + } + } + + void FreeCmds(CachedArray& cmds) { + for (uint i = 0; i < cmds.Size(); ++i) { + if (--cmds[i]->ref_count == 0) { + free_cmds_.Push(cmds[i]); + } + } + cmds.Clear(); + } + + void Release() { + for (uint i = 0; i < free_cmds_.Size(); ++i) { + T* cmd = free_cmds_[i]; + cmd->Clear(); + frees_[++free_idx_] = cmd; + } + free_cmds_.Clear(); + } + + private: + T** frees_ = nullptr; + uint count_ = 0; + CachedArray free_cmds_; + int free_idx_ = 0; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2Commands.cc b/native/cocos/renderer/gfx-gles2/GLES2Commands.cc new file mode 100644 index 0000000000..19c7447079 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2Commands.cc @@ -0,0 +1,2039 @@ +#include "GLES2Std.h" +#include "GLES2Commands.h" +#include "GLES2Device.h" +#include "GLES2StateCache.h" + +#define BUFFER_OFFSET(idx) (static_cast(0) + (idx)) + +CC_NAMESPACE_BEGIN + +GLenum MapGLInternalFormat(GFXFormat format) { + switch (format) { + case GFXFormat::A8: return GL_ALPHA; + case GFXFormat::L8: return GL_LUMINANCE; + case GFXFormat::LA8: return GL_LUMINANCE_ALPHA; + case GFXFormat::R8: return GL_LUMINANCE; + case GFXFormat::R8SN: return GL_LUMINANCE; + case GFXFormat::R8UI: return GL_LUMINANCE; + case GFXFormat::R8I: return GL_LUMINANCE; + case GFXFormat::RG8: return GL_LUMINANCE_ALPHA; + case GFXFormat::RG8SN: return GL_LUMINANCE_ALPHA; + case GFXFormat::RG8UI: return GL_LUMINANCE_ALPHA; + case GFXFormat::RG8I: return GL_LUMINANCE_ALPHA; + case GFXFormat::RGB8: return GL_RGB; + case GFXFormat::RGB8SN: return GL_RGB; + case GFXFormat::RGB8UI: return GL_RGB; + case GFXFormat::RGB8I: return GL_RGB; + case GFXFormat::RGBA8: return GL_RGBA; + case GFXFormat::RGBA8SN: return GL_RGBA; + case GFXFormat::RGBA8UI: return GL_RGBA; + case GFXFormat::RGBA8I: return GL_RGBA; + case GFXFormat::R16I: return GL_LUMINANCE; + case GFXFormat::R16UI: return GL_LUMINANCE; + case GFXFormat::R16F: return GL_LUMINANCE; + case GFXFormat::RG16I: return GL_LUMINANCE_ALPHA; + case GFXFormat::RG16UI: return GL_LUMINANCE_ALPHA; + case GFXFormat::RG16F: return GL_LUMINANCE_ALPHA; + case GFXFormat::RGB16I: return GL_RGB; + case GFXFormat::RGB16UI: return GL_RGB; + case GFXFormat::RGB16F: return GL_RGB; + case GFXFormat::RGBA16I: return GL_RGBA; + case GFXFormat::RGBA16UI: return GL_RGBA; + case GFXFormat::RGBA16F: return GL_RGBA; + case GFXFormat::R32I: return GL_LUMINANCE; + case GFXFormat::R32UI: return GL_LUMINANCE; + case GFXFormat::R32F: return GL_LUMINANCE; + case GFXFormat::RG32I: return GL_LUMINANCE_ALPHA; + case GFXFormat::RG32UI: return GL_LUMINANCE_ALPHA; + case GFXFormat::RG32F: return GL_LUMINANCE_ALPHA; + case GFXFormat::RGB32I: return GL_RGB; + case GFXFormat::RGB32UI: return GL_RGB; + case GFXFormat::RGB32F: return GL_RGB; + case GFXFormat::RGBA32I: return GL_RGBA; + case GFXFormat::RGBA32UI: return GL_RGBA; + case GFXFormat::RGBA32F: return GL_RGBA; + case GFXFormat::R5G6B5: return GL_RGB565; + case GFXFormat::RGB5A1: return GL_RGB5_A1; + case GFXFormat::RGBA4: return GL_RGBA4; + case GFXFormat::RGB10A2: return GL_RGB; + case GFXFormat::RGB10A2UI: return GL_RGB; + case GFXFormat::R11G11B10F: return GL_RGB; + case GFXFormat::D16: return GL_DEPTH_COMPONENT; + case GFXFormat::D16S8: return GL_DEPTH_STENCIL_OES; + case GFXFormat::D24: return GL_DEPTH_COMPONENT; + case GFXFormat::D24S8: return GL_DEPTH_STENCIL_OES; + case GFXFormat::D32F: return GL_DEPTH_COMPONENT; + case GFXFormat::D32F_S8: return GL_DEPTH_STENCIL_OES; + + case GFXFormat::BC1: return GL_COMPRESSED_RGB_S3TC_DXT1_EXT; + case GFXFormat::BC1_ALPHA: return GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; + case GFXFormat::BC1_SRGB: return GL_COMPRESSED_SRGB_S3TC_DXT1_EXT; + case GFXFormat::BC1_SRGB_ALPHA: return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT; + case GFXFormat::BC2: return GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; + case GFXFormat::BC2_SRGB: return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT; + case GFXFormat::BC3: return GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; + case GFXFormat::BC3_SRGB: return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT; + + case GFXFormat::ETC_RGB8: return GL_ETC1_RGB8_OES; + + case GFXFormat::PVRTC_RGB2: return GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG; + case GFXFormat::PVRTC_RGBA2: return GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; + case GFXFormat::PVRTC_RGB4: return GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG; + case GFXFormat::PVRTC_RGBA4: return GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; + + default: { + CC_ASSERTS(false, "Unsupported GFXFormat, convert to GL internal format failed."); + return GL_RGBA; + } + } +} + +GLenum MapGLFormat(GFXFormat format) { + switch (format) { + case GFXFormat::A8: return GL_ALPHA; + case GFXFormat::L8: return GL_LUMINANCE; + case GFXFormat::LA8: return GL_LUMINANCE_ALPHA; + case GFXFormat::R8: + case GFXFormat::R8SN: + case GFXFormat::R8UI: + case GFXFormat::R8I: return GL_LUMINANCE; + case GFXFormat::RG8: + case GFXFormat::RG8SN: + case GFXFormat::RG8UI: + case GFXFormat::RG8I: return GL_LUMINANCE_ALPHA; + case GFXFormat::RGB8: + case GFXFormat::RGB8SN: + case GFXFormat::RGB8UI: + case GFXFormat::RGB8I: return GL_RGB; + case GFXFormat::RGBA8: + case GFXFormat::RGBA8SN: + case GFXFormat::RGBA8UI: + case GFXFormat::RGBA8I: return GL_RGBA; + case GFXFormat::R16UI: + case GFXFormat::R16I: + case GFXFormat::R16F: return GL_LUMINANCE; + case GFXFormat::RG16UI: + case GFXFormat::RG16I: + case GFXFormat::RG16F: return GL_LUMINANCE_ALPHA; + case GFXFormat::RGB16UI: + case GFXFormat::RGB16I: + case GFXFormat::RGB16F: return GL_RGB; + case GFXFormat::RGBA16UI: + case GFXFormat::RGBA16I: + case GFXFormat::RGBA16F: return GL_RGBA; + case GFXFormat::R32UI: + case GFXFormat::R32I: + case GFXFormat::R32F: return GL_LUMINANCE; + case GFXFormat::RG32UI: + case GFXFormat::RG32I: + case GFXFormat::RG32F: return GL_LUMINANCE_ALPHA; + case GFXFormat::RGB32UI: + case GFXFormat::RGB32I: + case GFXFormat::RGB32F: return GL_RGB; + case GFXFormat::RGBA32UI: + case GFXFormat::RGBA32I: + case GFXFormat::RGBA32F: return GL_RGBA; + case GFXFormat::RGB10A2: return GL_RGBA; + case GFXFormat::R11G11B10F: return GL_RGB; + case GFXFormat::R5G6B5: return GL_RGB; + case GFXFormat::RGB5A1: return GL_RGBA; + case GFXFormat::RGBA4: return GL_RGBA; + case GFXFormat::D16: return GL_DEPTH_COMPONENT; + case GFXFormat::D16S8: return GL_DEPTH_STENCIL_OES; + case GFXFormat::D24: return GL_DEPTH_COMPONENT; + case GFXFormat::D24S8: return GL_DEPTH_STENCIL_OES; + case GFXFormat::D32F: return GL_DEPTH_COMPONENT; + case GFXFormat::D32F_S8: return GL_DEPTH_STENCIL_OES; + + case GFXFormat::BC1: return GL_COMPRESSED_RGB_S3TC_DXT1_EXT; + case GFXFormat::BC1_ALPHA: return GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; + case GFXFormat::BC1_SRGB: return GL_COMPRESSED_SRGB_S3TC_DXT1_EXT; + case GFXFormat::BC1_SRGB_ALPHA: return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT; + case GFXFormat::BC2: return GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; + case GFXFormat::BC2_SRGB: return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT; + case GFXFormat::BC3: return GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; + case GFXFormat::BC3_SRGB: return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT; + + case GFXFormat::ETC_RGB8: return GL_ETC1_RGB8_OES; + + case GFXFormat::PVRTC_RGB2: return GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG; + case GFXFormat::PVRTC_RGBA2: return GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; + case GFXFormat::PVRTC_RGB4: return GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG; + case GFXFormat::PVRTC_RGBA4: return GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; + + default: { + CC_ASSERTS(false, "Unsupported GFXFormat, convert to WebGL format failed."); + return GL_RGBA; + } + } +} + +GLenum MapGLType(GFXType type) { + switch (type) { + case GFXType::BOOL: return GL_BOOL; + case GFXType::BOOL2: return GL_BOOL_VEC2; + case GFXType::BOOL3: return GL_BOOL_VEC3; + case GFXType::BOOL4: return GL_BOOL_VEC4; + case GFXType::INT: return GL_INT; + case GFXType::INT2: return GL_INT_VEC2; + case GFXType::INT3: return GL_INT_VEC3; + case GFXType::INT4: return GL_INT_VEC4; + case GFXType::UINT: return GL_UNSIGNED_INT; + case GFXType::FLOAT: return GL_FLOAT; + case GFXType::FLOAT2: return GL_FLOAT_VEC2; + case GFXType::FLOAT3: return GL_FLOAT_VEC3; + case GFXType::FLOAT4: return GL_FLOAT_VEC4; + case GFXType::MAT2: return GL_FLOAT_MAT2; + case GFXType::MAT3: return GL_FLOAT_MAT3; + case GFXType::MAT4: return GL_FLOAT_MAT4; + case GFXType::SAMPLER2D: return GL_SAMPLER_2D; + case GFXType::SAMPLER3D: return GL_SAMPLER_3D_OES; + case GFXType::SAMPLER_CUBE: return GL_SAMPLER_CUBE; + default: { + CC_ASSERTS(false, "Unsupported GLType, convert to GL type failed."); + return GL_NONE; + } + } +} + +GFXType MapGFXType(GLenum gl_type) { + switch (gl_type) { + case GL_BOOL: return GFXType::BOOL; + case GL_BOOL_VEC2: return GFXType::BOOL2; + case GL_BOOL_VEC3: return GFXType::BOOL3; + case GL_BOOL_VEC4: return GFXType::BOOL4; + case GL_INT: return GFXType::INT; + case GL_INT_VEC2: return GFXType::INT2; + case GL_INT_VEC3: return GFXType::INT3; + case GL_INT_VEC4: return GFXType::INT4; + case GL_UNSIGNED_INT: return GFXType::UINT; + case GL_FLOAT: return GFXType::FLOAT; + case GL_FLOAT_VEC2: return GFXType::FLOAT2; + case GL_FLOAT_VEC3: return GFXType::FLOAT3; + case GL_FLOAT_VEC4: return GFXType::FLOAT4; + case GL_FLOAT_MAT2: return GFXType::MAT2; + case GL_FLOAT_MAT3: return GFXType::MAT3; + case GL_FLOAT_MAT4: return GFXType::MAT4; + case GL_SAMPLER_2D: return GFXType::SAMPLER2D; + case GL_SAMPLER_3D_OES: return GFXType::SAMPLER3D; + case GL_SAMPLER_CUBE: return GFXType::SAMPLER_CUBE; + default: { + CC_ASSERTS(false, "Unsupported GLType, convert to GFXType failed."); + return GFXType::UNKNOWN; + } + } +} + +GLenum GFXFormatToGLType(GFXFormat format) { + switch (format) { + case GFXFormat::R8: return GL_UNSIGNED_BYTE; + case GFXFormat::R8SN: return GL_BYTE; + case GFXFormat::R8UI: return GL_UNSIGNED_BYTE; + case GFXFormat::R8I: return GL_BYTE; + case GFXFormat::R16UI: return GL_UNSIGNED_SHORT; + case GFXFormat::R16I: return GL_SHORT; + case GFXFormat::R32F: return GL_FLOAT; + case GFXFormat::R32UI: return GL_UNSIGNED_INT; + case GFXFormat::R32I: return GL_INT; + + case GFXFormat::RG8: return GL_UNSIGNED_BYTE; + case GFXFormat::RG8SN: return GL_BYTE; + case GFXFormat::RG8UI: return GL_UNSIGNED_BYTE; + case GFXFormat::RG8I: return GL_BYTE; + case GFXFormat::RG16UI: return GL_UNSIGNED_SHORT; + case GFXFormat::RG16I: return GL_SHORT; + case GFXFormat::RG32F: return GL_FLOAT; + case GFXFormat::RG32UI: return GL_UNSIGNED_INT; + case GFXFormat::RG32I: return GL_INT; + + case GFXFormat::RGB8: return GL_UNSIGNED_BYTE; + case GFXFormat::SRGB8: return GL_UNSIGNED_BYTE; + case GFXFormat::RGB8SN: return GL_BYTE; + case GFXFormat::RGB8UI: return GL_UNSIGNED_BYTE; + case GFXFormat::RGB8I: return GL_BYTE; + case GFXFormat::RGB16F: return GL_HALF_FLOAT_OES; + case GFXFormat::RGB16UI: return GL_UNSIGNED_SHORT; + case GFXFormat::RGB16I: return GL_SHORT; + case GFXFormat::RGB32F: return GL_FLOAT; + case GFXFormat::RGB32UI: return GL_UNSIGNED_INT; + case GFXFormat::RGB32I: return GL_INT; + + case GFXFormat::RGBA8: return GL_UNSIGNED_BYTE; + case GFXFormat::SRGB8_A8: return GL_UNSIGNED_BYTE; + case GFXFormat::RGBA8SN: return GL_BYTE; + case GFXFormat::RGBA8UI: return GL_UNSIGNED_BYTE; + case GFXFormat::RGBA8I: return GL_BYTE; + case GFXFormat::RGBA16F: return GL_HALF_FLOAT_OES; + case GFXFormat::RGBA16UI: return GL_UNSIGNED_SHORT; + case GFXFormat::RGBA16I: return GL_SHORT; + case GFXFormat::RGBA32F: return GL_FLOAT; + case GFXFormat::RGBA32UI: return GL_UNSIGNED_INT; + case GFXFormat::RGBA32I: return GL_INT; + + case GFXFormat::R5G6B5: return GL_UNSIGNED_SHORT_5_6_5; + case GFXFormat::R11G11B10F: return GL_FLOAT; + case GFXFormat::RGB5A1: return GL_UNSIGNED_SHORT_5_5_5_1; + case GFXFormat::RGBA4: return GL_UNSIGNED_SHORT_4_4_4_4; + case GFXFormat::RGB10A2: return GL_UNSIGNED_BYTE; + case GFXFormat::RGB10A2UI: return GL_UNSIGNED_INT; + case GFXFormat::RGB9E5: return GL_FLOAT; + + case GFXFormat::D16: return GL_UNSIGNED_SHORT; + case GFXFormat::D16S8: return GL_UNSIGNED_SHORT; + case GFXFormat::D24: return GL_UNSIGNED_INT; + case GFXFormat::D24S8: return GL_UNSIGNED_INT_24_8_OES; + case GFXFormat::D32F: return GL_FLOAT; + + case GFXFormat::BC1: return GL_UNSIGNED_BYTE; + case GFXFormat::BC1_SRGB: return GL_UNSIGNED_BYTE; + case GFXFormat::BC2: return GL_UNSIGNED_BYTE; + case GFXFormat::BC2_SRGB: return GL_UNSIGNED_BYTE; + case GFXFormat::BC3: return GL_UNSIGNED_BYTE; + case GFXFormat::BC3_SRGB: return GL_UNSIGNED_BYTE; + case GFXFormat::BC4: return GL_UNSIGNED_BYTE; + case GFXFormat::BC4_SNORM: return GL_BYTE; + case GFXFormat::BC5: return GL_UNSIGNED_BYTE; + case GFXFormat::BC5_SNORM: return GL_BYTE; + case GFXFormat::BC6H_SF16: return GL_FLOAT; + case GFXFormat::BC6H_UF16: return GL_FLOAT; + case GFXFormat::BC7: return GL_UNSIGNED_BYTE; + case GFXFormat::BC7_SRGB: return GL_UNSIGNED_BYTE; + + case GFXFormat::ETC_RGB8: return GL_UNSIGNED_BYTE; + case GFXFormat::ETC2_RGB8: return GL_UNSIGNED_BYTE; + case GFXFormat::ETC2_SRGB8: return GL_UNSIGNED_BYTE; + case GFXFormat::ETC2_RGB8_A1: return GL_UNSIGNED_BYTE; + case GFXFormat::ETC2_SRGB8_A1: return GL_UNSIGNED_BYTE; + case GFXFormat::EAC_R11: return GL_UNSIGNED_BYTE; + case GFXFormat::EAC_R11SN: return GL_BYTE; + case GFXFormat::EAC_RG11: return GL_UNSIGNED_BYTE; + case GFXFormat::EAC_RG11SN: return GL_BYTE; + + case GFXFormat::PVRTC_RGB2: return GL_UNSIGNED_BYTE; + case GFXFormat::PVRTC_RGBA2: return GL_UNSIGNED_BYTE; + case GFXFormat::PVRTC_RGB4: return GL_UNSIGNED_BYTE; + case GFXFormat::PVRTC_RGBA4: return GL_UNSIGNED_BYTE; + case GFXFormat::PVRTC2_2BPP: return GL_UNSIGNED_BYTE; + case GFXFormat::PVRTC2_4BPP: return GL_UNSIGNED_BYTE; + + default: { + return GL_UNSIGNED_BYTE; + } + } +} + +uint GLTypeSize(GLenum gl_type) { + switch (gl_type) { + case GL_BOOL: return 4; + case GL_BOOL_VEC2: return 8; + case GL_BOOL_VEC3: return 12; + case GL_BOOL_VEC4: return 16; + case GL_INT: return 4; + case GL_INT_VEC2: return 8; + case GL_INT_VEC3: return 12; + case GL_INT_VEC4: return 16; + case GL_UNSIGNED_INT: return 4; + case GL_FLOAT: return 4; + case GL_FLOAT_VEC2: return 8; + case GL_FLOAT_VEC3: return 12; + case GL_FLOAT_VEC4: return 16; + case GL_FLOAT_MAT2: return 16; + case GL_FLOAT_MAT3: return 36; + case GL_FLOAT_MAT4: return 64; + case GL_SAMPLER_2D: return 4; + case GL_SAMPLER_3D_OES: return 4; + case GL_SAMPLER_CUBE: return 4; + case GL_SAMPLER_CUBE_MAP_ARRAY_OES: return 4; + case GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_OES: return 4; + case GL_INT_SAMPLER_CUBE_MAP_ARRAY_OES: return 4; + case GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_OES: return 4; + default: { + CC_ASSERTS(false, "Unsupported GLType, get type failed."); + return 0; + } + } +} + +uint GLComponentCount (GLenum gl_type) { + switch (gl_type) { + case GL_FLOAT_MAT2: return 2; + case GL_FLOAT_MAT3: return 3; + case GL_FLOAT_MAT4: return 4; + default: { + return 1; + } + } +} + +const GLenum GLES3_WRAPS[] = { + GL_REPEAT, + GL_MIRRORED_REPEAT, + GL_CLAMP_TO_EDGE, + GL_CLAMP_TO_EDGE, +}; + +const GLenum GLES2_CMP_FUNCS[] = { + GL_NEVER, + GL_LESS, + GL_EQUAL, + GL_LEQUAL, + GL_GREATER, + GL_NOTEQUAL, + GL_GEQUAL, + GL_ALWAYS, +}; + +const GLenum GLES2_STENCIL_OPS[] = { + GL_ZERO, + GL_KEEP, + GL_REPLACE, + GL_INCR, + GL_DECR, + GL_INVERT, + GL_INCR_WRAP, + GL_DECR_WRAP, +}; + +const GLenum GLES2_BLEND_OPS[] = { + GL_FUNC_ADD, + GL_FUNC_SUBTRACT, + GL_FUNC_REVERSE_SUBTRACT, + GL_FUNC_ADD, + GL_FUNC_ADD, +}; + +const GLenum GLES2_BLEND_FACTORS[] = { + GL_ZERO, + GL_ONE, + GL_SRC_ALPHA, + GL_DST_ALPHA, + GL_ONE_MINUS_SRC_ALPHA, + GL_ONE_MINUS_DST_ALPHA, + GL_SRC_COLOR, + GL_DST_COLOR, + GL_ONE_MINUS_SRC_COLOR, + GL_ONE_MINUS_DST_COLOR, + GL_SRC_ALPHA_SATURATE, + GL_CONSTANT_COLOR, + GL_ONE_MINUS_CONSTANT_COLOR, + GL_CONSTANT_ALPHA, + GL_ONE_MINUS_CONSTANT_ALPHA, +}; + +void GLES2CmdFuncCreateBuffer(GLES2Device* device, GLES2GPUBuffer* gpu_buffer) { + GLenum gl_usage = (gpu_buffer->mem_usage & GFXMemoryUsageBit::HOST ? GL_DYNAMIC_DRAW : GL_STATIC_DRAW); + + if (gpu_buffer->usage & GFXBufferUsageBit::VERTEX) { + gpu_buffer->gl_target = GL_ARRAY_BUFFER; + glGenBuffers(1, &gpu_buffer->gl_buffer); + if (gpu_buffer->size) { + if (device->use_vao()) { + if (device->state_cache->gl_vao) { + glBindVertexArrayOES(0); + device->state_cache->gl_vao = 0; + } + } + + if (device->state_cache->gl_array_buffer != gpu_buffer->gl_buffer) { + glBindBuffer(GL_ARRAY_BUFFER, gpu_buffer->gl_buffer); + } + + glBufferData(GL_ARRAY_BUFFER, gpu_buffer->size, nullptr, gl_usage); + glBindBuffer(GL_ARRAY_BUFFER, 0); + device->state_cache->gl_array_buffer = 0; + } + } else if (gpu_buffer->usage & GFXBufferUsageBit::INDEX) { + gpu_buffer->gl_target = GL_ELEMENT_ARRAY_BUFFER; + glGenBuffers(1, &gpu_buffer->gl_buffer); + if (gpu_buffer->size) { + if (device->use_vao()) { + if (device->state_cache->gl_vao) { + glBindVertexArrayOES(0); + device->state_cache->gl_vao = 0; + } + } + + if (device->state_cache->gl_element_array_buffer != gpu_buffer->gl_buffer) { + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, gpu_buffer->gl_buffer); + } + + glBufferData(GL_ELEMENT_ARRAY_BUFFER, gpu_buffer->size, nullptr, gl_usage); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + device->state_cache->gl_element_array_buffer = 0; + } + } else if (gpu_buffer->usage & GFXBufferUsageBit::UNIFORM) { + gpu_buffer->buffer = (uint8_t*)CC_MALLOC(gpu_buffer->size); + gpu_buffer->gl_target = GL_NONE; + } else if (gpu_buffer->usage & GFXBufferUsageBit::INDIRECT){ + gpu_buffer->indirect_buff.draws.resize(gpu_buffer->count); + gpu_buffer->gl_target = GL_NONE; + } else if ((gpu_buffer->usage & GFXBufferUsageBit::TRANSFER_DST) || + (gpu_buffer->usage & GFXBufferUsageBit::TRANSFER_SRC)) { + gpu_buffer->gl_target = GL_NONE; + } else { + CC_ASSERTS(false, "Unsupported GFXBufferType, create buffer failed.") + gpu_buffer->gl_target = GL_NONE; + } +} + +void GLES2CmdFuncDestroyBuffer(GLES2Device* device, GLES2GPUBuffer* gpu_buffer) { + if (gpu_buffer->gl_buffer) { + glDeleteBuffers(1, &gpu_buffer->gl_buffer); + gpu_buffer->gl_buffer = 0; + } + + CC_SAFE_FREE(gpu_buffer->buffer); +} + +void GLES2CmdFuncResizeBuffer(GLES2Device* device, GLES2GPUBuffer* gpu_buffer) { + GLenum gl_usage = (gpu_buffer->mem_usage & GFXMemoryUsageBit::HOST ? GL_DYNAMIC_DRAW : GL_STATIC_DRAW); + + if (gpu_buffer->usage & GFXBufferUsageBit::VERTEX) { + gpu_buffer->gl_target = GL_ARRAY_BUFFER; + if (gpu_buffer->size) { + if (device->use_vao()) { + if (device->state_cache->gl_vao) { + glBindVertexArrayOES(0); + device->state_cache->gl_vao = 0; + } + } + + if (device->state_cache->gl_array_buffer != gpu_buffer->gl_buffer) { + glBindBuffer(GL_ARRAY_BUFFER, gpu_buffer->gl_buffer); + } + + glBufferData(GL_ARRAY_BUFFER, gpu_buffer->size, nullptr, gl_usage); + glBindBuffer(GL_ARRAY_BUFFER, 0); + device->state_cache->gl_array_buffer = 0; + } + } else if (gpu_buffer->usage & GFXBufferUsageBit::INDEX) { + gpu_buffer->gl_target = GL_ELEMENT_ARRAY_BUFFER; + if (gpu_buffer->size) { + if (device->use_vao()) { + if (device->state_cache->gl_vao) { + glBindVertexArrayOES(0); + device->state_cache->gl_vao = 0; + } + } + + if (device->state_cache->gl_element_array_buffer != gpu_buffer->gl_buffer) { + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, gpu_buffer->gl_buffer); + } + + glBufferData(GL_ELEMENT_ARRAY_BUFFER, gpu_buffer->size, nullptr, gl_usage); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + device->state_cache->gl_element_array_buffer = 0; + } + } else if (gpu_buffer->usage & GFXBufferUsageBit::UNIFORM) { + if (gpu_buffer->buffer) { + CC_FREE(gpu_buffer->buffer); + } + gpu_buffer->buffer = (uint8_t*)CC_MALLOC(gpu_buffer->size); + gpu_buffer->gl_target = GL_NONE; + } else if (gpu_buffer->usage & GFXBufferUsageBit::INDIRECT) { + gpu_buffer->indirect_buff.draws.resize(gpu_buffer->count); + gpu_buffer->gl_target = GL_NONE; + } else if ((gpu_buffer->usage & GFXBufferUsageBit::TRANSFER_DST) || + (gpu_buffer->usage & GFXBufferUsageBit::TRANSFER_SRC)) { + gpu_buffer->gl_target = GL_NONE; + } else { + CC_ASSERTS(false, "Unsupported GFXBufferType, resize buffer failed.") + gpu_buffer->gl_target = GL_NONE; + } +} + +void GLES2CmdFuncUpdateBuffer(GLES2Device* device, GLES2GPUBuffer* gpu_buffer, void* buffer, uint offset, uint size) { + if (gpu_buffer->usage & GFXBufferUsageBit::UNIFORM) { + memcpy(gpu_buffer->buffer + offset, buffer, size); + } else if (gpu_buffer->usage & GFXBufferUsageBit::INDIRECT) { + memcpy((uint8_t*)gpu_buffer->indirect_buff.draws.data() + offset, buffer, size); + } else { + switch (gpu_buffer->gl_target) { + case GL_ARRAY_BUFFER: { + if (device->state_cache->gl_vao) { + glBindVertexArrayOES(0); + device->state_cache->gl_vao = 0; + } + if (device->state_cache->gl_array_buffer != gpu_buffer->gl_buffer) { + glBindBuffer(GL_ARRAY_BUFFER, gpu_buffer->gl_buffer); + device->state_cache->gl_array_buffer = gpu_buffer->gl_buffer; + } + glBufferSubData(GL_ARRAY_BUFFER, offset, size, buffer); + break; + } + case GL_ELEMENT_ARRAY_BUFFER: { + if (device->state_cache->gl_vao) { + glBindVertexArrayOES(0); + device->state_cache->gl_vao = 0; + } + if (device->state_cache->gl_element_array_buffer != gpu_buffer->gl_buffer) { + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, gpu_buffer->gl_buffer); + device->state_cache->gl_element_array_buffer = gpu_buffer->gl_buffer; + } + glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, offset, size, buffer); + break; + } + default: + CC_ASSERTS(false, "Unsupported GFXBufferType, update buffer failed.") + break; + } + } +} + +void GLES2CmdFuncCreateTexture(GLES2Device* device, GLES2GPUTexture* gpu_texture) { + gpu_texture->gl_internal_fmt = MapGLInternalFormat(gpu_texture->format); + gpu_texture->gl_format = MapGLFormat(gpu_texture->format); + gpu_texture->gl_type = GFXFormatToGLType(gpu_texture->format); + + switch (gpu_texture->view_type) { + case GFXTextureViewType::TV2D: { + gpu_texture->view_type = GFXTextureViewType::TV2D; + gpu_texture->gl_target = GL_TEXTURE_2D; + glGenTextures(1, &gpu_texture->gl_texture); + if (gpu_texture->size > 0) { + GLuint gl_texture = device->state_cache->gl_textures[device->state_cache->tex_uint]; + if (gpu_texture->gl_texture != gl_texture) { + glBindTexture(GL_TEXTURE_2D, gl_texture); + gpu_texture->gl_texture = gl_texture; + } + uint w = gpu_texture->width; + uint h = gpu_texture->height; + if (!GFX_FORMAT_INFOS[(int)gpu_texture->format].is_compressed) { + for (uint i = 0; i < gpu_texture->mip_level; ++i) { + glTexImage2D(GL_TEXTURE_2D, i, gpu_texture->gl_internal_fmt, w, h, 0, gpu_texture->gl_format, gpu_texture->gl_type, nullptr); + w = std::max(1U, w >> 1); + h = std::max(1U, w >> 1); + } + } else { + for (uint i = 0; i < gpu_texture->mip_level; ++i) { + uint img_size = GFXFormatSize(gpu_texture->format, w, h, 1); + glCompressedTexImage2D(GL_TEXTURE_2D, i, gpu_texture->gl_internal_fmt, w, h, 0, img_size, nullptr); + w = std::max(1U, w >> 1); + h = std::max(1U, w >> 1); + } + } + } + break; + } + case GFXTextureViewType::CUBE: { + gpu_texture->view_type = GFXTextureViewType::CUBE; + gpu_texture->gl_target = GL_TEXTURE_CUBE_MAP; + glGenTextures(1, &gpu_texture->gl_texture); + if (gpu_texture->size > 0) { + GLuint gl_texture = device->state_cache->gl_textures[device->state_cache->tex_uint]; + if (gpu_texture->gl_texture != gl_texture) { + glBindTexture(GL_TEXTURE_CUBE_MAP, gl_texture); + gpu_texture->gl_texture = gl_texture; + } + if (!GFX_FORMAT_INFOS[(int)gpu_texture->format].is_compressed) { + for (uint f = 0; f < 6; ++f) { + uint w = gpu_texture->width; + uint h = gpu_texture->height; + for (uint i = 0; i < gpu_texture->mip_level; ++i) { + glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + f, i, gpu_texture->gl_internal_fmt, w, h, 0, gpu_texture->gl_format, gpu_texture->gl_type, nullptr); + w = std::max(1U, w >> 1); + h = std::max(1U, w >> 1); + } + } + } else { + for (uint f = 0; f < 6; ++f) { + uint w = gpu_texture->width; + uint h = gpu_texture->height; + for (uint i = 0; i < gpu_texture->mip_level; ++i) { + uint img_size = GFXFormatSize(gpu_texture->format, w, h, 1); + glCompressedTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + f, i, gpu_texture->gl_internal_fmt, w, h, 0, img_size, nullptr); + w = std::max(1U, w >> 1); + h = std::max(1U, w >> 1); + } + } + } + } + break; + } + default: + CC_ASSERTS(false, "Unsupported GFXTextureType, create texture failed."); + break; + } +} + +void GLES2CmdFuncDestroyTexture(GLES2Device* device, GLES2GPUTexture* gpu_texture) { + if (gpu_texture->gl_texture) { + glDeleteTextures(1, &gpu_texture->gl_texture); + gpu_texture->gl_texture = 0; + } +} + +void GLES2CmdFuncResizeTexture(GLES2Device* device, GLES2GPUTexture* gpu_texture) { + gpu_texture->gl_internal_fmt = MapGLInternalFormat(gpu_texture->format); + gpu_texture->gl_format = MapGLFormat(gpu_texture->format); + gpu_texture->gl_type = GFXFormatToGLType(gpu_texture->format); + + switch (gpu_texture->view_type) { + case GFXTextureViewType::TV2D: { + gpu_texture->view_type = GFXTextureViewType::TV2D; + gpu_texture->gl_target = GL_TEXTURE_2D; + if (gpu_texture->size > 0) { + GLuint gl_texture = device->state_cache->gl_textures[device->state_cache->tex_uint]; + if (gpu_texture->gl_texture != gl_texture) { + glBindTexture(GL_TEXTURE_2D, gl_texture); + gpu_texture->gl_texture = gl_texture; + } + uint w = gpu_texture->width; + uint h = gpu_texture->height; + if (!GFX_FORMAT_INFOS[(int)gpu_texture->format].is_compressed) { + for (uint i = 0; i < gpu_texture->mip_level; ++i) { + glTexImage2D(GL_TEXTURE_2D, i, gpu_texture->gl_internal_fmt, w, h, 0, gpu_texture->gl_format, gpu_texture->gl_type, nullptr); + w = std::max(1U, w >> 1); + h = std::max(1U, w >> 1); + } + } else { + for (uint i = 0; i < gpu_texture->mip_level; ++i) { + uint img_size = GFXFormatSize(gpu_texture->format, w, h, 1); + glCompressedTexImage2D(GL_TEXTURE_2D, i, gpu_texture->gl_internal_fmt, w, h, 0, img_size, nullptr); + w = std::max(1U, w >> 1); + h = std::max(1U, w >> 1); + } + } + } + break; + } + case GFXTextureViewType::CUBE: { + gpu_texture->view_type = GFXTextureViewType::CUBE; + gpu_texture->gl_target = GL_TEXTURE_CUBE_MAP; + if (gpu_texture->size > 0) { + GLuint gl_texture = device->state_cache->gl_textures[device->state_cache->tex_uint]; + if (gpu_texture->gl_texture != gl_texture) { + glBindTexture(GL_TEXTURE_CUBE_MAP, gl_texture); + gpu_texture->gl_texture = gl_texture; + } + if (!GFX_FORMAT_INFOS[(int)gpu_texture->format].is_compressed) { + for (uint f = 0; f < 6; ++f) { + uint w = gpu_texture->width; + uint h = gpu_texture->height; + for (uint i = 0; i < gpu_texture->mip_level; ++i) { + glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + f, i, gpu_texture->gl_internal_fmt, w, h, 0, gpu_texture->gl_format, gpu_texture->gl_type, nullptr); + w = std::max(1U, w >> 1); + h = std::max(1U, w >> 1); + } + } + } else { + for (uint f = 0; f < 6; ++f) { + uint w = gpu_texture->width; + uint h = gpu_texture->height; + for (uint i = 0; i < gpu_texture->mip_level; ++i) { + uint img_size = GFXFormatSize(gpu_texture->format, w, h, 1); + glCompressedTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + f, i, gpu_texture->gl_internal_fmt, w, h, 0, img_size, nullptr); + w = std::max(1U, w >> 1); + h = std::max(1U, w >> 1); + } + } + } + } + break; + } + default: + CC_ASSERTS(false, "Unsupported GFXTextureType, resize texture failed."); + break; + } +} + +void GLES2CmdFuncCreateSampler(GLES2Device* device, GLES2GPUSampler* gpu_sampler) { + if (gpu_sampler->min_filter == GFXFilter::LINEAR || gpu_sampler->min_filter == GFXFilter::ANISOTROPIC) { + if (gpu_sampler->mip_filter == GFXFilter::LINEAR || gpu_sampler->mip_filter == GFXFilter::ANISOTROPIC) { + gpu_sampler->gl_min_filter = GL_LINEAR_MIPMAP_LINEAR; + } else if (gpu_sampler->mip_filter == GFXFilter::POINT) { + gpu_sampler->gl_min_filter = GL_LINEAR_MIPMAP_NEAREST; + } else { + gpu_sampler->gl_min_filter = GL_LINEAR; + } + } else { + if (gpu_sampler->mip_filter == GFXFilter::LINEAR || gpu_sampler->mip_filter == GFXFilter::ANISOTROPIC) { + gpu_sampler->gl_min_filter = GL_NEAREST_MIPMAP_LINEAR; + } else if (gpu_sampler->mip_filter == GFXFilter::POINT) { + gpu_sampler->gl_min_filter = GL_NEAREST_MIPMAP_NEAREST; + } else { + gpu_sampler->gl_min_filter = GL_NEAREST; + } + } + + if (gpu_sampler->mag_filter == GFXFilter::LINEAR || gpu_sampler->mag_filter == GFXFilter::ANISOTROPIC) { + gpu_sampler->gl_mag_filter = GL_LINEAR; + } else { + gpu_sampler->gl_mag_filter = GL_NEAREST; + } + + gpu_sampler->gl_wrap_s = GLES3_WRAPS[(int)gpu_sampler->address_u]; + gpu_sampler->gl_wrap_t = GLES3_WRAPS[(int)gpu_sampler->address_v]; + gpu_sampler->gl_wrap_r = GLES3_WRAPS[(int)gpu_sampler->address_w]; +} + +void GLES2CmdFuncDestroySampler(GLES2Device* device, GLES2GPUSampler* gpu_sampler) { +} + +void GLES2CmdFuncCreateShader(GLES2Device* device, GLES2GPUShader* gpu_shader) { + GLenum gl_shader_type = 0; + String shader_type_str; + GLint status; + + for (size_t i = 0; i < gpu_shader->gpu_stages.size(); ++i) { + GLES2GPUShaderStage& gpu_stage = gpu_shader->gpu_stages[i]; + + switch (gpu_stage.type) { + case GFXShaderType::VERTEX: { + gl_shader_type = GL_VERTEX_SHADER; + shader_type_str = "Vertex Shader"; + break; + } + case GFXShaderType::FRAGMENT: { + gl_shader_type = GL_FRAGMENT_SHADER; + shader_type_str = "Fragment Shader"; + break; + } + default: { + CC_ASSERTS(false, "Unsupported GFXShaderType"); + return; + } + } + + gpu_stage.gl_shader = glCreateShader(gl_shader_type); + const char* shader_src = gpu_stage.source.c_str(); + glShaderSource(gpu_stage.gl_shader, 1, (const GLchar**)&shader_src, nullptr); + glCompileShader(gpu_stage.gl_shader); + + glGetShaderiv(gpu_stage.gl_shader, GL_COMPILE_STATUS, &status); + if (status != 1) { + GLint log_size = 0; + glGetShaderiv(gpu_stage.gl_shader, GL_INFO_LOG_LENGTH, &log_size); + + ++log_size; + GLchar* logs = (GLchar*)CC_MALLOC(log_size); + glGetShaderInfoLog(gpu_stage.gl_shader, log_size, nullptr, logs); + + CC_LOG_ERROR("%s in %s compilation failed.", shader_type_str.c_str(), gpu_shader->name.c_str()); + CC_LOG_ERROR("Shader source:", gpu_stage.source.c_str()); + CC_LOG_ERROR(logs); + + glDeleteShader(gpu_stage.gl_shader); + gpu_stage.gl_shader = 0; + return; + } + } + + gpu_shader->gl_program = glCreateProgram(); + + // link program + for (size_t i = 0; i < gpu_shader->gpu_stages.size(); ++i) { + GLES2GPUShaderStage& gpu_stage = gpu_shader->gpu_stages[i]; + glAttachShader(gpu_shader->gl_program, gpu_stage.gl_shader); + } + + glLinkProgram(gpu_shader->gl_program); + glGetProgramiv(gpu_shader->gl_program, GL_LINK_STATUS, &status); + if (status != 1) { + CC_LOG_ERROR("Failed to link Shader [%s].", gpu_shader->name.c_str()); + GLint log_size = 0; + glGetProgramiv(gpu_shader->gl_program, GL_INFO_LOG_LENGTH, &log_size); + if (log_size) { + ++log_size; + GLchar* logs = (GLchar*)CC_MALLOC(log_size); + glGetProgramInfoLog(gpu_shader->gl_program, log_size, nullptr, logs); + + CC_LOG_ERROR("Failed to link shader '%s'.", gpu_shader->name.c_str()); + CC_LOG_ERROR(logs); + + for (size_t i = 0; i < gpu_shader->gpu_stages.size(); ++i) { + GLES2GPUShaderStage& gpu_stage = gpu_shader->gpu_stages[i]; + glDeleteShader(gpu_stage.gl_shader); + gpu_stage.gl_shader = 0; + } + return; + } + } + + CC_LOG_INFO("Shader '%s' compilation successed.", gpu_shader->name.c_str()); + + GLint attr_max_length = 0; + GLint attr_count = 0; + glGetProgramiv(gpu_shader->gl_program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &attr_max_length); + glGetProgramiv(gpu_shader->gl_program, GL_ACTIVE_ATTRIBUTES, &attr_count); + + GLchar gl_name[256]; + GLsizei gl_length; + GLsizei gl_size; + GLenum gl_type; + + gpu_shader->gpu_inputs.resize(attr_count); + for (GLint i = 0; i < attr_count; ++i) { + GLES2GPUInput& gpu_input = gpu_shader->gpu_inputs[i]; + + memset(gl_name, 0, sizeof(gl_name)); + glGetActiveAttrib(gpu_shader->gl_program, i, attr_max_length, &gl_length, &gl_size, &gl_type, gl_name); + char* offset = strchr(gl_name, '['); + if (offset) { + gl_name[offset - gl_name] = '\0'; + } + + gpu_input.gl_loc = glGetAttribLocation(gpu_shader->gl_program, gl_name); + gpu_input.binding = gpu_input.gl_loc; + gpu_input.name = gl_name; + gpu_input.type = MapGFXType(gl_type); + gpu_input.stride = GLTypeSize(gl_type); + gpu_input.count = gl_size; + gpu_input.size = gpu_input.stride * gpu_input.count; + gpu_input.gl_type = gl_type; + } + + // create uniform blocks + if (gpu_shader->blocks.size()) { + + gpu_shader->gpu_blocks.resize(gpu_shader->blocks.size()); + + for (size_t i = 0; i < gpu_shader->gpu_blocks.size(); ++i) { + GLES2GPUUniformBlock& gpu_block = gpu_shader->gpu_blocks[i]; + GFXUniformBlock& block = gpu_shader->blocks[i]; + + gpu_block.name = block.name; + gpu_block.binding = block.binding; + gpu_block.uniforms.resize(block.uniforms.size()); + + for (size_t j = 0; j < gpu_block.uniforms.size(); ++j) { + GLES2GPUUniform& gpu_uniform = gpu_block.uniforms[j]; + GFXUniform& uniform = block.uniforms[j]; + + gpu_uniform.binding = GFX_INVALID_BINDING; + gpu_uniform.name = uniform.name; + gpu_uniform.type = uniform.type; + gpu_uniform.stride = GFX_TYPE_SIZES[(int)uniform.type]; + gpu_uniform.count = uniform.count; + gpu_uniform.size = gpu_uniform.stride * gpu_uniform.count; + gpu_uniform.offset = gpu_block.size; + gpu_uniform.gl_type = MapGLType(gpu_uniform.type); + gpu_uniform.gl_loc = -1; + gpu_uniform.buff = nullptr; + + gpu_block.size += gpu_uniform.size; + } + } + } // if + + // create uniform samplers + if (gpu_shader->samplers.size()) { + gpu_shader->gpu_samplers.resize(gpu_shader->samplers.size()); + + for (size_t i = 0; i < gpu_shader->gpu_samplers.size(); ++i) { + GFXUniformSampler& sampler = gpu_shader->samplers[i]; + GLES2GPUUniformSampler& gpu_sampler = gpu_shader->gpu_samplers[i]; + gpu_sampler.binding = sampler.binding; + gpu_sampler.name = sampler.name; + gpu_sampler.type = sampler.type; + gpu_sampler.gl_type = MapGLType(gpu_sampler.type); + gpu_sampler.gl_loc = -1; + } + } + + // parse uniforms + GLint active_uniforms; + glGetProgramiv(gpu_shader->gl_program, GL_ACTIVE_UNIFORMS, &active_uniforms); + + GLint unit_idx = 0; + + GLES2GPUUniformSamplerList active_gpu_samplers; + + for (GLint i = 0; i < active_uniforms; ++i) { + memset(gl_name, 0, sizeof(gl_name)); + glGetActiveUniform(gpu_shader->gl_program, i, 255, &gl_length, &gl_size, &gl_type, gl_name); + char* u_offset = strchr(gl_name, '['); + if (u_offset) { + gl_name[u_offset - gl_name] = '\0'; + } + String u_name = gl_name; + + bool is_sampler = (gl_type == GL_SAMPLER_2D) || + (gl_type == GL_SAMPLER_3D_OES) || + (gl_type == GL_SAMPLER_CUBE) || + (gl_type == GL_SAMPLER_CUBE_MAP_ARRAY_OES) || + (gl_type == GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_OES) || + (gl_type == GL_INT_SAMPLER_CUBE_MAP_ARRAY_OES) || + (gl_type == GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_OES); + if (is_sampler) { + for (size_t s = 0; s < gpu_shader->gpu_samplers.size(); ++s) { + GLES2GPUUniformSampler& gpu_sampler = gpu_shader->gpu_samplers[s]; + if (gpu_sampler.name == u_name) { + gpu_sampler.units.resize(gl_size); + for (GLsizei u = 0; u < gl_size; ++u) { + gpu_sampler.units[u] = unit_idx + u; + } + + gpu_sampler.gl_loc = glGetAttribLocation(gpu_shader->gl_program, gl_name); + unit_idx += gl_size; + + active_gpu_samplers.push_back(gpu_sampler); + break; + } + } + } else { + for (size_t b = 0; b < gpu_shader->gpu_blocks.size(); ++b) { + GLES2GPUUniformBlock& gpu_block = gpu_shader->gpu_blocks[b]; + for (size_t u = 0; u < gpu_block.uniforms.size(); ++u) { + if (gpu_block.uniforms[u].name == u_name) { + GLES2GPUUniform gpu_uniform = gpu_block.uniforms[u]; + gpu_uniform.gl_loc = glGetAttribLocation(gpu_shader->gl_program, gl_name); + gpu_uniform.buff = (uint8_t*)CC_MALLOC(gpu_uniform.size); + + gpu_block.active_uniforms.emplace_back(gpu_uniform); + break; + } + } + } + } + } // for + + if (active_gpu_samplers.size()) { + if (device->state_cache->gl_program != gpu_shader->gl_program) { + glUseProgram(gpu_shader->gl_program); + device->state_cache->gl_program = gpu_shader->gl_program; + } + + for (size_t i = 0; i < active_gpu_samplers.size(); ++i) { + GLES2GPUUniformSampler& gpu_sampler = active_gpu_samplers[i]; + glUniform1iv(gpu_sampler.gl_loc, (GLsizei)gpu_sampler.units.size(), gpu_sampler.units.data()); + } + } +} + +void GLES2CmdFuncDestroyShader(GLES2Device* device, GLES2GPUShader* gpu_shader) { + for (size_t i = 0; i < gpu_shader->gpu_stages.size(); ++i) { + GLES2GPUShaderStage& gpu_stage = gpu_shader->gpu_stages[i]; + if (gpu_stage.gl_shader) { + glDeleteShader(gpu_stage.gl_shader); + gpu_stage.gl_shader = 0; + } + } + if (gpu_shader->gl_program) { + glDeleteProgram(gpu_shader->gl_program); + gpu_shader->gl_program = 0; + } +} + +void GLES2CmdFuncCreateInputAssembler(GLES2Device* device, GLES2GPUInputAssembler* gpu_ia) { + + if (gpu_ia->gpu_index_buffer) { + switch (gpu_ia->gpu_index_buffer->stride) { + case 1: gpu_ia->gl_index_type = GL_UNSIGNED_BYTE; break; + case 2: gpu_ia->gl_index_type = GL_UNSIGNED_SHORT; break; + case 4: gpu_ia->gl_index_type = GL_UNSIGNED_INT; break; + default: { + CC_LOG_ERROR("Illegal index buffer stride."); + } + } + } + + uint stream_offsets[GFX_MAX_VERTEX_ATTRIBUTES] = {0}; + + gpu_ia->gpu_attribs.resize(gpu_ia->attribs.size()); + for (size_t i = 0; i < gpu_ia->gpu_attribs.size(); ++i) { + GLES2GPUAttribute& gpu_attrib = gpu_ia->gpu_attribs[i]; + const GFXAttribute& attrib = gpu_ia->attribs[i]; + + GLES2GPUBuffer* gpu_vb = (GLES2GPUBuffer*)gpu_ia->gpu_vertex_buffers[attrib.stream]; + + gpu_attrib.name = attrib.name; + gpu_attrib.gl_type = GFXFormatToGLType(attrib.format); + gpu_attrib.size = GFX_FORMAT_INFOS[(int)attrib.format].size; + gpu_attrib.count = GFX_FORMAT_INFOS[(int)attrib.format].count; + gpu_attrib.component_count = GLComponentCount(gpu_attrib.gl_type); + gpu_attrib.is_normalized = attrib.is_normalized; + gpu_attrib.is_instanced = attrib.is_instanced; + gpu_attrib.offset = stream_offsets[attrib.stream]; + + if (gpu_vb) { + gpu_attrib.gl_buffer = gpu_vb->gl_buffer; + gpu_attrib.stride = gpu_vb->stride; + } + } +} + +void GLES2CmdFuncDestroyInputAssembler(GLES2Device* device, GLES2GPUInputAssembler* gpu_ia) { + for (auto it = gpu_ia->gl_vaos.begin(); it != gpu_ia->gl_vaos.end(); ++it) { + glDeleteVertexArraysOES(1, &it->second); + } + gpu_ia->gl_vaos.clear(); +} + +void GLES2CmdFuncCreateFramebuffer(GLES2Device* device, GLES2GPUFramebuffer* gpu_fbo) { + if (gpu_fbo->is_offscreen) { + glGenFramebuffers(1, &gpu_fbo->gl_fbo); + if (device->state_cache->gl_fbo != gpu_fbo->gl_fbo) { + glBindFramebuffer(GL_FRAMEBUFFER, gpu_fbo->gl_fbo); + device->state_cache->gl_fbo = gpu_fbo->gl_fbo; + } + + GLenum attachments[GFX_MAX_ATTACHMENTS] = {0}; + uint attachment_count = 0; + + for (size_t i = 0; i < gpu_fbo->gpu_color_views.size(); ++i) { + GLES2GPUTextureView* gpu_color_view = gpu_fbo->gpu_color_views[i]; + if (gpu_color_view && gpu_color_view->gpu_texture) { + glFramebufferTexture2D(GL_FRAMEBUFFER, (GLenum)(GL_COLOR_ATTACHMENT0 + i), gpu_color_view->gpu_texture->gl_target, gpu_color_view->gpu_texture->gl_texture, gpu_color_view->base_level); + + attachments[attachment_count++] = (GLenum)(GL_COLOR_ATTACHMENT0 + i); + } + } + + if (gpu_fbo->gpu_depth_stencil_view) { + GLES2GPUTextureView* gpu_dsv = gpu_fbo->gpu_depth_stencil_view; + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, gpu_dsv->gpu_texture->gl_target, gpu_dsv->gpu_texture->gl_texture, gpu_dsv->base_level); + + if (GFX_FORMAT_INFOS[(int)gpu_dsv->format].has_stencil) { + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, gpu_dsv->gpu_texture->gl_target, gpu_dsv->gpu_texture->gl_texture, gpu_dsv->base_level); + } + } + + GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + if (status != GL_FRAMEBUFFER_COMPLETE) { + switch (status) { + case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT: { + CC_LOG_ERROR("glCheckFramebufferStatus() - FRAMEBUFFER_INCOMPLETE_ATTACHMENT"); + break; + } + case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: { + CC_LOG_ERROR("glCheckFramebufferStatus() - FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT"); + break; + } + case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS: { + CC_LOG_ERROR("glCheckFramebufferStatus() - FRAMEBUFFER_INCOMPLETE_DIMENSIONS"); + break; + } + case GL_FRAMEBUFFER_UNSUPPORTED: { + CC_LOG_ERROR("glCheckFramebufferStatus() - FRAMEBUFFER_UNSUPPORTED"); + break; + } + default:; + } + } + } +} + +void GLES2CmdFuncDestroyFramebuffer(GLES2Device* device, GLES2GPUFramebuffer* gpu_fbo) { + if (gpu_fbo->gl_fbo) { + glDeleteFramebuffers(1, &gpu_fbo->gl_fbo); + gpu_fbo->gl_fbo = 0; + } +} + +void GLES2CmdFuncExecuteCmds(GLES2Device* device, GLES2CmdPackage* cmd_package) { + static uint cmd_indices[(int)GLES2CmdType::COUNT] = {0}; + static GLenum gl_attachments[GFX_MAX_ATTACHMENTS] = {0}; + + memset(cmd_indices, 0, sizeof(cmd_indices)); + + GLES2StateCache* cache = device->state_cache; + GLES2GPURenderPass* gpu_render_pass = nullptr; + bool is_shader_changed = false; + GLES2GPUPipelineState* gpu_pso = nullptr; + GLenum gl_primitive = 0; + GLES2GPUInputAssembler* gpu_ia = nullptr; + GLES2CmdBeginRenderPass* cmd_begin_render_pass = nullptr; + GLenum gl_wrap_s; + GLenum gl_wrap_t; + GLenum gl_min_filter; + + for (uint i = 0; i < cmd_package->cmd_types.Size(); ++i) { + GLES2CmdType cmd_type = cmd_package->cmd_types[i]; + uint cmd_idx = cmd_indices[(int)cmd_type]; + + switch (cmd_type) { + case GLES2CmdType::BEGIN_RENDER_PASS: { + GLES2CmdBeginRenderPass* cmd = cmd_package->begin_render_pass_cmds[cmd_idx]; + cmd_begin_render_pass = cmd; + if (cmd->gpu_fbo) { + if (cache->gl_fbo != cmd->gpu_fbo->gl_fbo) { + glBindFramebuffer(GL_FRAMEBUFFER, cmd->gpu_fbo->gl_fbo); + cache->gl_fbo = cmd->gpu_fbo->gl_fbo; + } + + if (cache->viewport.left != cmd->render_area.x || + cache->viewport.top != cmd->render_area.y || + cache->viewport.width != cmd->render_area.width || + cache->viewport.height != cmd->render_area.height) { + glViewport(cmd->render_area.x, cmd->render_area.y, cmd->render_area.width, cmd->render_area.height); + cache->viewport.left = cmd->render_area.x; + cache->viewport.top = cmd->render_area.y; + cache->viewport.width = cmd->render_area.width; + cache->viewport.height = cmd->render_area.height; + } + + if (cache->scissor.x != cmd->render_area.x || + cache->scissor.y != cmd->render_area.y || + cache->scissor.width != cmd->render_area.width || + cache->scissor.height != cmd->render_area.height) { + glScissor(cmd->render_area.x, cmd->render_area.y, cmd->render_area.width, cmd->render_area.height); + cache->scissor.x = cmd->render_area.x; + cache->scissor.y = cmd->render_area.y; + cache->scissor.width = cmd->render_area.width; + cache->scissor.height = cmd->render_area.height; + } + + GLbitfield gl_clears = 0; + uint num_attachments = 0; + + gpu_render_pass = cmd->gpu_fbo->gpu_render_pass; + for (uint j = 0; j < cmd->num_clear_colors; ++j) { + const GFXColorAttachment& color_attachment = gpu_render_pass->color_attachments[j]; + if (color_attachment.format != GFXFormat::UNKNOWN) { + switch (color_attachment.load_op) { + case GFXLoadOp::LOAD: break; // GL default behaviour + case GFXLoadOp::CLEAR: { + if (cmd->clear_flags & GFXClearFlagBit::COLOR) { + if (cache->bs.targets[0].blend_color_mask != GFXColorMask::ALL) { + glColorMask(true, true, true, true); + } + + if (!cmd->gpu_fbo->is_offscreen) { + const GFXColor& color = cmd->clear_colors[j]; + glClearColor(color.r, color.g, color.b, color.a); + gl_clears |= GL_COLOR_BUFFER_BIT; + } + } + break; + } + case GFXLoadOp::DISCARD: { + // invalidate fbo + gl_attachments[num_attachments++] = (cmd->gpu_fbo->is_offscreen ? GL_COLOR_ATTACHMENT0 + j : GL_COLOR_EXT); + break; + } + default:; + } + } + } // for + + if (gpu_render_pass->depth_stencil_attachment.format != GFXFormat::UNKNOWN) { + bool has_depth = GFX_FORMAT_INFOS[(int)gpu_render_pass->depth_stencil_attachment.format].has_depth; + if (has_depth) { + switch (gpu_render_pass->depth_stencil_attachment.depth_load_op) { + case GFXLoadOp::LOAD: break; // GL default behaviour + case GFXLoadOp::CLEAR: { + if (cache->dss.depth_write) { + glDepthMask(true); + } + glClearDepthf(cmd->clear_depth); + gl_clears |= GL_DEPTH_BUFFER_BIT; + break; + } + case GFXLoadOp::DISCARD: { + // invalidate fbo + gl_attachments[num_attachments++] = (cmd->gpu_fbo->is_offscreen ? GL_DEPTH_ATTACHMENT : GL_DEPTH_EXT); + break; + } + default:; + } + } // if (has_depth) + bool has_stencils = GFX_FORMAT_INFOS[(int)gpu_render_pass->depth_stencil_attachment.format].has_stencil; + if (has_stencils) { + switch (gpu_render_pass->depth_stencil_attachment.depth_load_op) { + case GFXLoadOp::LOAD: break; // GL default behaviour + case GFXLoadOp::CLEAR: { + if (!cache->dss.stencil_write_mask_front) { + glStencilMaskSeparate(GL_FRONT, 0xffffffff); + } + if (!cache->dss.stencil_write_mask_back) { + glStencilMaskSeparate(GL_BACK, 0xffffffff); + } + glClearStencil(cmd->clear_stencil); + gl_clears |= GL_STENCIL_BUFFER_BIT; + break; + } + case GFXLoadOp::DISCARD: { + // invalidate fbo + gl_attachments[num_attachments++] = (cmd->gpu_fbo->is_offscreen ? GL_STENCIL_ATTACHMENT : GL_STENCIL_EXT); + break; + } + default:; + } + } // if (has_stencils) + } // if + + if (num_attachments && device->use_discard_framebuffer()) { + glDiscardFramebufferEXT(GL_FRAMEBUFFER, num_attachments, gl_attachments); + } + + if (gl_clears) { + glClear(gl_clears); + } + + // restore states + if (gl_clears & GL_COLOR_BUFFER_BIT) { + GFXColorMask color_mask = cache->bs.targets[0].blend_color_mask; + if (color_mask != GFXColorMask::ALL) { + glColorMask((GLboolean)(color_mask & GFXColorMask::R), + (GLboolean)(color_mask & GFXColorMask::G), + (GLboolean)(color_mask & GFXColorMask::B), + (GLboolean)(color_mask & GFXColorMask::A)); + } + } + + if ((gl_clears & GL_COLOR_BUFFER_BIT) && !cache->dss.depth_write) { + glDepthMask(false); + } + + if (gl_clears & GL_STENCIL_BUFFER_BIT) { + if (!cache->dss.stencil_write_mask_front) { + glStencilMaskSeparate(GL_FRONT, 0); + } + if (!cache->dss.stencil_write_mask_back) { + glStencilMaskSeparate(GL_BACK, 0); + } + } + } + break; + } + case GLES2CmdType::END_RENDER_PASS: { + GLES2CmdBeginRenderPass* cmd = cmd_begin_render_pass; + uint num_attachments = 0; + for (uint j = 0; j < cmd->num_clear_colors; ++j) { + const GFXColorAttachment& color_attachment = gpu_render_pass->color_attachments[j]; + if (color_attachment.format != GFXFormat::UNKNOWN) { + switch (color_attachment.load_op) { + case GFXLoadOp::LOAD: break; // GL default behaviour + case GFXLoadOp::CLEAR: break; + case GFXLoadOp::DISCARD: { + // invalidate fbo + gl_attachments[num_attachments++] = (cmd->gpu_fbo->is_offscreen ? GL_COLOR_ATTACHMENT0 + j : GL_COLOR_EXT); + break; + } + default:; + } + } + } // for + + if (gpu_render_pass->depth_stencil_attachment.format != GFXFormat::UNKNOWN) { + bool has_depth = GFX_FORMAT_INFOS[(int)gpu_render_pass->depth_stencil_attachment.format].has_depth; + if (has_depth) { + switch (gpu_render_pass->depth_stencil_attachment.depth_load_op) { + case GFXLoadOp::LOAD: break; // GL default behaviour + case GFXLoadOp::CLEAR: break; + case GFXLoadOp::DISCARD: { + // invalidate fbo + gl_attachments[num_attachments++] = (cmd->gpu_fbo->is_offscreen ? GL_DEPTH_ATTACHMENT : GL_DEPTH_EXT); + break; + } + default:; + } + } // if (has_depth) + bool has_stencils = GFX_FORMAT_INFOS[(int)gpu_render_pass->depth_stencil_attachment.format].has_stencil; + if (has_stencils) { + switch (gpu_render_pass->depth_stencil_attachment.depth_load_op) { + case GFXLoadOp::LOAD: break; // GL default behaviour + case GFXLoadOp::CLEAR: break; + case GFXLoadOp::DISCARD: { + // invalidate fbo + gl_attachments[num_attachments++] = (cmd->gpu_fbo->is_offscreen ? GL_STENCIL_ATTACHMENT : GL_STENCIL_EXT); + break; + } + default:; + } + } // if (has_stencils) + } // if + + if (num_attachments && device->use_discard_framebuffer()) { + glDiscardFramebufferEXT(GL_FRAMEBUFFER, num_attachments, gl_attachments); + } + break; + } + case GLES2CmdType::BIND_STATES: { + GLES2CmdBindStates* cmd = cmd_package->bind_states_cmds[cmd_idx]; + is_shader_changed = false; + if (cmd->gpu_pso) { + gpu_pso = cmd->gpu_pso; + gl_primitive = gpu_pso->gl_primitive; + + if (gpu_pso->gpu_shader) { + if (cache->gl_program != gpu_pso->gpu_shader->gl_program) { + glUseProgram(cache->gl_program); + cache->gl_program = gpu_pso->gpu_shader->gl_program; + is_shader_changed = true; + } + } + + // bind rasterizer state + if (cache->rs.cull_mode != gpu_pso->rs.cull_mode) { + switch (gpu_pso->rs.cull_mode) { + case GFXCullMode::NONE: { + if (cache->is_cull_face_enabled) { + glDisable(GL_CULL_FACE); + cache->is_cull_face_enabled = false; + } + } break; + case GFXCullMode::FRONT: { + if (!cache->is_cull_face_enabled) { + glEnable(GL_CULL_FACE); + cache->is_cull_face_enabled = true; + } + glCullFace(GL_FRONT); + } break; + case GFXCullMode::BACK: { + if (!cache->is_cull_face_enabled) { + glEnable(GL_CULL_FACE); + cache->is_cull_face_enabled = true; + } + glCullFace(GL_BACK); + } break; + default: + break; + } + cache->rs.cull_mode = gpu_pso->rs.cull_mode; + } + } + if (cache->rs.is_front_face_ccw != gpu_pso->rs.is_front_face_ccw) { + glFrontFace(gpu_pso->rs.is_front_face_ccw? GL_CCW : GL_CW); + cache->rs.is_front_face_ccw = gpu_pso->rs.is_front_face_ccw; + } + if ((cache->rs.depth_bias != gpu_pso->rs.depth_bias) || + (cache->rs.depth_bias_slope != gpu_pso->rs.depth_bias_slope)){ + glPolygonOffset(cache->rs.depth_bias, cache->rs.depth_bias_slope); + cache->rs.depth_bias_slope = gpu_pso->rs.depth_bias_slope; + } + if (cache->rs.line_width != gpu_pso->rs.line_width) { + glLineWidth(gpu_pso->rs.line_width); + cache->rs.line_width = gpu_pso->rs.line_width; + } + + // bind depth-stencil state + if (cache->dss.depth_test != gpu_pso->dss.depth_test) { + if (gpu_pso->dss.depth_test) { + glEnable(GL_DEPTH_TEST); + } else { + glDisable(GL_DEPTH_TEST); + } + cache->dss.depth_test = gpu_pso->dss.depth_test; + } + if (cache->dss.depth_write != gpu_pso->dss.depth_write) { + glDepthMask(gpu_pso->dss.depth_write); + cache->dss.depth_write = gpu_pso->dss.depth_write; + } + if (cache->dss.depth_func != gpu_pso->dss.depth_func) { + glDepthFunc(GLES2_CMP_FUNCS[(int)gpu_pso->dss.depth_func]); + cache->dss.depth_func = gpu_pso->dss.depth_func; + } + + // bind depth-stencil state - front + if (cache->dss.stencil_test_front != gpu_pso->dss.stencil_test_front || + cache->dss.stencil_test_back != gpu_pso->dss.stencil_test_back) { + if (gpu_pso->dss.stencil_test_front || gpu_pso->dss.stencil_test_back) { + if (!cache->is_stencil_test_enabled) { + glEnable(GL_STENCIL_TEST); + cache->is_stencil_test_enabled = true; + } + } else { + if (cache->is_stencil_test_enabled) { + glDisable(GL_STENCIL_TEST); + cache->is_stencil_test_enabled = false; + } + } + } + if (cache->dss.stencil_func_front != gpu_pso->dss.stencil_func_front || + cache->dss.stencil_ref_front != gpu_pso->dss.stencil_ref_front || + cache->dss.stencil_read_mask_front != gpu_pso->dss.stencil_read_mask_front) { + glStencilFuncSeparate(GL_FRONT, + GLES2_CMP_FUNCS[(int)gpu_pso->dss.stencil_func_front], + gpu_pso->dss.stencil_ref_front, + gpu_pso->dss.stencil_read_mask_front); + } + if (cache->dss.stencil_fail_op_front != gpu_pso->dss.stencil_fail_op_front || + cache->dss.stencil_z_fail_op_front != gpu_pso->dss.stencil_z_fail_op_front || + cache->dss.stencil_pass_op_front != gpu_pso->dss.stencil_pass_op_front) { + glStencilOpSeparate(GL_FRONT, + GLES2_STENCIL_OPS[(int)gpu_pso->dss.stencil_fail_op_front], + GLES2_STENCIL_OPS[(int)gpu_pso->dss.stencil_z_fail_op_front], + GLES2_STENCIL_OPS[(int)gpu_pso->dss.stencil_pass_op_front]); + } + if (cache->dss.stencil_write_mask_front != gpu_pso->dss.stencil_write_mask_front) { + glStencilMaskSeparate(GL_FRONT, gpu_pso->dss.stencil_write_mask_front); + cache->dss.stencil_write_mask_front = gpu_pso->dss.stencil_write_mask_front; + } + + // bind depth-stencil state - back + if (cache->dss.stencil_func_back != gpu_pso->dss.stencil_func_back || + cache->dss.stencil_ref_back != gpu_pso->dss.stencil_ref_back || + cache->dss.stencil_read_mask_back != gpu_pso->dss.stencil_read_mask_back) { + glStencilFuncSeparate(GL_BACK, + GLES2_CMP_FUNCS[(int)gpu_pso->dss.stencil_func_front], + gpu_pso->dss.stencil_ref_back, + gpu_pso->dss.stencil_read_mask_back); + } + if (cache->dss.stencil_fail_op_back != gpu_pso->dss.stencil_fail_op_back || + cache->dss.stencil_z_fail_op_back != gpu_pso->dss.stencil_z_fail_op_back || + cache->dss.stencil_pass_op_back != gpu_pso->dss.stencil_pass_op_back) { + glStencilOpSeparate(GL_BACK, + GLES2_STENCIL_OPS[(int)gpu_pso->dss.stencil_fail_op_back], + GLES2_STENCIL_OPS[(int)gpu_pso->dss.stencil_z_fail_op_back], + GLES2_STENCIL_OPS[(int)gpu_pso->dss.stencil_pass_op_back]); + } + if (cache->dss.stencil_write_mask_back != gpu_pso->dss.stencil_write_mask_back) { + glStencilMaskSeparate(GL_BACK, gpu_pso->dss.stencil_write_mask_back); + cache->dss.stencil_write_mask_back = gpu_pso->dss.stencil_write_mask_back; + } + + // bind blend state + if (cache->bs.is_a2c != gpu_pso->bs.is_a2c) { + if (cache->bs.is_a2c) { + glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE); + } else { + glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE); + } + } + if (cache->bs.blend_color.r != gpu_pso->bs.blend_color.r || + cache->bs.blend_color.g != gpu_pso->bs.blend_color.g || + cache->bs.blend_color.b != gpu_pso->bs.blend_color.b || + cache->bs.blend_color.a != gpu_pso->bs.blend_color.a) { + + glBlendColor(gpu_pso->bs.blend_color.r, + gpu_pso->bs.blend_color.g, + gpu_pso->bs.blend_color.b, + gpu_pso->bs.blend_color.a); + cache->bs.blend_color = gpu_pso->bs.blend_color; + } + + GFXBlendTarget& cache_target = cache->bs.targets[0]; + const GFXBlendTarget& target = gpu_pso->bs.targets[0]; + if (cache_target.is_blend != target.is_blend) { + if (cache_target.is_blend) { + glEnable(GL_BLEND); + } else { + glDisable(GL_BLEND); + } + cache_target.is_blend = target.is_blend; + } + if (cache_target.blend_eq != target.blend_eq || + cache_target.blend_alpha_eq != target.blend_alpha_eq) { + glBlendEquationSeparate(GLES2_BLEND_OPS[(int)target.blend_eq], + GLES2_BLEND_OPS[(int)target.blend_alpha_eq]); + cache_target.blend_eq = target.blend_eq; + cache_target.blend_alpha_eq = target.blend_alpha_eq; + } + if (cache_target.blend_src != target.blend_src || + cache_target.blend_dst != target.blend_dst || + cache_target.blend_src_alpha != target.blend_src_alpha || + cache_target.blend_dst_alpha != target.blend_dst_alpha) { + glBlendFuncSeparate(GLES2_BLEND_FACTORS[(int)target.blend_src], + GLES2_BLEND_FACTORS[(int)target.blend_dst], + GLES2_BLEND_FACTORS[(int)target.blend_src_alpha], + GLES2_BLEND_FACTORS[(int)target.blend_dst_alpha]); + cache_target.blend_src = target.blend_src; + cache_target.blend_dst = target.blend_dst; + cache_target.blend_src_alpha = target.blend_src_alpha; + cache_target.blend_dst_alpha = target.blend_dst_alpha; + } + if (cache_target.blend_color_mask != target.blend_color_mask) { + glColorMask((GLboolean)(target.blend_color_mask & GFXColorMask::R), + (GLboolean)(target.blend_color_mask & GFXColorMask::G), + (GLboolean)(target.blend_color_mask & GFXColorMask::B), + (GLboolean)(target.blend_color_mask & GFXColorMask::A)); + cache_target.blend_color_mask = target.blend_color_mask; + } + + // bind shader resources + if (cmd->gpu_binding_layout && gpu_pso->gpu_shader) { + uint8_t* uniform_buff; + + for(size_t j = 0; j < cmd->gpu_binding_layout->gpu_bindings.size(); ++j) { + const GLES2GPUBinding& gpu_binding = cmd->gpu_binding_layout->gpu_bindings[j]; + switch (gpu_binding.type) { + case GFXBindingType::UNIFORM_BUFFER: { + if (gpu_binding.gpu_buffer) { + for (size_t k = 0; k < gpu_pso->gpu_shader->gpu_blocks.size(); ++k) { + const GLES2GPUUniformBlock& gpu_block = gpu_pso->gpu_shader->gpu_blocks[k]; + + if (gpu_binding.binding == gpu_block.binding && + gpu_binding.gpu_buffer && + gpu_binding.gpu_buffer->buffer) { + for (size_t u = 0; u < gpu_block.active_uniforms.size(); ++u) { + const GLES2GPUUniform& gpu_uniform = gpu_block.active_uniforms[u]; + uniform_buff = (gpu_binding.gpu_buffer->buffer + gpu_uniform.offset); + switch (gpu_uniform.gl_type) + { + case GL_BOOL: + case GL_INT: { + if (memcmp(gpu_uniform.buff, uniform_buff, gpu_uniform.size) != 0) { + glUniform1iv(gpu_uniform.gl_loc, gpu_uniform.count, (const GLint*)uniform_buff); + memcpy(gpu_uniform.buff, uniform_buff, gpu_uniform.size); + } + break; + } + case GL_BOOL_VEC2: + case GL_INT_VEC2: { + if (memcmp(gpu_uniform.buff, uniform_buff, gpu_uniform.size) != 0) { + glUniform2iv(gpu_uniform.gl_loc, gpu_uniform.count, (const GLint*)uniform_buff); + memcpy(gpu_uniform.buff, uniform_buff, gpu_uniform.size); + } + break; + } + case GL_BOOL_VEC3: + case GL_INT_VEC3: { + if (memcmp(gpu_uniform.buff, uniform_buff, gpu_uniform.size) != 0) { + glUniform3iv(gpu_uniform.gl_loc, gpu_uniform.count, (const GLint*)uniform_buff); + memcpy(gpu_uniform.buff, uniform_buff, gpu_uniform.size); + } + break; + } + case GL_BOOL_VEC4: + case GL_INT_VEC4: { + if (memcmp(gpu_uniform.buff, uniform_buff, gpu_uniform.size) != 0) { + glUniform4iv(gpu_uniform.gl_loc, gpu_uniform.count, (const GLint*)uniform_buff); + memcpy(gpu_uniform.buff, uniform_buff, gpu_uniform.size); + } + break; + } + case GL_FLOAT: { + if (memcmp(gpu_uniform.buff, uniform_buff, gpu_uniform.size) != 0) { + glUniform1fv(gpu_uniform.gl_loc, gpu_uniform.count, (const GLfloat*)uniform_buff); + memcpy(gpu_uniform.buff, uniform_buff, gpu_uniform.size); + } + break; + } + case GL_FLOAT_VEC2: { + if (memcmp(gpu_uniform.buff, uniform_buff, gpu_uniform.size) != 0) { + glUniform2fv(gpu_uniform.gl_loc, gpu_uniform.count, (const GLfloat*)uniform_buff); + memcpy(gpu_uniform.buff, uniform_buff, gpu_uniform.size); + } + break; + } + case GL_FLOAT_VEC3: { + if (memcmp(gpu_uniform.buff, uniform_buff, gpu_uniform.size) != 0) { + glUniform3fv(gpu_uniform.gl_loc, gpu_uniform.count, (const GLfloat*)uniform_buff); + memcpy(gpu_uniform.buff, uniform_buff, gpu_uniform.size); + } + break; + } + case GL_FLOAT_VEC4: { + if (memcmp(gpu_uniform.buff, uniform_buff, gpu_uniform.size) != 0) { + glUniform4fv(gpu_uniform.gl_loc, gpu_uniform.count, (const GLfloat*)uniform_buff); + memcpy(gpu_uniform.buff, uniform_buff, gpu_uniform.size); + } + break; + } + case GL_FLOAT_MAT2: { + if (memcmp(gpu_uniform.buff, uniform_buff, gpu_uniform.size) != 0) { + glUniformMatrix2fv(gpu_uniform.gl_loc, gpu_uniform.count, GL_FALSE, (const GLfloat*)uniform_buff); + memcpy(gpu_uniform.buff, uniform_buff, gpu_uniform.size); + } + break; + } + case GL_FLOAT_MAT3: { + if (memcmp(gpu_uniform.buff, uniform_buff, gpu_uniform.size) != 0) { + glUniformMatrix3fv(gpu_uniform.gl_loc, gpu_uniform.count, GL_FALSE, (const GLfloat*)uniform_buff); + memcpy(gpu_uniform.buff, uniform_buff, gpu_uniform.size); + } + break; + } + case GL_FLOAT_MAT4: { + if (memcmp(gpu_uniform.buff, uniform_buff, gpu_uniform.size) != 0) { + glUniformMatrix4fv(gpu_uniform.gl_loc, gpu_uniform.count, GL_FALSE, (const GLfloat*)uniform_buff); + memcpy(gpu_uniform.buff, uniform_buff, gpu_uniform.size); + } + break; + } + default: + break; + } + } // for + break; + } + } + } + break; + } + case GFXBindingType::SAMPLER: { + if (gpu_binding.gpu_sampler) { + for (size_t k = 0; k < gpu_pso->gpu_shader->gpu_samplers.size(); ++k) { + const GLES2GPUUniformSampler& gpu_sampler = gpu_pso->gpu_shader->gpu_samplers[k]; + if (gpu_sampler.binding == gpu_binding.binding) { + for (size_t u = 0; u < gpu_sampler.units.size(); ++u) { + uint unit = (uint)gpu_sampler.units[u]; + if (gpu_binding.gpu_tex_view && (gpu_binding.gpu_tex_view->gpu_texture->size > 0)) { + GLES2GPUTexture* gpu_texture = gpu_binding.gpu_tex_view->gpu_texture; + GLuint gl_texture = gpu_texture->gl_texture; + if (cache->gl_textures[unit] != gl_texture) { + if (cache->tex_uint != unit) { + glActiveTexture(GL_TEXTURE0 + unit); + cache->tex_uint = unit; + } + glBindTexture(gpu_texture->gl_target, gl_texture); + cache->gl_textures[unit] = gl_texture; + } + + if (gpu_binding.gpu_tex_view->gpu_texture->is_pot) { + gl_wrap_s = gpu_binding.gpu_sampler->gl_wrap_s; + gl_wrap_t = gpu_binding.gpu_sampler->gl_wrap_t; + + if (gpu_binding.gpu_tex_view->gpu_texture->mip_level <= 1 && + (gpu_binding.gpu_sampler->gl_min_filter == GL_LINEAR_MIPMAP_NEAREST || + gpu_binding.gpu_sampler->gl_min_filter == GL_LINEAR_MIPMAP_LINEAR)) { + gl_min_filter = GL_LINEAR; + } else { + gl_min_filter = gpu_binding.gpu_sampler->gl_min_filter; + } + } else { + gl_wrap_s = GL_CLAMP_TO_EDGE; + gl_wrap_t = GL_CLAMP_TO_EDGE; + + if (gpu_binding.gpu_sampler->gl_min_filter == GL_LINEAR || + gpu_binding.gpu_sampler->gl_min_filter == GL_LINEAR_MIPMAP_NEAREST || + gpu_binding.gpu_sampler->gl_min_filter == GL_LINEAR_MIPMAP_LINEAR) { + gl_min_filter = GL_LINEAR; + } else { + gl_min_filter = GL_NEAREST; + } + } + + if (gpu_texture->gl_wrap_s != gl_wrap_s) { + if (cache->tex_uint != unit) { + glActiveTexture(GL_TEXTURE0 + unit); + cache->tex_uint = unit; + } + glTexParameteri(gpu_texture->gl_target, GL_TEXTURE_WRAP_S, gl_wrap_s); + gpu_texture->gl_wrap_s = gl_wrap_s; + } + + if (gpu_texture->gl_wrap_t != gl_wrap_t) { + if (cache->tex_uint != unit) { + glActiveTexture(GL_TEXTURE0 + unit); + cache->tex_uint = unit; + } + glTexParameteri(gpu_texture->gl_target, GL_TEXTURE_WRAP_T, gl_wrap_t); + gpu_texture->gl_wrap_t = gl_wrap_t; + } + + if (gpu_texture->gl_min_filter != gl_min_filter) { + if (cache->tex_uint != unit) { + glActiveTexture(GL_TEXTURE0 + unit); + cache->tex_uint = unit; + } + glTexParameteri(gpu_texture->gl_target, GL_TEXTURE_MIN_FILTER, gl_min_filter); + gpu_texture->gl_min_filter = gl_min_filter; + } + + if (gpu_texture->gl_mag_filter != gpu_binding.gpu_sampler->gl_mag_filter) { + if (cache->tex_uint != unit) { + glActiveTexture(GL_TEXTURE0 + unit); + cache->tex_uint = unit; + } + glTexParameteri(gpu_texture->gl_target, GL_TEXTURE_MAG_FILTER, gpu_binding.gpu_sampler->gl_mag_filter); + gpu_texture->gl_mag_filter = gpu_binding.gpu_sampler->gl_mag_filter; + } + } + } + break; + } + } + } + break; + } + default: + break; + } + } + } // if + + // bind vao + if (cmd->gpu_ia && gpu_pso->gpu_shader && + (is_shader_changed || gpu_ia != cmd->gpu_ia)) { + gpu_ia = cmd->gpu_ia; + if (device->use_vao()) { + const auto it = gpu_ia->gl_vaos.find(gpu_pso->gpu_shader->gl_program); + if (it != gpu_ia->gl_vaos.end()) { + GLuint gl_vao = it->second; + if (!gl_vao) { + glGenVertexArraysOES(1, &gl_vao); + gpu_ia->gl_vaos.insert(std::make_pair(gpu_pso->gpu_shader->gl_program, gl_vao)); + glBindVertexArrayOES(gl_vao); + glBindBuffer(GL_ARRAY_BUFFER, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + + for (size_t j = 0; j < gpu_pso->gpu_shader->gpu_inputs.size(); ++j) { + const GLES2GPUInput& gpu_input = gpu_pso->gpu_shader->gpu_inputs[j]; + for (size_t a = 0; a < gpu_ia->attribs.size(); ++a) { + const GLES2GPUAttribute& gpu_attrib = gpu_ia->gpu_attribs[a]; + if (gpu_attrib.name == gpu_input.name) { + glBindBuffer(GL_ARRAY_BUFFER, gpu_attrib.gl_buffer); + + for (uint c = 0; c < gpu_attrib.component_count; ++c) { + GLint gl_loc = gpu_input.gl_loc + c; + uint attrib_offset = gpu_attrib.offset + gpu_attrib.size * c; + glEnableVertexAttribArray(gl_loc); + + cache->gl_enabled_attrib_locs[gl_loc] = true; + glVertexAttribPointer(gl_loc, gpu_attrib.count, gpu_attrib.gl_type, gpu_attrib.is_normalized, gpu_attrib.stride, BUFFER_OFFSET(attrib_offset)); + + if (device->use_instanced_arrays()) { + glVertexAttribDivisorEXT(gl_loc, gpu_attrib.is_instanced ? 1 : 0); + } + } + break; + } + } // for + } // for + + if (gpu_ia->gpu_index_buffer) { + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, gpu_ia->gpu_index_buffer->gl_buffer); + } + + glBindVertexArrayOES(0); + glBindBuffer(GL_ARRAY_BUFFER, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + cache->gl_vao = 0; + cache->gl_array_buffer = 0; + cache->gl_element_array_buffer = 0; + } + + if (cache->gl_vao != gl_vao) { + glBindVertexArrayOES(gl_vao); + cache->gl_vao = gl_vao; + } + } else { + for (uint a = 0; a < GFX_MAX_VERTEX_ATTRIBUTES; ++a) { + cache->gl_current_attrib_locs[a] = false; + } + + for (size_t j = 0; j < gpu_pso->gpu_shader->gpu_inputs.size(); ++j) { + const GLES2GPUInput& gpu_input = gpu_pso->gpu_shader->gpu_inputs[j]; + for (size_t a = 0; a < gpu_ia->attribs.size(); ++a) { + const GLES2GPUAttribute& gpu_attrib = gpu_ia->gpu_attribs[a]; + if (gpu_attrib.name == gpu_input.name) { + glBindBuffer(GL_ARRAY_BUFFER, gpu_attrib.gl_buffer); + + for (uint c = 0; c < gpu_attrib.component_count; ++c) { + GLint gl_loc = gpu_input.gl_loc + c; + uint attrib_offset = gpu_attrib.offset + gpu_attrib.size * c; + glEnableVertexAttribArray(gl_loc); + + cache->gl_enabled_attrib_locs[gl_loc] = true; + glVertexAttribPointer(gl_loc, gpu_attrib.count, gpu_attrib.gl_type, gpu_attrib.is_normalized, gpu_attrib.stride, BUFFER_OFFSET(attrib_offset)); + + if (device->use_instanced_arrays()) { + glVertexAttribDivisorEXT(gl_loc, gpu_attrib.is_instanced ? 1 : 0); + } + } + break; + } + } // for + } // for + + if (gpu_ia->gpu_index_buffer) { + if (cache->gl_element_array_buffer != gpu_ia->gpu_index_buffer->gl_buffer) { + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, gpu_ia->gpu_index_buffer->gl_buffer); + cache->gl_element_array_buffer = gpu_ia->gpu_index_buffer->gl_buffer; + } + } + + for (uint a = 0; a < GFX_MAX_VERTEX_ATTRIBUTES; ++a) { + if (cache->gl_enabled_attrib_locs[a] != cache->gl_current_attrib_locs[a]) { + glDisableVertexAttribArray(a); + cache->gl_enabled_attrib_locs[a] = false; + } + } + } + } // if + } + + break; + } + case GLES2CmdType::DRAW: { + GLES2CmdDraw* cmd = cmd_package->draw_cmds[cmd_idx]; + if (gpu_ia && gpu_pso) { + if (!gpu_ia->gpu_indirect_buffer) { + + if (gpu_ia->gpu_index_buffer && cmd->draw_info.index_count >= 0) { + uint8_t* offset = 0; + offset += cmd->draw_info.first_index * gpu_ia->gpu_index_buffer->stride; + if (cmd->draw_info.instance_count == 0) { + glDrawElements(gl_primitive, cmd->draw_info.index_count, gpu_ia->gl_index_type, offset); + } else { + if (device->use_draw_instanced()) { + glDrawElementsInstancedEXT(gl_primitive, cmd->draw_info.index_count, gpu_ia->gl_index_type, offset, cmd->draw_info.instance_count); + } + } + } else { + if (cmd->draw_info.instance_count == 0) { + glDrawArrays(gl_primitive, cmd->draw_info.first_index, cmd->draw_info.vertex_count); + } else { + if (device->use_draw_instanced()) { + glDrawArraysInstancedEXT(gl_primitive, cmd->draw_info.first_index, cmd->draw_info.vertex_count, cmd->draw_info.instance_count); + } + } + } + } else { + for (size_t j = 0; j < gpu_ia->gpu_indirect_buffer->indirect_buff.draws.size(); ++j) { + GFXDrawInfo& draw = gpu_ia->gpu_indirect_buffer->indirect_buff.draws[j]; + if (gpu_ia->gpu_index_buffer && draw.index_count >= 0) { + uint8_t* offset = 0; + offset += draw.first_index * gpu_ia->gpu_index_buffer->stride; + if (cmd->draw_info.instance_count == 0) { + glDrawElements(gl_primitive, draw.index_count, gpu_ia->gl_index_type, offset); + } else { + if (device->use_draw_instanced()) { + glDrawElementsInstancedEXT(gl_primitive, draw.index_count, gpu_ia->gl_index_type, offset, cmd->draw_info.instance_count); + } + } + } else { + if (cmd->draw_info.instance_count == 0) { + glDrawArrays(gl_primitive, draw.first_index, draw.vertex_count); + } else { + if (device->use_draw_instanced()) { + glDrawArraysInstancedEXT(gl_primitive, draw.first_index, draw.vertex_count, cmd->draw_info.instance_count); + } + } + } + } + } + } + break; + } + case GLES2CmdType::UPDATE_BUFFER: { + GLES2CmdUpdateBuffer* cmd = cmd_package->update_buffer_cmds[cmd_idx]; + GLES2CmdFuncUpdateBuffer(device, cmd->gpu_buffer, cmd->buffer, cmd->offset, cmd->size); + break; + } + case GLES2CmdType::COPY_BUFFER_TO_TEXTURE: { + GLES2CmdCopyBufferToTexture* cmd = cmd_package->copy_buffer_to_texture_cmds[cmd_idx]; + GLES2CmdFuncCopyBuffersToTexture(device, &(cmd->gpu_buffer->buffer), 1, cmd->gpu_texture, cmd->regions); + break; + } + default: + break; + } + } +} + +void GLES2CmdFuncCopyBuffersToTexture(GLES2Device* device, uint8_t** buffers, uint count, GLES2GPUTexture* gpu_texture, const GFXBufferTextureCopyList& regions) { + GLuint gl_texture = device->state_cache->gl_textures[device->state_cache->tex_uint]; + if (gl_texture != gpu_texture->gl_texture) { + glBindTexture(gpu_texture->gl_target, gpu_texture->gl_texture); + device->state_cache->gl_textures[device->state_cache->tex_uint] = gl_texture; + } + + bool is_compressed = GFX_FORMAT_INFOS[(int)gpu_texture->format].is_compressed; + uint n = 0; + + switch (gpu_texture->gl_target) { + case GL_TEXTURE_2D: { + uint w; + uint h; + for (size_t i = 0; i < regions.size(); ++i) { + const GFXBufferTextureCopy& region = regions[i]; + n = 0; + w = region.tex_extent.width; + h = region.tex_extent.height; + for (uint m = region.tex_subres.base_mip_level; m < region.tex_subres.base_mip_level + region.tex_subres.level_count; ++m) { + uint8_t* buff = region.buff_offset + region.buff_tex_height * region.buff_stride + buffers[n++]; + if (!is_compressed) { + glTexSubImage2D(GL_TEXTURE_2D, m, region.tex_offset.x, region.tex_offset.y, w, h, gpu_texture->gl_format, gpu_texture->gl_type, (GLvoid*)buff); + } else { + GLsizei memSize = (GLsizei)GFXFormatSize(gpu_texture->format, w, h, 1); + glCompressedTexSubImage2D(GL_TEXTURE_2D, m, region.tex_offset.x, region.tex_offset.y, w, h, gpu_texture->gl_format, memSize, (GLvoid*)buff); + } + + w = std::max(w >> 1, 1U); + h = std::max(h >> 1, 1U); + } + } + break; + } + case GL_TEXTURE_2D_ARRAY: { + uint w; + uint h; + for (size_t i = 0; i < regions.size(); ++i) { + const GFXBufferTextureCopy& region = regions[i]; + n = 0; + uint d = region.tex_subres.layer_count; + uint layer_count = d + region.tex_subres.base_array_layer; + + for (uint z = region.tex_subres.base_array_layer; z < layer_count; ++z) { + w = region.tex_extent.width; + h = region.tex_extent.height; + for (uint m = region.tex_subres.base_mip_level; m < region.tex_subres.base_mip_level + region.tex_subres.level_count; ++m) { + uint8_t* buff = region.buff_offset + region.buff_tex_height * region.buff_stride + buffers[n++]; + if (!is_compressed) { + glTexSubImage3DOES(GL_TEXTURE_2D_ARRAY, m, region.tex_offset.x, region.tex_offset.y, z, + w, h, d, gpu_texture->gl_format, gpu_texture->gl_type, (GLvoid*)buff); + } + else { + GLsizei memSize = (GLsizei)GFXFormatSize(gpu_texture->format, w, h, 1); + glCompressedTexSubImage3DOES(GL_TEXTURE_2D_ARRAY, m, region.tex_offset.x, region.tex_offset.y, z, + w, h, d, gpu_texture->gl_format, memSize, (GLvoid*)buff); + } + + w = std::max(w >> 1, 1U); + h = std::max(h >> 1, 1U); + } + } + } + break; + } + case GL_TEXTURE_3D: { + uint w; + uint h; + uint d; + for (size_t i = 0; i < regions.size(); ++i) { + const GFXBufferTextureCopy& region = regions[i]; + n = 0; + w = region.tex_extent.width; + h = region.tex_extent.height; + d = region.tex_extent.depth; + for (uint m = region.tex_subres.base_mip_level; m < region.tex_subres.base_mip_level + region.tex_subres.level_count; ++m) { + uint8_t* buff = region.buff_offset + region.buff_tex_height * region.buff_stride + buffers[n++]; + if (!is_compressed) { + glTexSubImage3DOES(GL_TEXTURE_3D, m, region.tex_offset.x, region.tex_offset.y, region.tex_offset.z, + w, h, d, gpu_texture->gl_format, gpu_texture->gl_type, (GLvoid*)buff); + } + else { + GLsizei memSize = (GLsizei)GFXFormatSize(gpu_texture->format, w, d + 1, 1); + glCompressedTexSubImage3DOES(GL_TEXTURE_3D, m, region.tex_offset.x, region.tex_offset.y, region.tex_offset.z, + w, h, d, gpu_texture->gl_format, memSize, (GLvoid*)buff); + } + + w = std::max(w >> 1, 1U); + h = std::max(h >> 1, 1U); + d = std::max(d >> 1, 1U); + } + } + break; + } + case GL_TEXTURE_CUBE_MAP: { + uint w; + uint h; + uint f; + for (size_t i = 0; i < regions.size(); ++i) { + const GFXBufferTextureCopy& region = regions[i]; + n = 0; + + uint face_count = region.tex_subres.base_array_layer + region.tex_subres.layer_count; + for (f = region.tex_subres.base_array_layer; f < face_count; ++f) { + w = region.tex_extent.width; + h = region.tex_extent.height; + + for (uint m = region.tex_subres.base_mip_level; m < region.tex_subres.base_mip_level + region.tex_subres.level_count; ++m) { + uint8_t* buff = region.buff_offset + region.buff_tex_height * region.buff_stride + buffers[n++]; + if (!is_compressed) { + glTexSubImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + f, m, region.tex_offset.x, region.tex_offset.y, w, h, gpu_texture->gl_format, gpu_texture->gl_type, (GLvoid*)buff); + } + else { + GLsizei memSize = (GLsizei)GFXFormatSize(gpu_texture->format, w, h, 1); + glCompressedTexSubImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + f, m, region.tex_offset.x, region.tex_offset.y, w, h, gpu_texture->gl_format, memSize, (GLvoid*)buff); + } + + w = std::max(w >> 1, 1U); + h = std::max(h >> 1, 1U); + } + } + } + break; + } + default: + CC_ASSERTS(false, "Unsupported GFXTextureType, copy buffers to texture failed."); + break; + } +} + + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles2/GLES2Commands.h b/native/cocos/renderer/gfx-gles2/GLES2Commands.h new file mode 100644 index 0000000000..a74fb6f484 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2Commands.h @@ -0,0 +1,193 @@ +#ifndef CC_GFXGLES2_COMMANDS_H_ +#define CC_GFXGLES2_COMMANDS_H_ + +#include "GLES2GPUObjects.h" + +CC_NAMESPACE_BEGIN + +class GLES2Device; + +struct GLES2DepthBias { + float constant = 0.0f; + float clamp = 0.0f; + float slope = 0.0f; +}; + +struct GLES2DepthBounds { + float min_bounds = 0.0f; + float max_bounds = 0.0f; +}; + +struct GLES2StencilWriteMask { + GFXStencilFace face = GFXStencilFace::FRONT; + GLuint write_mask = 0; +}; + +struct GLES2StencilCompareMask { + GFXStencilFace face = GFXStencilFace::FRONT; + GLint refrence = 0; + GLuint compare_mask = 0; +}; + +struct GLES2TextureSubres { + uint base_mip_level = 0; + uint level_count = 1; + uint base_array_layer = 0; + uint layer_count = 1; +}; + +struct GLES2BufferTextureCopy { + uint buff_offset = 0; + uint buff_stride = 0; + uint buff_tex_height = 0; + uint tex_offset[3] = {0}; + uint tex_extent[3] = {0}; + GLES2TextureSubres tex_subres; +}; + +enum class GLES2CmdType : uint8_t { + BEGIN_RENDER_PASS, + END_RENDER_PASS, + BIND_STATES, + DRAW, + UPDATE_BUFFER, + COPY_BUFFER_TO_TEXTURE, + COUNT, +}; + +class GLES2Cmd : public Object { + public: + GLES2CmdType type; + uint ref_count = 0; + + GLES2Cmd(GLES2CmdType _type) : type(_type) {} + virtual ~GLES2Cmd() {} + + virtual void Clear() = 0; +}; + +class GLES2CmdBeginRenderPass : public GLES2Cmd { + public: + GLES2GPUFramebuffer* gpu_fbo = nullptr; + GFXRect render_area; + GFXClearFlags clear_flags = GFXClearFlagBit::NONE; + uint num_clear_colors = 0; + GFXColor clear_colors[GFX_MAX_ATTACHMENTS]; + float clear_depth = 1.0f; + int clear_stencil = 0; + + GLES2CmdBeginRenderPass() : GLES2Cmd(GLES2CmdType::BEGIN_RENDER_PASS) {} + + void Clear() { + gpu_fbo = nullptr; + num_clear_colors = 0; + } +}; + +enum class GLES2State : uint8_t { + VIEWPORT, + SCISSOR, + LINE_WIDTH, + DEPTH_BIAS, + BLEND_CONSTANTS, + DEPTH_BOUNDS, + STENCIL_WRITE_MASK, + STENCIL_COMPARE_MASK, + COUNT, +}; + +class GLES2CmdBindStates : public GLES2Cmd { + public: + GLES2GPUPipelineState* gpu_pso = nullptr; + GLES2GPUBindingLayout* gpu_binding_layout = nullptr; + GLES2GPUInputAssembler* gpu_ia = nullptr; + uint8_t state_flags[(int)GLES2State::COUNT] = {0}; + GFXViewport viewport; + GFXRect scissor; + float line_width = 1.0f; + GLES2DepthBias depth_bias; + GFXColor blend_constants; + GLES2DepthBounds depth_bounds; + GLES2StencilWriteMask stencil_write_mask; + GLES2StencilCompareMask stencil_compare_mask; + + GLES2CmdBindStates() : GLES2Cmd(GLES2CmdType::BIND_STATES) {} + + void Clear() { + gpu_pso = nullptr; + gpu_binding_layout = nullptr; + gpu_ia = nullptr; + memset(state_flags, 0, sizeof(state_flags)); + } +}; + +class GLES2CmdDraw : public GLES2Cmd { + public: + GFXDrawInfo draw_info; + + GLES2CmdDraw() : GLES2Cmd(GLES2CmdType::DRAW) {} + void Clear() {} +}; + +class GLES2CmdUpdateBuffer : public GLES2Cmd { + public: + GLES2GPUBuffer* gpu_buffer = nullptr; + uint8_t* buffer = nullptr; + uint size = 0; + uint offset = 0; + + GLES2CmdUpdateBuffer() : GLES2Cmd(GLES2CmdType::UPDATE_BUFFER) {} + + void Clear() { + gpu_buffer = nullptr; + buffer = nullptr; + } +}; + +class GLES2CmdCopyBufferToTexture : public GLES2Cmd { + public: + GLES2GPUBuffer* gpu_buffer = nullptr; + GLES2GPUTexture* gpu_texture = nullptr; + GFXTextureLayout dst_layout; + GFXBufferTextureCopyList regions; + + GLES2CmdCopyBufferToTexture() : GLES2Cmd(GLES2CmdType::COPY_BUFFER_TO_TEXTURE) {} + + void Clear() { + gpu_buffer = nullptr; + gpu_texture = nullptr; + regions.clear(); + } +}; + +class GLES2CmdPackage : public Object { + public: + CachedArray cmd_types; + CachedArray begin_render_pass_cmds; + CachedArray bind_states_cmds; + CachedArray draw_cmds; + CachedArray update_buffer_cmds; + CachedArray copy_buffer_to_texture_cmds; +}; + +CC_GLES2_API void GLES2CmdFuncCreateBuffer(GLES2Device* device, GLES2GPUBuffer* gpu_buffer); +CC_GLES2_API void GLES2CmdFuncDestroyBuffer(GLES2Device* device, GLES2GPUBuffer* gpu_buffer); +CC_GLES2_API void GLES2CmdFuncResizeBuffer(GLES2Device* device, GLES2GPUBuffer* gpu_buffer); +CC_GLES2_API void GLES2CmdFuncUpdateBuffer(GLES2Device* device, GLES2GPUBuffer* gpu_buffer, void* buffer, uint offset, uint size); +CC_GLES2_API void GLES2CmdFuncCreateTexture(GLES2Device* device, GLES2GPUTexture* gpu_texture); +CC_GLES2_API void GLES2CmdFuncDestroyTexture(GLES2Device* device, GLES2GPUTexture* gpu_texture); +CC_GLES2_API void GLES2CmdFuncResizeTexture(GLES2Device* device, GLES2GPUTexture* gpu_texture); +CC_GLES2_API void GLES2CmdFuncCreateSampler(GLES2Device* device, GLES2GPUSampler* gpu_sampler); +CC_GLES2_API void GLES2CmdFuncDestroySampler(GLES2Device* device, GLES2GPUSampler* gpu_sampler); +CC_GLES2_API void GLES2CmdFuncCreateShader(GLES2Device* device, GLES2GPUShader* gpu_shader); +CC_GLES2_API void GLES2CmdFuncDestroyShader(GLES2Device* device, GLES2GPUShader* gpu_shader); +CC_GLES2_API void GLES2CmdFuncCreateInputAssembler(GLES2Device* device, GLES2GPUInputAssembler* gpu_ia); +CC_GLES2_API void GLES2CmdFuncDestroyInputAssembler(GLES2Device* device, GLES2GPUInputAssembler* gpu_ia); +CC_GLES2_API void GLES2CmdFuncCreateFramebuffer(GLES2Device* device, GLES2GPUFramebuffer* gpu_fbo); +CC_GLES2_API void GLES2CmdFuncDestroyFramebuffer(GLES2Device* device, GLES2GPUFramebuffer* gpu_fbo); +CC_GLES2_API void GLES2CmdFuncExecuteCmds(GLES2Device* device, GLES2CmdPackage* cmd_package); +CC_GLES2_API void GLES2CmdFuncCopyBuffersToTexture(GLES2Device* device, uint8_t** buffers, uint count, GLES2GPUTexture* gpu_texture, const GFXBufferTextureCopyList& regions); + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2Device.cc b/native/cocos/renderer/gfx-gles2/GLES2Device.cc new file mode 100644 index 0000000000..bf29c38239 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2Device.cc @@ -0,0 +1,270 @@ +#include "GLES2Std.h" +#include "GLES2Device.h" +#include "GLES2StateCache.h" +#include "GLES2EGLContext.h" +#include "GLES2Window.h" +#include "GLES2Queue.h" +#include "GLES2CommandAllocator.h" +#include "GLES2CommandBuffer.h" +#include "GLES2Buffer.h" +#include "GLES2Texture.h" +#include "GLES2TextureView.h" +#include "GLES2Sampler.h" +#include "GLES2Shader.h" +#include "GLES2InputAssembler.h" +#include "GLES2RenderPass.h" +#include "GLES2Framebuffer.h" +#include "GLES2BindingLayout.h" + +CC_NAMESPACE_BEGIN + +GLES2Device::GLES2Device() + : state_cache(nullptr), + use_vao_(false), + use_draw_instanced_(false), + use_instanced_arrays_(false), + use_discard_framebuffer_(false) { +} + +GLES2Device::~GLES2Device() { +} + +bool GLES2Device::Initialize(const GFXDeviceInfo& info) { + + api_ = GFXAPI::GLES2; + width_ = info.width; + height_ = info.height; + native_width_ = info.native_width; + native_height_ = info.native_height; + window_handle_ = info.window_handle; + + state_cache = CC_NEW(GLES2StateCache); + + GFXContextInfo ctx_info; + ctx_info.window_handle = window_handle_; + ctx_info.shared_ctx = info.shared_ctx; + + context_ = CC_NEW(GLES2EGLContext(this)); + if (!context_->Initialize(ctx_info)) { + Destroy(); + return false; + } + + String extStr = (const char*)glGetString(GL_EXTENSIONS); + extensions_ = StringUtil::Split(extStr, " "); + + features_[(int)GFXFeature::TEXTURE_FLOAT] = true; + features_[(int)GFXFeature::TEXTURE_HALF_FLOAT] = true; + features_[(int)GFXFeature::FORMAT_R11G11B10F] = true; + features_[(int)GFXFeature::FORMAT_D24S8] = true; + features_[(int)GFXFeature::MSAA] = true; + + if (CheckExtension("color_buffer_float")) { + features_[(int)GFXFeature::COLOR_FLOAT] = true; + } + if (CheckExtension("color_buffer_half_float")) { + features_[(int)GFXFeature::COLOR_HALF_FLOAT] = true; + } + if (CheckExtension("texture_float_linear")) { + features_[(int)GFXFeature::TEXTURE_FLOAT_LINEAR] = true; + } + if (CheckExtension("texture_half_float_linear")) { + features_[(int)GFXFeature::TEXTURE_HALF_FLOAT_LINEAR] = true; + } + + use_vao_ = CheckExtension("GL_OES_depth_texture"); + use_draw_instanced_ = CheckExtension("draw_instanced_"); + use_instanced_arrays_ = CheckExtension("instanced_arrays"); + use_discard_framebuffer_ = CheckExtension("discard_framebuffer"); + + String compressed_fmts; + + if (CheckExtension("compressed_ETC1")) { + features_[(int)GFXFeature::FORMAT_ETC1] = true; + compressed_fmts += "etc1 "; + } + + features_[(int)GFXFeature::FORMAT_ETC2] = true; + compressed_fmts += "etc2 "; + + if (CheckExtension("texture_compression_pvrtc")) { + features_[(int)GFXFeature::FORMAT_PVRTC] = true; + compressed_fmts += "pvrtc "; + } + + if (CheckExtension("texture_compression_astc")) { + features_[(int)GFXFeature::FORMAT_ASTC] = true; + compressed_fmts += "astc "; + } + + renderer_ = (const char*)glGetString(GL_RENDERER); + vendor_ = (const char*)glGetString(GL_VENDOR); + version_ = (const char*)glGetString(GL_VERSION); + + CC_LOG_INFO("RENDERER: %s", renderer_.c_str()); + CC_LOG_INFO("VENDOR: %s", vendor_.c_str()); + CC_LOG_INFO("VERSION: %s", version_.c_str()); + CC_LOG_INFO("SCREEN_SIZE: %d x %d", width_, height_); + CC_LOG_INFO("NATIVE_SIZE: %d x %d", native_width_, native_height_); + CC_LOG_INFO("USE_VAO: %s", use_vao_ ? "true" : "false"); + CC_LOG_INFO("COMPRESSED_FORMATS: %s", compressed_fmts.c_str()); + + GFXWindowInfo window_info; + window_info.color_fmt = context_->color_fmt(); + window_info.depth_stencil_fmt = context_->depth_stencil_fmt(); + window_info.is_offscreen = false; + window_ = CreateGFXWindow(window_info); + + GFXQueueInfo queue_info; + queue_info.type = GFXQueueType::GRAPHICS; + queue_ = CreateGFXQueue(queue_info); + + GFXCommandAllocatorInfo cmd_alloc_info; + cmd_allocator_ = CreateGFXCommandAllocator(cmd_alloc_info); + + return true; +} + +void GLES2Device::Destroy() { + CC_SAFE_DESTROY(cmd_allocator_); + CC_SAFE_DESTROY(queue_); + CC_SAFE_DESTROY(window_); + CC_SAFE_DESTROY(context_); + CC_SAFE_DELETE(state_cache); +} + +void GLES2Device::Resize(uint width, uint height) { + +} + +void GLES2Device::Present() { + ((GLES2CommandAllocator*)cmd_allocator_)->ReleaseCmds(); + GLES2Queue* queue = (GLES2Queue*)queue_; + num_draw_calls_ += queue->num_draw_calls_; + num_tris_ += queue->num_tris_; + + context_->Present(); + + // Clear queue stats + queue->num_draw_calls_ = 0; + queue->num_tris_ = 0; +} + +GFXWindow* GLES2Device::CreateGFXWindow(const GFXWindowInfo& info) { + GFXWindow* gfx_window = CC_NEW(GLES2Window(this)); + if (gfx_window->Initialize(info)) { + return gfx_window; + } else { + return nullptr; + } +} + +GFXQueue* GLES2Device::CreateGFXQueue(const GFXQueueInfo& info) { + GFXQueue* gfx_queue = CC_NEW(GLES2Queue(this)); + if (gfx_queue->Initialize(info)) { + return gfx_queue; + } else { + return nullptr; + } +} + +GFXCommandAllocator* GLES2Device::CreateGFXCommandAllocator(const GFXCommandAllocatorInfo& info) { + GFXCommandAllocator* gfx_cmd_allocator = CC_NEW(GLES2CommandAllocator(this)); + if (gfx_cmd_allocator->Initialize(info)) { + return gfx_cmd_allocator; + } else { + return nullptr; + } +} + +GFXCommandBuffer* GLES2Device::CreateGFXCommandBuffer(const GFXCommandBufferInfo& info) { + GFXCommandBuffer* gfx_cmd_buff = CC_NEW(GLES2CommandBuffer(this)); + if (gfx_cmd_buff->Initialize(info)) { + return gfx_cmd_buff; + } else { + return nullptr; + } +} + +GFXBuffer* GLES2Device::CreateGFXBuffer(const GFXBufferInfo& info) { + GFXBuffer* gfx_buffer = CC_NEW(GLES2Buffer(this)); + if (gfx_buffer->Initialize(info)) { + return gfx_buffer; + } else { + return nullptr; + } +} + +GFXTexture* GLES2Device::CreateGFXTexture(const GFXTextureInfo& info) { + GFXTexture* gfx_texture = CC_NEW(GLES2Texture(this)); + if (gfx_texture->Initialize(info)) { + return gfx_texture; + } else { + return nullptr; + } +} + +GFXTextureView* GLES2Device::CreateGFXTextureView(const GFXTextureViewInfo& info) { + GFXTextureView* gfx_tex_view = CC_NEW(GLES2TextureView(this)); + if (gfx_tex_view->Initialize(info)) { + return gfx_tex_view; + } else { + return nullptr; + } +} + +GFXSampler* GLES2Device::CreateGFXSampler(const GFXSamplerInfo& info) { + GFXSampler* gfx_sampler = CC_NEW(GLES2Sampler(this)); + if (gfx_sampler->Initialize(info)) { + return gfx_sampler; + } else { + return nullptr; + } +} + +GFXShader* GLES2Device::CreateGFXShader(const GFXShaderInfo& info) { + GFXShader* gfx_shader = CC_NEW(GLES2Shader(this)); + if (gfx_shader->Initialize(info)) { + return gfx_shader; + } else { + return nullptr; + } +} + +GFXInputAssembler* GLES2Device::CreateGFXInputAssembler(const GFXInputAssemblerInfo& info) { + GFXInputAssembler* gfx_input_assembler = CC_NEW(GLES2InputAssembler(this)); + if (gfx_input_assembler->Initialize(info)) { + return gfx_input_assembler; + } else { + return nullptr; + } +} + +GFXRenderPass* GLES2Device::CreateGFXRenderPass(const GFXRenderPassInfo& info) { + GFXRenderPass* gfx_render_pass = CC_NEW(GLES2RenderPass(this)); + if (gfx_render_pass->Initialize(info)) { + return gfx_render_pass; + } else { + return nullptr; + } +} + +GFXFramebuffer* GLES2Device::CreateGFXFramebuffer(const GFXFramebufferInfo& info) { + GFXFramebuffer* gfx_framebuffer = CC_NEW(GLES2Framebuffer(this)); + if (gfx_framebuffer->Initialize(info)) { + return gfx_framebuffer; + } else { + return nullptr; + } +} + +GFXBindingLayout* GLES2Device::CreateGFXBindingLayout(const GFXBindingLayoutInfo& info) { + GFXBindingLayout* gfx_binding_layout = CC_NEW(GLES2BindingLayout(this)); + if (gfx_binding_layout->Initialize(info)) { + return gfx_binding_layout; + } else { + return nullptr; + } +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles2/GLES2Device.h b/native/cocos/renderer/gfx-gles2/GLES2Device.h new file mode 100644 index 0000000000..f449d8d217 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2Device.h @@ -0,0 +1,58 @@ +#ifndef CC_GFXGLES2_GLES2_DEVICE_H_ +#define CC_GFXGLES2_GLES2_DEVICE_H_ + +CC_NAMESPACE_BEGIN + +class GLES2StateCache; + +class CC_GLES2_API GLES2Device : public GFXDevice { +public: + GLES2Device(); + ~GLES2Device(); + + GLES2StateCache* state_cache; + +public: + bool Initialize(const GFXDeviceInfo& info); + void Destroy(); + void Resize(uint width, uint height); + void Present(); + GFXWindow* CreateGFXWindow(const GFXWindowInfo& info); + GFXQueue* CreateGFXQueue(const GFXQueueInfo& info); + GFXCommandAllocator* CreateGFXCommandAllocator(const GFXCommandAllocatorInfo& info); + GFXCommandBuffer* CreateGFXCommandBuffer(const GFXCommandBufferInfo& info); + GFXBuffer* CreateGFXBuffer(const GFXBufferInfo& info); + GFXTexture* CreateGFXTexture(const GFXTextureInfo& info); + GFXTextureView* CreateGFXTextureView(const GFXTextureViewInfo& info); + GFXSampler* CreateGFXSampler(const GFXSamplerInfo& info); + GFXShader* CreateGFXShader(const GFXShaderInfo& info); + GFXInputAssembler* CreateGFXInputAssembler(const GFXInputAssemblerInfo& info); + GFXRenderPass* CreateGFXRenderPass(const GFXRenderPassInfo& info); + GFXFramebuffer* CreateGFXFramebuffer(const GFXFramebufferInfo& info); + GFXBindingLayout* CreateGFXBindingLayout(const GFXBindingLayoutInfo& info); + + CC_INLINE bool use_vao() const { return use_vao_; } + CC_INLINE bool use_draw_instanced() const { return use_draw_instanced_; } + CC_INLINE bool use_instanced_arrays() const { return use_instanced_arrays_; } + CC_INLINE bool use_discard_framebuffer() const { return use_discard_framebuffer_; } + + CC_INLINE bool CheckExtension(const String& extension) const { + for (size_t i = 0; i < extensions_.size(); ++i) { + if (extensions_[i].find(extension) != String::npos) { + return true; + } + } + return false; + } + + private: + StringArray extensions_; + bool use_vao_; + bool use_draw_instanced_; + bool use_instanced_arrays_; + bool use_discard_framebuffer_; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2EGLContext.cc b/native/cocos/renderer/gfx-gles2/GLES2EGLContext.cc new file mode 100644 index 0000000000..358c840ee6 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2EGLContext.cc @@ -0,0 +1,430 @@ +#include "GLES2Std.h" +#include "GLES2EGLContext.h" +#include "gles2w.h" + +// #define CC_GFX_DEBUG + +CC_NAMESPACE_BEGIN + +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) + +void APIENTRY GLES2EGLDebugProc(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam) +{ + String source_desc; + switch (source) + { + case GL_DEBUG_SOURCE_API_KHR: source_desc = "API"; break; + case GL_DEBUG_SOURCE_SHADER_COMPILER_KHR: source_desc = "SHADER_COMPILER"; break; + case GL_DEBUG_SOURCE_WINDOW_SYSTEM_KHR: source_desc = "WINDOW_SYSTEM"; break; + case GL_DEBUG_SOURCE_THIRD_PARTY_KHR: source_desc = "THIRD_PARTY"; break; + case GL_DEBUG_SOURCE_APPLICATION_KHR: source_desc = "APPLICATION"; break; + default: source_desc = "OTHER"; + } + + String type_desc; + switch (severity) + { + case GL_DEBUG_TYPE_ERROR_KHR: type_desc = "ERROR"; break; + case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR: type_desc = "PEPRECATED_BEHAVIOR"; break; + case GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR: type_desc = "UNDEFINED_BEHAVIOR"; break; + case GL_DEBUG_TYPE_PERFORMANCE_KHR: type_desc = "PERFORMANCE"; break; + case GL_DEBUG_TYPE_PORTABILITY_KHR: type_desc = "PORTABILITY"; break; + case GL_DEBUG_TYPE_MARKER_KHR: type_desc = "MARKER"; break; + case GL_DEBUG_TYPE_PUSH_GROUP_KHR: type_desc = "PUSH_GROUP"; break; + case GL_DEBUG_TYPE_POP_GROUP_KHR: type_desc = "POP_GROUP"; break; + default: type_desc = "OTHER"; + } + + String severity_desc; + switch (severity) + { + case GL_DEBUG_SEVERITY_HIGH_KHR: severity_desc = "HIGH"; break; + case GL_DEBUG_SEVERITY_MEDIUM_KHR: severity_desc = "MEDIUM"; break; + case GL_DEBUG_SEVERITY_LOW_KHR: severity_desc = "LOW"; break; + default: severity_desc = "NOTIFICATION"; + } + + String msg = StringUtil::Format("source: %s, type: %s, severity: %s, message: %s", + source_desc.c_str(), type_desc.c_str(), severity_desc.c_str(), message); + + if (severity == GL_DEBUG_SEVERITY_HIGH_KHR) + { +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) + CC_ASSERTS(false, msg.c_str()); +#else + CC_LOG_ERROR(msg.c_str()); +#endif + } else { + CC_LOG_DEBUG(msg.c_str()); + } +} + +#endif + +GLES2EGLContext::GLES2EGLContext(GFXDevice* device) + : GFXContext(device), + is_primary_ctx_(false), + native_display_(0), + egl_display_(EGL_NO_DISPLAY), + egl_config_(EGL_NO_CONFIG_KHR), + egl_surface_(EGL_NO_SURFACE), + egl_context_(EGL_NO_CONTEXT), + egl_shared_ctx_(EGL_NO_CONTEXT), + major_ver_(0), + minor_ver_(0), + is_initialized(false) { +} + +GLES2EGLContext::~GLES2EGLContext() { +} + +bool GLES2EGLContext::Initialize(const GFXContextInfo &info) { + + vsync_mode_ = info.vsync_mode; + window_handle_ = info.window_handle; + + ////////////////////////////////////////////////////////////////////////// + + if (!info.shared_ctx) + { + is_primary_ctx_ = true; + window_handle_ = info.window_handle; + +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) + native_display_ = (NativeDisplayType)GetDC((HWND)window_handle_); + if (!native_display_) { + return false; + } + + egl_display_ = eglGetDisplay(native_display_); + if (egl_display_ == EGL_NO_DISPLAY) { + egl_display_ = eglGetDisplay((EGLNativeDisplayType)EGL_DEFAULT_DISPLAY); + } +#else + egl_display_ = eglGetDisplay((EGLNativeDisplayType)EGL_DEFAULT_DISPLAY); +#endif + // If a display still couldn't be obtained, return an error. + if (egl_display_ == EGL_NO_DISPLAY) { + CC_LOG_ERROR("eglGetDisplay() - FAILED."); + return false; + } + + EGLint major = 0; + EGLint minor = 0; + if (eglInitialize(egl_display_, &major, &minor) != EGL_TRUE) { + CC_LOG_ERROR("Couldn't initialize EGLDisplay."); + return false; + } + + // Make OpenGL ES the current API. + // EGL needs a way to know that any subsequent EGL calls are going to be affecting OpenGL ES, + // rather than any other API (such as OpenVG). + eglBindAPI(EGL_OPENGL_ES_API); + + if (!gles2wInit()) + { + return false; + } + + color_fmt_ = GFXFormat::RGBA8; + depth_stencil_fmt_ = GFXFormat::D24S8; + + const EGLint attribs[] = { + EGL_SURFACE_TYPE, EGL_WINDOW_BIT | EGL_PBUFFER_BIT, + // EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, + EGL_RENDERABLE_TYPE, EGL_OPENGL_ES3_BIT_KHR, + // EGL_BUFFER_SIZE, colorBuffSize, + EGL_BLUE_SIZE, 8, + EGL_GREEN_SIZE, 8, + EGL_RED_SIZE, 8, + EGL_ALPHA_SIZE, 8, + EGL_DEPTH_SIZE, 24, + EGL_STENCIL_SIZE, 8, + EGL_NONE + }; + + // Find a suitable EGLConfig + // eglChooseConfig is provided by EGL to provide an easy way to select an appropriate configuration. It takes in the capabilities + // specified in the attribute list, and returns a list of available configurations that match or exceed the capabilities requested. + // Details of all the possible attributes and how they are selected for by this function are available in the EGL reference pages here: + // http://www.khronos.org/registry/egl/sdk/docs/man/xhtml/eglChooseConfig.html + // It is also possible to simply get the entire list of configurations and use a custom algorithm to choose a suitable one, as many + // advanced applications choose to do. For this application however, taking the first EGLConfig that the function returns suits + // its needs perfectly, so we limit it to returning a single EGLConfig. + + EGLint num_configs; + if (eglChooseConfig(egl_display_, attribs, &egl_config_, 1, &num_configs) == EGL_FALSE || num_configs <= 0) + { + CC_LOG_ERROR("Choosing configuration failed."); + return false; + } + + EGLint depth = attribs[13]; + EGLint stencil = attribs[15]; + CC_LOG_INFO("Setup EGLConfig: depth [%d] stencil [%d]", depth, stencil); + + if (depth == 16 && stencil == 0) { + depth_stencil_fmt_ = GFXFormat::D16; + } else if (depth == 16 && stencil == 8) { + depth_stencil_fmt_ = GFXFormat::D16S8; + } else if (depth == 24 && stencil == 0) { + depth_stencil_fmt_ = GFXFormat::D24; + } else if (depth == 24 && stencil == 8) { + depth_stencil_fmt_ = GFXFormat::D24S8; + } else if (depth == 32 && stencil == 0) { + depth_stencil_fmt_ = GFXFormat::D32F; + } else if (depth == 32 && stencil == 8) { + depth_stencil_fmt_ = GFXFormat::D32F_S8; + } else { + CC_LOG_ERROR("Unknown depth stencil format."); + return false; + } + + CC_LOG_INFO("Chosen EGLConfig: color [%s], depth stencil [%s].", + GFX_FORMAT_INFOS[(int)color_fmt_].name.c_str(), + GFX_FORMAT_INFOS[(int)depth_stencil_fmt_].name.c_str()); + + /* EGL_NATIVE_VISUAL_ID is an attribute of the EGLConfig that is + * guaranteed to be accepted by ANativeWindow_setBuffersGeometry(). + * As soon as we picked a EGLConfig, we can safely reconfigure the + * ANativeWindow buffers to match, using EGL_NATIVE_VISUAL_ID. */ + +#if (CC_PLATFORM == CC_PLATFORM_ANDROID) + EGLint n_fmt; + if (eglGetConfigAttrib(egl_display_, egl_config_, EGL_NATIVE_VISUAL_ID, &n_fmt) == EGL_FALSE) { + CC_LOG_ERROR("Getting configuration attributes failed."); + return false; + } + + uint width = device_->width(); + uint height = device_->height(); + ANativeWindow_setBuffersGeometry((ANativeWindow*)window_handle_, width, height, n_fmt); +#endif + + egl_surface_ = eglCreateWindowSurface(egl_display_, egl_config_, (EGLNativeWindowType)window_handle_, NULL); + if (egl_surface_ == EGL_NO_SURFACE) { + CC_LOG_ERROR("Window surface created failed."); + return false; + } + + //String egl_vendor = eglQueryString(egl_display_, EGL_VENDOR); + //String egl_version = eglQueryString(egl_display_, EGL_VERSION); + + extensions_ = StringUtil::Split((const char*)eglQueryString(egl_display_, EGL_EXTENSIONS), " "); + + major_ver_ = 2; + minor_ver_ = 0; + EGLint ctx_attribs[32]; + uint n = 0; + + bool has_khr_create_ctx = CheckExtension(CC_TOSTR(EGL_KHR_create_context)); + if (has_khr_create_ctx) { + ctx_attribs[n++] = EGL_CONTEXT_MAJOR_VERSION_KHR; + ctx_attribs[n++] = major_ver_; + ctx_attribs[n++] = EGL_CONTEXT_MINOR_VERSION_KHR; + ctx_attribs[n++] = minor_ver_; + +#ifdef CC_GFX_DEBUG + ctx_attribs[n++] = EGL_CONTEXT_FLAGS_KHR; + ctx_attribs[n++] = EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR; +#endif + ctx_attribs[n] = EGL_NONE; + } + else { + ctx_attribs[n++] = EGL_CONTEXT_CLIENT_VERSION; + ctx_attribs[n++] = major_ver_; + ctx_attribs[n] = EGL_NONE; + } + + egl_context_ = eglCreateContext(egl_display_, egl_config_, NULL, ctx_attribs); + if (!egl_context_) { + CC_LOG_ERROR("Create EGL context failed."); + return false; + } + + egl_shared_ctx_ = egl_context_; + } else { + GLES2EGLContext* shared_ctx = (GLES2EGLContext*)info.shared_ctx; + + major_ver_ = shared_ctx->major_ver(); + minor_ver_ = shared_ctx->minor_ver(); + native_display_ = shared_ctx->native_display(); + egl_display_ = shared_ctx->egl_display(); + egl_config_ = shared_ctx->egl_config(); + egl_shared_ctx_ = shared_ctx->egl_shared_ctx(); + color_fmt_ = shared_ctx->color_fmt(); + depth_stencil_fmt_ = shared_ctx->depth_stencil_fmt(); + + EGLint pbuff_attribs[] = + { + EGL_WIDTH, 2, + EGL_HEIGHT, 2, + EGL_LARGEST_PBUFFER, EGL_TRUE, + EGL_TEXTURE_FORMAT, EGL_NO_TEXTURE, + EGL_TEXTURE_TARGET, EGL_NO_TEXTURE, + EGL_NONE + }; + + egl_surface_ = eglCreatePbufferSurface(egl_display_, egl_config_, pbuff_attribs); + if (egl_surface_ == EGL_NO_SURFACE) { + CC_LOG_ERROR("eglCreatePbufferSurface - FAILED"); + return false; + } + + bool has_khr_create_ctx = CheckExtension(CC_TOSTR(EGL_KHR_create_context)); + if (!has_khr_create_ctx) + { + CC_LOG_INFO("EGL context creation: EGL_KHR_create_context not supported. Minor version will be discarded, and debug disabled."); + minor_ver_ = 0; + } + + EGLint ctx_attribs[32]; + uint n = 0; + + if (has_khr_create_ctx) + { + ctx_attribs[n++] = EGL_CONTEXT_MAJOR_VERSION_KHR; + ctx_attribs[n++] = major_ver_; + ctx_attribs[n++] = EGL_CONTEXT_MINOR_VERSION_KHR; + ctx_attribs[n++] = minor_ver_; + +#ifdef CC_GFX_DEBUG + ctx_attribs[n++] = EGL_CONTEXT_FLAGS_KHR; + ctx_attribs[n++] = EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR; +#endif + } + else + { + ctx_attribs[n++] = EGL_CONTEXT_CLIENT_VERSION; + ctx_attribs[n++] = major_ver_; + } + + ctx_attribs[n] = EGL_NONE; + + egl_context_ = eglCreateContext(egl_display_, egl_config_, egl_shared_ctx_, ctx_attribs); + if (!egl_context_) { + CC_LOG_ERROR("Create EGL context with share context [0x%p] failed.", egl_shared_ctx_); + return false; + } + } + + if (!MakeCurrent()) { + return false; + } + + return true; +} + +void GLES2EGLContext::Destroy() { + if (egl_context_ != EGL_NO_CONTEXT) { + eglDestroyContext(egl_display_, egl_context_); + egl_context_ = EGL_NO_CONTEXT; + } + + if (egl_surface_ != EGL_NO_SURFACE) { + eglDestroySurface(egl_display_, egl_surface_); + egl_surface_ = EGL_NO_SURFACE; + } + + eglMakeCurrent(egl_display_, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); + +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) + if (is_primary_ctx_ && native_display_) + { + ReleaseDC((HWND)window_handle_, native_display_); + } +#endif + + is_primary_ctx_ = false; + window_handle_ = 0; + native_display_ = 0; + vsync_mode_ = GFXVsyncMode::OFF; + is_initialized = false; +} + +bool GLES2EGLContext::CheckExtension(const String& extension) const { + return (std::find(extensions_.begin(), extensions_.end(), extension) != extensions_.end()); +} + +bool GLES2EGLContext::MakeCurrent() { + if (eglMakeCurrent(egl_display_, egl_surface_, egl_surface_, egl_context_)) { + if (!is_initialized) { + // Turn on or off the vertical sync depending on the input bool value. + int interval = 1; + switch (vsync_mode_) { + case GFXVsyncMode::OFF: interval = 0; break; + case GFXVsyncMode::ON: interval = 1; break; + case GFXVsyncMode::RELAXED: interval = -1; break; + case GFXVsyncMode::MAILBOX: interval = 0; break; + case GFXVsyncMode::HALF: interval = 2; break; + default:; + } + + if (eglSwapInterval(egl_display_, interval) != 1) { + CC_LOG_ERROR("wglSwapInterval() - FAILED."); + return false; + } + +#if defined(CC_GFX_DEBUG) + glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR); + glDebugMessageControlKHR(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, NULL, GL_TRUE); + glDebugMessageCallbackKHR(GLES3EGLDebugProc, NULL); +#endif + + ////////////////////////////////////////////////////////////////////////// + + glPixelStorei(GL_PACK_ALIGNMENT, 1); + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + glActiveTexture(GL_TEXTURE0); + + ////////////////////////////////////////////////////////////////////////// + + glEnable(GL_CULL_FACE); + glCullFace(GL_BACK); + + glFrontFace(GL_CW); + + //glDisable(GL_MULTISAMPLE); + + ////////////////////////////////////////////////////////////////////////// + // DepthStencilState + glEnable(GL_DEPTH_TEST); + glDepthMask(GL_TRUE); + glDepthFunc(GL_LESS); + + glStencilFuncSeparate(GL_FRONT, GL_ALWAYS, 1, 0xffffffff); + glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_KEEP); + glStencilMaskSeparate(GL_FRONT, 0xffffffff); + glStencilFuncSeparate(GL_BACK, GL_ALWAYS, 1, 0xffffffff); + glStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_KEEP); + glStencilMaskSeparate(GL_BACK, 0xffffffff); + + glDisable(GL_STENCIL_TEST); + + ////////////////////////////////////////////////////////////////////////// + // BlendState + + glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE); + glDisable(GL_BLEND); + glBlendEquationSeparate(GL_FUNC_ADD, GL_FUNC_ADD); + glBlendFuncSeparate(GL_ONE, GL_ZERO, GL_ONE, GL_ZERO); + glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); + glBlendColor((GLclampf)0.0f, (GLclampf)0.0f, (GLclampf)0.0f, (GLclampf)0.0f); + + is_initialized = true; + } + + CC_LOG_DEBUG("eglMakeCurrent() - SUCCESSED, NativeDisplayType: 0x%p, EGLContext: 0x%p", native_display_, egl_context_); + return true; + } else { + CC_LOG_ERROR("eglMakeCurrent() - FAILED, Error: %d, NativeDisplayType: 0x%p, EGLContext: 0x%p", GetLastError(), native_display_, egl_context_); + return false; + } +} + +void GLES2EGLContext::Present() +{ + eglSwapBuffers(egl_display_, egl_surface_); +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles2/GLES2EGLContext.h b/native/cocos/renderer/gfx-gles2/GLES2EGLContext.h new file mode 100644 index 0000000000..3b9e28edac --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2EGLContext.h @@ -0,0 +1,71 @@ +#ifndef CC_GFXGLES2_GLES2_EGL_CONTEXT_H_ +#define CC_GFXGLES2_GLES2_EGL_CONTEXT_H_ + +#if (CC_PLATFORM == CC_PLATFORM_MAC_IOS) +# ifdef __OBJC__ +# include +# endif +#else +# include +# include +# include +#endif + +#ifndef EGL_KHR_create_context +#define EGL_KHR_create_context 1 +#define EGL_CONTEXT_MAJOR_VERSION_KHR EGL_CONTEXT_CLIENT_VERSION +#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB +#define EGL_CONTEXT_FLAGS_KHR 0x30FC +#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD +#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD +#define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE +#define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF +#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001 +#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002 +#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004 +#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001 +#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002 +#define EGL_OPENGL_ES3_BIT_KHR 0x00000040 +#endif + +CC_NAMESPACE_BEGIN + +class CC_GLES2_API GLES2EGLContext : public GFXContext { +public: + GLES2EGLContext(GFXDevice* device); + ~GLES2EGLContext(); + +public: + bool Initialize(const GFXContextInfo& info); + void Destroy(); + void Present(); + bool MakeCurrent(); + + bool CheckExtension(const String& extension) const; + + CC_INLINE NativeDisplayType native_display() const { return native_display_; } + CC_INLINE EGLDisplay egl_display() const { return egl_display_; } + CC_INLINE EGLConfig egl_config() const { return egl_config_; } + CC_INLINE EGLSurface egl_surface() const { return egl_surface_; } + CC_INLINE EGLContext egl_context() const { return egl_context_; } + CC_INLINE EGLContext egl_shared_ctx() const { return egl_shared_ctx_; } + CC_INLINE int major_ver() const { return major_ver_; } + CC_INLINE int minor_ver() const { return minor_ver_; } + +private: + bool is_primary_ctx_; + NativeDisplayType native_display_; + EGLDisplay egl_display_; + EGLConfig egl_config_; + EGLSurface egl_surface_; + EGLContext egl_context_; + EGLContext egl_shared_ctx_; + int major_ver_; + int minor_ver_; + StringArray extensions_; + bool is_initialized; +}; + +CC_NAMESPACE_END + +#endif // CC_GFXGLES2_GLES2_EGL_CONTEXT_H_ diff --git a/native/cocos/renderer/gfx-gles2/GLES2Framebuffer.cc b/native/cocos/renderer/gfx-gles2/GLES2Framebuffer.cc new file mode 100644 index 0000000000..25455ba6e0 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2Framebuffer.cc @@ -0,0 +1,54 @@ +#include "GLES2Std.h" +#include "GLES2Framebuffer.h" +#include "GLES2RenderPass.h" +#include "GLES2Commands.h" +#include "GLES2TextureView.h" + +CC_NAMESPACE_BEGIN + +GLES2Framebuffer::GLES2Framebuffer(GFXDevice* device) + : GFXFramebuffer(device), + gpu_fbo_(nullptr) { +} + +GLES2Framebuffer::~GLES2Framebuffer() { +} + +bool GLES2Framebuffer::Initialize(const GFXFramebufferInfo &info) { + + render_pass_ = info.render_pass; + color_views_ = info.color_views; + depth_stencil_view_ = info.depth_stencil_view; + is_offscreen_ = info.is_offscreen; + + gpu_fbo_ = CC_NEW(GLES2GPUFramebuffer); + gpu_fbo_->gpu_render_pass = ((GLES2RenderPass*)render_pass_)->gpu_render_pass(); + + if (is_offscreen_) { + gpu_fbo_->gpu_color_views.resize(color_views_.size()); + for (size_t i = 0; i < color_views_.size(); ++i) { + GLES2TextureView* color_view = (GLES2TextureView*)color_views_[i]; + gpu_fbo_->gpu_color_views[i] = color_view->gpu_tex_view(); + } + + if (depth_stencil_view_) { + gpu_fbo_->gpu_depth_stencil_view = ((GLES2TextureView*)depth_stencil_view_)->gpu_tex_view(); + } + + gpu_fbo_->is_offscreen = is_offscreen_; + + GLES2CmdFuncCreateFramebuffer((GLES2Device*)device_, gpu_fbo_); + } + + return true; +} + +void GLES2Framebuffer::Destroy() { + if (gpu_fbo_) { + CC_DELETE(gpu_fbo_); + GLES2CmdFuncDestroyFramebuffer((GLES2Device*)device_, gpu_fbo_); + gpu_fbo_ = nullptr; + } +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles2/GLES2Framebuffer.h b/native/cocos/renderer/gfx-gles2/GLES2Framebuffer.h new file mode 100644 index 0000000000..b5471ed740 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2Framebuffer.h @@ -0,0 +1,25 @@ +#ifndef CC_GFXGLES2_GLES2_FRAMEBUFFER_H_ +#define CC_GFXGLES2_GLES2_FRAMEBUFFER_H_ + +CC_NAMESPACE_BEGIN + +class GLES2GPUFramebuffer; + +class CC_GLES2_API GLES2Framebuffer : public GFXFramebuffer { + public: + GLES2Framebuffer(GFXDevice* device); + ~GLES2Framebuffer(); + + public: + bool Initialize(const GFXFramebufferInfo& info); + void Destroy(); + + CC_INLINE GLES2GPUFramebuffer* gpu_fbo() const { return gpu_fbo_; } + + private: + GLES2GPUFramebuffer* gpu_fbo_; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2GPUObjects.h b/native/cocos/renderer/gfx-gles2/GLES2GPUObjects.h new file mode 100644 index 0000000000..ef5770f797 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2GPUObjects.h @@ -0,0 +1,221 @@ +#ifndef CC_GFXGLES2_GPU_OBJECTS_H_ +#define CC_GFXGLES2_GPU_OBJECTS_H_ + +#include "gles2w.h" + +CC_NAMESPACE_BEGIN + +class GLES2GPUBuffer : public Object { + public: + GFXBufferUsage usage = GFXBufferUsage::NONE; + GFXMemoryUsage mem_usage = GFXMemoryUsage::NONE; + uint size = 0; + uint stride = 0; + uint count = 0; + GLenum gl_target = 0; + GLuint gl_buffer = 0; + uint8_t* buffer = nullptr; + GFXIndirectBuffer indirect_buff; +}; +typedef vector::type GLES2GPUBufferList; + +class GLES2GPUTexture : public Object { + public: + GFXTextureType type = GFXTextureType::TEX2D; + GFXTextureViewType view_type = GFXTextureViewType::TV2D; + GFXFormat format = GFXFormat::UNKNOWN; + GFXTextureUsage usage = GFXTextureUsageBit::NONE; + uint width = 0; + uint height = 0; + uint depth = 1; + uint size = 0; + uint array_layer = 1; + uint mip_level = 1; + GFXSampleCount samples = GFXSampleCount::X1; + GFXTextureFlags flags = GFXTextureFlagBit::NONE; + bool is_pot = false; + GLenum gl_target = 0; + GLenum gl_internal_fmt = 0; + GLenum gl_format = 0; + GLenum gl_type = 0; + GLenum gl_usage = 0; + GLuint gl_texture = 0; + GLenum gl_wrap_s = 0; + GLenum gl_wrap_t = 0; + GLenum gl_min_filter = 0; + GLenum gl_mag_filter = 0; +}; + +class GLES2GPUTextureView : public Object { + public: + GLES2GPUTexture* gpu_texture = nullptr; + GFXTextureViewType type = GFXTextureViewType::TV2D; + GFXFormat format = GFXFormat::UNKNOWN; + uint base_level = 0; + uint level_count = 1; +}; + +typedef vector::type GLES2GPUTextureViewList; + +class GLES2GPUSampler : public Object { + public: + GFXFilter min_filter = GFXFilter::NONE; + GFXFilter mag_filter = GFXFilter::NONE; + GFXFilter mip_filter = GFXFilter::NONE; + GFXAddress address_u = GFXAddress::CLAMP; + GFXAddress address_v = GFXAddress::CLAMP; + GFXAddress address_w = GFXAddress::CLAMP; + uint min_lod = 0; + uint max_lod = 1000; + GLenum gl_min_filter = 0; + GLenum gl_mag_filter = 0; + GLenum gl_wrap_s = 0; + GLenum gl_wrap_t = 0; + GLenum gl_wrap_r = 0; +}; + +struct GLES2GPUInput { + uint binding; + String name; + GFXType type; + uint stride; + uint count; + uint size; + GLenum gl_type; + GLint gl_loc; +}; +typedef vector::type GLES2GPUInputList; + +struct GLES2GPUUniform { + uint binding; + String name; + GFXType type; + uint stride; + uint count; + uint size; + uint offset; + GLenum gl_type; + GLint gl_loc; + uint8_t* buff = nullptr; + + GLES2GPUUniform() {} + ~GLES2GPUUniform() { + CC_SAFE_FREE(buff); + } +}; +typedef vector::type GLES2GPUUniformList; + +struct GLES2GPUUniformBlock { + uint binding; + uint idx; + String name; + uint size; + GLES2GPUUniformList uniforms; + GLES2GPUUniformList active_uniforms; +}; +typedef vector::type GLES2GPUUniformBlockList; + +struct GLES2GPUUniformSampler { + uint binding; + String name; + GFXType type; + vector::type units; + GLenum gl_type; + GLint gl_loc; +}; +typedef vector::type GLES2GPUUniformSamplerList; + +struct GLES2GPUShaderStage { + GFXShaderType type; + String source; + GFXShaderMacroList macros; + GLuint gl_shader = 0; +}; +typedef vector::type GLES2GPUShaderStageList; + +class GLES2GPUShader : public Object { +public: + String name; + GFXUniformBlockList blocks; + GFXUniformSamplerList samplers; + GLuint gl_program = 0; + GLES2GPUShaderStageList gpu_stages; + GLES2GPUInputList gpu_inputs; + GLES2GPUUniformBlockList gpu_blocks; + GLES2GPUUniformSamplerList gpu_samplers; +}; + +struct GLES2GPUAttribute { + String name; + GLuint gl_buffer = 0; + GLenum gl_type = 0; + uint size = 0; + uint count = 0; + uint stride = 1; + uint component_count = 1; + bool is_normalized = false; + bool is_instanced = false; + uint offset = 0; +}; +typedef vector::type GLES2GPUAttributeList; + +class GLES2GPUInputAssembler : public Object { + public: + GFXAttributeList attribs; + GLES2GPUBufferList gpu_vertex_buffers; + GLES2GPUBuffer* gpu_index_buffer; + GLES2GPUBuffer* gpu_indirect_buffer; + GLES2GPUAttributeList gpu_attribs; + GLenum gl_index_type; + map::type gl_vaos; +}; + +class GLES2GPURenderPass : public Object { + public: + GFXColorAttachmentList color_attachments; + GFXDepthStencilAttachment depth_stencil_attachment; +}; + +class GLES2GPUFramebuffer : public Object { + public: + GLES2GPURenderPass* gpu_render_pass = nullptr; + GLES2GPUTextureViewList gpu_color_views; + GLES2GPUTextureView* gpu_depth_stencil_view = nullptr; + bool is_offscreen = false; + GLuint gl_fbo = 0; +}; + +class GLES2GPUPipelineLayout : public Object { + public: +}; + +class GLES2GPUPipelineState : public Object { + public: + GLenum gl_primitive = GL_TRIANGLES; + GLES2GPUShader* gpu_shader = nullptr; + GFXRasterizerState rs; + GFXDepthStencilState dss; + GFXBlendState bs; + GFXDynamicStateList dynamic_states; + GLES2GPUPipelineLayout* gpu_layout = nullptr; + GLES2GPURenderPass* gpu_render_pass = nullptr; +}; + +struct GLES2GPUBinding { + uint binding = GFX_INVALID_BINDING; + GFXBindingType type = GFXBindingType::UNKNOWN; + String name; + GLES2GPUBuffer* gpu_buffer = nullptr; + GLES2GPUTextureView* gpu_tex_view = nullptr; + GLES2GPUSampler* gpu_sampler = nullptr; +}; +typedef vector::type GLES2GPUBindingList; + +class GLES2GPUBindingLayout : public Object { + public: + GLES2GPUBindingList gpu_bindings; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2InputAssembler.cc b/native/cocos/renderer/gfx-gles2/GLES2InputAssembler.cc new file mode 100644 index 0000000000..684f21a4f9 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2InputAssembler.cc @@ -0,0 +1,60 @@ +#include "GLES2Std.h" +#include "GLES2InputAssembler.h" +#include "GLES2Commands.h" +#include "GLES2Buffer.h" + +CC_NAMESPACE_BEGIN + +GLES2InputAssembler::GLES2InputAssembler(GFXDevice* device) + : GFXInputAssembler(device), + gpu_input_assembler_(nullptr) { +} + +GLES2InputAssembler::~GLES2InputAssembler() { +} + +bool GLES2InputAssembler::Initialize(const GFXInputAssemblerInfo &info) { + + attributes_ = info.attributes; + vertex_buffers_ = info.vertex_buffers; + index_buffer_ = info.index_buffer; + indirect_buffer_ = info.indirect_buffer; + + if (index_buffer_) { + index_count_ = index_buffer_->count(); + } else if (vertex_buffers_.size()) { + vertex_count_ = vertex_buffers_[0]->count(); + } + + gpu_input_assembler_ = CC_NEW(GLES2GPUInputAssembler); + gpu_input_assembler_->attribs = attributes_; + gpu_input_assembler_->gpu_vertex_buffers.resize(vertex_buffers_.size()); + for (size_t i = 0; i < gpu_input_assembler_->gpu_vertex_buffers.size(); ++i) { + GLES2Buffer* vb = (GLES2Buffer*)vertex_buffers_[i]; + gpu_input_assembler_->gpu_vertex_buffers[i] = vb->gpu_buffer(); + } + + GLES2CmdFuncCreateInputAssembler((GLES2Device*)device_, gpu_input_assembler_); + + return true; +} + +void GLES2InputAssembler::Destroy() { + if (gpu_input_assembler_) { + GLES2CmdFuncDestroyInputAssembler((GLES2Device*)device_, gpu_input_assembler_); + CC_DELETE(gpu_input_assembler_); + gpu_input_assembler_ = nullptr; + } +} + +void GLES2InputAssembler::ExtractCmdDraw(GLES2CmdDraw* cmd) { + cmd->draw_info.vertex_count = vertex_count_; + cmd->draw_info.first_vertex = first_vertex_; + cmd->draw_info.index_count = index_count_; + cmd->draw_info.first_index = first_index_; + cmd->draw_info.vertex_offset = vertex_offset_; + cmd->draw_info.instance_count = instance_count_; + cmd->draw_info.first_instance = first_instance_; +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles2/GLES2InputAssembler.h b/native/cocos/renderer/gfx-gles2/GLES2InputAssembler.h new file mode 100644 index 0000000000..8dc676d771 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2InputAssembler.h @@ -0,0 +1,28 @@ +#ifndef CC_GFXGLES2_GLES2_INPUT_ASSEMBLER_H_ +#define CC_GFXGLES2_GLES2_INPUT_ASSEMBLER_H_ + +CC_NAMESPACE_BEGIN + +class GLES2GPUInputAssembler; +class GLES2CmdDraw; + +class CC_GLES2_API GLES2InputAssembler : public GFXInputAssembler { + public: + GLES2InputAssembler(GFXDevice* device); + ~GLES2InputAssembler(); + + public: + bool Initialize(const GFXInputAssemblerInfo& info); + void Destroy(); + + void ExtractCmdDraw(GLES2CmdDraw* cmd); + + CC_INLINE GLES2GPUInputAssembler* gpu_input_assembler() const { return gpu_input_assembler_; } + + private: + GLES2GPUInputAssembler* gpu_input_assembler_; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2PipelineLayout.cc b/native/cocos/renderer/gfx-gles2/GLES2PipelineLayout.cc new file mode 100644 index 0000000000..c016ab7e74 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2PipelineLayout.cc @@ -0,0 +1,31 @@ +#include "GLES2Std.h" +#include "GLES2PipelineLayout.h" +#include "GLES2Commands.h" + +CC_NAMESPACE_BEGIN + +GLES2PipelineLayout::GLES2PipelineLayout(GFXDevice* device) + : GFXPipelineLayout(device), + gpu_pipeline_layout_(nullptr) { +} + +GLES2PipelineLayout::~GLES2PipelineLayout() { +} + +bool GLES2PipelineLayout::Initialize(const GFXPipelineLayoutInfo &info) { + + layouts_ = info.layouts; + push_constant_ranges_ = info.push_constant_ranges; + + gpu_pipeline_layout_ = CC_NEW(GLES2GPUPipelineLayout); + return true; +} + +void GLES2PipelineLayout::Destroy() { + if (gpu_pipeline_layout_) { + CC_DELETE(gpu_pipeline_layout_); + gpu_pipeline_layout_ = nullptr; + } +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles2/GLES2PipelineLayout.h b/native/cocos/renderer/gfx-gles2/GLES2PipelineLayout.h new file mode 100644 index 0000000000..57d2d2fbed --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2PipelineLayout.h @@ -0,0 +1,24 @@ +#ifndef CC_GFXGLES2_GLES2_PIPELINE_LAYOUT_H_ +#define CC_GFXGLES2_GLES2_PIPELINE_LAYOUT_H_ + +CC_NAMESPACE_BEGIN + +class GLES2GPUPipelineLayout; + +class CC_GLES2_API GLES2PipelineLayout : public GFXPipelineLayout { + public: + GLES2PipelineLayout(GFXDevice* device); + ~GLES2PipelineLayout(); + + public: + bool Initialize(const GFXPipelineLayoutInfo& info); + void Destroy(); + + CC_INLINE GLES2GPUPipelineLayout* gpu_pipeline_layout() const { return gpu_pipeline_layout_; } + private: + GLES2GPUPipelineLayout* gpu_pipeline_layout_; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2PipelineState.cc b/native/cocos/renderer/gfx-gles2/GLES2PipelineState.cc new file mode 100644 index 0000000000..8fbde4b6ae --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2PipelineState.cc @@ -0,0 +1,67 @@ +#include "GLES2Std.h" +#include "GLES2PipelineState.h" +#include "GLES2Commands.h" +#include "GLES2Shader.h" +#include "GLES2RenderPass.h" +#include "GLES2PipelineLayout.h" + +CC_NAMESPACE_BEGIN + +const GLenum GLES2Primitives [] = { + GL_POINTS, + GL_LINES, + GL_LINE_STRIP, + GL_LINE_LOOP, + GL_NONE, + GL_NONE, + GL_NONE, + GL_TRIANGLES, + GL_TRIANGLE_STRIP, + GL_TRIANGLE_FAN, + GL_NONE, + GL_NONE, + GL_NONE, + GL_NONE, +}; + +GLES2PipelineState::GLES2PipelineState(GFXDevice* device) + : GFXPipelineState(device), + gpu_pso_(nullptr) { +} + +GLES2PipelineState::~GLES2PipelineState() { +} + +bool GLES2PipelineState::Initialize(const GFXPipelineStateInfo &info) { + + primitive_ = info.primitive; + shader_ = info.shader; + is_ = info.is; + rs_ = info.rs; + dss_ = info.dss; + bs_ = info.bs; + dynamic_states_ = info.dynamic_states; + layout_ = info.layout; + render_pass_ = info.render_pass; + + gpu_pso_ = CC_NEW(GLES2GPUPipelineState); + gpu_pso_->gl_primitive = GLES2Primitives[(int)primitive_]; + gpu_pso_->gpu_shader = ((GLES2Shader*)shader_)->gpu_shader(); + gpu_pso_->rs = rs_; + gpu_pso_->dss = dss_; + gpu_pso_->bs = bs_; + gpu_pso_->dynamic_states = dynamic_states_; + gpu_pso_->gpu_layout = ((GLES2PipelineLayout*)layout_)->gpu_pipeline_layout(); + gpu_pso_->gpu_render_pass = ((GLES2RenderPass*)render_pass_)->gpu_render_pass(); + + return true; +} + +void GLES2PipelineState::Destroy() { + if (gpu_pso_) { + CC_DELETE(gpu_pso_); + gpu_pso_ = nullptr; + } +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles2/GLES2PipelineState.h b/native/cocos/renderer/gfx-gles2/GLES2PipelineState.h new file mode 100644 index 0000000000..169efca200 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2PipelineState.h @@ -0,0 +1,25 @@ +#ifndef CC_GFXGLES2_GLES2_PIPELINE_STATE_H_ +#define CC_GFXGLES2_GLES2_PIPELINE_STATE_H_ + +CC_NAMESPACE_BEGIN + +class GLES2GPUPipelineState; + +class CC_GLES2_API GLES2PipelineState : public GFXPipelineState { + public: + GLES2PipelineState(GFXDevice* device); + ~GLES2PipelineState(); + + public: + bool Initialize(const GFXPipelineStateInfo& info); + void Destroy(); + + CC_INLINE GLES2GPUPipelineState* gpu_pso() const { return gpu_pso_; } + + private: + GLES2GPUPipelineState* gpu_pso_; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2Queue.cc b/native/cocos/renderer/gfx-gles2/GLES2Queue.cc new file mode 100644 index 0000000000..2d29a1d6cd --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2Queue.cc @@ -0,0 +1,36 @@ +#include "GLES2Std.h" +#include "GLES2Queue.h" +#include "GLES2Commands.h" +#include "GLES2CommandBuffer.h" + +CC_NAMESPACE_BEGIN + +GLES2Queue::GLES2Queue(GFXDevice* device) + : GFXQueue(device), + is_async_(false) { +} + +GLES2Queue::~GLES2Queue() { +} + +bool GLES2Queue::Initialize(const GFXQueueInfo &info) { + type_ = info.type; + + return true; +} + +void GLES2Queue::Destroy() { +} + +void GLES2Queue::submit(GFXCommandBuffer** cmd_buffs, uint count) { + if (!is_async_) { + for (uint i = 0; i < count; ++i) { + GLES2CommandBuffer* cmd_buff = (GLES2CommandBuffer*)cmd_buffs[i]; + GLES2CmdFuncExecuteCmds((GLES2Device*)device_, cmd_buff->cmd_package_); + num_draw_calls_ += cmd_buff->num_draw_calls_; + num_tris_ += cmd_buff->num_tris_; + } + } +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles2/GLES2Queue.h b/native/cocos/renderer/gfx-gles2/GLES2Queue.h new file mode 100644 index 0000000000..9ab5aa04c2 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2Queue.h @@ -0,0 +1,28 @@ +#ifndef CC_GFXGLES2_GLES2_QUEUE_H_ +#define CC_GFXGLES2_GLES2_QUEUE_H_ + +CC_NAMESPACE_BEGIN + +class CC_GLES2_API GLES2Queue : public GFXQueue { + public: + GLES2Queue(GFXDevice* device); + ~GLES2Queue(); + + friend class GLES2Device; + + public: + bool Initialize(const GFXQueueInfo& info); + void Destroy(); + void submit(GFXCommandBuffer** cmd_buffs, uint count); + + CC_INLINE bool is_async() const { return is_async_; } + + private: + bool is_async_; + uint num_draw_calls_; + uint num_tris_; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2RenderPass.cc b/native/cocos/renderer/gfx-gles2/GLES2RenderPass.cc new file mode 100644 index 0000000000..c56fa21893 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2RenderPass.cc @@ -0,0 +1,34 @@ +#include "GLES2Std.h" +#include "GLES2RenderPass.h" +#include "GLES2Commands.h" + +CC_NAMESPACE_BEGIN + +GLES2RenderPass::GLES2RenderPass(GFXDevice* device) + : GFXRenderPass(device), + gpu_render_pass_(nullptr) { +} + +GLES2RenderPass::~GLES2RenderPass() { +} + +bool GLES2RenderPass::Initialize(const GFXRenderPassInfo &info) { + + color_attachments_ = info.color_attachments; + depth_stencil_attachment_ = info.depth_stencil_attachment; + + gpu_render_pass_ = CC_NEW(GLES2GPURenderPass); + gpu_render_pass_->color_attachments = color_attachments_; + gpu_render_pass_->depth_stencil_attachment = depth_stencil_attachment_; + + return true; +} + +void GLES2RenderPass::Destroy() { + if (gpu_render_pass_) { + CC_DELETE(gpu_render_pass_); + gpu_render_pass_ = nullptr; + } +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles2/GLES2RenderPass.h b/native/cocos/renderer/gfx-gles2/GLES2RenderPass.h new file mode 100644 index 0000000000..0f14936745 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2RenderPass.h @@ -0,0 +1,25 @@ +#ifndef CC_GFXGLES2_GLES2_RENDER_PASS_H_ +#define CC_GFXGLES2_GLES2_RENDER_PASS_H_ + +CC_NAMESPACE_BEGIN + +class GLES2GPURenderPass; + +class CC_GLES2_API GLES2RenderPass : public GFXRenderPass { + public: + GLES2RenderPass(GFXDevice* device); + ~GLES2RenderPass(); + + public: + bool Initialize(const GFXRenderPassInfo& info); + void Destroy(); + + CC_INLINE GLES2GPURenderPass* gpu_render_pass() const { return gpu_render_pass_; } + + private: + GLES2GPURenderPass* gpu_render_pass_; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2Sampler.cc b/native/cocos/renderer/gfx-gles2/GLES2Sampler.cc new file mode 100644 index 0000000000..08b8995bc7 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2Sampler.cc @@ -0,0 +1,53 @@ +#include "GLES2Std.h" +#include "GLES2Sampler.h" +#include "GLES2Commands.h" + +CC_NAMESPACE_BEGIN + +GLES2Sampler::GLES2Sampler(GFXDevice* device) + : GFXSampler(device), + gpu_sampler_(nullptr) { +} + +GLES2Sampler::~GLES2Sampler() { +} + +bool GLES2Sampler::Initialize(const GFXSamplerInfo &info) { + name_ = info.name; + min_filter_ = info.min_filter; + mag_filter_ = info.mag_filter; + mip_filter_ = info.mip_filter; + address_u_ = info.address_u; + address_v_ = info.address_v; + address_w_ = info.address_w; + max_anisotropy_ = info.max_anisotropy; + cmp_func_ = info.cmp_func; + border_color_ = info.border_color; + min_lod_ = info.min_lod; + max_lod_ = info.max_lod; + mip_lod_bias_ = info.mip_lod_bias; + + gpu_sampler_ = CC_NEW(GLES2GPUSampler); + gpu_sampler_->min_filter = min_filter_; + gpu_sampler_->mag_filter = mag_filter_; + gpu_sampler_->mip_filter = mip_filter_; + gpu_sampler_->address_u = address_u_; + gpu_sampler_->address_v = address_v_; + gpu_sampler_->address_w = address_w_; + gpu_sampler_->min_lod = min_lod_; + gpu_sampler_->max_lod = max_lod_; + + GLES2CmdFuncCreateSampler((GLES2Device*)device_, gpu_sampler_); + + return true; +} + +void GLES2Sampler::Destroy() { + if (gpu_sampler_) { + GLES2CmdFuncDestroySampler((GLES2Device*)device_, gpu_sampler_); + CC_DELETE(gpu_sampler_); + gpu_sampler_ = nullptr; + } +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles2/GLES2Sampler.h b/native/cocos/renderer/gfx-gles2/GLES2Sampler.h new file mode 100644 index 0000000000..494e09dca0 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2Sampler.h @@ -0,0 +1,38 @@ +#ifndef CC_GFXGLES2_GLES2_SAMPLER_H_ +#define CC_GFXGLES2_GLES2_SAMPLER_H_ + +CC_NAMESPACE_BEGIN + +class GLES2GPUSampler; + +class CC_GLES2_API GLES2Sampler : public GFXSampler { +public: + GLES2Sampler(GFXDevice* device); + ~GLES2Sampler(); + +public: + bool Initialize(const GFXSamplerInfo& info); + void Destroy(); + + CC_INLINE GLES2GPUSampler* gpu_sampler() const { return gpu_sampler_; } + +private: + GLES2GPUSampler* gpu_sampler_; + String name_; + GFXFilter min_filter_ = GFXFilter::LINEAR; + GFXFilter mag_filter_ = GFXFilter::LINEAR; + GFXFilter mip_filter_ = GFXFilter::NONE; + GFXAddress address_u_ = GFXAddress::WRAP; + GFXAddress address_v_ = GFXAddress::WRAP; + GFXAddress address_w_ = GFXAddress::WRAP; + uint max_anisotropy_ = 16; + GFXComparisonFunc cmp_func_ = GFXComparisonFunc::NEVER; + GFXColor border_color_; + uint min_lod_ = 0; + uint max_lod_ = 1000; + float mip_lod_bias_ = 0.0f; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2Shader.cc b/native/cocos/renderer/gfx-gles2/GLES2Shader.cc new file mode 100644 index 0000000000..e67d1aba76 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2Shader.cc @@ -0,0 +1,35 @@ +#include "GLES2Std.h" +#include "GLES2Shader.h" +#include "GLES2Commands.h" + +CC_NAMESPACE_BEGIN + +GLES2Shader::GLES2Shader(GFXDevice* device) + : GFXShader(device), + gpu_shader_(nullptr) { +} + +GLES2Shader::~GLES2Shader() { +} + +bool GLES2Shader::Initialize(const GFXShaderInfo &info) { + name_ = info.name; + stages_ = info.stages; + blocks_ = info.blocks; + samplers_ = info.samplers; + + gpu_shader_ = CC_NEW(GLES2GPUShader); + GLES2CmdFuncCreateShader((GLES2Device*)device_, gpu_shader_); + + return true; +} + +void GLES2Shader::Destroy() { + if (gpu_shader_) { + GLES2CmdFuncDestroyShader((GLES2Device*)device_, gpu_shader_); + CC_DELETE(gpu_shader_); + gpu_shader_ = nullptr; + } +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles2/GLES2Shader.h b/native/cocos/renderer/gfx-gles2/GLES2Shader.h new file mode 100644 index 0000000000..4771567221 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2Shader.h @@ -0,0 +1,24 @@ +#ifndef CC_GFXGLES2_GLES2_SHADER_H_ +#define CC_GFXGLES2_GLES2_SHADER_H_ + +CC_NAMESPACE_BEGIN + +class GLES2GPUShader; + +class CC_GLES2_API GLES2Shader : public GFXShader { + public: + GLES2Shader(GFXDevice* device); + ~GLES2Shader(); + + public: + bool Initialize(const GFXShaderInfo& info); + void Destroy(); + + CC_INLINE GLES2GPUShader* gpu_shader() const { return gpu_shader_; } + private: + GLES2GPUShader* gpu_shader_; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2StateCache.h b/native/cocos/renderer/gfx-gles2/GLES2StateCache.h new file mode 100644 index 0000000000..cda38e9098 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2StateCache.h @@ -0,0 +1,36 @@ +#ifndef CC_GFXGLES2_STATE_CACHE_H_ +#define CC_GFXGLES2_STATE_CACHE_H_ + +#include "gles2w.h" + +CC_NAMESPACE_BEGIN + +class GLES2StateCache : public Object { + public: + GLuint gl_array_buffer = 0; + GLuint gl_element_array_buffer = 0; + GLuint gl_uniform_buffer = 0; + GLuint gl_bind_ubos[GFX_MAX_BUFFER_BINDINGS] = { 0 }; + GLuint gl_vao = 0; + uint tex_uint = 0; + GLuint gl_textures[GFX_MAX_TEXTURE_UNITS] = { 0 }; + GLuint gl_samplers[GFX_MAX_TEXTURE_UNITS] = { 0 }; + GLuint gl_program = 0; + bool gl_enabled_attrib_locs[GFX_MAX_VERTEX_ATTRIBUTES] = { false }; + bool gl_current_attrib_locs[GFX_MAX_VERTEX_ATTRIBUTES] = { false }; + GLuint gl_fbo = 0; + GLuint gl_read_fbo = 0; + GFXViewport viewport; + GFXRect scissor; + GFXRasterizerState rs; + GFXDepthStencilState dss; + GFXBlendState bs; + bool is_cull_face_enabled = false; + bool is_stencil_test_enabled = false; + + GLES2StateCache() {} +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2Std.cc b/native/cocos/renderer/gfx-gles2/GLES2Std.cc new file mode 100644 index 0000000000..2b22798869 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2Std.cc @@ -0,0 +1 @@ +#include "GLES2Std.h" \ No newline at end of file diff --git a/native/cocos/renderer/gfx-gles2/GLES2Std.h b/native/cocos/renderer/gfx-gles2/GLES2Std.h new file mode 100644 index 0000000000..00fa590de2 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2Std.h @@ -0,0 +1,16 @@ +#ifndef __CC_GFXGLES2_GLES2_STD_H__ +#define __CC_GFXGLES2_GLES2_STD_H__ + +#include + +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) +# ifdef CC_GLES2_EXPORTS +# define CC_GLES2_API __declspec(dllexport) +# else +# define CC_GLES2_API __declspec(dllimport) +# endif +#else +# define CC_GLES2_API +#endif + +#endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2Texture.cc b/native/cocos/renderer/gfx-gles2/GLES2Texture.cc new file mode 100644 index 0000000000..456ceb29fe --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2Texture.cc @@ -0,0 +1,129 @@ +#include "GLES2Std.h" +#include "GLES2Texture.h" +#include "GLES2Commands.h" + +CC_NAMESPACE_BEGIN + +GLES2Texture::GLES2Texture(GFXDevice* device) + : GFXTexture(device), + gpu_texture_(nullptr) { +} + +GLES2Texture::~GLES2Texture() { +} + +bool GLES2Texture::Initialize(const GFXTextureInfo &info) { + + type_ = info.type; + usage_ = info.usage; + format_ = info.format; + width_ = info.width; + height_ = info.height; + depth_ = info.depth; + array_layer_ = info.array_layer; + mip_level_ = info.mip_level; + samples_ = info.samples; + flags_ = info.flags; + size_ = GFXFormatSize(format_, width_, height_, depth_); + + if (flags_ & GFXTextureFlags::BAKUP_BUFFER) { + buffer_ = (uint8_t*)CC_MALLOC(size_); + device_->mem_status().texture_size += size_; + } + + gpu_texture_ = CC_NEW(GLES2GPUTexture); + gpu_texture_->type = type_; + + switch (type_) { + case GFXTextureType::TEX1D: { + if (array_layer_) { + gpu_texture_->view_type = array_layer_ <= 1 ? GFXTextureViewType::TV1D : GFXTextureViewType::TV1D_ARRAY; + } else { + gpu_texture_->view_type = GFXTextureViewType::TV1D; + } + break; + } + case GFXTextureType::TEX2D: { + if (array_layer_) { + if (array_layer_ <= 1) { + gpu_texture_->view_type = GFXTextureViewType::TV2D; + } else if (flags_ & GFXTextureFlagBit::CUBEMAP) { + gpu_texture_->view_type = GFXTextureViewType::CUBE; + } else { + gpu_texture_->view_type = GFXTextureViewType::TV2D_ARRAY; + } + } else { + gpu_texture_->view_type = GFXTextureViewType::TV2D; + } + break; + } + case GFXTextureType::TEX3D: { + gpu_texture_->view_type = GFXTextureViewType::TV3D; + break; + } + default: { + gpu_texture_->view_type = GFXTextureViewType::TV2D; + } + } + + gpu_texture_->format = format_; + gpu_texture_->usage = usage_; + gpu_texture_->width = width_; + gpu_texture_->height = height_; + gpu_texture_->depth = depth_; + gpu_texture_->size = size_; + gpu_texture_->array_layer = array_layer_; + gpu_texture_->mip_level = mip_level_; + gpu_texture_->samples = samples_; + gpu_texture_->flags = flags_; + gpu_texture_->is_pot = math::IsPowerOfTwo(width_) && math::IsPowerOfTwo(height_); + + GLES2CmdFuncCreateTexture((GLES2Device*)device_, gpu_texture_); + device_->mem_status().texture_size += size_; + + return true; +} + +void GLES2Texture::Destroy() { + if (gpu_texture_) { + GLES2CmdFuncDestroyTexture((GLES2Device*)device_, gpu_texture_); + device_->mem_status().texture_size -= size_; + CC_DELETE(gpu_texture_); + gpu_texture_ = nullptr; + } + + if (buffer_) { + CC_FREE(buffer_); + device_->mem_status().texture_size -= size_; + buffer_ = nullptr; + } +} + +void GLES2Texture::Resize(uint width, uint height) { + uint size = GFXFormatSize(format_, width, height, depth_); + if (size_ != size) { + const uint old_size = size_; + width_ = width; + height_ = height; + size_ = size; + + GFXMemoryStatus& status = device_->mem_status(); + gpu_texture_->width = width_; + gpu_texture_->height = height_; + gpu_texture_->size = size_; + GLES2CmdFuncResizeTexture((GLES2Device*)device_, gpu_texture_); + status.buffer_size -= old_size; + status.buffer_size += size_; + + if (buffer_) { + const uint8_t* old_buff = buffer_; + buffer_ = (uint8_t*)CC_MALLOC(size_); + memcpy(buffer_, old_buff, old_size); + CC_FREE(buffer_); + status.buffer_size -= old_size; + status.buffer_size += size_; + } + } +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles2/GLES2Texture.h b/native/cocos/renderer/gfx-gles2/GLES2Texture.h new file mode 100644 index 0000000000..7fceca7850 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2Texture.h @@ -0,0 +1,26 @@ +#ifndef CC_GFXGLES2_GLES2_TEXTURE_H_ +#define CC_GFXGLES2_GLES2_TEXTURE_H_ + +CC_NAMESPACE_BEGIN + +class GLES2GPUTexture; + +class CC_GLES2_API GLES2Texture : public GFXTexture { + public: + GLES2Texture(GFXDevice* device); + ~GLES2Texture(); + + public: + bool Initialize(const GFXTextureInfo& info); + void Destroy(); + void Resize(uint width, uint height); + + CC_INLINE GLES2GPUTexture* gpu_texture() const { return gpu_texture_; } + + private: + GLES2GPUTexture* gpu_texture_; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2TextureView.cc b/native/cocos/renderer/gfx-gles2/GLES2TextureView.cc new file mode 100644 index 0000000000..d89b47b418 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2TextureView.cc @@ -0,0 +1,44 @@ +#include "GLES2Std.h" +#include "GLES2TextureView.h" +#include "GLES2Texture.h" +#include "GLES2Commands.h" + +CC_NAMESPACE_BEGIN + +GLES2TextureView::GLES2TextureView(GFXDevice* device) + : GFXTextureView(device), + gpu_tex_view_(nullptr) { +} + +GLES2TextureView::~GLES2TextureView() { +} + +bool GLES2TextureView::Initialize(const GFXTextureViewInfo &info) { + + texture_ = info.texture; + type_ = info.type; + format_ = info.format; + base_layer_ = info.base_layer; + level_count_ = info.level_count; + base_layer_ = info.base_layer; + layer_count_ = info.layer_count; + + gpu_tex_view_ = CC_NEW(GLES2GPUTextureView); + gpu_tex_view_->gpu_texture = ((GLES2GPUTexture*)texture_); + gpu_tex_view_->type = type_; + gpu_tex_view_->format = format_; + gpu_tex_view_->base_level = info.base_level; + gpu_tex_view_->level_count = info.level_count; + + return true; +} + +void GLES2TextureView::Destroy() { + if (gpu_tex_view_) { + CC_DELETE(gpu_tex_view_); + gpu_tex_view_ = nullptr; + } + texture_ = nullptr; +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles2/GLES2TextureView.h b/native/cocos/renderer/gfx-gles2/GLES2TextureView.h new file mode 100644 index 0000000000..06db29601f --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2TextureView.h @@ -0,0 +1,25 @@ +#ifndef CC_GFXGLES2_GLES2_TEXTURE_VIEW_H_ +#define CC_GFXGLES2_GLES2_TEXTURE_VIEW_H_ + +CC_NAMESPACE_BEGIN + +class GLES2GPUTextureView; + +class CC_GLES2_API GLES2TextureView : public GFXTextureView { +public: + GLES2TextureView(GFXDevice* device); + ~GLES2TextureView(); + +public: + bool Initialize(const GFXTextureViewInfo& info); + void Destroy(); + + CC_INLINE GLES2GPUTextureView* gpu_tex_view() const { return gpu_tex_view_; } + +private: + GLES2GPUTextureView* gpu_tex_view_; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles2/GLES2Window.cc b/native/cocos/renderer/gfx-gles2/GLES2Window.cc new file mode 100644 index 0000000000..ca51156cd3 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2Window.cc @@ -0,0 +1,155 @@ +#include "GLES2Std.h" +#include "GLES2Window.h" + +CC_NAMESPACE_BEGIN + +GLES2Window::GLES2Window(GFXDevice* device) + : GFXWindow(device) { +} + +GLES2Window::~GLES2Window() { +} + +bool GLES2Window::Initialize(const GFXWindowInfo &info) { + title_ = info.title; + left_ = info.left; + top_ = info.top; + width_ = info.width; + height_ = info.height; + native_width_ = width_; + native_height_ = height_; + color_fmt_ = info.color_fmt; + depth_stencil_fmt_ = info.depth_stencil_fmt; + is_offscreen_ = info.is_offscreen; + is_fullscreen_ = info.is_fullscreen; + + // Create render pass + + GFXRenderPassInfo render_pass_info; + + GFXColorAttachment color_attachment; + color_attachment.format = color_fmt_; + color_attachment.load_op = GFXLoadOp::CLEAR; + color_attachment.store_op = GFXStoreOp::STORE; + color_attachment.sample_count = 1; + color_attachment.begin_layout = GFXTextureLayout::COLOR_ATTACHMENT_OPTIMAL; + color_attachment.end_layout = GFXTextureLayout::COLOR_ATTACHMENT_OPTIMAL; + render_pass_info.color_attachments.emplace_back(color_attachment); + + GFXDepthStencilAttachment& depth_stencil_attachment = render_pass_info.depth_stencil_attachment; + render_pass_info.depth_stencil_attachment.format = depth_stencil_fmt_; + depth_stencil_attachment.depth_load_op = GFXLoadOp::LOAD; + depth_stencil_attachment.depth_store_op = GFXStoreOp::STORE; + depth_stencil_attachment.stencil_load_op = GFXLoadOp::LOAD; + depth_stencil_attachment.stencil_store_op = GFXStoreOp::STORE; + depth_stencil_attachment.sample_count = 1; + depth_stencil_attachment.begin_layout = GFXTextureLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL; + depth_stencil_attachment.end_layout = GFXTextureLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL; + + render_pass_ = device_->CreateGFXRenderPass(render_pass_info); + + // Create texture & texture views + if (is_offscreen_) { + if (color_fmt_ != GFXFormat::UNKNOWN) { + GFXTextureInfo color_tex_info; + color_tex_info.type = GFXTextureType::TEX2D; + color_tex_info.usage = GFXTextureUsageBit::COLOR_ATTACHMENT | GFXTextureUsageBit::SAMPLED; + color_tex_info.format = color_fmt_; + color_tex_info.width = width_; + color_tex_info.height = height_; + color_tex_info.depth = 1; + color_tex_info.array_layer = 1; + color_tex_info.mip_level = 1; + color_texture_ = device_->CreateGFXTexture(color_tex_info); + + GFXTextureViewInfo color_tex_view_info; + color_tex_view_info.type = GFXTextureViewType::TV2D; + color_tex_view_info.format = color_fmt_; + color_tex_view_info.base_level = 0; + color_tex_view_info.level_count = 1; + color_tex_view_info.base_layer = 0; + color_tex_view_info.layer_count = 1; + color_tex_view_ = device_->CreateGFXTextureView(color_tex_view_info); + } + if (depth_stencil_fmt_ != GFXFormat::UNKNOWN) { + GFXTextureInfo depth_stecnil_tex_info; + depth_stecnil_tex_info.type = GFXTextureType::TEX2D; + depth_stecnil_tex_info.usage = GFXTextureUsageBit::DEPTH_STENCIL_ATTACHMENT | GFXTextureUsageBit::SAMPLED; + depth_stecnil_tex_info.format = depth_stencil_fmt_; + depth_stecnil_tex_info.width = width_; + depth_stecnil_tex_info.height = height_; + depth_stecnil_tex_info.depth = 1; + depth_stecnil_tex_info.array_layer = 1; + depth_stecnil_tex_info.mip_level = 1; + depth_stencil_texture_ = device_->CreateGFXTexture(depth_stecnil_tex_info); + + GFXTextureViewInfo depth_stecnil_tex_view_info; + depth_stecnil_tex_view_info.type = GFXTextureViewType::TV2D; + depth_stecnil_tex_view_info.format = color_fmt_; + depth_stecnil_tex_view_info.base_level = 0; + depth_stecnil_tex_view_info.level_count = 1; + depth_stecnil_tex_view_info.base_layer = 0; + depth_stecnil_tex_view_info.layer_count = 1; + depth_stencil_tex_view_ = device_->CreateGFXTextureView(depth_stecnil_tex_view_info); + } + } + + GFXFramebufferInfo fbo_info; + fbo_info.render_pass = render_pass_; + fbo_info.color_views.push_back(color_tex_view_); + fbo_info.depth_stencil_view = depth_stencil_tex_view_; + fbo_info.is_offscreen = is_offscreen_; + framebuffer_ = device_->CreateGFXFramebuffer(fbo_info); + + return true; +} + +void GLES2Window::Destroy() { + CC_SAFE_DESTROY(render_pass_); + CC_SAFE_DESTROY(color_tex_view_); + CC_SAFE_DESTROY(color_texture_); + CC_SAFE_DESTROY(depth_stencil_tex_view_); + CC_SAFE_DESTROY(depth_stencil_texture_); + CC_SAFE_DESTROY(framebuffer_); +} + +void GLES2Window::Resize(uint width, uint height) { + width_ = width; + height_ = height; + if (width > native_width_ || height > native_height_) { + native_width_ = width; + native_height_ = height; + + if (color_texture_) { + color_texture_->Resize(width, height); + color_tex_view_->Destroy(); + + GFXTextureViewInfo color_tex_view_info; + color_tex_view_info.type = GFXTextureViewType::TV2D; + color_tex_view_info.format = color_fmt_; + color_tex_view_->Initialize(color_tex_view_info); + } + + if (depth_stencil_texture_) { + depth_stencil_texture_->Resize(width, height); + depth_stencil_tex_view_->Destroy(); + + GFXTextureViewInfo depth_stencil_tex_view__info; + depth_stencil_tex_view__info.type = GFXTextureViewType::TV2D; + depth_stencil_tex_view__info.format = depth_stencil_fmt_; + depth_stencil_tex_view_->Initialize(depth_stencil_tex_view__info); + } + + if (framebuffer_) { + framebuffer_->Destroy(); + + GFXFramebufferInfo fbo_info; + fbo_info.render_pass = render_pass_; + fbo_info.color_views.push_back(color_tex_view_); + fbo_info.depth_stencil_view = depth_stencil_tex_view_; + framebuffer_->Initialize(fbo_info); + } + } +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles2/GLES2Window.h b/native/cocos/renderer/gfx-gles2/GLES2Window.h new file mode 100644 index 0000000000..122a0da645 --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/GLES2Window.h @@ -0,0 +1,19 @@ +#ifndef CC_GFXGLES2_GLES2_WINDOW_H_ +#define CC_GFXGLES2_GLES2_WINDOW_H_ + +CC_NAMESPACE_BEGIN + +class CC_GLES2_API GLES2Window : public GFXWindow { +public: + GLES2Window(GFXDevice* device); + ~GLES2Window(); + +public: + bool Initialize(const GFXWindowInfo& info); + void Destroy(); + void Resize(uint width, uint height); +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles2/gles2w.c b/native/cocos/renderer/gfx-gles2/gles2w.c new file mode 100755 index 0000000000..4f9d051f5f --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/gles2w.c @@ -0,0 +1,796 @@ +#include "gles2w.h" + +#if defined(_WIN32) && !defined(ANDROID) +#define WIN32_LEAN_AND_MEAN 1 +#include +#include + +static HMODULE libgl; + +static int open_libgl(void) +{ + libgl = LoadLibraryA("libGLESv2.dll"); + return (libgl != NULL); +} + +static void close_libgl(void) +{ + FreeLibrary(libgl); +} + +static void *get_proc(const char *proc) +{ + void *res; + + res = (void*)eglGetProcAddress(proc); + if (!res) + res = (void*)GetProcAddress(libgl, proc); + return res; +} +#elif defined(__APPLE__) || defined(__APPLE_CC__) +#import +#import +#import +#import +#import + +// Routine to run a system command and retrieve the output. +// From http://stackoverflow.com/questions/478898/how-to-execute-a-command-and-get-output-of-command-within-c +std::string ES2_EXEC(const char* cmd) { + FILE* pipe = popen(cmd, "r"); + if (!pipe) return "ERROR"; + char buffer[128]; + std::string result = ""; + while(!feof(pipe)) { + if(fgets(buffer, 128, pipe) != NULL) + result += buffer; + } + pclose(pipe); + return result; +} + +static CFBundleRef g_es2Bundle; +static CFURLRef g_es2BundleURL; + +static int open_libgl(void) +{ + CFStringRef frameworkPath = CFSTR("/System/Library/Frameworks/OpenGLES.framework"); + NSString *sysVersion = [UIDevice currentDevice].systemVersion; + NSArray *sysVersionComponents = [sysVersion componentsSeparatedByString:@"."]; + //BOOL isSimulator = ([[UIDevice currentDevice].model rangeOfString:@"Simulator"].location != NSNotFound); + +#if TARGET_IPHONE_SIMULATOR + bool isSimulator = true; +#else + bool isSimulator = false; +#endif + if(isSimulator) + { + // Ask where Xcode is installed + std::string xcodePath = "/Applications/Xcode.app/Contents/Developer\n"; + + // The result contains an end line character. Remove it. + size_t pos = xcodePath.find("\n"); + xcodePath.erase(pos); + + char tempPath[PATH_MAX]; + sprintf(tempPath, + "%s/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator%s.%s.sdk/System/Library/Frameworks/OpenGLES.framework", + xcodePath.c_str(), + [[sysVersionComponents objectAtIndex:0] cStringUsingEncoding:NSUTF8StringEncoding], + [[sysVersionComponents objectAtIndex:1] cStringUsingEncoding:NSUTF8StringEncoding]); + frameworkPath = CFStringCreateWithCString(kCFAllocatorDefault, tempPath, kCFStringEncodingUTF8); + } + + g_es2BundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, + frameworkPath, + kCFURLPOSIXPathStyle, true); + + CFRelease(frameworkPath); + + g_es2Bundle = CFBundleCreate(kCFAllocatorDefault, g_es2BundleURL); + + return (g_es2Bundle != NULL); +} + +static void close_libgl(void) +{ + CFRelease(g_es2Bundle); + CFRelease(g_es2BundleURL); +} + +static void *get_proc(const char *proc) +{ + void *res; + + CFStringRef procname = CFStringCreateWithCString(kCFAllocatorDefault, proc, + kCFStringEncodingASCII); + res = CFBundleGetFunctionPointerForName(g_es2Bundle, procname); + CFRelease(procname); + return res; +} +#elif defined(__EMSCRIPTEN__) +#include +static void open_libgl() {} +static void close_libgl() {} +static void *get_proc(const char *proc) +{ + return (void*)eglGetProcAddress(proc); +} +#else +#include +#include + +static void *libgl; + +static int open_libgl(void) +{ + libgl = dlopen("libGLESv2.so", RTLD_LAZY | RTLD_GLOBAL); + return libgl != NULL; +} + +static void close_libgl(void) +{ + dlclose(libgl); +} + +static void *get_proc(const char *proc) +{ + void *res; + res = dlsym(libgl, proc); + return res; +} +#endif + +static struct { + int major, minor; +} version; + +static int parse_version(void) +{ + version.major = 2; + version.minor = 0; + + return 0; +} + +static void load_procs(void); + +int gles2wInit(void) +{ + if (!open_libgl()) + { + return 0; + } + + load_procs(); + close_libgl(); + parse_version(); + + return 1; +} + +int gles2wIsSupported(int major, int minor) +{ + if (major < 2) + return 0; + if (version.major == major) + return version.minor >= minor; + return version.major >= major; +} + +void *gles2wGetProcAddress(const char *proc) +{ + return get_proc(proc); +} + +PFNGLACTIVETEXTUREPROC gles2wActiveTexture; +PFNGLATTACHSHADERPROC gles2wAttachShader; +PFNGLBINDATTRIBLOCATIONPROC gles2wBindAttribLocation; +PFNGLBINDBUFFERPROC gles2wBindBuffer; +PFNGLBINDFRAMEBUFFERPROC gles2wBindFramebuffer; +PFNGLBINDRENDERBUFFERPROC gles2wBindRenderbuffer; +PFNGLBINDTEXTUREPROC gles2wBindTexture; +PFNGLBLENDCOLORPROC gles2wBlendColor; +PFNGLBLENDEQUATIONPROC gles2wBlendEquation; +PFNGLBLENDEQUATIONSEPARATEPROC gles2wBlendEquationSeparate; +PFNGLBLENDFUNCPROC gles2wBlendFunc; +PFNGLBLENDFUNCSEPARATEPROC gles2wBlendFuncSeparate; +PFNGLBUFFERDATAPROC gles2wBufferData; +PFNGLBUFFERSUBDATAPROC gles2wBufferSubData; +PFNGLCHECKFRAMEBUFFERSTATUSPROC gles2wCheckFramebufferStatus; +PFNGLCLEARPROC gles2wClear; +PFNGLCLEARCOLORPROC gles2wClearColor; +PFNGLCLEARDEPTHFPROC gles2wClearDepthf; +PFNGLCLEARSTENCILPROC gles2wClearStencil; +PFNGLCOLORMASKPROC gles2wColorMask; +PFNGLCOMPILESHADERPROC gles2wCompileShader; +PFNGLCOMPRESSEDTEXIMAGE2DPROC gles2wCompressedTexImage2D; +PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC gles2wCompressedTexSubImage2D; +PFNGLCOPYTEXIMAGE2DPROC gles2wCopyTexImage2D; +PFNGLCOPYTEXSUBIMAGE2DPROC gles2wCopyTexSubImage2D; +PFNGLCREATEPROGRAMPROC gles2wCreateProgram; +PFNGLCREATESHADERPROC gles2wCreateShader; +PFNGLCULLFACEPROC gles2wCullFace; +PFNGLDELETEBUFFERSPROC gles2wDeleteBuffers; +PFNGLDELETEFRAMEBUFFERSPROC gles2wDeleteFramebuffers; +PFNGLDELETEPROGRAMPROC gles2wDeleteProgram; +PFNGLDELETERENDERBUFFERSPROC gles2wDeleteRenderbuffers; +PFNGLDELETESHADERPROC gles2wDeleteShader; +PFNGLDELETETEXTURESPROC gles2wDeleteTextures; +PFNGLDEPTHFUNCPROC gles2wDepthFunc; +PFNGLDEPTHMASKPROC gles2wDepthMask; +PFNGLDEPTHRANGEFPROC gles2wDepthRangef; +PFNGLDETACHSHADERPROC gles2wDetachShader; +PFNGLDISABLEPROC gles2wDisable; +PFNGLDISABLEVERTEXATTRIBARRAYPROC gles2wDisableVertexAttribArray; +PFNGLDRAWARRAYSPROC gles2wDrawArrays; +PFNGLDRAWELEMENTSPROC gles2wDrawElements; +PFNGLENABLEPROC gles2wEnable; +PFNGLENABLEVERTEXATTRIBARRAYPROC gles2wEnableVertexAttribArray; +PFNGLFINISHPROC gles2wFinish; +PFNGLFLUSHPROC gles2wFlush; +PFNGLFRAMEBUFFERRENDERBUFFERPROC gles2wFramebufferRenderbuffer; +PFNGLFRAMEBUFFERTEXTURE2DPROC gles2wFramebufferTexture2D; +PFNGLFRONTFACEPROC gles2wFrontFace; +PFNGLGENBUFFERSPROC gles2wGenBuffers; +PFNGLGENERATEMIPMAPPROC gles2wGenerateMipmap; +PFNGLGENFRAMEBUFFERSPROC gles2wGenFramebuffers; +PFNGLGENRENDERBUFFERSPROC gles2wGenRenderbuffers; +PFNGLGENTEXTURESPROC gles2wGenTextures; +PFNGLGETACTIVEATTRIBPROC gles2wGetActiveAttrib; +PFNGLGETACTIVEUNIFORMPROC gles2wGetActiveUniform; +PFNGLGETATTACHEDSHADERSPROC gles2wGetAttachedShaders; +PFNGLGETATTRIBLOCATIONPROC gles2wGetAttribLocation; +PFNGLGETBOOLEANVPROC gles2wGetBooleanv; +PFNGLGETBUFFERPARAMETERIVPROC gles2wGetBufferParameteriv; +PFNGLGETERRORPROC gles2wGetError; +PFNGLGETFLOATVPROC gles2wGetFloatv; +PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC gles2wGetFramebufferAttachmentParameteriv; +PFNGLGETINTEGERVPROC gles2wGetIntegerv; +PFNGLGETPROGRAMIVPROC gles2wGetProgramiv; +PFNGLGETPROGRAMINFOLOGPROC gles2wGetProgramInfoLog; +PFNGLGETRENDERBUFFERPARAMETERIVPROC gles2wGetRenderbufferParameteriv; +PFNGLGETSHADERIVPROC gles2wGetShaderiv; +PFNGLGETSHADERINFOLOGPROC gles2wGetShaderInfoLog; +PFNGLGETSHADERPRECISIONFORMATPROC gles2wGetShaderPrecisionFormat; +PFNGLGETSHADERSOURCEPROC gles2wGetShaderSource; +PFNGLGETSTRINGPROC gles2wGetString; +PFNGLGETTEXPARAMETERFVPROC gles2wGetTexParameterfv; +PFNGLGETTEXPARAMETERIVPROC gles2wGetTexParameteriv; +PFNGLGETUNIFORMFVPROC gles2wGetUniformfv; +PFNGLGETUNIFORMIVPROC gles2wGetUniformiv; +PFNGLGETUNIFORMLOCATIONPROC gles2wGetUniformLocation; +PFNGLGETVERTEXATTRIBFVPROC gles2wGetVertexAttribfv; +PFNGLGETVERTEXATTRIBIVPROC gles2wGetVertexAttribiv; +PFNGLGETVERTEXATTRIBPOINTERVPROC gles2wGetVertexAttribPointerv; +PFNGLHINTPROC gles2wHint; +PFNGLISBUFFERPROC gles2wIsBuffer; +PFNGLISENABLEDPROC gles2wIsEnabled; +PFNGLISFRAMEBUFFERPROC gles2wIsFramebuffer; +PFNGLISPROGRAMPROC gles2wIsProgram; +PFNGLISRENDERBUFFERPROC gles2wIsRenderbuffer; +PFNGLISSHADERPROC gles2wIsShader; +PFNGLISTEXTUREPROC gles2wIsTexture; +PFNGLLINEWIDTHPROC gles2wLineWidth; +PFNGLLINKPROGRAMPROC gles2wLinkProgram; +PFNGLPIXELSTOREIPROC gles2wPixelStorei; +PFNGLPOLYGONOFFSETPROC gles2wPolygonOffset; +PFNGLREADPIXELSPROC gles2wReadPixels; +PFNGLRELEASESHADERCOMPILERPROC gles2wReleaseShaderCompiler; +PFNGLRENDERBUFFERSTORAGEPROC gles2wRenderbufferStorage; +PFNGLSAMPLECOVERAGEPROC gles2wSampleCoverage; +PFNGLSCISSORPROC gles2wScissor; +PFNGLSHADERBINARYPROC gles2wShaderBinary; +PFNGLSHADERSOURCEPROC gles2wShaderSource; +PFNGLSTENCILFUNCPROC gles2wStencilFunc; +PFNGLSTENCILFUNCSEPARATEPROC gles2wStencilFuncSeparate; +PFNGLSTENCILMASKPROC gles2wStencilMask; +PFNGLSTENCILMASKSEPARATEPROC gles2wStencilMaskSeparate; +PFNGLSTENCILOPPROC gles2wStencilOp; +PFNGLSTENCILOPSEPARATEPROC gles2wStencilOpSeparate; +PFNGLTEXIMAGE2DPROC gles2wTexImage2D; +PFNGLTEXPARAMETERFPROC gles2wTexParameterf; +PFNGLTEXPARAMETERFVPROC gles2wTexParameterfv; +PFNGLTEXPARAMETERIPROC gles2wTexParameteri; +PFNGLTEXPARAMETERIVPROC gles2wTexParameteriv; +PFNGLTEXSUBIMAGE2DPROC gles2wTexSubImage2D; +PFNGLUNIFORM1FPROC gles2wUniform1f; +PFNGLUNIFORM1FVPROC gles2wUniform1fv; +PFNGLUNIFORM1IPROC gles2wUniform1i; +PFNGLUNIFORM1IVPROC gles2wUniform1iv; +PFNGLUNIFORM2FPROC gles2wUniform2f; +PFNGLUNIFORM2FVPROC gles2wUniform2fv; +PFNGLUNIFORM2IPROC gles2wUniform2i; +PFNGLUNIFORM2IVPROC gles2wUniform2iv; +PFNGLUNIFORM3FPROC gles2wUniform3f; +PFNGLUNIFORM3FVPROC gles2wUniform3fv; +PFNGLUNIFORM3IPROC gles2wUniform3i; +PFNGLUNIFORM3IVPROC gles2wUniform3iv; +PFNGLUNIFORM4FPROC gles2wUniform4f; +PFNGLUNIFORM4FVPROC gles2wUniform4fv; +PFNGLUNIFORM4IPROC gles2wUniform4i; +PFNGLUNIFORM4IVPROC gles2wUniform4iv; +PFNGLUNIFORMMATRIX2FVPROC gles2wUniformMatrix2fv; +PFNGLUNIFORMMATRIX3FVPROC gles2wUniformMatrix3fv; +PFNGLUNIFORMMATRIX4FVPROC gles2wUniformMatrix4fv; +PFNGLUSEPROGRAMPROC gles2wUseProgram; +PFNGLVALIDATEPROGRAMPROC gles2wValidateProgram; +PFNGLVERTEXATTRIB1FPROC gles2wVertexAttrib1f; +PFNGLVERTEXATTRIB1FVPROC gles2wVertexAttrib1fv; +PFNGLVERTEXATTRIB2FPROC gles2wVertexAttrib2f; +PFNGLVERTEXATTRIB2FVPROC gles2wVertexAttrib2fv; +PFNGLVERTEXATTRIB3FPROC gles2wVertexAttrib3f; +PFNGLVERTEXATTRIB3FVPROC gles2wVertexAttrib3fv; +PFNGLVERTEXATTRIB4FPROC gles2wVertexAttrib4f; +PFNGLVERTEXATTRIB4FVPROC gles2wVertexAttrib4fv; +PFNGLVERTEXATTRIBPOINTERPROC gles2wVertexAttribPointer; +PFNGLVIEWPORTPROC gles2wViewport; +PFNGLEGLIMAGETARGETTEXTURE2DOESPROC gles2wEGLImageTargetTexture2DOES; +PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC gles2wEGLImageTargetRenderbufferStorageOES; +PFNGLGETPROGRAMBINARYOESPROC gles2wGetProgramBinaryOES; +PFNGLPROGRAMBINARYOESPROC gles2wProgramBinaryOES; +PFNGLMAPBUFFEROESPROC gles2wMapBufferOES; +PFNGLUNMAPBUFFEROESPROC gles2wUnmapBufferOES; +PFNGLGETBUFFERPOINTERVOESPROC gles2wGetBufferPointervOES; +PFNGLTEXIMAGE3DOESPROC gles2wTexImage3DOES; +PFNGLTEXSUBIMAGE3DOESPROC gles2wTexSubImage3DOES; +PFNGLCOPYTEXSUBIMAGE3DOESPROC gles2wCopyTexSubImage3DOES; +PFNGLCOMPRESSEDTEXIMAGE3DOESPROC gles2wCompressedTexImage3DOES; +PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC gles2wCompressedTexSubImage3DOES; +PFNGLFRAMEBUFFERTEXTURE3DOESPROC gles2wFramebufferTexture3DOES; +PFNGLBINDVERTEXARRAYOESPROC gles2wBindVertexArrayOES; +PFNGLDELETEVERTEXARRAYSOESPROC gles2wDeleteVertexArraysOES; +PFNGLGENVERTEXARRAYSOESPROC gles2wGenVertexArraysOES; +PFNGLISVERTEXARRAYOESPROC gles2wIsVertexArrayOES; +PFNGLDEBUGMESSAGECONTROLKHRPROC gles2wDebugMessageControlKHR; +PFNGLDEBUGMESSAGEINSERTKHRPROC gles2wDebugMessageInsertKHR; +PFNGLDEBUGMESSAGECALLBACKKHRPROC gles2wDebugMessageCallbackKHR; +PFNGLGETDEBUGMESSAGELOGKHRPROC gles2wGetDebugMessageLogKHR; +PFNGLPUSHDEBUGGROUPKHRPROC gles2wPushDebugGroupKHR; +PFNGLPOPDEBUGGROUPKHRPROC gles2wPopDebugGroupKHR; +PFNGLOBJECTLABELKHRPROC gles2wObjectLabelKHR; +PFNGLGETOBJECTLABELKHRPROC gles2wGetObjectLabelKHR; +PFNGLOBJECTPTRLABELKHRPROC gles2wObjectPtrLabelKHR; +PFNGLGETOBJECTPTRLABELKHRPROC gles2wGetObjectPtrLabelKHR; +PFNGLGETPOINTERVKHRPROC gles2wGetPointervKHR; +PFNGLGETPERFMONITORGROUPSAMDPROC gles2wGetPerfMonitorGroupsAMD; +PFNGLGETPERFMONITORCOUNTERSAMDPROC gles2wGetPerfMonitorCountersAMD; +PFNGLGETPERFMONITORGROUPSTRINGAMDPROC gles2wGetPerfMonitorGroupStringAMD; +PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC gles2wGetPerfMonitorCounterStringAMD; +PFNGLGETPERFMONITORCOUNTERINFOAMDPROC gles2wGetPerfMonitorCounterInfoAMD; +PFNGLGENPERFMONITORSAMDPROC gles2wGenPerfMonitorsAMD; +PFNGLDELETEPERFMONITORSAMDPROC gles2wDeletePerfMonitorsAMD; +PFNGLSELECTPERFMONITORCOUNTERSAMDPROC gles2wSelectPerfMonitorCountersAMD; +PFNGLBEGINPERFMONITORAMDPROC gles2wBeginPerfMonitorAMD; +PFNGLENDPERFMONITORAMDPROC gles2wEndPerfMonitorAMD; +PFNGLGETPERFMONITORCOUNTERDATAAMDPROC gles2wGetPerfMonitorCounterDataAMD; +PFNGLBLITFRAMEBUFFERANGLEPROC gles2wBlitFramebufferANGLE; +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC gles2wRenderbufferStorageMultisampleANGLE; +PFNGLDRAWARRAYSINSTANCEDANGLEPROC gles2wDrawArraysInstancedANGLE; +PFNGLDRAWELEMENTSINSTANCEDANGLEPROC gles2wDrawElementsInstancedANGLE; +PFNGLVERTEXATTRIBDIVISORANGLEPROC gles2wVertexAttribDivisorANGLE; +PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC gles2wGetTranslatedShaderSourceANGLE; +PFNGLDRAWARRAYSINSTANCEDEXTPROC gles2wDrawArraysInstancedEXT; +PFNGLDRAWELEMENTSINSTANCEDEXTPROC gles2wDrawElementsInstancedEXT; +PFNGLVERTEXATTRIBDIVISOREXTPROC gles2wVertexAttribDivisorEXT; +PFNGLCOPYTEXTURELEVELSAPPLEPROC gles2wCopyTextureLevelsAPPLE; +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC gles2wRenderbufferStorageMultisampleAPPLE; +PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC gles2wResolveMultisampleFramebufferAPPLE; +PFNGLFENCESYNCAPPLEPROC gles2wFenceSyncAPPLE; +PFNGLISSYNCAPPLEPROC gles2wIsSyncAPPLE; +PFNGLDELETESYNCAPPLEPROC gles2wDeleteSyncAPPLE; +PFNGLCLIENTWAITSYNCAPPLEPROC gles2wClientWaitSyncAPPLE; +PFNGLWAITSYNCAPPLEPROC gles2wWaitSyncAPPLE; +PFNGLGETINTEGER64VAPPLEPROC gles2wGetInteger64vAPPLE; +PFNGLGETSYNCIVAPPLEPROC gles2wGetSyncivAPPLE; +PFNGLLABELOBJECTEXTPROC gles2wLabelObjectEXT; +PFNGLGETOBJECTLABELEXTPROC gles2wGetObjectLabelEXT; +PFNGLINSERTEVENTMARKEREXTPROC gles2wInsertEventMarkerEXT; +PFNGLPUSHGROUPMARKEREXTPROC gles2wPushGroupMarkerEXT; +PFNGLPOPGROUPMARKEREXTPROC gles2wPopGroupMarkerEXT; +PFNGLDISCARDFRAMEBUFFEREXTPROC gles2wDiscardFramebufferEXT; +PFNGLGENQUERIESEXTPROC gles2wGenQueriesEXT; +PFNGLDELETEQUERIESEXTPROC gles2wDeleteQueriesEXT; +PFNGLISQUERYEXTPROC gles2wIsQueryEXT; +PFNGLBEGINQUERYEXTPROC gles2wBeginQueryEXT; +PFNGLENDQUERYEXTPROC gles2wEndQueryEXT; +PFNGLQUERYCOUNTEREXTPROC gles2wQueryCounterEXT; +PFNGLGETQUERYIVEXTPROC gles2wGetQueryivEXT; +PFNGLGETQUERYOBJECTIVEXTPROC gles2wGetQueryObjectivEXT; +PFNGLGETQUERYOBJECTUIVEXTPROC gles2wGetQueryObjectuivEXT; +PFNGLGETQUERYOBJECTI64VEXTPROC gles2wGetQueryObjecti64vEXT; +PFNGLGETQUERYOBJECTUI64VEXTPROC gles2wGetQueryObjectui64vEXT; +PFNGLMAPBUFFERRANGEEXTPROC gles2wMapBufferRangeEXT; +PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC gles2wFlushMappedBufferRangeEXT; +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC gles2wRenderbufferStorageMultisampleEXT; +PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC gles2wFramebufferTexture2DMultisampleEXT; +PFNGLREADBUFFERINDEXEDEXTPROC gles2wReadBufferIndexedEXT; +PFNGLDRAWBUFFERSINDEXEDEXTPROC gles2wDrawBuffersIndexedEXT; +PFNGLGETINTEGERI_VEXTPROC gles2wGetIntegeri_vEXT; +PFNGLMULTIDRAWARRAYSEXTPROC gles2wMultiDrawArraysEXT; +PFNGLMULTIDRAWELEMENTSEXTPROC gles2wMultiDrawElementsEXT; +PFNGLGETGRAPHICSRESETSTATUSEXTPROC gles2wGetGraphicsResetStatusEXT; +PFNGLREADNPIXELSEXTPROC gles2wReadnPixelsEXT; +PFNGLGETNUNIFORMFVEXTPROC gles2wGetnUniformfvEXT; +PFNGLGETNUNIFORMIVEXTPROC gles2wGetnUniformivEXT; +PFNGLUSEPROGRAMSTAGESEXTPROC gles2wUseProgramStagesEXT; +PFNGLACTIVESHADERPROGRAMEXTPROC gles2wActiveShaderProgramEXT; +PFNGLCREATESHADERPROGRAMVEXTPROC gles2wCreateShaderProgramvEXT; +PFNGLBINDPROGRAMPIPELINEEXTPROC gles2wBindProgramPipelineEXT; +PFNGLDELETEPROGRAMPIPELINESEXTPROC gles2wDeleteProgramPipelinesEXT; +PFNGLGENPROGRAMPIPELINESEXTPROC gles2wGenProgramPipelinesEXT; +PFNGLISPROGRAMPIPELINEEXTPROC gles2wIsProgramPipelineEXT; +PFNGLPROGRAMPARAMETERIEXTPROC gles2wProgramParameteriEXT; +PFNGLGETPROGRAMPIPELINEIVEXTPROC gles2wGetProgramPipelineivEXT; +PFNGLPROGRAMUNIFORM1IEXTPROC gles2wProgramUniform1iEXT; +PFNGLPROGRAMUNIFORM2IEXTPROC gles2wProgramUniform2iEXT; +PFNGLPROGRAMUNIFORM3IEXTPROC gles2wProgramUniform3iEXT; +PFNGLPROGRAMUNIFORM4IEXTPROC gles2wProgramUniform4iEXT; +PFNGLPROGRAMUNIFORM1FEXTPROC gles2wProgramUniform1fEXT; +PFNGLPROGRAMUNIFORM2FEXTPROC gles2wProgramUniform2fEXT; +PFNGLPROGRAMUNIFORM3FEXTPROC gles2wProgramUniform3fEXT; +PFNGLPROGRAMUNIFORM4FEXTPROC gles2wProgramUniform4fEXT; +PFNGLPROGRAMUNIFORM1IVEXTPROC gles2wProgramUniform1ivEXT; +PFNGLPROGRAMUNIFORM2IVEXTPROC gles2wProgramUniform2ivEXT; +PFNGLPROGRAMUNIFORM3IVEXTPROC gles2wProgramUniform3ivEXT; +PFNGLPROGRAMUNIFORM4IVEXTPROC gles2wProgramUniform4ivEXT; +PFNGLPROGRAMUNIFORM1FVEXTPROC gles2wProgramUniform1fvEXT; +PFNGLPROGRAMUNIFORM2FVEXTPROC gles2wProgramUniform2fvEXT; +PFNGLPROGRAMUNIFORM3FVEXTPROC gles2wProgramUniform3fvEXT; +PFNGLPROGRAMUNIFORM4FVEXTPROC gles2wProgramUniform4fvEXT; +PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC gles2wProgramUniformMatrix2fvEXT; +PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC gles2wProgramUniformMatrix3fvEXT; +PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC gles2wProgramUniformMatrix4fvEXT; +PFNGLVALIDATEPROGRAMPIPELINEEXTPROC gles2wValidateProgramPipelineEXT; +PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC gles2wGetProgramPipelineInfoLogEXT; +PFNGLTEXSTORAGE1DEXTPROC gles2wTexStorage1DEXT; +PFNGLTEXSTORAGE2DEXTPROC gles2wTexStorage2DEXT; +PFNGLTEXSTORAGE3DEXTPROC gles2wTexStorage3DEXT; +PFNGLTEXTURESTORAGE1DEXTPROC gles2wTextureStorage1DEXT; +PFNGLTEXTURESTORAGE2DEXTPROC gles2wTextureStorage2DEXT; +PFNGLTEXTURESTORAGE3DEXTPROC gles2wTextureStorage3DEXT; +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMGPROC gles2wRenderbufferStorageMultisampleIMG; +PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC gles2wFramebufferTexture2DMultisampleIMG; +PFNGLCOVERAGEMASKNVPROC gles2wCoverageMaskNV; +PFNGLCOVERAGEOPERATIONNVPROC gles2wCoverageOperationNV; +PFNGLDRAWBUFFERSNVPROC gles2wDrawBuffersNV; +PFNGLDRAWARRAYSINSTANCEDNVPROC gles2wDrawArraysInstancedNV; +PFNGLDRAWELEMENTSINSTANCEDNVPROC gles2wDrawElementsInstancedNV; +PFNGLDELETEFENCESNVPROC gles2wDeleteFencesNV; +PFNGLGENFENCESNVPROC gles2wGenFencesNV; +PFNGLISFENCENVPROC gles2wIsFenceNV; +PFNGLTESTFENCENVPROC gles2wTestFenceNV; +PFNGLGETFENCEIVNVPROC gles2wGetFenceivNV; +PFNGLFINISHFENCENVPROC gles2wFinishFenceNV; +PFNGLSETFENCENVPROC gles2wSetFenceNV; +PFNGLBLITFRAMEBUFFERNVPROC gles2wBlitFramebufferNV; +PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC gles2wRenderbufferStorageMultisampleNV; +PFNGLVERTEXATTRIBDIVISORNVPROC gles2wVertexAttribDivisorNV; +PFNGLREADBUFFERNVPROC gles2wReadBufferNV; +PFNGLALPHAFUNCQCOMPROC gles2wAlphaFuncQCOM; +PFNGLGETDRIVERCONTROLSQCOMPROC gles2wGetDriverControlsQCOM; +PFNGLGETDRIVERCONTROLSTRINGQCOMPROC gles2wGetDriverControlStringQCOM; +PFNGLENABLEDRIVERCONTROLQCOMPROC gles2wEnableDriverControlQCOM; +PFNGLDISABLEDRIVERCONTROLQCOMPROC gles2wDisableDriverControlQCOM; +PFNGLEXTGETTEXTURESQCOMPROC gles2wExtGetTexturesQCOM; +PFNGLEXTGETBUFFERSQCOMPROC gles2wExtGetBuffersQCOM; +PFNGLEXTGETRENDERBUFFERSQCOMPROC gles2wExtGetRenderbuffersQCOM; +PFNGLEXTGETFRAMEBUFFERSQCOMPROC gles2wExtGetFramebuffersQCOM; +PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC gles2wExtGetTexLevelParameterivQCOM; +PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC gles2wExtTexObjectStateOverrideiQCOM; +PFNGLEXTGETTEXSUBIMAGEQCOMPROC gles2wExtGetTexSubImageQCOM; +PFNGLEXTGETBUFFERPOINTERVQCOMPROC gles2wExtGetBufferPointervQCOM; +PFNGLEXTGETSHADERSQCOMPROC gles2wExtGetShadersQCOM; +PFNGLEXTGETPROGRAMSQCOMPROC gles2wExtGetProgramsQCOM; +PFNGLEXTISPROGRAMBINARYQCOMPROC gles2wExtIsProgramBinaryQCOM; +PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC gles2wExtGetProgramBinarySourceQCOM; +PFNGLSTARTTILINGQCOMPROC gles2wStartTilingQCOM; +PFNGLENDTILINGQCOMPROC gles2wEndTilingQCOM; + +static void load_procs(void) +{ + gles2wActiveTexture = (PFNGLACTIVETEXTUREPROC) get_proc("glActiveTexture"); + gles2wAttachShader = (PFNGLATTACHSHADERPROC) get_proc("glAttachShader"); + gles2wBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC) get_proc("glBindAttribLocation"); + gles2wBindBuffer = (PFNGLBINDBUFFERPROC) get_proc("glBindBuffer"); + gles2wBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC) get_proc("glBindFramebuffer"); + gles2wBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC) get_proc("glBindRenderbuffer"); + gles2wBindTexture = (PFNGLBINDTEXTUREPROC) get_proc("glBindTexture"); + gles2wBlendColor = (PFNGLBLENDCOLORPROC) get_proc("glBlendColor"); + gles2wBlendEquation = (PFNGLBLENDEQUATIONPROC) get_proc("glBlendEquation"); + gles2wBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC) get_proc("glBlendEquationSeparate"); + gles2wBlendFunc = (PFNGLBLENDFUNCPROC) get_proc("glBlendFunc"); + gles2wBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC) get_proc("glBlendFuncSeparate"); + gles2wBufferData = (PFNGLBUFFERDATAPROC) get_proc("glBufferData"); + gles2wBufferSubData = (PFNGLBUFFERSUBDATAPROC) get_proc("glBufferSubData"); + gles2wCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC) get_proc("glCheckFramebufferStatus"); + gles2wClear = (PFNGLCLEARPROC) get_proc("glClear"); + gles2wClearColor = (PFNGLCLEARCOLORPROC) get_proc("glClearColor"); + gles2wClearDepthf = (PFNGLCLEARDEPTHFPROC) get_proc("glClearDepthf"); + gles2wClearStencil = (PFNGLCLEARSTENCILPROC) get_proc("glClearStencil"); + gles2wColorMask = (PFNGLCOLORMASKPROC) get_proc("glColorMask"); + gles2wCompileShader = (PFNGLCOMPILESHADERPROC) get_proc("glCompileShader"); + gles2wCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC) get_proc("glCompressedTexImage2D"); + gles2wCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) get_proc("glCompressedTexSubImage2D"); + gles2wCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC) get_proc("glCopyTexImage2D"); + gles2wCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC) get_proc("glCopyTexSubImage2D"); + gles2wCreateProgram = (PFNGLCREATEPROGRAMPROC) get_proc("glCreateProgram"); + gles2wCreateShader = (PFNGLCREATESHADERPROC) get_proc("glCreateShader"); + gles2wCullFace = (PFNGLCULLFACEPROC) get_proc("glCullFace"); + gles2wDeleteBuffers = (PFNGLDELETEBUFFERSPROC) get_proc("glDeleteBuffers"); + gles2wDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC) get_proc("glDeleteFramebuffers"); + gles2wDeleteProgram = (PFNGLDELETEPROGRAMPROC) get_proc("glDeleteProgram"); + gles2wDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC) get_proc("glDeleteRenderbuffers"); + gles2wDeleteShader = (PFNGLDELETESHADERPROC) get_proc("glDeleteShader"); + gles2wDeleteTextures = (PFNGLDELETETEXTURESPROC) get_proc("glDeleteTextures"); + gles2wDepthFunc = (PFNGLDEPTHFUNCPROC) get_proc("glDepthFunc"); + gles2wDepthMask = (PFNGLDEPTHMASKPROC) get_proc("glDepthMask"); + gles2wDepthRangef = (PFNGLDEPTHRANGEFPROC) get_proc("glDepthRangef"); + gles2wDetachShader = (PFNGLDETACHSHADERPROC) get_proc("glDetachShader"); + gles2wDisable = (PFNGLDISABLEPROC) get_proc("glDisable"); + gles2wDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC) get_proc("glDisableVertexAttribArray"); + gles2wDrawArrays = (PFNGLDRAWARRAYSPROC) get_proc("glDrawArrays"); + gles2wDrawElements = (PFNGLDRAWELEMENTSPROC) get_proc("glDrawElements"); + gles2wEnable = (PFNGLENABLEPROC) get_proc("glEnable"); + gles2wEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC) get_proc("glEnableVertexAttribArray"); + gles2wFinish = (PFNGLFINISHPROC) get_proc("glFinish"); + gles2wFlush = (PFNGLFLUSHPROC) get_proc("glFlush"); + gles2wFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC) get_proc("glFramebufferRenderbuffer"); + gles2wFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC) get_proc("glFramebufferTexture2D"); + gles2wFrontFace = (PFNGLFRONTFACEPROC) get_proc("glFrontFace"); + gles2wGenBuffers = (PFNGLGENBUFFERSPROC) get_proc("glGenBuffers"); + gles2wGenerateMipmap = (PFNGLGENERATEMIPMAPPROC) get_proc("glGenerateMipmap"); + gles2wGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC) get_proc("glGenFramebuffers"); + gles2wGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC) get_proc("glGenRenderbuffers"); + gles2wGenTextures = (PFNGLGENTEXTURESPROC) get_proc("glGenTextures"); + gles2wGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC) get_proc("glGetActiveAttrib"); + gles2wGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC) get_proc("glGetActiveUniform"); + gles2wGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC) get_proc("glGetAttachedShaders"); + gles2wGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC) get_proc("glGetAttribLocation"); + gles2wGetBooleanv = (PFNGLGETBOOLEANVPROC) get_proc("glGetBooleanv"); + gles2wGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC) get_proc("glGetBufferParameteriv"); + gles2wGetError = (PFNGLGETERRORPROC) get_proc("glGetError"); + gles2wGetFloatv = (PFNGLGETFLOATVPROC) get_proc("glGetFloatv"); + gles2wGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) get_proc("glGetFramebufferAttachmentParameteriv"); + gles2wGetIntegerv = (PFNGLGETINTEGERVPROC) get_proc("glGetIntegerv"); + gles2wGetProgramiv = (PFNGLGETPROGRAMIVPROC) get_proc("glGetProgramiv"); + gles2wGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC) get_proc("glGetProgramInfoLog"); + gles2wGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC) get_proc("glGetRenderbufferParameteriv"); + gles2wGetShaderiv = (PFNGLGETSHADERIVPROC) get_proc("glGetShaderiv"); + gles2wGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC) get_proc("glGetShaderInfoLog"); + gles2wGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC) get_proc("glGetShaderPrecisionFormat"); + gles2wGetShaderSource = (PFNGLGETSHADERSOURCEPROC) get_proc("glGetShaderSource"); + gles2wGetString = (PFNGLGETSTRINGPROC) get_proc("glGetString"); + gles2wGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC) get_proc("glGetTexParameterfv"); + gles2wGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC) get_proc("glGetTexParameteriv"); + gles2wGetUniformfv = (PFNGLGETUNIFORMFVPROC) get_proc("glGetUniformfv"); + gles2wGetUniformiv = (PFNGLGETUNIFORMIVPROC) get_proc("glGetUniformiv"); + gles2wGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC) get_proc("glGetUniformLocation"); + gles2wGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC) get_proc("glGetVertexAttribfv"); + gles2wGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC) get_proc("glGetVertexAttribiv"); + gles2wGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC) get_proc("glGetVertexAttribPointerv"); + gles2wHint = (PFNGLHINTPROC) get_proc("glHint"); + gles2wIsBuffer = (PFNGLISBUFFERPROC) get_proc("glIsBuffer"); + gles2wIsEnabled = (PFNGLISENABLEDPROC) get_proc("glIsEnabled"); + gles2wIsFramebuffer = (PFNGLISFRAMEBUFFERPROC) get_proc("glIsFramebuffer"); + gles2wIsProgram = (PFNGLISPROGRAMPROC) get_proc("glIsProgram"); + gles2wIsRenderbuffer = (PFNGLISRENDERBUFFERPROC) get_proc("glIsRenderbuffer"); + gles2wIsShader = (PFNGLISSHADERPROC) get_proc("glIsShader"); + gles2wIsTexture = (PFNGLISTEXTUREPROC) get_proc("glIsTexture"); + gles2wLineWidth = (PFNGLLINEWIDTHPROC) get_proc("glLineWidth"); + gles2wLinkProgram = (PFNGLLINKPROGRAMPROC) get_proc("glLinkProgram"); + gles2wPixelStorei = (PFNGLPIXELSTOREIPROC) get_proc("glPixelStorei"); + gles2wPolygonOffset = (PFNGLPOLYGONOFFSETPROC) get_proc("glPolygonOffset"); + gles2wReadPixels = (PFNGLREADPIXELSPROC) get_proc("glReadPixels"); + gles2wReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC) get_proc("glReleaseShaderCompiler"); + gles2wRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC) get_proc("glRenderbufferStorage"); + gles2wSampleCoverage = (PFNGLSAMPLECOVERAGEPROC) get_proc("glSampleCoverage"); + gles2wScissor = (PFNGLSCISSORPROC) get_proc("glScissor"); + gles2wShaderBinary = (PFNGLSHADERBINARYPROC) get_proc("glShaderBinary"); + gles2wShaderSource = (PFNGLSHADERSOURCEPROC) get_proc("glShaderSource"); + gles2wStencilFunc = (PFNGLSTENCILFUNCPROC) get_proc("glStencilFunc"); + gles2wStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC) get_proc("glStencilFuncSeparate"); + gles2wStencilMask = (PFNGLSTENCILMASKPROC) get_proc("glStencilMask"); + gles2wStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC) get_proc("glStencilMaskSeparate"); + gles2wStencilOp = (PFNGLSTENCILOPPROC) get_proc("glStencilOp"); + gles2wStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC) get_proc("glStencilOpSeparate"); + gles2wTexImage2D = (PFNGLTEXIMAGE2DPROC) get_proc("glTexImage2D"); + gles2wTexParameterf = (PFNGLTEXPARAMETERFPROC) get_proc("glTexParameterf"); + gles2wTexParameterfv = (PFNGLTEXPARAMETERFVPROC) get_proc("glTexParameterfv"); + gles2wTexParameteri = (PFNGLTEXPARAMETERIPROC) get_proc("glTexParameteri"); + gles2wTexParameteriv = (PFNGLTEXPARAMETERIVPROC) get_proc("glTexParameteriv"); + gles2wTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC) get_proc("glTexSubImage2D"); + gles2wUniform1f = (PFNGLUNIFORM1FPROC) get_proc("glUniform1f"); + gles2wUniform1fv = (PFNGLUNIFORM1FVPROC) get_proc("glUniform1fv"); + gles2wUniform1i = (PFNGLUNIFORM1IPROC) get_proc("glUniform1i"); + gles2wUniform1iv = (PFNGLUNIFORM1IVPROC) get_proc("glUniform1iv"); + gles2wUniform2f = (PFNGLUNIFORM2FPROC) get_proc("glUniform2f"); + gles2wUniform2fv = (PFNGLUNIFORM2FVPROC) get_proc("glUniform2fv"); + gles2wUniform2i = (PFNGLUNIFORM2IPROC) get_proc("glUniform2i"); + gles2wUniform2iv = (PFNGLUNIFORM2IVPROC) get_proc("glUniform2iv"); + gles2wUniform3f = (PFNGLUNIFORM3FPROC) get_proc("glUniform3f"); + gles2wUniform3fv = (PFNGLUNIFORM3FVPROC) get_proc("glUniform3fv"); + gles2wUniform3i = (PFNGLUNIFORM3IPROC) get_proc("glUniform3i"); + gles2wUniform3iv = (PFNGLUNIFORM3IVPROC) get_proc("glUniform3iv"); + gles2wUniform4f = (PFNGLUNIFORM4FPROC) get_proc("glUniform4f"); + gles2wUniform4fv = (PFNGLUNIFORM4FVPROC) get_proc("glUniform4fv"); + gles2wUniform4i = (PFNGLUNIFORM4IPROC) get_proc("glUniform4i"); + gles2wUniform4iv = (PFNGLUNIFORM4IVPROC) get_proc("glUniform4iv"); + gles2wUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC) get_proc("glUniformMatrix2fv"); + gles2wUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC) get_proc("glUniformMatrix3fv"); + gles2wUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC) get_proc("glUniformMatrix4fv"); + gles2wUseProgram = (PFNGLUSEPROGRAMPROC) get_proc("glUseProgram"); + gles2wValidateProgram = (PFNGLVALIDATEPROGRAMPROC) get_proc("glValidateProgram"); + gles2wVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC) get_proc("glVertexAttrib1f"); + gles2wVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC) get_proc("glVertexAttrib1fv"); + gles2wVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC) get_proc("glVertexAttrib2f"); + gles2wVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC) get_proc("glVertexAttrib2fv"); + gles2wVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC) get_proc("glVertexAttrib3f"); + gles2wVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC) get_proc("glVertexAttrib3fv"); + gles2wVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC) get_proc("glVertexAttrib4f"); + gles2wVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC) get_proc("glVertexAttrib4fv"); + gles2wVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC) get_proc("glVertexAttribPointer"); + gles2wViewport = (PFNGLVIEWPORTPROC) get_proc("glViewport"); + gles2wEGLImageTargetTexture2DOES = (PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) get_proc("glEGLImageTargetTexture2DOES"); + gles2wEGLImageTargetRenderbufferStorageOES = (PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) get_proc("glEGLImageTargetRenderbufferStorageOES"); + gles2wGetProgramBinaryOES = (PFNGLGETPROGRAMBINARYOESPROC) get_proc("glGetProgramBinaryOES"); + gles2wProgramBinaryOES = (PFNGLPROGRAMBINARYOESPROC) get_proc("glProgramBinaryOES"); + gles2wMapBufferOES = (PFNGLMAPBUFFEROESPROC) get_proc("glMapBufferOES"); + gles2wUnmapBufferOES = (PFNGLUNMAPBUFFEROESPROC) get_proc("glUnmapBufferOES"); + gles2wGetBufferPointervOES = (PFNGLGETBUFFERPOINTERVOESPROC) get_proc("glGetBufferPointervOES"); + gles2wTexImage3DOES = (PFNGLTEXIMAGE3DOESPROC) get_proc("glTexImage3DOES"); + gles2wTexSubImage3DOES = (PFNGLTEXSUBIMAGE3DOESPROC) get_proc("glTexSubImage3DOES"); + gles2wCopyTexSubImage3DOES = (PFNGLCOPYTEXSUBIMAGE3DOESPROC) get_proc("glCopyTexSubImage3DOES"); + gles2wCompressedTexImage3DOES = (PFNGLCOMPRESSEDTEXIMAGE3DOESPROC) get_proc("glCompressedTexImage3DOES"); + gles2wCompressedTexSubImage3DOES = (PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC) get_proc("glCompressedTexSubImage3DOES"); + gles2wFramebufferTexture3DOES = (PFNGLFRAMEBUFFERTEXTURE3DOESPROC) get_proc("glFramebufferTexture3DOES"); + gles2wBindVertexArrayOES = (PFNGLBINDVERTEXARRAYOESPROC) get_proc("glBindVertexArrayOES"); + gles2wDeleteVertexArraysOES = (PFNGLDELETEVERTEXARRAYSOESPROC) get_proc("glDeleteVertexArraysOES"); + gles2wGenVertexArraysOES = (PFNGLGENVERTEXARRAYSOESPROC) get_proc("glGenVertexArraysOES"); + gles2wIsVertexArrayOES = (PFNGLISVERTEXARRAYOESPROC) get_proc("glIsVertexArrayOES"); + gles2wDebugMessageControlKHR = (PFNGLDEBUGMESSAGECONTROLKHRPROC) get_proc("glDebugMessageControlKHR"); + gles2wDebugMessageInsertKHR = (PFNGLDEBUGMESSAGEINSERTKHRPROC) get_proc("glDebugMessageInsertKHR"); + gles2wDebugMessageCallbackKHR = (PFNGLDEBUGMESSAGECALLBACKKHRPROC) get_proc("glDebugMessageCallbackKHR"); + gles2wGetDebugMessageLogKHR = (PFNGLGETDEBUGMESSAGELOGKHRPROC) get_proc("glGetDebugMessageLogKHR"); + gles2wPushDebugGroupKHR = (PFNGLPUSHDEBUGGROUPKHRPROC) get_proc("glPushDebugGroupKHR"); + gles2wPopDebugGroupKHR = (PFNGLPOPDEBUGGROUPKHRPROC) get_proc("glPopDebugGroupKHR"); + gles2wObjectLabelKHR = (PFNGLOBJECTLABELKHRPROC) get_proc("glObjectLabelKHR"); + gles2wGetObjectLabelKHR = (PFNGLGETOBJECTLABELKHRPROC) get_proc("glGetObjectLabelKHR"); + gles2wObjectPtrLabelKHR = (PFNGLOBJECTPTRLABELKHRPROC) get_proc("glObjectPtrLabelKHR"); + gles2wGetObjectPtrLabelKHR = (PFNGLGETOBJECTPTRLABELKHRPROC) get_proc("glGetObjectPtrLabelKHR"); + gles2wGetPointervKHR = (PFNGLGETPOINTERVKHRPROC) get_proc("glGetPointervKHR"); + gles2wGetPerfMonitorGroupsAMD = (PFNGLGETPERFMONITORGROUPSAMDPROC) get_proc("glGetPerfMonitorGroupsAMD"); + gles2wGetPerfMonitorCountersAMD = (PFNGLGETPERFMONITORCOUNTERSAMDPROC) get_proc("glGetPerfMonitorCountersAMD"); + gles2wGetPerfMonitorGroupStringAMD = (PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) get_proc("glGetPerfMonitorGroupStringAMD"); + gles2wGetPerfMonitorCounterStringAMD = (PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) get_proc("glGetPerfMonitorCounterStringAMD"); + gles2wGetPerfMonitorCounterInfoAMD = (PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) get_proc("glGetPerfMonitorCounterInfoAMD"); + gles2wGenPerfMonitorsAMD = (PFNGLGENPERFMONITORSAMDPROC) get_proc("glGenPerfMonitorsAMD"); + gles2wDeletePerfMonitorsAMD = (PFNGLDELETEPERFMONITORSAMDPROC) get_proc("glDeletePerfMonitorsAMD"); + gles2wSelectPerfMonitorCountersAMD = (PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) get_proc("glSelectPerfMonitorCountersAMD"); + gles2wBeginPerfMonitorAMD = (PFNGLBEGINPERFMONITORAMDPROC) get_proc("glBeginPerfMonitorAMD"); + gles2wEndPerfMonitorAMD = (PFNGLENDPERFMONITORAMDPROC) get_proc("glEndPerfMonitorAMD"); + gles2wGetPerfMonitorCounterDataAMD = (PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) get_proc("glGetPerfMonitorCounterDataAMD"); + gles2wBlitFramebufferANGLE = (PFNGLBLITFRAMEBUFFERANGLEPROC) get_proc("glBlitFramebufferANGLE"); + gles2wRenderbufferStorageMultisampleANGLE = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) get_proc("glRenderbufferStorageMultisampleANGLE"); + gles2wDrawArraysInstancedANGLE = (PFNGLDRAWARRAYSINSTANCEDANGLEPROC) get_proc("glDrawArraysInstancedANGLE"); + gles2wDrawElementsInstancedANGLE = (PFNGLDRAWELEMENTSINSTANCEDANGLEPROC) get_proc("glDrawElementsInstancedANGLE"); + gles2wVertexAttribDivisorANGLE = (PFNGLVERTEXATTRIBDIVISORANGLEPROC) get_proc("glVertexAttribDivisorANGLE"); + gles2wGetTranslatedShaderSourceANGLE = (PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) get_proc("glGetTranslatedShaderSourceANGLE"); + gles2wDrawArraysInstancedEXT = (PFNGLDRAWARRAYSINSTANCEDEXTPROC) get_proc("glDrawArraysInstancedEXT"); + gles2wDrawElementsInstancedEXT = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC) get_proc("glDrawElementsInstancedEXT"); + gles2wVertexAttribDivisorEXT = (PFNGLVERTEXATTRIBDIVISOREXTPROC) get_proc("glVertexAttribDivisorEXT"); + gles2wCopyTextureLevelsAPPLE = (PFNGLCOPYTEXTURELEVELSAPPLEPROC) get_proc("glCopyTextureLevelsAPPLE"); + gles2wRenderbufferStorageMultisampleAPPLE = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) get_proc("glRenderbufferStorageMultisampleAPPLE"); + gles2wResolveMultisampleFramebufferAPPLE = (PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) get_proc("glResolveMultisampleFramebufferAPPLE"); + gles2wFenceSyncAPPLE = (PFNGLFENCESYNCAPPLEPROC) get_proc("glFenceSyncAPPLE"); + gles2wIsSyncAPPLE = (PFNGLISSYNCAPPLEPROC) get_proc("glIsSyncAPPLE"); + gles2wDeleteSyncAPPLE = (PFNGLDELETESYNCAPPLEPROC) get_proc("glDeleteSyncAPPLE"); + gles2wClientWaitSyncAPPLE = (PFNGLCLIENTWAITSYNCAPPLEPROC) get_proc("glClientWaitSyncAPPLE"); + gles2wWaitSyncAPPLE = (PFNGLWAITSYNCAPPLEPROC) get_proc("glWaitSyncAPPLE"); + gles2wGetInteger64vAPPLE = (PFNGLGETINTEGER64VAPPLEPROC) get_proc("glGetInteger64vAPPLE"); + gles2wGetSyncivAPPLE = (PFNGLGETSYNCIVAPPLEPROC) get_proc("glGetSyncivAPPLE"); + gles2wLabelObjectEXT = (PFNGLLABELOBJECTEXTPROC) get_proc("glLabelObjectEXT"); + gles2wGetObjectLabelEXT = (PFNGLGETOBJECTLABELEXTPROC) get_proc("glGetObjectLabelEXT"); + gles2wInsertEventMarkerEXT = (PFNGLINSERTEVENTMARKEREXTPROC) get_proc("glInsertEventMarkerEXT"); + gles2wPushGroupMarkerEXT = (PFNGLPUSHGROUPMARKEREXTPROC) get_proc("glPushGroupMarkerEXT"); + gles2wPopGroupMarkerEXT = (PFNGLPOPGROUPMARKEREXTPROC) get_proc("glPopGroupMarkerEXT"); + gles2wDiscardFramebufferEXT = (PFNGLDISCARDFRAMEBUFFEREXTPROC) get_proc("glDiscardFramebufferEXT"); + gles2wGenQueriesEXT = (PFNGLGENQUERIESEXTPROC) get_proc("glGenQueriesEXT"); + gles2wDeleteQueriesEXT = (PFNGLDELETEQUERIESEXTPROC) get_proc("glDeleteQueriesEXT"); + gles2wIsQueryEXT = (PFNGLISQUERYEXTPROC) get_proc("glIsQueryEXT"); + gles2wBeginQueryEXT = (PFNGLBEGINQUERYEXTPROC) get_proc("glBeginQueryEXT"); + gles2wEndQueryEXT = (PFNGLENDQUERYEXTPROC) get_proc("glEndQueryEXT"); + gles2wQueryCounterEXT = (PFNGLQUERYCOUNTEREXTPROC) get_proc("glQueryCounterEXT"); + gles2wGetQueryivEXT = (PFNGLGETQUERYIVEXTPROC) get_proc("glGetQueryivEXT"); + gles2wGetQueryObjectivEXT = (PFNGLGETQUERYOBJECTIVEXTPROC) get_proc("glGetQueryObjectivEXT"); + gles2wGetQueryObjectuivEXT = (PFNGLGETQUERYOBJECTUIVEXTPROC) get_proc("glGetQueryObjectuivEXT"); + gles2wGetQueryObjecti64vEXT = (PFNGLGETQUERYOBJECTI64VEXTPROC) get_proc("glGetQueryObjecti64vEXT"); + gles2wGetQueryObjectui64vEXT = (PFNGLGETQUERYOBJECTUI64VEXTPROC) get_proc("glGetQueryObjectui64vEXT"); + gles2wMapBufferRangeEXT = (PFNGLMAPBUFFERRANGEEXTPROC) get_proc("glMapBufferRangeEXT"); + gles2wFlushMappedBufferRangeEXT = (PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC) get_proc("glFlushMappedBufferRangeEXT"); + gles2wRenderbufferStorageMultisampleEXT = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) get_proc("glRenderbufferStorageMultisampleEXT"); + gles2wFramebufferTexture2DMultisampleEXT = (PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) get_proc("glFramebufferTexture2DMultisampleEXT"); + gles2wReadBufferIndexedEXT = (PFNGLREADBUFFERINDEXEDEXTPROC) get_proc("glReadBufferIndexedEXT"); + gles2wDrawBuffersIndexedEXT = (PFNGLDRAWBUFFERSINDEXEDEXTPROC) get_proc("glDrawBuffersIndexedEXT"); + gles2wGetIntegeri_vEXT = (PFNGLGETINTEGERI_VEXTPROC) get_proc("glGetIntegeri_vEXT"); + gles2wMultiDrawArraysEXT = (PFNGLMULTIDRAWARRAYSEXTPROC) get_proc("glMultiDrawArraysEXT"); + gles2wMultiDrawElementsEXT = (PFNGLMULTIDRAWELEMENTSEXTPROC) get_proc("glMultiDrawElementsEXT"); + gles2wGetGraphicsResetStatusEXT = (PFNGLGETGRAPHICSRESETSTATUSEXTPROC) get_proc("glGetGraphicsResetStatusEXT"); + gles2wReadnPixelsEXT = (PFNGLREADNPIXELSEXTPROC) get_proc("glReadnPixelsEXT"); + gles2wGetnUniformfvEXT = (PFNGLGETNUNIFORMFVEXTPROC) get_proc("glGetnUniformfvEXT"); + gles2wGetnUniformivEXT = (PFNGLGETNUNIFORMIVEXTPROC) get_proc("glGetnUniformivEXT"); + gles2wUseProgramStagesEXT = (PFNGLUSEPROGRAMSTAGESEXTPROC) get_proc("glUseProgramStagesEXT"); + gles2wActiveShaderProgramEXT = (PFNGLACTIVESHADERPROGRAMEXTPROC) get_proc("glActiveShaderProgramEXT"); + gles2wCreateShaderProgramvEXT = (PFNGLCREATESHADERPROGRAMVEXTPROC) get_proc("glCreateShaderProgramvEXT"); + gles2wBindProgramPipelineEXT = (PFNGLBINDPROGRAMPIPELINEEXTPROC) get_proc("glBindProgramPipelineEXT"); + gles2wDeleteProgramPipelinesEXT = (PFNGLDELETEPROGRAMPIPELINESEXTPROC) get_proc("glDeleteProgramPipelinesEXT"); + gles2wGenProgramPipelinesEXT = (PFNGLGENPROGRAMPIPELINESEXTPROC) get_proc("glGenProgramPipelinesEXT"); + gles2wIsProgramPipelineEXT = (PFNGLISPROGRAMPIPELINEEXTPROC) get_proc("glIsProgramPipelineEXT"); + gles2wProgramParameteriEXT = (PFNGLPROGRAMPARAMETERIEXTPROC) get_proc("glProgramParameteriEXT"); + gles2wGetProgramPipelineivEXT = (PFNGLGETPROGRAMPIPELINEIVEXTPROC) get_proc("glGetProgramPipelineivEXT"); + gles2wProgramUniform1iEXT = (PFNGLPROGRAMUNIFORM1IEXTPROC) get_proc("glProgramUniform1iEXT"); + gles2wProgramUniform2iEXT = (PFNGLPROGRAMUNIFORM2IEXTPROC) get_proc("glProgramUniform2iEXT"); + gles2wProgramUniform3iEXT = (PFNGLPROGRAMUNIFORM3IEXTPROC) get_proc("glProgramUniform3iEXT"); + gles2wProgramUniform4iEXT = (PFNGLPROGRAMUNIFORM4IEXTPROC) get_proc("glProgramUniform4iEXT"); + gles2wProgramUniform1fEXT = (PFNGLPROGRAMUNIFORM1FEXTPROC) get_proc("glProgramUniform1fEXT"); + gles2wProgramUniform2fEXT = (PFNGLPROGRAMUNIFORM2FEXTPROC) get_proc("glProgramUniform2fEXT"); + gles2wProgramUniform3fEXT = (PFNGLPROGRAMUNIFORM3FEXTPROC) get_proc("glProgramUniform3fEXT"); + gles2wProgramUniform4fEXT = (PFNGLPROGRAMUNIFORM4FEXTPROC) get_proc("glProgramUniform4fEXT"); + gles2wProgramUniform1ivEXT = (PFNGLPROGRAMUNIFORM1IVEXTPROC) get_proc("glProgramUniform1ivEXT"); + gles2wProgramUniform2ivEXT = (PFNGLPROGRAMUNIFORM2IVEXTPROC) get_proc("glProgramUniform2ivEXT"); + gles2wProgramUniform3ivEXT = (PFNGLPROGRAMUNIFORM3IVEXTPROC) get_proc("glProgramUniform3ivEXT"); + gles2wProgramUniform4ivEXT = (PFNGLPROGRAMUNIFORM4IVEXTPROC) get_proc("glProgramUniform4ivEXT"); + gles2wProgramUniform1fvEXT = (PFNGLPROGRAMUNIFORM1FVEXTPROC) get_proc("glProgramUniform1fvEXT"); + gles2wProgramUniform2fvEXT = (PFNGLPROGRAMUNIFORM2FVEXTPROC) get_proc("glProgramUniform2fvEXT"); + gles2wProgramUniform3fvEXT = (PFNGLPROGRAMUNIFORM3FVEXTPROC) get_proc("glProgramUniform3fvEXT"); + gles2wProgramUniform4fvEXT = (PFNGLPROGRAMUNIFORM4FVEXTPROC) get_proc("glProgramUniform4fvEXT"); + gles2wProgramUniformMatrix2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) get_proc("glProgramUniformMatrix2fvEXT"); + gles2wProgramUniformMatrix3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) get_proc("glProgramUniformMatrix3fvEXT"); + gles2wProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) get_proc("glProgramUniformMatrix4fvEXT"); + gles2wValidateProgramPipelineEXT = (PFNGLVALIDATEPROGRAMPIPELINEEXTPROC) get_proc("glValidateProgramPipelineEXT"); + gles2wGetProgramPipelineInfoLogEXT = (PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC) get_proc("glGetProgramPipelineInfoLogEXT"); + gles2wTexStorage1DEXT = (PFNGLTEXSTORAGE1DEXTPROC) get_proc("glTexStorage1DEXT"); + gles2wTexStorage2DEXT = (PFNGLTEXSTORAGE2DEXTPROC) get_proc("glTexStorage2DEXT"); + gles2wTexStorage3DEXT = (PFNGLTEXSTORAGE3DEXTPROC) get_proc("glTexStorage3DEXT"); + gles2wTextureStorage1DEXT = (PFNGLTEXTURESTORAGE1DEXTPROC) get_proc("glTextureStorage1DEXT"); + gles2wTextureStorage2DEXT = (PFNGLTEXTURESTORAGE2DEXTPROC) get_proc("glTextureStorage2DEXT"); + gles2wTextureStorage3DEXT = (PFNGLTEXTURESTORAGE3DEXTPROC) get_proc("glTextureStorage3DEXT"); + gles2wRenderbufferStorageMultisampleIMG = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMGPROC) get_proc("glRenderbufferStorageMultisampleIMG"); + gles2wFramebufferTexture2DMultisampleIMG = (PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC) get_proc("glFramebufferTexture2DMultisampleIMG"); + gles2wCoverageMaskNV = (PFNGLCOVERAGEMASKNVPROC) get_proc("glCoverageMaskNV"); + gles2wCoverageOperationNV = (PFNGLCOVERAGEOPERATIONNVPROC) get_proc("glCoverageOperationNV"); + gles2wDrawBuffersNV = (PFNGLDRAWBUFFERSNVPROC) get_proc("glDrawBuffersNV"); + gles2wDrawArraysInstancedNV = (PFNGLDRAWARRAYSINSTANCEDNVPROC) get_proc("glDrawArraysInstancedNV"); + gles2wDrawElementsInstancedNV = (PFNGLDRAWELEMENTSINSTANCEDNVPROC) get_proc("glDrawElementsInstancedNV"); + gles2wDeleteFencesNV = (PFNGLDELETEFENCESNVPROC) get_proc("glDeleteFencesNV"); + gles2wGenFencesNV = (PFNGLGENFENCESNVPROC) get_proc("glGenFencesNV"); + gles2wIsFenceNV = (PFNGLISFENCENVPROC) get_proc("glIsFenceNV"); + gles2wTestFenceNV = (PFNGLTESTFENCENVPROC) get_proc("glTestFenceNV"); + gles2wGetFenceivNV = (PFNGLGETFENCEIVNVPROC) get_proc("glGetFenceivNV"); + gles2wFinishFenceNV = (PFNGLFINISHFENCENVPROC) get_proc("glFinishFenceNV"); + gles2wSetFenceNV = (PFNGLSETFENCENVPROC) get_proc("glSetFenceNV"); + gles2wBlitFramebufferNV = (PFNGLBLITFRAMEBUFFERNVPROC) get_proc("glBlitFramebufferNV"); + gles2wRenderbufferStorageMultisampleNV = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC) get_proc("glRenderbufferStorageMultisampleNV"); + gles2wVertexAttribDivisorNV = (PFNGLVERTEXATTRIBDIVISORNVPROC) get_proc("glVertexAttribDivisorNV"); + gles2wReadBufferNV = (PFNGLREADBUFFERNVPROC) get_proc("glReadBufferNV"); + gles2wAlphaFuncQCOM = (PFNGLALPHAFUNCQCOMPROC) get_proc("glAlphaFuncQCOM"); + gles2wGetDriverControlsQCOM = (PFNGLGETDRIVERCONTROLSQCOMPROC) get_proc("glGetDriverControlsQCOM"); + gles2wGetDriverControlStringQCOM = (PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) get_proc("glGetDriverControlStringQCOM"); + gles2wEnableDriverControlQCOM = (PFNGLENABLEDRIVERCONTROLQCOMPROC) get_proc("glEnableDriverControlQCOM"); + gles2wDisableDriverControlQCOM = (PFNGLDISABLEDRIVERCONTROLQCOMPROC) get_proc("glDisableDriverControlQCOM"); + gles2wExtGetTexturesQCOM = (PFNGLEXTGETTEXTURESQCOMPROC) get_proc("glExtGetTexturesQCOM"); + gles2wExtGetBuffersQCOM = (PFNGLEXTGETBUFFERSQCOMPROC) get_proc("glExtGetBuffersQCOM"); + gles2wExtGetRenderbuffersQCOM = (PFNGLEXTGETRENDERBUFFERSQCOMPROC) get_proc("glExtGetRenderbuffersQCOM"); + gles2wExtGetFramebuffersQCOM = (PFNGLEXTGETFRAMEBUFFERSQCOMPROC) get_proc("glExtGetFramebuffersQCOM"); + gles2wExtGetTexLevelParameterivQCOM = (PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) get_proc("glExtGetTexLevelParameterivQCOM"); + gles2wExtTexObjectStateOverrideiQCOM = (PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) get_proc("glExtTexObjectStateOverrideiQCOM"); + gles2wExtGetTexSubImageQCOM = (PFNGLEXTGETTEXSUBIMAGEQCOMPROC) get_proc("glExtGetTexSubImageQCOM"); + gles2wExtGetBufferPointervQCOM = (PFNGLEXTGETBUFFERPOINTERVQCOMPROC) get_proc("glExtGetBufferPointervQCOM"); + gles2wExtGetShadersQCOM = (PFNGLEXTGETSHADERSQCOMPROC) get_proc("glExtGetShadersQCOM"); + gles2wExtGetProgramsQCOM = (PFNGLEXTGETPROGRAMSQCOMPROC) get_proc("glExtGetProgramsQCOM"); + gles2wExtIsProgramBinaryQCOM = (PFNGLEXTISPROGRAMBINARYQCOMPROC) get_proc("glExtIsProgramBinaryQCOM"); + gles2wExtGetProgramBinarySourceQCOM = (PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) get_proc("glExtGetProgramBinarySourceQCOM"); + gles2wStartTilingQCOM = (PFNGLSTARTTILINGQCOMPROC) get_proc("glStartTilingQCOM"); + gles2wEndTilingQCOM = (PFNGLENDTILINGQCOMPROC) get_proc("glEndTilingQCOM"); +} diff --git a/native/cocos/renderer/gfx-gles2/gles2w.h b/native/cocos/renderer/gfx-gles2/gles2w.h new file mode 100755 index 0000000000..6c6d5bec4a --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/gles2w.h @@ -0,0 +1,971 @@ +#ifndef __gles2w_h_ +#define __gles2w_h_ + +#if defined(__APPLE__) || defined(__APPLE_CC__) +# include + // Prevent Apple's non-standard extension header from being included +# define __gl_es20ext_h_ +#else +# include +#endif + +#include +#include +#include + +typedef khronos_int64_t GLint64EXT; +typedef khronos_uint64_t GLuint64EXT; + +#ifndef __gl2_h_ +#define __gl2_h_ +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef GL_EXT_texture_sRGB +#define GL_EXT_texture_sRGB 1 + +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB8_EXT 0x8C41 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 +#define GL_SLUMINANCE_EXT 0x8C46 +#define GL_SLUMINANCE8_EXT 0x8C47 +#define GL_COMPRESSED_SRGB_EXT 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 +#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B +#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F + +#endif /* GL_EXT_texture_sRGB */ + +/* gles2w api */ +int gles2wInit(void); +int gles2wIsSupported(int major, int minor); +void *gles2wGetProcAddress(const char *proc); + +/* OpenGL functions */ +typedef void (GL_APIENTRY* PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (GL_APIENTRY* PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (GL_APIENTRY* PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar* name); +typedef void (GL_APIENTRY* PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); +typedef void (GL_APIENTRY* PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); +typedef void (GL_APIENTRY* PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); +typedef void (GL_APIENTRY* PFNGLBINDTEXTUREPROC) (GLenum target, GLuint texture); +typedef void (GL_APIENTRY* PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (GL_APIENTRY* PFNGLBLENDEQUATIONPROC) ( GLenum mode ); +typedef void (GL_APIENTRY* PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); +typedef void (GL_APIENTRY* PFNGLBLENDFUNCPROC) (GLenum sfactor, GLenum dfactor); +typedef void (GL_APIENTRY* PFNGLBLENDFUNCSEPARATEPROC) (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (GL_APIENTRY* PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage); +typedef void (GL_APIENTRY* PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data); +typedef GLenum (GL_APIENTRY* PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); +typedef void (GL_APIENTRY* PFNGLCLEARPROC) (GLbitfield mask); +typedef void (GL_APIENTRY* PFNGLCLEARCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (GL_APIENTRY* PFNGLCLEARDEPTHFPROC) (GLclampf depth); +typedef void (GL_APIENTRY* PFNGLCLEARSTENCILPROC) (GLint s); +typedef void (GL_APIENTRY* PFNGLCOLORMASKPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +typedef void (GL_APIENTRY* PFNGLCOMPILESHADERPROC) (GLuint shader); +typedef void (GL_APIENTRY* PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data); +typedef void (GL_APIENTRY* PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data); +typedef void (GL_APIENTRY* PFNGLCOPYTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GL_APIENTRY* PFNGLCOPYTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef GLuint (GL_APIENTRY* PFNGLCREATEPROGRAMPROC) (void); +typedef GLuint (GL_APIENTRY* PFNGLCREATESHADERPROC) (GLenum type); +typedef void (GL_APIENTRY* PFNGLCULLFACEPROC) (GLenum mode); +typedef void (GL_APIENTRY* PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint* buffers); +typedef void (GL_APIENTRY* PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint* framebuffers); +typedef void (GL_APIENTRY* PFNGLDELETEPROGRAMPROC) (GLuint program); +typedef void (GL_APIENTRY* PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint* renderbuffers); +typedef void (GL_APIENTRY* PFNGLDELETESHADERPROC) (GLuint shader); +typedef void (GL_APIENTRY* PFNGLDELETETEXTURESPROC) (GLsizei n, const GLuint* textures); +typedef void (GL_APIENTRY* PFNGLDEPTHFUNCPROC) (GLenum func); +typedef void (GL_APIENTRY* PFNGLDEPTHMASKPROC) (GLboolean flag); +typedef void (GL_APIENTRY* PFNGLDEPTHRANGEFPROC) (GLclampf zNear, GLclampf zFar); +typedef void (GL_APIENTRY* PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (GL_APIENTRY* PFNGLDISABLEPROC) (GLenum cap); +typedef void (GL_APIENTRY* PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (GL_APIENTRY* PFNGLDRAWARRAYSPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (GL_APIENTRY* PFNGLDRAWELEMENTSPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices); +typedef void (GL_APIENTRY* PFNGLENABLEPROC) (GLenum cap); +typedef void (GL_APIENTRY* PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (GL_APIENTRY* PFNGLFINISHPROC) (void); +typedef void (GL_APIENTRY* PFNGLFLUSHPROC) (void); +typedef void (GL_APIENTRY* PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GL_APIENTRY* PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GL_APIENTRY* PFNGLFRONTFACEPROC) (GLenum mode); +typedef void (GL_APIENTRY* PFNGLGENBUFFERSPROC) (GLsizei n, GLuint* buffers); +typedef void (GL_APIENTRY* PFNGLGENERATEMIPMAPPROC) (GLenum target); +typedef void (GL_APIENTRY* PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint* framebuffers); +typedef void (GL_APIENTRY* PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (GL_APIENTRY* PFNGLGENTEXTURESPROC) (GLsizei n, GLuint* textures); +typedef void (GL_APIENTRY* PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name); +typedef void (GL_APIENTRY* PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name); +typedef void (GL_APIENTRY* PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders); +typedef GLint (GL_APIENTRY* PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar* name); +typedef void (GL_APIENTRY* PFNGLGETBOOLEANVPROC) (GLenum pname, GLboolean* params); +typedef void (GL_APIENTRY* PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLenum (GL_APIENTRY* PFNGLGETERRORPROC) (void); +typedef void (GL_APIENTRY* PFNGLGETFLOATVPROC) (GLenum pname, GLfloat* params); +typedef void (GL_APIENTRY* PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); +typedef void (GL_APIENTRY* PFNGLGETINTEGERVPROC) (GLenum pname, GLint* params); +typedef void (GL_APIENTRY* PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint* params); +typedef void (GL_APIENTRY* PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog); +typedef void (GL_APIENTRY* PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GL_APIENTRY* PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint* params); +typedef void (GL_APIENTRY* PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog); +typedef void (GL_APIENTRY* PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision); +typedef void (GL_APIENTRY* PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source); +typedef const GLubyte* (GL_APIENTRY* PFNGLGETSTRINGPROC) (GLenum name); +typedef void (GL_APIENTRY* PFNGLGETTEXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GL_APIENTRY* PFNGLGETTEXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GL_APIENTRY* PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat* params); +typedef void (GL_APIENTRY* PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint* params); +typedef GLint (GL_APIENTRY* PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar* name); +typedef void (GL_APIENTRY* PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GL_APIENTRY* PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint* params); +typedef void (GL_APIENTRY* PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid** pointer); +typedef void (GL_APIENTRY* PFNGLHINTPROC) (GLenum target, GLenum mode); +typedef GLboolean (GL_APIENTRY* PFNGLISBUFFERPROC) (GLuint buffer); +typedef GLboolean (GL_APIENTRY* PFNGLISENABLEDPROC) (GLenum cap); +typedef GLboolean (GL_APIENTRY* PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); +typedef GLboolean (GL_APIENTRY* PFNGLISPROGRAMPROC) (GLuint program); +typedef GLboolean (GL_APIENTRY* PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); +typedef GLboolean (GL_APIENTRY* PFNGLISSHADERPROC) (GLuint shader); +typedef GLboolean (GL_APIENTRY* PFNGLISTEXTUREPROC) (GLuint texture); +typedef void (GL_APIENTRY* PFNGLLINEWIDTHPROC) (GLfloat width); +typedef void (GL_APIENTRY* PFNGLLINKPROGRAMPROC) (GLuint program); +typedef void (GL_APIENTRY* PFNGLPIXELSTOREIPROC) (GLenum pname, GLint param); +typedef void (GL_APIENTRY* PFNGLPOLYGONOFFSETPROC) (GLfloat factor, GLfloat units); +typedef void (GL_APIENTRY* PFNGLREADPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels); +typedef void (GL_APIENTRY* PFNGLRELEASESHADERCOMPILERPROC) (void); +typedef void (GL_APIENTRY* PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRY* PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); +typedef void (GL_APIENTRY* PFNGLSCISSORPROC) (GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GL_APIENTRY* PFNGLSHADERBINARYPROC) (GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length); +typedef void (GL_APIENTRY* PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length); +typedef void (GL_APIENTRY* PFNGLSTENCILFUNCPROC) (GLenum func, GLint ref, GLuint mask); +typedef void (GL_APIENTRY* PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask); +typedef void (GL_APIENTRY* PFNGLSTENCILMASKPROC) (GLuint mask); +typedef void (GL_APIENTRY* PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); +typedef void (GL_APIENTRY* PFNGLSTENCILOPPROC) (GLenum fail, GLenum zfail, GLenum zpass); +typedef void (GL_APIENTRY* PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum fail, GLenum zfail, GLenum zpass); +typedef void (GL_APIENTRY* PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels); +typedef void (GL_APIENTRY* PFNGLTEXPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (GL_APIENTRY* PFNGLTEXPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GL_APIENTRY* PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GL_APIENTRY* PFNGLTEXPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GL_APIENTRY* PFNGLTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels); +typedef void (GL_APIENTRY* PFNGLUNIFORM1FPROC) (GLint location, GLfloat x); +typedef void (GL_APIENTRY* PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat* v); +typedef void (GL_APIENTRY* PFNGLUNIFORM1IPROC) (GLint location, GLint x); +typedef void (GL_APIENTRY* PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint* v); +typedef void (GL_APIENTRY* PFNGLUNIFORM2FPROC) (GLint location, GLfloat x, GLfloat y); +typedef void (GL_APIENTRY* PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat* v); +typedef void (GL_APIENTRY* PFNGLUNIFORM2IPROC) (GLint location, GLint x, GLint y); +typedef void (GL_APIENTRY* PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint* v); +typedef void (GL_APIENTRY* PFNGLUNIFORM3FPROC) (GLint location, GLfloat x, GLfloat y, GLfloat z); +typedef void (GL_APIENTRY* PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat* v); +typedef void (GL_APIENTRY* PFNGLUNIFORM3IPROC) (GLint location, GLint x, GLint y, GLint z); +typedef void (GL_APIENTRY* PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint* v); +typedef void (GL_APIENTRY* PFNGLUNIFORM4FPROC) (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GL_APIENTRY* PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat* v); +typedef void (GL_APIENTRY* PFNGLUNIFORM4IPROC) (GLint location, GLint x, GLint y, GLint z, GLint w); +typedef void (GL_APIENTRY* PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint* v); +typedef void (GL_APIENTRY* PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GL_APIENTRY* PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GL_APIENTRY* PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GL_APIENTRY* PFNGLUSEPROGRAMPROC) (GLuint program); +typedef void (GL_APIENTRY* PFNGLVALIDATEPROGRAMPROC) (GLuint program); +typedef void (GL_APIENTRY* PFNGLVERTEXATTRIB1FPROC) (GLuint indx, GLfloat x); +typedef void (GL_APIENTRY* PFNGLVERTEXATTRIB1FVPROC) (GLuint indx, const GLfloat* values); +typedef void (GL_APIENTRY* PFNGLVERTEXATTRIB2FPROC) (GLuint indx, GLfloat x, GLfloat y); +typedef void (GL_APIENTRY* PFNGLVERTEXATTRIB2FVPROC) (GLuint indx, const GLfloat* values); +typedef void (GL_APIENTRY* PFNGLVERTEXATTRIB3FPROC) (GLuint indx, GLfloat x, GLfloat y, GLfloat z); +typedef void (GL_APIENTRY* PFNGLVERTEXATTRIB3FVPROC) (GLuint indx, const GLfloat* values); +typedef void (GL_APIENTRY* PFNGLVERTEXATTRIB4FPROC) (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GL_APIENTRY* PFNGLVERTEXATTRIB4FVPROC) (GLuint indx, const GLfloat* values); +typedef void (GL_APIENTRY* PFNGLVERTEXATTRIBPOINTERPROC) (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr); +typedef void (GL_APIENTRY* PFNGLVIEWPORTPROC) (GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GL_APIENTRY* PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); +typedef void (GL_APIENTRY* PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image); +typedef void (GL_APIENTRY* PFNGLGETPROGRAMBINARYOESPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary); +typedef void (GL_APIENTRY* PFNGLPROGRAMBINARYOESPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length); +typedef void* (GL_APIENTRY* PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access); +typedef GLboolean (GL_APIENTRY* PFNGLUNMAPBUFFEROESPROC) (GLenum target); +typedef void (GL_APIENTRY* PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, GLvoid** params); +typedef void (GL_APIENTRY* PFNGLTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels); +typedef void (GL_APIENTRY* PFNGLTEXSUBIMAGE3DOESPROC) (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 (GL_APIENTRY* PFNGLCOPYTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GL_APIENTRY* PFNGLCOMPRESSEDTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data); +typedef void (GL_APIENTRY* PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC) (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 (GL_APIENTRY* PFNGLFRAMEBUFFERTEXTURE3DOESPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (GL_APIENTRY* PFNGLBINDVERTEXARRAYOESPROC) (GLuint array); +typedef void (GL_APIENTRY* PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays); +typedef void (GL_APIENTRY* PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays); +typedef GLboolean (GL_APIENTRY* PFNGLISVERTEXARRAYOESPROC) (GLuint array); +typedef void (GL_APIENTRY* PFNGLDEBUGMESSAGECONTROLKHRPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +typedef void (GL_APIENTRY* PFNGLDEBUGMESSAGEINSERTKHRPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +typedef void (GL_APIENTRY* PFNGLDEBUGMESSAGECALLBACKKHRPROC) (GLDEBUGPROCKHR callback, const void *userParam); +typedef GLuint (GL_APIENTRY* PFNGLGETDEBUGMESSAGELOGKHRPROC) (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +typedef void (GL_APIENTRY* PFNGLPUSHDEBUGGROUPKHRPROC) (GLenum source, GLuint id, GLsizei length, const GLchar *message); +typedef void (GL_APIENTRY* PFNGLPOPDEBUGGROUPKHRPROC) (void); +typedef void (GL_APIENTRY* PFNGLOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); +typedef void (GL_APIENTRY* PFNGLGETOBJECTLABELKHRPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); +typedef void (GL_APIENTRY* PFNGLOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei length, const GLchar *label); +typedef void (GL_APIENTRY* PFNGLGETOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); +typedef void (GL_APIENTRY* PFNGLGETPOINTERVKHRPROC) (GLenum pname, void **params); +typedef void (GL_APIENTRY* PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups); +typedef void (GL_APIENTRY* PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); +typedef void (GL_APIENTRY* PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); +typedef void (GL_APIENTRY* PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); +typedef void (GL_APIENTRY* PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data); +typedef void (GL_APIENTRY* PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); +typedef void (GL_APIENTRY* PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); +typedef void (GL_APIENTRY* PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList); +typedef void (GL_APIENTRY* PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GL_APIENTRY* PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GL_APIENTRY* PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); +typedef void (GL_APIENTRY* PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef void (GL_APIENTRY* PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRY* PFNGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GL_APIENTRY* PFNGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +typedef void (GL_APIENTRY* PFNGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor); +typedef void (GL_APIENTRY* PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufsize, GLsizei *length, GLchar *source); +typedef void (GL_APIENTRY* PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GL_APIENTRY* PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); +typedef void (GL_APIENTRY* PFNGLVERTEXATTRIBDIVISOREXTPROC) (GLuint index, GLuint divisor); +typedef void (GL_APIENTRY* PFNGLCOPYTEXTURELEVELSAPPLEPROC) (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount); +typedef void (GL_APIENTRY* PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum, GLsizei, GLenum, GLsizei, GLsizei); +typedef void (GL_APIENTRY* PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void); +typedef GLsync (GL_APIENTRY* PFNGLFENCESYNCAPPLEPROC) (GLenum condition, GLbitfield flags); +typedef GLboolean (GL_APIENTRY* PFNGLISSYNCAPPLEPROC) (GLsync sync); +typedef void (GL_APIENTRY* PFNGLDELETESYNCAPPLEPROC) (GLsync sync); +typedef GLenum (GL_APIENTRY* PFNGLCLIENTWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); +typedef void (GL_APIENTRY* PFNGLWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); +typedef void (GL_APIENTRY* PFNGLGETINTEGER64VAPPLEPROC) (GLenum pname, GLint64 *params); +typedef void (GL_APIENTRY* PFNGLGETSYNCIVAPPLEPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +typedef void (GL_APIENTRY* PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label); +typedef void (GL_APIENTRY* PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); +typedef void (GL_APIENTRY* PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker); +typedef void (GL_APIENTRY* PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker); +typedef void (GL_APIENTRY* PFNGLPOPGROUPMARKEREXTPROC) (void); +typedef void (GL_APIENTRY* PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments); +typedef void (GL_APIENTRY* PFNGLGENQUERIESEXTPROC) (GLsizei n, GLuint *ids); +typedef void (GL_APIENTRY* PFNGLDELETEQUERIESEXTPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (GL_APIENTRY* PFNGLISQUERYEXTPROC) (GLuint id); +typedef void (GL_APIENTRY* PFNGLBEGINQUERYEXTPROC) (GLenum target, GLuint id); +typedef void (GL_APIENTRY* PFNGLENDQUERYEXTPROC) (GLenum target); +typedef void (GL_APIENTRY* PFNGLQUERYCOUNTEREXTPROC) (GLuint id, GLenum target); +typedef void (GL_APIENTRY* PFNGLGETQUERYIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GL_APIENTRY* PFNGLGETQUERYOBJECTIVEXTPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (GL_APIENTRY* PFNGLGETQUERYOBJECTUIVEXTPROC) (GLuint id, GLenum pname, GLuint *params); +typedef void (GL_APIENTRY* PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params); +typedef void (GL_APIENTRY* PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params); +typedef void* (GL_APIENTRY* PFNGLMAPBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (GL_APIENTRY* PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length); +typedef void (GL_APIENTRY* PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum, GLsizei, GLenum, GLsizei, GLsizei); +typedef void (GL_APIENTRY* PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei); +typedef void (GL_APIENTRY* PFNGLREADBUFFERINDEXEDEXTPROC) (GLenum src, GLint index); +typedef void (GL_APIENTRY* PFNGLDRAWBUFFERSINDEXEDEXTPROC) (GLint n, const GLenum *location, const GLint *indices); +typedef void (GL_APIENTRY* PFNGLGETINTEGERI_VEXTPROC) (GLenum target, GLuint index, GLint *data); +typedef void (GL_APIENTRY* PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum, const GLint *, const GLsizei *, GLsizei); +//typedef void (GL_APIENTRY* PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); +typedef GLenum (GL_APIENTRY* PFNGLGETGRAPHICSRESETSTATUSEXTPROC) (void); +typedef void (GL_APIENTRY* PFNGLREADNPIXELSEXTPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); +typedef void (GL_APIENTRY* PFNGLGETNUNIFORMFVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, float *params); +typedef void (GL_APIENTRY* PFNGLGETNUNIFORMIVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); +typedef void (GL_APIENTRY* PFNGLUSEPROGRAMSTAGESEXTPROC) (GLuint pipeline, GLbitfield stages, GLuint program); +typedef void (GL_APIENTRY* PFNGLACTIVESHADERPROGRAMEXTPROC) (GLuint pipeline, GLuint program); +typedef GLuint (GL_APIENTRY* PFNGLCREATESHADERPROGRAMVEXTPROC) (GLenum type, GLsizei count, const GLchar **strings); +typedef void (GL_APIENTRY* PFNGLBINDPROGRAMPIPELINEEXTPROC) (GLuint pipeline); +typedef void (GL_APIENTRY* PFNGLDELETEPROGRAMPIPELINESEXTPROC) (GLsizei n, const GLuint *pipelines); +typedef void (GL_APIENTRY* PFNGLGENPROGRAMPIPELINESEXTPROC) (GLsizei n, GLuint *pipelines); +typedef GLboolean (GL_APIENTRY* PFNGLISPROGRAMPIPELINEEXTPROC) (GLuint pipeline); +typedef void (GL_APIENTRY* PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); +typedef void (GL_APIENTRY* PFNGLGETPROGRAMPIPELINEIVEXTPROC) (GLuint pipeline, GLenum pname, GLint *params); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint x); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint x, GLint y); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat x); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRY* PFNGLVALIDATEPROGRAMPIPELINEEXTPROC) (GLuint pipeline); +typedef void (GL_APIENTRY* PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (GL_APIENTRY* PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GL_APIENTRY* PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRY* PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (GL_APIENTRY* PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); +typedef void (GL_APIENTRY* PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRY* PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (GL_APIENTRY* PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMGPROC) (GLenum, GLsizei, GLenum, GLsizei, GLsizei); +typedef void (GL_APIENTRY* PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC) (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei); +typedef void (GL_APIENTRY* PFNGLCOVERAGEMASKNVPROC) (GLboolean mask); +typedef void (GL_APIENTRY* PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation); +typedef void (GL_APIENTRY* PFNGLDRAWBUFFERSNVPROC) (GLsizei n, const GLenum *bufs); +typedef void (GL_APIENTRY* PFNGLDRAWARRAYSINSTANCEDNVPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GL_APIENTRY* PFNGLDRAWELEMENTSINSTANCEDNVPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +typedef void (GL_APIENTRY* PFNGLDELETEFENCESNVPROC) (GLsizei, const GLuint *); +typedef void (GL_APIENTRY* PFNGLGENFENCESNVPROC) (GLsizei, GLuint *); +typedef GLboolean (GL_APIENTRY* PFNGLISFENCENVPROC) (GLuint); +typedef GLboolean (GL_APIENTRY* PFNGLTESTFENCENVPROC) (GLuint); +typedef void (GL_APIENTRY* PFNGLGETFENCEIVNVPROC) (GLuint, GLenum, GLint *); +typedef void (GL_APIENTRY* PFNGLFINISHFENCENVPROC) (GLuint); +typedef void (GL_APIENTRY* PFNGLSETFENCENVPROC) (GLuint, GLenum); +typedef void (GL_APIENTRY* PFNGLBLITFRAMEBUFFERNVPROC) (int srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef void (GL_APIENTRY* PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC) ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRY* PFNGLVERTEXATTRIBDIVISORNVPROC) (GLuint index, GLuint divisor); +typedef void (GL_APIENTRY* PFNGLREADBUFFERNVPROC) (GLenum mode); +typedef void (GL_APIENTRY* PFNGLALPHAFUNCQCOMPROC) (GLenum func, GLclampf ref); +typedef void (GL_APIENTRY* PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls); +typedef void (GL_APIENTRY* PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); +typedef void (GL_APIENTRY* PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); +typedef void (GL_APIENTRY* PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); +typedef void (GL_APIENTRY* PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures); +typedef void (GL_APIENTRY* PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); +typedef void (GL_APIENTRY* PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); +typedef void (GL_APIENTRY* PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); +typedef void (GL_APIENTRY* PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); +typedef void (GL_APIENTRY* PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GL_APIENTRY* PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels); +typedef void (GL_APIENTRY* PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, GLvoid **params); +typedef void (GL_APIENTRY* PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders); +typedef void (GL_APIENTRY* PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms); +typedef GLboolean (GL_APIENTRY* PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program); +typedef void (GL_APIENTRY* PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length); +typedef void (GL_APIENTRY* PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); +typedef void (GL_APIENTRY* PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask); + +extern PFNGLACTIVETEXTUREPROC gles2wActiveTexture; +extern PFNGLATTACHSHADERPROC gles2wAttachShader; +extern PFNGLBINDATTRIBLOCATIONPROC gles2wBindAttribLocation; +extern PFNGLBINDBUFFERPROC gles2wBindBuffer; +extern PFNGLBINDFRAMEBUFFERPROC gles2wBindFramebuffer; +extern PFNGLBINDRENDERBUFFERPROC gles2wBindRenderbuffer; +extern PFNGLBINDTEXTUREPROC gles2wBindTexture; +extern PFNGLBLENDCOLORPROC gles2wBlendColor; +extern PFNGLBLENDEQUATIONPROC gles2wBlendEquation; +extern PFNGLBLENDEQUATIONSEPARATEPROC gles2wBlendEquationSeparate; +extern PFNGLBLENDFUNCPROC gles2wBlendFunc; +extern PFNGLBLENDFUNCSEPARATEPROC gles2wBlendFuncSeparate; +extern PFNGLBUFFERDATAPROC gles2wBufferData; +extern PFNGLBUFFERSUBDATAPROC gles2wBufferSubData; +extern PFNGLCHECKFRAMEBUFFERSTATUSPROC gles2wCheckFramebufferStatus; +extern PFNGLCLEARPROC gles2wClear; +extern PFNGLCLEARCOLORPROC gles2wClearColor; +extern PFNGLCLEARDEPTHFPROC gles2wClearDepthf; +extern PFNGLCLEARSTENCILPROC gles2wClearStencil; +extern PFNGLCOLORMASKPROC gles2wColorMask; +extern PFNGLCOMPILESHADERPROC gles2wCompileShader; +extern PFNGLCOMPRESSEDTEXIMAGE2DPROC gles2wCompressedTexImage2D; +extern PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC gles2wCompressedTexSubImage2D; +extern PFNGLCOPYTEXIMAGE2DPROC gles2wCopyTexImage2D; +extern PFNGLCOPYTEXSUBIMAGE2DPROC gles2wCopyTexSubImage2D; +extern PFNGLCREATEPROGRAMPROC gles2wCreateProgram; +extern PFNGLCREATESHADERPROC gles2wCreateShader; +extern PFNGLCULLFACEPROC gles2wCullFace; +extern PFNGLDELETEBUFFERSPROC gles2wDeleteBuffers; +extern PFNGLDELETEFRAMEBUFFERSPROC gles2wDeleteFramebuffers; +extern PFNGLDELETEPROGRAMPROC gles2wDeleteProgram; +extern PFNGLDELETERENDERBUFFERSPROC gles2wDeleteRenderbuffers; +extern PFNGLDELETESHADERPROC gles2wDeleteShader; +extern PFNGLDELETETEXTURESPROC gles2wDeleteTextures; +extern PFNGLDEPTHFUNCPROC gles2wDepthFunc; +extern PFNGLDEPTHMASKPROC gles2wDepthMask; +extern PFNGLDEPTHRANGEFPROC gles2wDepthRangef; +extern PFNGLDETACHSHADERPROC gles2wDetachShader; +extern PFNGLDISABLEPROC gles2wDisable; +extern PFNGLDISABLEVERTEXATTRIBARRAYPROC gles2wDisableVertexAttribArray; +extern PFNGLDRAWARRAYSPROC gles2wDrawArrays; +extern PFNGLDRAWELEMENTSPROC gles2wDrawElements; +extern PFNGLENABLEPROC gles2wEnable; +extern PFNGLENABLEVERTEXATTRIBARRAYPROC gles2wEnableVertexAttribArray; +extern PFNGLFINISHPROC gles2wFinish; +extern PFNGLFLUSHPROC gles2wFlush; +extern PFNGLFRAMEBUFFERRENDERBUFFERPROC gles2wFramebufferRenderbuffer; +extern PFNGLFRAMEBUFFERTEXTURE2DPROC gles2wFramebufferTexture2D; +extern PFNGLFRONTFACEPROC gles2wFrontFace; +extern PFNGLGENBUFFERSPROC gles2wGenBuffers; +extern PFNGLGENERATEMIPMAPPROC gles2wGenerateMipmap; +extern PFNGLGENFRAMEBUFFERSPROC gles2wGenFramebuffers; +extern PFNGLGENRENDERBUFFERSPROC gles2wGenRenderbuffers; +extern PFNGLGENTEXTURESPROC gles2wGenTextures; +extern PFNGLGETACTIVEATTRIBPROC gles2wGetActiveAttrib; +extern PFNGLGETACTIVEUNIFORMPROC gles2wGetActiveUniform; +extern PFNGLGETATTACHEDSHADERSPROC gles2wGetAttachedShaders; +extern PFNGLGETATTRIBLOCATIONPROC gles2wGetAttribLocation; +extern PFNGLGETBOOLEANVPROC gles2wGetBooleanv; +extern PFNGLGETBUFFERPARAMETERIVPROC gles2wGetBufferParameteriv; +extern PFNGLGETERRORPROC gles2wGetError; +extern PFNGLGETFLOATVPROC gles2wGetFloatv; +extern PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC gles2wGetFramebufferAttachmentParameteriv; +extern PFNGLGETINTEGERVPROC gles2wGetIntegerv; +extern PFNGLGETPROGRAMIVPROC gles2wGetProgramiv; +extern PFNGLGETPROGRAMINFOLOGPROC gles2wGetProgramInfoLog; +extern PFNGLGETRENDERBUFFERPARAMETERIVPROC gles2wGetRenderbufferParameteriv; +extern PFNGLGETSHADERIVPROC gles2wGetShaderiv; +extern PFNGLGETSHADERINFOLOGPROC gles2wGetShaderInfoLog; +extern PFNGLGETSHADERPRECISIONFORMATPROC gles2wGetShaderPrecisionFormat; +extern PFNGLGETSHADERSOURCEPROC gles2wGetShaderSource; +extern PFNGLGETSTRINGPROC gles2wGetString; +extern PFNGLGETTEXPARAMETERFVPROC gles2wGetTexParameterfv; +extern PFNGLGETTEXPARAMETERIVPROC gles2wGetTexParameteriv; +extern PFNGLGETUNIFORMFVPROC gles2wGetUniformfv; +extern PFNGLGETUNIFORMIVPROC gles2wGetUniformiv; +extern PFNGLGETUNIFORMLOCATIONPROC gles2wGetUniformLocation; +extern PFNGLGETVERTEXATTRIBFVPROC gles2wGetVertexAttribfv; +extern PFNGLGETVERTEXATTRIBIVPROC gles2wGetVertexAttribiv; +extern PFNGLGETVERTEXATTRIBPOINTERVPROC gles2wGetVertexAttribPointerv; +extern PFNGLHINTPROC gles2wHint; +extern PFNGLISBUFFERPROC gles2wIsBuffer; +extern PFNGLISENABLEDPROC gles2wIsEnabled; +extern PFNGLISFRAMEBUFFERPROC gles2wIsFramebuffer; +extern PFNGLISPROGRAMPROC gles2wIsProgram; +extern PFNGLISRENDERBUFFERPROC gles2wIsRenderbuffer; +extern PFNGLISSHADERPROC gles2wIsShader; +extern PFNGLISTEXTUREPROC gles2wIsTexture; +extern PFNGLLINEWIDTHPROC gles2wLineWidth; +extern PFNGLLINKPROGRAMPROC gles2wLinkProgram; +extern PFNGLPIXELSTOREIPROC gles2wPixelStorei; +extern PFNGLPOLYGONOFFSETPROC gles2wPolygonOffset; +extern PFNGLREADPIXELSPROC gles2wReadPixels; +extern PFNGLRELEASESHADERCOMPILERPROC gles2wReleaseShaderCompiler; +extern PFNGLRENDERBUFFERSTORAGEPROC gles2wRenderbufferStorage; +extern PFNGLSAMPLECOVERAGEPROC gles2wSampleCoverage; +extern PFNGLSCISSORPROC gles2wScissor; +extern PFNGLSHADERBINARYPROC gles2wShaderBinary; +extern PFNGLSHADERSOURCEPROC gles2wShaderSource; +extern PFNGLSTENCILFUNCPROC gles2wStencilFunc; +extern PFNGLSTENCILFUNCSEPARATEPROC gles2wStencilFuncSeparate; +extern PFNGLSTENCILMASKPROC gles2wStencilMask; +extern PFNGLSTENCILMASKSEPARATEPROC gles2wStencilMaskSeparate; +extern PFNGLSTENCILOPPROC gles2wStencilOp; +extern PFNGLSTENCILOPSEPARATEPROC gles2wStencilOpSeparate; +extern PFNGLTEXIMAGE2DPROC gles2wTexImage2D; +extern PFNGLTEXPARAMETERFPROC gles2wTexParameterf; +extern PFNGLTEXPARAMETERFVPROC gles2wTexParameterfv; +extern PFNGLTEXPARAMETERIPROC gles2wTexParameteri; +extern PFNGLTEXPARAMETERIVPROC gles2wTexParameteriv; +extern PFNGLTEXSUBIMAGE2DPROC gles2wTexSubImage2D; +extern PFNGLUNIFORM1FPROC gles2wUniform1f; +extern PFNGLUNIFORM1FVPROC gles2wUniform1fv; +extern PFNGLUNIFORM1IPROC gles2wUniform1i; +extern PFNGLUNIFORM1IVPROC gles2wUniform1iv; +extern PFNGLUNIFORM2FPROC gles2wUniform2f; +extern PFNGLUNIFORM2FVPROC gles2wUniform2fv; +extern PFNGLUNIFORM2IPROC gles2wUniform2i; +extern PFNGLUNIFORM2IVPROC gles2wUniform2iv; +extern PFNGLUNIFORM3FPROC gles2wUniform3f; +extern PFNGLUNIFORM3FVPROC gles2wUniform3fv; +extern PFNGLUNIFORM3IPROC gles2wUniform3i; +extern PFNGLUNIFORM3IVPROC gles2wUniform3iv; +extern PFNGLUNIFORM4FPROC gles2wUniform4f; +extern PFNGLUNIFORM4FVPROC gles2wUniform4fv; +extern PFNGLUNIFORM4IPROC gles2wUniform4i; +extern PFNGLUNIFORM4IVPROC gles2wUniform4iv; +extern PFNGLUNIFORMMATRIX2FVPROC gles2wUniformMatrix2fv; +extern PFNGLUNIFORMMATRIX3FVPROC gles2wUniformMatrix3fv; +extern PFNGLUNIFORMMATRIX4FVPROC gles2wUniformMatrix4fv; +extern PFNGLUSEPROGRAMPROC gles2wUseProgram; +extern PFNGLVALIDATEPROGRAMPROC gles2wValidateProgram; +extern PFNGLVERTEXATTRIB1FPROC gles2wVertexAttrib1f; +extern PFNGLVERTEXATTRIB1FVPROC gles2wVertexAttrib1fv; +extern PFNGLVERTEXATTRIB2FPROC gles2wVertexAttrib2f; +extern PFNGLVERTEXATTRIB2FVPROC gles2wVertexAttrib2fv; +extern PFNGLVERTEXATTRIB3FPROC gles2wVertexAttrib3f; +extern PFNGLVERTEXATTRIB3FVPROC gles2wVertexAttrib3fv; +extern PFNGLVERTEXATTRIB4FPROC gles2wVertexAttrib4f; +extern PFNGLVERTEXATTRIB4FVPROC gles2wVertexAttrib4fv; +extern PFNGLVERTEXATTRIBPOINTERPROC gles2wVertexAttribPointer; +extern PFNGLVIEWPORTPROC gles2wViewport; +extern PFNGLEGLIMAGETARGETTEXTURE2DOESPROC gles2wEGLImageTargetTexture2DOES; +extern PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC gles2wEGLImageTargetRenderbufferStorageOES; +extern PFNGLGETPROGRAMBINARYOESPROC gles2wGetProgramBinaryOES; +extern PFNGLPROGRAMBINARYOESPROC gles2wProgramBinaryOES; +extern PFNGLMAPBUFFEROESPROC gles2wMapBufferOES; +extern PFNGLUNMAPBUFFEROESPROC gles2wUnmapBufferOES; +extern PFNGLGETBUFFERPOINTERVOESPROC gles2wGetBufferPointervOES; +extern PFNGLTEXIMAGE3DOESPROC gles2wTexImage3DOES; +extern PFNGLTEXSUBIMAGE3DOESPROC gles2wTexSubImage3DOES; +extern PFNGLCOPYTEXSUBIMAGE3DOESPROC gles2wCopyTexSubImage3DOES; +extern PFNGLCOMPRESSEDTEXIMAGE3DOESPROC gles2wCompressedTexImage3DOES; +extern PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC gles2wCompressedTexSubImage3DOES; +extern PFNGLFRAMEBUFFERTEXTURE3DOESPROC gles2wFramebufferTexture3DOES; +extern PFNGLBINDVERTEXARRAYOESPROC gles2wBindVertexArrayOES; +extern PFNGLDELETEVERTEXARRAYSOESPROC gles2wDeleteVertexArraysOES; +extern PFNGLGENVERTEXARRAYSOESPROC gles2wGenVertexArraysOES; +extern PFNGLISVERTEXARRAYOESPROC gles2wIsVertexArrayOES; +extern PFNGLDEBUGMESSAGECONTROLKHRPROC gles2wDebugMessageControlKHR; +extern PFNGLDEBUGMESSAGEINSERTKHRPROC gles2wDebugMessageInsertKHR; +extern PFNGLDEBUGMESSAGECALLBACKKHRPROC gles2wDebugMessageCallbackKHR; +extern PFNGLGETDEBUGMESSAGELOGKHRPROC gles2wGetDebugMessageLogKHR; +extern PFNGLPUSHDEBUGGROUPKHRPROC gles2wPushDebugGroupKHR; +extern PFNGLPOPDEBUGGROUPKHRPROC gles2wPopDebugGroupKHR; +extern PFNGLOBJECTLABELKHRPROC gles2wObjectLabelKHR; +extern PFNGLGETOBJECTLABELKHRPROC gles2wGetObjectLabelKHR; +extern PFNGLOBJECTPTRLABELKHRPROC gles2wObjectPtrLabelKHR; +extern PFNGLGETOBJECTPTRLABELKHRPROC gles2wGetObjectPtrLabelKHR; +extern PFNGLGETPOINTERVKHRPROC gles2wGetPointervKHR; +extern PFNGLGETPERFMONITORGROUPSAMDPROC gles2wGetPerfMonitorGroupsAMD; +extern PFNGLGETPERFMONITORCOUNTERSAMDPROC gles2wGetPerfMonitorCountersAMD; +extern PFNGLGETPERFMONITORGROUPSTRINGAMDPROC gles2wGetPerfMonitorGroupStringAMD; +extern PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC gles2wGetPerfMonitorCounterStringAMD; +extern PFNGLGETPERFMONITORCOUNTERINFOAMDPROC gles2wGetPerfMonitorCounterInfoAMD; +extern PFNGLGENPERFMONITORSAMDPROC gles2wGenPerfMonitorsAMD; +extern PFNGLDELETEPERFMONITORSAMDPROC gles2wDeletePerfMonitorsAMD; +extern PFNGLSELECTPERFMONITORCOUNTERSAMDPROC gles2wSelectPerfMonitorCountersAMD; +extern PFNGLBEGINPERFMONITORAMDPROC gles2wBeginPerfMonitorAMD; +extern PFNGLENDPERFMONITORAMDPROC gles2wEndPerfMonitorAMD; +extern PFNGLGETPERFMONITORCOUNTERDATAAMDPROC gles2wGetPerfMonitorCounterDataAMD; +extern PFNGLBLITFRAMEBUFFERANGLEPROC gles2wBlitFramebufferANGLE; +extern PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC gles2wRenderbufferStorageMultisampleANGLE; +extern PFNGLDRAWARRAYSINSTANCEDANGLEPROC gles2wDrawArraysInstancedANGLE; +extern PFNGLDRAWELEMENTSINSTANCEDANGLEPROC gles2wDrawElementsInstancedANGLE; +extern PFNGLVERTEXATTRIBDIVISORANGLEPROC gles2wVertexAttribDivisorANGLE; +extern PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC gles2wGetTranslatedShaderSourceANGLE; +extern PFNGLDRAWARRAYSINSTANCEDEXTPROC gles2wDrawArraysInstancedEXT; +extern PFNGLDRAWELEMENTSINSTANCEDEXTPROC gles2wDrawElementsInstancedEXT; +extern PFNGLVERTEXATTRIBDIVISOREXTPROC gles2wVertexAttribDivisorEXT; +extern PFNGLCOPYTEXTURELEVELSAPPLEPROC gles2wCopyTextureLevelsAPPLE; +extern PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC gles2wRenderbufferStorageMultisampleAPPLE; +extern PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC gles2wResolveMultisampleFramebufferAPPLE; +extern PFNGLFENCESYNCAPPLEPROC gles2wFenceSyncAPPLE; +extern PFNGLISSYNCAPPLEPROC gles2wIsSyncAPPLE; +extern PFNGLDELETESYNCAPPLEPROC gles2wDeleteSyncAPPLE; +extern PFNGLCLIENTWAITSYNCAPPLEPROC gles2wClientWaitSyncAPPLE; +extern PFNGLWAITSYNCAPPLEPROC gles2wWaitSyncAPPLE; +extern PFNGLGETINTEGER64VAPPLEPROC gles2wGetInteger64vAPPLE; +extern PFNGLGETSYNCIVAPPLEPROC gles2wGetSyncivAPPLE; +extern PFNGLLABELOBJECTEXTPROC gles2wLabelObjectEXT; +extern PFNGLGETOBJECTLABELEXTPROC gles2wGetObjectLabelEXT; +extern PFNGLINSERTEVENTMARKEREXTPROC gles2wInsertEventMarkerEXT; +extern PFNGLPUSHGROUPMARKEREXTPROC gles2wPushGroupMarkerEXT; +extern PFNGLPOPGROUPMARKEREXTPROC gles2wPopGroupMarkerEXT; +extern PFNGLDISCARDFRAMEBUFFEREXTPROC gles2wDiscardFramebufferEXT; +extern PFNGLGENQUERIESEXTPROC gles2wGenQueriesEXT; +extern PFNGLDELETEQUERIESEXTPROC gles2wDeleteQueriesEXT; +extern PFNGLISQUERYEXTPROC gles2wIsQueryEXT; +extern PFNGLBEGINQUERYEXTPROC gles2wBeginQueryEXT; +extern PFNGLENDQUERYEXTPROC gles2wEndQueryEXT; +extern PFNGLQUERYCOUNTEREXTPROC gles2wQueryCounterEXT; +extern PFNGLGETQUERYIVEXTPROC gles2wGetQueryivEXT; +extern PFNGLGETQUERYOBJECTIVEXTPROC gles2wGetQueryObjectivEXT; +extern PFNGLGETQUERYOBJECTUIVEXTPROC gles2wGetQueryObjectuivEXT; +extern PFNGLGETQUERYOBJECTI64VEXTPROC gles2wGetQueryObjecti64vEXT; +extern PFNGLGETQUERYOBJECTUI64VEXTPROC gles2wGetQueryObjectui64vEXT; +extern PFNGLMAPBUFFERRANGEEXTPROC gles2wMapBufferRangeEXT; +extern PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC gles2wFlushMappedBufferRangeEXT; +extern PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC gles2wRenderbufferStorageMultisampleEXT; +extern PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC gles2wFramebufferTexture2DMultisampleEXT; +extern PFNGLREADBUFFERINDEXEDEXTPROC gles2wReadBufferIndexedEXT; +extern PFNGLDRAWBUFFERSINDEXEDEXTPROC gles2wDrawBuffersIndexedEXT; +extern PFNGLGETINTEGERI_VEXTPROC gles2wGetIntegeri_vEXT; +extern PFNGLMULTIDRAWARRAYSEXTPROC gles2wMultiDrawArraysEXT; +extern PFNGLMULTIDRAWELEMENTSEXTPROC gles2wMultiDrawElementsEXT; +extern PFNGLGETGRAPHICSRESETSTATUSEXTPROC gles2wGetGraphicsResetStatusEXT; +extern PFNGLREADNPIXELSEXTPROC gles2wReadnPixelsEXT; +extern PFNGLGETNUNIFORMFVEXTPROC gles2wGetnUniformfvEXT; +extern PFNGLGETNUNIFORMIVEXTPROC gles2wGetnUniformivEXT; +extern PFNGLUSEPROGRAMSTAGESEXTPROC gles2wUseProgramStagesEXT; +extern PFNGLACTIVESHADERPROGRAMEXTPROC gles2wActiveShaderProgramEXT; +extern PFNGLCREATESHADERPROGRAMVEXTPROC gles2wCreateShaderProgramvEXT; +extern PFNGLBINDPROGRAMPIPELINEEXTPROC gles2wBindProgramPipelineEXT; +extern PFNGLDELETEPROGRAMPIPELINESEXTPROC gles2wDeleteProgramPipelinesEXT; +extern PFNGLGENPROGRAMPIPELINESEXTPROC gles2wGenProgramPipelinesEXT; +extern PFNGLISPROGRAMPIPELINEEXTPROC gles2wIsProgramPipelineEXT; +extern PFNGLPROGRAMPARAMETERIEXTPROC gles2wProgramParameteriEXT; +extern PFNGLGETPROGRAMPIPELINEIVEXTPROC gles2wGetProgramPipelineivEXT; +extern PFNGLPROGRAMUNIFORM1IEXTPROC gles2wProgramUniform1iEXT; +extern PFNGLPROGRAMUNIFORM2IEXTPROC gles2wProgramUniform2iEXT; +extern PFNGLPROGRAMUNIFORM3IEXTPROC gles2wProgramUniform3iEXT; +extern PFNGLPROGRAMUNIFORM4IEXTPROC gles2wProgramUniform4iEXT; +extern PFNGLPROGRAMUNIFORM1FEXTPROC gles2wProgramUniform1fEXT; +extern PFNGLPROGRAMUNIFORM2FEXTPROC gles2wProgramUniform2fEXT; +extern PFNGLPROGRAMUNIFORM3FEXTPROC gles2wProgramUniform3fEXT; +extern PFNGLPROGRAMUNIFORM4FEXTPROC gles2wProgramUniform4fEXT; +extern PFNGLPROGRAMUNIFORM1IVEXTPROC gles2wProgramUniform1ivEXT; +extern PFNGLPROGRAMUNIFORM2IVEXTPROC gles2wProgramUniform2ivEXT; +extern PFNGLPROGRAMUNIFORM3IVEXTPROC gles2wProgramUniform3ivEXT; +extern PFNGLPROGRAMUNIFORM4IVEXTPROC gles2wProgramUniform4ivEXT; +extern PFNGLPROGRAMUNIFORM1FVEXTPROC gles2wProgramUniform1fvEXT; +extern PFNGLPROGRAMUNIFORM2FVEXTPROC gles2wProgramUniform2fvEXT; +extern PFNGLPROGRAMUNIFORM3FVEXTPROC gles2wProgramUniform3fvEXT; +extern PFNGLPROGRAMUNIFORM4FVEXTPROC gles2wProgramUniform4fvEXT; +extern PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC gles2wProgramUniformMatrix2fvEXT; +extern PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC gles2wProgramUniformMatrix3fvEXT; +extern PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC gles2wProgramUniformMatrix4fvEXT; +extern PFNGLVALIDATEPROGRAMPIPELINEEXTPROC gles2wValidateProgramPipelineEXT; +extern PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC gles2wGetProgramPipelineInfoLogEXT; +extern PFNGLTEXSTORAGE1DEXTPROC gles2wTexStorage1DEXT; +extern PFNGLTEXSTORAGE2DEXTPROC gles2wTexStorage2DEXT; +extern PFNGLTEXSTORAGE3DEXTPROC gles2wTexStorage3DEXT; +extern PFNGLTEXTURESTORAGE1DEXTPROC gles2wTextureStorage1DEXT; +extern PFNGLTEXTURESTORAGE2DEXTPROC gles2wTextureStorage2DEXT; +extern PFNGLTEXTURESTORAGE3DEXTPROC gles2wTextureStorage3DEXT; +extern PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMGPROC gles2wRenderbufferStorageMultisampleIMG; +extern PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC gles2wFramebufferTexture2DMultisampleIMG; +extern PFNGLCOVERAGEMASKNVPROC gles2wCoverageMaskNV; +extern PFNGLCOVERAGEOPERATIONNVPROC gles2wCoverageOperationNV; +extern PFNGLDRAWBUFFERSNVPROC gles2wDrawBuffersNV; +extern PFNGLDRAWARRAYSINSTANCEDNVPROC gles2wDrawArraysInstancedNV; +extern PFNGLDRAWELEMENTSINSTANCEDNVPROC gles2wDrawElementsInstancedNV; +extern PFNGLDELETEFENCESNVPROC gles2wDeleteFencesNV; +extern PFNGLGENFENCESNVPROC gles2wGenFencesNV; +extern PFNGLISFENCENVPROC gles2wIsFenceNV; +extern PFNGLTESTFENCENVPROC gles2wTestFenceNV; +extern PFNGLGETFENCEIVNVPROC gles2wGetFenceivNV; +extern PFNGLFINISHFENCENVPROC gles2wFinishFenceNV; +extern PFNGLSETFENCENVPROC gles2wSetFenceNV; +extern PFNGLBLITFRAMEBUFFERNVPROC gles2wBlitFramebufferNV; +extern PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC gles2wRenderbufferStorageMultisampleNV; +extern PFNGLVERTEXATTRIBDIVISORNVPROC gles2wVertexAttribDivisorNV; +extern PFNGLREADBUFFERNVPROC gles2wReadBufferNV; +extern PFNGLALPHAFUNCQCOMPROC gles2wAlphaFuncQCOM; +extern PFNGLGETDRIVERCONTROLSQCOMPROC gles2wGetDriverControlsQCOM; +extern PFNGLGETDRIVERCONTROLSTRINGQCOMPROC gles2wGetDriverControlStringQCOM; +extern PFNGLENABLEDRIVERCONTROLQCOMPROC gles2wEnableDriverControlQCOM; +extern PFNGLDISABLEDRIVERCONTROLQCOMPROC gles2wDisableDriverControlQCOM; +extern PFNGLEXTGETTEXTURESQCOMPROC gles2wExtGetTexturesQCOM; +extern PFNGLEXTGETBUFFERSQCOMPROC gles2wExtGetBuffersQCOM; +extern PFNGLEXTGETRENDERBUFFERSQCOMPROC gles2wExtGetRenderbuffersQCOM; +extern PFNGLEXTGETFRAMEBUFFERSQCOMPROC gles2wExtGetFramebuffersQCOM; +extern PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC gles2wExtGetTexLevelParameterivQCOM; +extern PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC gles2wExtTexObjectStateOverrideiQCOM; +extern PFNGLEXTGETTEXSUBIMAGEQCOMPROC gles2wExtGetTexSubImageQCOM; +extern PFNGLEXTGETBUFFERPOINTERVQCOMPROC gles2wExtGetBufferPointervQCOM; +extern PFNGLEXTGETSHADERSQCOMPROC gles2wExtGetShadersQCOM; +extern PFNGLEXTGETPROGRAMSQCOMPROC gles2wExtGetProgramsQCOM; +extern PFNGLEXTISPROGRAMBINARYQCOMPROC gles2wExtIsProgramBinaryQCOM; +extern PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC gles2wExtGetProgramBinarySourceQCOM; +extern PFNGLSTARTTILINGQCOMPROC gles2wStartTilingQCOM; +extern PFNGLENDTILINGQCOMPROC gles2wEndTilingQCOM; + +#define glActiveTexture gles2wActiveTexture +#define glAttachShader gles2wAttachShader +#define glBindAttribLocation gles2wBindAttribLocation +#define glBindBuffer gles2wBindBuffer +#define glBindFramebuffer gles2wBindFramebuffer +#define glBindRenderbuffer gles2wBindRenderbuffer +#define glBindTexture gles2wBindTexture +#define glBlendColor gles2wBlendColor +#define glBlendEquation gles2wBlendEquation +#define glBlendEquationSeparate gles2wBlendEquationSeparate +#define glBlendFunc gles2wBlendFunc +#define glBlendFuncSeparate gles2wBlendFuncSeparate +#define glBufferData gles2wBufferData +#define glBufferSubData gles2wBufferSubData +#define glCheckFramebufferStatus gles2wCheckFramebufferStatus +#define glClear gles2wClear +#define glClearColor gles2wClearColor +#define glClearDepthf gles2wClearDepthf +#define glClearStencil gles2wClearStencil +#define glColorMask gles2wColorMask +#define glCompileShader gles2wCompileShader +#define glCompressedTexImage2D gles2wCompressedTexImage2D +#define glCompressedTexSubImage2D gles2wCompressedTexSubImage2D +#define glCopyTexImage2D gles2wCopyTexImage2D +#define glCopyTexSubImage2D gles2wCopyTexSubImage2D +#define glCreateProgram gles2wCreateProgram +#define glCreateShader gles2wCreateShader +#define glCullFace gles2wCullFace +#define glDeleteBuffers gles2wDeleteBuffers +#define glDeleteFramebuffers gles2wDeleteFramebuffers +#define glDeleteProgram gles2wDeleteProgram +#define glDeleteRenderbuffers gles2wDeleteRenderbuffers +#define glDeleteShader gles2wDeleteShader +#define glDeleteTextures gles2wDeleteTextures +#define glDepthFunc gles2wDepthFunc +#define glDepthMask gles2wDepthMask +#define glDepthRangef gles2wDepthRangef +#define glDetachShader gles2wDetachShader +#define glDisable gles2wDisable +#define glDisableVertexAttribArray gles2wDisableVertexAttribArray +#define glDrawArrays gles2wDrawArrays +#define glDrawElements gles2wDrawElements +#define glEnable gles2wEnable +#define glEnableVertexAttribArray gles2wEnableVertexAttribArray +#define glFinish gles2wFinish +#define glFlush gles2wFlush +#define glFramebufferRenderbuffer gles2wFramebufferRenderbuffer +#define glFramebufferTexture2D gles2wFramebufferTexture2D +#define glFrontFace gles2wFrontFace +#define glGenBuffers gles2wGenBuffers +#define glGenerateMipmap gles2wGenerateMipmap +#define glGenFramebuffers gles2wGenFramebuffers +#define glGenRenderbuffers gles2wGenRenderbuffers +#define glGenTextures gles2wGenTextures +#define glGetActiveAttrib gles2wGetActiveAttrib +#define glGetActiveUniform gles2wGetActiveUniform +#define glGetAttachedShaders gles2wGetAttachedShaders +#define glGetAttribLocation gles2wGetAttribLocation +#define glGetBooleanv gles2wGetBooleanv +#define glGetBufferParameteriv gles2wGetBufferParameteriv +#define glGetError gles2wGetError +#define glGetFloatv gles2wGetFloatv +#define glGetFramebufferAttachmentParameteriv gles2wGetFramebufferAttachmentParameteriv +#define glGetIntegerv gles2wGetIntegerv +#define glGetProgramiv gles2wGetProgramiv +#define glGetProgramInfoLog gles2wGetProgramInfoLog +#define glGetRenderbufferParameteriv gles2wGetRenderbufferParameteriv +#define glGetShaderiv gles2wGetShaderiv +#define glGetShaderInfoLog gles2wGetShaderInfoLog +#define glGetShaderPrecisionFormat gles2wGetShaderPrecisionFormat +#define glGetShaderSource gles2wGetShaderSource +#define glGetString gles2wGetString +#define glGetTexParameterfv gles2wGetTexParameterfv +#define glGetTexParameteriv gles2wGetTexParameteriv +#define glGetUniformfv gles2wGetUniformfv +#define glGetUniformiv gles2wGetUniformiv +#define glGetUniformLocation gles2wGetUniformLocation +#define glGetVertexAttribfv gles2wGetVertexAttribfv +#define glGetVertexAttribiv gles2wGetVertexAttribiv +#define glGetVertexAttribPointerv gles2wGetVertexAttribPointerv +#define glHint gles2wHint +#define glIsBuffer gles2wIsBuffer +#define glIsEnabled gles2wIsEnabled +#define glIsFramebuffer gles2wIsFramebuffer +#define glIsProgram gles2wIsProgram +#define glIsRenderbuffer gles2wIsRenderbuffer +#define glIsShader gles2wIsShader +#define glIsTexture gles2wIsTexture +#define glLineWidth gles2wLineWidth +#define glLinkProgram gles2wLinkProgram +#define glPixelStorei gles2wPixelStorei +#define glPolygonOffset gles2wPolygonOffset +#define glReadPixels gles2wReadPixels +#define glReleaseShaderCompiler gles2wReleaseShaderCompiler +#define glRenderbufferStorage gles2wRenderbufferStorage +#define glSampleCoverage gles2wSampleCoverage +#define glScissor gles2wScissor +#define glShaderBinary gles2wShaderBinary +#define glShaderSource gles2wShaderSource +#define glStencilFunc gles2wStencilFunc +#define glStencilFuncSeparate gles2wStencilFuncSeparate +#define glStencilMask gles2wStencilMask +#define glStencilMaskSeparate gles2wStencilMaskSeparate +#define glStencilOp gles2wStencilOp +#define glStencilOpSeparate gles2wStencilOpSeparate +#define glTexImage2D gles2wTexImage2D +#define glTexParameterf gles2wTexParameterf +#define glTexParameterfv gles2wTexParameterfv +#define glTexParameteri gles2wTexParameteri +#define glTexParameteriv gles2wTexParameteriv +#define glTexSubImage2D gles2wTexSubImage2D +#define glUniform1f gles2wUniform1f +#define glUniform1fv gles2wUniform1fv +#define glUniform1i gles2wUniform1i +#define glUniform1iv gles2wUniform1iv +#define glUniform2f gles2wUniform2f +#define glUniform2fv gles2wUniform2fv +#define glUniform2i gles2wUniform2i +#define glUniform2iv gles2wUniform2iv +#define glUniform3f gles2wUniform3f +#define glUniform3fv gles2wUniform3fv +#define glUniform3i gles2wUniform3i +#define glUniform3iv gles2wUniform3iv +#define glUniform4f gles2wUniform4f +#define glUniform4fv gles2wUniform4fv +#define glUniform4i gles2wUniform4i +#define glUniform4iv gles2wUniform4iv +#define glUniformMatrix2fv gles2wUniformMatrix2fv +#define glUniformMatrix3fv gles2wUniformMatrix3fv +#define glUniformMatrix4fv gles2wUniformMatrix4fv +#define glUseProgram gles2wUseProgram +#define glValidateProgram gles2wValidateProgram +#define glVertexAttrib1f gles2wVertexAttrib1f +#define glVertexAttrib1fv gles2wVertexAttrib1fv +#define glVertexAttrib2f gles2wVertexAttrib2f +#define glVertexAttrib2fv gles2wVertexAttrib2fv +#define glVertexAttrib3f gles2wVertexAttrib3f +#define glVertexAttrib3fv gles2wVertexAttrib3fv +#define glVertexAttrib4f gles2wVertexAttrib4f +#define glVertexAttrib4fv gles2wVertexAttrib4fv +#define glVertexAttribPointer gles2wVertexAttribPointer +#define glViewport gles2wViewport +#define glEGLImageTargetTexture2DOES gles2wEGLImageTargetTexture2DOES +#define glEGLImageTargetRenderbufferStorageOES gles2wEGLImageTargetRenderbufferStorageOES +#define glGetProgramBinaryOES gles2wGetProgramBinaryOES +#define glProgramBinaryOES gles2wProgramBinaryOES +#define glMapBufferOES gles2wMapBufferOES +#define glUnmapBufferOES gles2wUnmapBufferOES +#define glGetBufferPointervOES gles2wGetBufferPointervOES +#define glTexImage3DOES gles2wTexImage3DOES +#define glTexSubImage3DOES gles2wTexSubImage3DOES +#define glCopyTexSubImage3DOES gles2wCopyTexSubImage3DOES +#define glCompressedTexImage3DOES gles2wCompressedTexImage3DOES +#define glCompressedTexSubImage3DOES gles2wCompressedTexSubImage3DOES +#define glFramebufferTexture3DOES gles2wFramebufferTexture3DOES +#define glBindVertexArrayOES gles2wBindVertexArrayOES +#define glDeleteVertexArraysOES gles2wDeleteVertexArraysOES +#define glGenVertexArraysOES gles2wGenVertexArraysOES +#define glIsVertexArrayOES gles2wIsVertexArrayOES +#define glDebugMessageControlKHR gles2wDebugMessageControlKHR +#define glDebugMessageInsertKHR gles2wDebugMessageInsertKHR +#define glDebugMessageCallbackKHR gles2wDebugMessageCallbackKHR +#define glGetDebugMessageLogKHR gles2wGetDebugMessageLogKHR +#define glPushDebugGroupKHR gles2wPushDebugGroupKHR +#define glPopDebugGroupKHR gles2wPopDebugGroupKHR +#define glObjectLabelKHR gles2wObjectLabelKHR +#define glGetObjectLabelKHR gles2wGetObjectLabelKHR +#define glObjectPtrLabelKHR gles2wObjectPtrLabelKHR +#define glGetObjectPtrLabelKHR gles2wGetObjectPtrLabelKHR +#define glGetPointervKHR gles2wGetPointervKHR +#define glGetPerfMonitorGroupsAMD gles2wGetPerfMonitorGroupsAMD +#define glGetPerfMonitorCountersAMD gles2wGetPerfMonitorCountersAMD +#define glGetPerfMonitorGroupStringAMD gles2wGetPerfMonitorGroupStringAMD +#define glGetPerfMonitorCounterStringAMD gles2wGetPerfMonitorCounterStringAMD +#define glGetPerfMonitorCounterInfoAMD gles2wGetPerfMonitorCounterInfoAMD +#define glGenPerfMonitorsAMD gles2wGenPerfMonitorsAMD +#define glDeletePerfMonitorsAMD gles2wDeletePerfMonitorsAMD +#define glSelectPerfMonitorCountersAMD gles2wSelectPerfMonitorCountersAMD +#define glBeginPerfMonitorAMD gles2wBeginPerfMonitorAMD +#define glEndPerfMonitorAMD gles2wEndPerfMonitorAMD +#define glGetPerfMonitorCounterDataAMD gles2wGetPerfMonitorCounterDataAMD +#define glBlitFramebufferANGLE gles2wBlitFramebufferANGLE +#define glRenderbufferStorageMultisampleANGLE gles2wRenderbufferStorageMultisampleANGLE +#define glDrawArraysInstancedANGLE gles2wDrawArraysInstancedANGLE +#define glDrawElementsInstancedANGLE gles2wDrawElementsInstancedANGLE +#define glVertexAttribDivisorANGLE gles2wVertexAttribDivisorANGLE +#define glGetTranslatedShaderSourceANGLE gles2wGetTranslatedShaderSourceANGLE +#define glDrawArraysInstancedEXT gles2wDrawArraysInstancedEXT +#define glDrawElementsInstancedEXT gles2wDrawElementsInstancedEXT +#define glVertexAttribDivisorEXT gles2wVertexAttribDivisorEXT +#define glCopyTextureLevelsAPPLE gles2wCopyTextureLevelsAPPLE +#define glRenderbufferStorageMultisampleAPPLE gles2wRenderbufferStorageMultisampleAPPLE +#define glResolveMultisampleFramebufferAPPLE gles2wResolveMultisampleFramebufferAPPLE +#define glFenceSyncAPPLE gles2wFenceSyncAPPLE +#define glIsSyncAPPLE gles2wIsSyncAPPLE +#define glDeleteSyncAPPLE gles2wDeleteSyncAPPLE +#define glClientWaitSyncAPPLE gles2wClientWaitSyncAPPLE +#define glWaitSyncAPPLE gles2wWaitSyncAPPLE +#define glGetInteger64vAPPLE gles2wGetInteger64vAPPLE +#define glGetSyncivAPPLE gles2wGetSyncivAPPLE +#define glLabelObjectEXT gles2wLabelObjectEXT +#define glGetObjectLabelEXT gles2wGetObjectLabelEXT +#define glInsertEventMarkerEXT gles2wInsertEventMarkerEXT +#define glPushGroupMarkerEXT gles2wPushGroupMarkerEXT +#define glPopGroupMarkerEXT gles2wPopGroupMarkerEXT +#define glDiscardFramebufferEXT gles2wDiscardFramebufferEXT +#define glGenQueriesEXT gles2wGenQueriesEXT +#define glDeleteQueriesEXT gles2wDeleteQueriesEXT +#define glIsQueryEXT gles2wIsQueryEXT +#define glBeginQueryEXT gles2wBeginQueryEXT +#define glEndQueryEXT gles2wEndQueryEXT +#define glQueryCounterEXT gles2wQueryCounterEXT +#define glGetQueryivEXT gles2wGetQueryivEXT +#define glGetQueryObjectivEXT gles2wGetQueryObjectivEXT +#define glGetQueryObjectuivEXT gles2wGetQueryObjectuivEXT +#define glGetQueryObjecti64vEXT gles2wGetQueryObjecti64vEXT +#define glGetQueryObjectui64vEXT gles2wGetQueryObjectui64vEXT +#define glMapBufferRangeEXT gles2wMapBufferRangeEXT +#define glFlushMappedBufferRangeEXT gles2wFlushMappedBufferRangeEXT +#define glRenderbufferStorageMultisampleEXT gles2wRenderbufferStorageMultisampleEXT +#define glFramebufferTexture2DMultisampleEXT gles2wFramebufferTexture2DMultisampleEXT +#define glReadBufferIndexedEXT gles2wReadBufferIndexedEXT +#define glDrawBuffersIndexedEXT gles2wDrawBuffersIndexedEXT +#define glGetIntegeri_vEXT gles2wGetIntegeri_vEXT +#define glMultiDrawArraysEXT gles2wMultiDrawArraysEXT +#define glMultiDrawElementsEXT gles2wMultiDrawElementsEXT +#define glGetGraphicsResetStatusEXT gles2wGetGraphicsResetStatusEXT +#define glReadnPixelsEXT gles2wReadnPixelsEXT +#define glGetnUniformfvEXT gles2wGetnUniformfvEXT +#define glGetnUniformivEXT gles2wGetnUniformivEXT +#define glUseProgramStagesEXT gles2wUseProgramStagesEXT +#define glActiveShaderProgramEXT gles2wActiveShaderProgramEXT +#define glCreateShaderProgramvEXT gles2wCreateShaderProgramvEXT +#define glBindProgramPipelineEXT gles2wBindProgramPipelineEXT +#define glDeleteProgramPipelinesEXT gles2wDeleteProgramPipelinesEXT +#define glGenProgramPipelinesEXT gles2wGenProgramPipelinesEXT +#define glIsProgramPipelineEXT gles2wIsProgramPipelineEXT +#define glProgramParameteriEXT gles2wProgramParameteriEXT +#define glGetProgramPipelineivEXT gles2wGetProgramPipelineivEXT +#define glProgramUniform1iEXT gles2wProgramUniform1iEXT +#define glProgramUniform2iEXT gles2wProgramUniform2iEXT +#define glProgramUniform3iEXT gles2wProgramUniform3iEXT +#define glProgramUniform4iEXT gles2wProgramUniform4iEXT +#define glProgramUniform1fEXT gles2wProgramUniform1fEXT +#define glProgramUniform2fEXT gles2wProgramUniform2fEXT +#define glProgramUniform3fEXT gles2wProgramUniform3fEXT +#define glProgramUniform4fEXT gles2wProgramUniform4fEXT +#define glProgramUniform1ivEXT gles2wProgramUniform1ivEXT +#define glProgramUniform2ivEXT gles2wProgramUniform2ivEXT +#define glProgramUniform3ivEXT gles2wProgramUniform3ivEXT +#define glProgramUniform4ivEXT gles2wProgramUniform4ivEXT +#define glProgramUniform1fvEXT gles2wProgramUniform1fvEXT +#define glProgramUniform2fvEXT gles2wProgramUniform2fvEXT +#define glProgramUniform3fvEXT gles2wProgramUniform3fvEXT +#define glProgramUniform4fvEXT gles2wProgramUniform4fvEXT +#define glProgramUniformMatrix2fvEXT gles2wProgramUniformMatrix2fvEXT +#define glProgramUniformMatrix3fvEXT gles2wProgramUniformMatrix3fvEXT +#define glProgramUniformMatrix4fvEXT gles2wProgramUniformMatrix4fvEXT +#define glValidateProgramPipelineEXT gles2wValidateProgramPipelineEXT +#define glGetProgramPipelineInfoLogEXT gles2wGetProgramPipelineInfoLogEXT +#define glTexStorage1DEXT gles2wTexStorage1DEXT +#define glTexStorage2DEXT gles2wTexStorage2DEXT +#define glTexStorage3DEXT gles2wTexStorage3DEXT +#define glTextureStorage1DEXT gles2wTextureStorage1DEXT +#define glTextureStorage2DEXT gles2wTextureStorage2DEXT +#define glTextureStorage3DEXT gles2wTextureStorage3DEXT +#define glRenderbufferStorageMultisampleIMG gles2wRenderbufferStorageMultisampleIMG +#define glFramebufferTexture2DMultisampleIMG gles2wFramebufferTexture2DMultisampleIMG +#define glCoverageMaskNV gles2wCoverageMaskNV +#define glCoverageOperationNV gles2wCoverageOperationNV +#define glDrawBuffersNV gles2wDrawBuffersNV +#define glDrawArraysInstancedNV gles2wDrawArraysInstancedNV +#define glDrawElementsInstancedNV gles2wDrawElementsInstancedNV +#define glDeleteFencesNV gles2wDeleteFencesNV +#define glGenFencesNV gles2wGenFencesNV +#define glIsFenceNV gles2wIsFenceNV +#define glTestFenceNV gles2wTestFenceNV +#define glGetFenceivNV gles2wGetFenceivNV +#define glFinishFenceNV gles2wFinishFenceNV +#define glSetFenceNV gles2wSetFenceNV +#define glBlitFramebufferNV gles2wBlitFramebufferNV +#define glRenderbufferStorageMultisampleNV gles2wRenderbufferStorageMultisampleNV +#define glVertexAttribDivisorNV gles2wVertexAttribDivisorNV +#define glReadBufferNV gles2wReadBufferNV +#define glAlphaFuncQCOM gles2wAlphaFuncQCOM +#define glGetDriverControlsQCOM gles2wGetDriverControlsQCOM +#define glGetDriverControlStringQCOM gles2wGetDriverControlStringQCOM +#define glEnableDriverControlQCOM gles2wEnableDriverControlQCOM +#define glDisableDriverControlQCOM gles2wDisableDriverControlQCOM +#define glExtGetTexturesQCOM gles2wExtGetTexturesQCOM +#define glExtGetBuffersQCOM gles2wExtGetBuffersQCOM +#define glExtGetRenderbuffersQCOM gles2wExtGetRenderbuffersQCOM +#define glExtGetFramebuffersQCOM gles2wExtGetFramebuffersQCOM +#define glExtGetTexLevelParameterivQCOM gles2wExtGetTexLevelParameterivQCOM +#define glExtTexObjectStateOverrideiQCOM gles2wExtTexObjectStateOverrideiQCOM +#define glExtGetTexSubImageQCOM gles2wExtGetTexSubImageQCOM +#define glExtGetBufferPointervQCOM gles2wExtGetBufferPointervQCOM +#define glExtGetShadersQCOM gles2wExtGetShadersQCOM +#define glExtGetProgramsQCOM gles2wExtGetProgramsQCOM +#define glExtIsProgramBinaryQCOM gles2wExtIsProgramBinaryQCOM +#define glExtGetProgramBinarySourceQCOM gles2wExtGetProgramBinarySourceQCOM +#define glStartTilingQCOM gles2wStartTilingQCOM +#define glEndTilingQCOM gles2wEndTilingQCOM + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/native/cocos/renderer/gfx-gles2/gles2w.mm b/native/cocos/renderer/gfx-gles2/gles2w.mm new file mode 100755 index 0000000000..4f9d051f5f --- /dev/null +++ b/native/cocos/renderer/gfx-gles2/gles2w.mm @@ -0,0 +1,796 @@ +#include "gles2w.h" + +#if defined(_WIN32) && !defined(ANDROID) +#define WIN32_LEAN_AND_MEAN 1 +#include +#include + +static HMODULE libgl; + +static int open_libgl(void) +{ + libgl = LoadLibraryA("libGLESv2.dll"); + return (libgl != NULL); +} + +static void close_libgl(void) +{ + FreeLibrary(libgl); +} + +static void *get_proc(const char *proc) +{ + void *res; + + res = (void*)eglGetProcAddress(proc); + if (!res) + res = (void*)GetProcAddress(libgl, proc); + return res; +} +#elif defined(__APPLE__) || defined(__APPLE_CC__) +#import +#import +#import +#import +#import + +// Routine to run a system command and retrieve the output. +// From http://stackoverflow.com/questions/478898/how-to-execute-a-command-and-get-output-of-command-within-c +std::string ES2_EXEC(const char* cmd) { + FILE* pipe = popen(cmd, "r"); + if (!pipe) return "ERROR"; + char buffer[128]; + std::string result = ""; + while(!feof(pipe)) { + if(fgets(buffer, 128, pipe) != NULL) + result += buffer; + } + pclose(pipe); + return result; +} + +static CFBundleRef g_es2Bundle; +static CFURLRef g_es2BundleURL; + +static int open_libgl(void) +{ + CFStringRef frameworkPath = CFSTR("/System/Library/Frameworks/OpenGLES.framework"); + NSString *sysVersion = [UIDevice currentDevice].systemVersion; + NSArray *sysVersionComponents = [sysVersion componentsSeparatedByString:@"."]; + //BOOL isSimulator = ([[UIDevice currentDevice].model rangeOfString:@"Simulator"].location != NSNotFound); + +#if TARGET_IPHONE_SIMULATOR + bool isSimulator = true; +#else + bool isSimulator = false; +#endif + if(isSimulator) + { + // Ask where Xcode is installed + std::string xcodePath = "/Applications/Xcode.app/Contents/Developer\n"; + + // The result contains an end line character. Remove it. + size_t pos = xcodePath.find("\n"); + xcodePath.erase(pos); + + char tempPath[PATH_MAX]; + sprintf(tempPath, + "%s/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator%s.%s.sdk/System/Library/Frameworks/OpenGLES.framework", + xcodePath.c_str(), + [[sysVersionComponents objectAtIndex:0] cStringUsingEncoding:NSUTF8StringEncoding], + [[sysVersionComponents objectAtIndex:1] cStringUsingEncoding:NSUTF8StringEncoding]); + frameworkPath = CFStringCreateWithCString(kCFAllocatorDefault, tempPath, kCFStringEncodingUTF8); + } + + g_es2BundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, + frameworkPath, + kCFURLPOSIXPathStyle, true); + + CFRelease(frameworkPath); + + g_es2Bundle = CFBundleCreate(kCFAllocatorDefault, g_es2BundleURL); + + return (g_es2Bundle != NULL); +} + +static void close_libgl(void) +{ + CFRelease(g_es2Bundle); + CFRelease(g_es2BundleURL); +} + +static void *get_proc(const char *proc) +{ + void *res; + + CFStringRef procname = CFStringCreateWithCString(kCFAllocatorDefault, proc, + kCFStringEncodingASCII); + res = CFBundleGetFunctionPointerForName(g_es2Bundle, procname); + CFRelease(procname); + return res; +} +#elif defined(__EMSCRIPTEN__) +#include +static void open_libgl() {} +static void close_libgl() {} +static void *get_proc(const char *proc) +{ + return (void*)eglGetProcAddress(proc); +} +#else +#include +#include + +static void *libgl; + +static int open_libgl(void) +{ + libgl = dlopen("libGLESv2.so", RTLD_LAZY | RTLD_GLOBAL); + return libgl != NULL; +} + +static void close_libgl(void) +{ + dlclose(libgl); +} + +static void *get_proc(const char *proc) +{ + void *res; + res = dlsym(libgl, proc); + return res; +} +#endif + +static struct { + int major, minor; +} version; + +static int parse_version(void) +{ + version.major = 2; + version.minor = 0; + + return 0; +} + +static void load_procs(void); + +int gles2wInit(void) +{ + if (!open_libgl()) + { + return 0; + } + + load_procs(); + close_libgl(); + parse_version(); + + return 1; +} + +int gles2wIsSupported(int major, int minor) +{ + if (major < 2) + return 0; + if (version.major == major) + return version.minor >= minor; + return version.major >= major; +} + +void *gles2wGetProcAddress(const char *proc) +{ + return get_proc(proc); +} + +PFNGLACTIVETEXTUREPROC gles2wActiveTexture; +PFNGLATTACHSHADERPROC gles2wAttachShader; +PFNGLBINDATTRIBLOCATIONPROC gles2wBindAttribLocation; +PFNGLBINDBUFFERPROC gles2wBindBuffer; +PFNGLBINDFRAMEBUFFERPROC gles2wBindFramebuffer; +PFNGLBINDRENDERBUFFERPROC gles2wBindRenderbuffer; +PFNGLBINDTEXTUREPROC gles2wBindTexture; +PFNGLBLENDCOLORPROC gles2wBlendColor; +PFNGLBLENDEQUATIONPROC gles2wBlendEquation; +PFNGLBLENDEQUATIONSEPARATEPROC gles2wBlendEquationSeparate; +PFNGLBLENDFUNCPROC gles2wBlendFunc; +PFNGLBLENDFUNCSEPARATEPROC gles2wBlendFuncSeparate; +PFNGLBUFFERDATAPROC gles2wBufferData; +PFNGLBUFFERSUBDATAPROC gles2wBufferSubData; +PFNGLCHECKFRAMEBUFFERSTATUSPROC gles2wCheckFramebufferStatus; +PFNGLCLEARPROC gles2wClear; +PFNGLCLEARCOLORPROC gles2wClearColor; +PFNGLCLEARDEPTHFPROC gles2wClearDepthf; +PFNGLCLEARSTENCILPROC gles2wClearStencil; +PFNGLCOLORMASKPROC gles2wColorMask; +PFNGLCOMPILESHADERPROC gles2wCompileShader; +PFNGLCOMPRESSEDTEXIMAGE2DPROC gles2wCompressedTexImage2D; +PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC gles2wCompressedTexSubImage2D; +PFNGLCOPYTEXIMAGE2DPROC gles2wCopyTexImage2D; +PFNGLCOPYTEXSUBIMAGE2DPROC gles2wCopyTexSubImage2D; +PFNGLCREATEPROGRAMPROC gles2wCreateProgram; +PFNGLCREATESHADERPROC gles2wCreateShader; +PFNGLCULLFACEPROC gles2wCullFace; +PFNGLDELETEBUFFERSPROC gles2wDeleteBuffers; +PFNGLDELETEFRAMEBUFFERSPROC gles2wDeleteFramebuffers; +PFNGLDELETEPROGRAMPROC gles2wDeleteProgram; +PFNGLDELETERENDERBUFFERSPROC gles2wDeleteRenderbuffers; +PFNGLDELETESHADERPROC gles2wDeleteShader; +PFNGLDELETETEXTURESPROC gles2wDeleteTextures; +PFNGLDEPTHFUNCPROC gles2wDepthFunc; +PFNGLDEPTHMASKPROC gles2wDepthMask; +PFNGLDEPTHRANGEFPROC gles2wDepthRangef; +PFNGLDETACHSHADERPROC gles2wDetachShader; +PFNGLDISABLEPROC gles2wDisable; +PFNGLDISABLEVERTEXATTRIBARRAYPROC gles2wDisableVertexAttribArray; +PFNGLDRAWARRAYSPROC gles2wDrawArrays; +PFNGLDRAWELEMENTSPROC gles2wDrawElements; +PFNGLENABLEPROC gles2wEnable; +PFNGLENABLEVERTEXATTRIBARRAYPROC gles2wEnableVertexAttribArray; +PFNGLFINISHPROC gles2wFinish; +PFNGLFLUSHPROC gles2wFlush; +PFNGLFRAMEBUFFERRENDERBUFFERPROC gles2wFramebufferRenderbuffer; +PFNGLFRAMEBUFFERTEXTURE2DPROC gles2wFramebufferTexture2D; +PFNGLFRONTFACEPROC gles2wFrontFace; +PFNGLGENBUFFERSPROC gles2wGenBuffers; +PFNGLGENERATEMIPMAPPROC gles2wGenerateMipmap; +PFNGLGENFRAMEBUFFERSPROC gles2wGenFramebuffers; +PFNGLGENRENDERBUFFERSPROC gles2wGenRenderbuffers; +PFNGLGENTEXTURESPROC gles2wGenTextures; +PFNGLGETACTIVEATTRIBPROC gles2wGetActiveAttrib; +PFNGLGETACTIVEUNIFORMPROC gles2wGetActiveUniform; +PFNGLGETATTACHEDSHADERSPROC gles2wGetAttachedShaders; +PFNGLGETATTRIBLOCATIONPROC gles2wGetAttribLocation; +PFNGLGETBOOLEANVPROC gles2wGetBooleanv; +PFNGLGETBUFFERPARAMETERIVPROC gles2wGetBufferParameteriv; +PFNGLGETERRORPROC gles2wGetError; +PFNGLGETFLOATVPROC gles2wGetFloatv; +PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC gles2wGetFramebufferAttachmentParameteriv; +PFNGLGETINTEGERVPROC gles2wGetIntegerv; +PFNGLGETPROGRAMIVPROC gles2wGetProgramiv; +PFNGLGETPROGRAMINFOLOGPROC gles2wGetProgramInfoLog; +PFNGLGETRENDERBUFFERPARAMETERIVPROC gles2wGetRenderbufferParameteriv; +PFNGLGETSHADERIVPROC gles2wGetShaderiv; +PFNGLGETSHADERINFOLOGPROC gles2wGetShaderInfoLog; +PFNGLGETSHADERPRECISIONFORMATPROC gles2wGetShaderPrecisionFormat; +PFNGLGETSHADERSOURCEPROC gles2wGetShaderSource; +PFNGLGETSTRINGPROC gles2wGetString; +PFNGLGETTEXPARAMETERFVPROC gles2wGetTexParameterfv; +PFNGLGETTEXPARAMETERIVPROC gles2wGetTexParameteriv; +PFNGLGETUNIFORMFVPROC gles2wGetUniformfv; +PFNGLGETUNIFORMIVPROC gles2wGetUniformiv; +PFNGLGETUNIFORMLOCATIONPROC gles2wGetUniformLocation; +PFNGLGETVERTEXATTRIBFVPROC gles2wGetVertexAttribfv; +PFNGLGETVERTEXATTRIBIVPROC gles2wGetVertexAttribiv; +PFNGLGETVERTEXATTRIBPOINTERVPROC gles2wGetVertexAttribPointerv; +PFNGLHINTPROC gles2wHint; +PFNGLISBUFFERPROC gles2wIsBuffer; +PFNGLISENABLEDPROC gles2wIsEnabled; +PFNGLISFRAMEBUFFERPROC gles2wIsFramebuffer; +PFNGLISPROGRAMPROC gles2wIsProgram; +PFNGLISRENDERBUFFERPROC gles2wIsRenderbuffer; +PFNGLISSHADERPROC gles2wIsShader; +PFNGLISTEXTUREPROC gles2wIsTexture; +PFNGLLINEWIDTHPROC gles2wLineWidth; +PFNGLLINKPROGRAMPROC gles2wLinkProgram; +PFNGLPIXELSTOREIPROC gles2wPixelStorei; +PFNGLPOLYGONOFFSETPROC gles2wPolygonOffset; +PFNGLREADPIXELSPROC gles2wReadPixels; +PFNGLRELEASESHADERCOMPILERPROC gles2wReleaseShaderCompiler; +PFNGLRENDERBUFFERSTORAGEPROC gles2wRenderbufferStorage; +PFNGLSAMPLECOVERAGEPROC gles2wSampleCoverage; +PFNGLSCISSORPROC gles2wScissor; +PFNGLSHADERBINARYPROC gles2wShaderBinary; +PFNGLSHADERSOURCEPROC gles2wShaderSource; +PFNGLSTENCILFUNCPROC gles2wStencilFunc; +PFNGLSTENCILFUNCSEPARATEPROC gles2wStencilFuncSeparate; +PFNGLSTENCILMASKPROC gles2wStencilMask; +PFNGLSTENCILMASKSEPARATEPROC gles2wStencilMaskSeparate; +PFNGLSTENCILOPPROC gles2wStencilOp; +PFNGLSTENCILOPSEPARATEPROC gles2wStencilOpSeparate; +PFNGLTEXIMAGE2DPROC gles2wTexImage2D; +PFNGLTEXPARAMETERFPROC gles2wTexParameterf; +PFNGLTEXPARAMETERFVPROC gles2wTexParameterfv; +PFNGLTEXPARAMETERIPROC gles2wTexParameteri; +PFNGLTEXPARAMETERIVPROC gles2wTexParameteriv; +PFNGLTEXSUBIMAGE2DPROC gles2wTexSubImage2D; +PFNGLUNIFORM1FPROC gles2wUniform1f; +PFNGLUNIFORM1FVPROC gles2wUniform1fv; +PFNGLUNIFORM1IPROC gles2wUniform1i; +PFNGLUNIFORM1IVPROC gles2wUniform1iv; +PFNGLUNIFORM2FPROC gles2wUniform2f; +PFNGLUNIFORM2FVPROC gles2wUniform2fv; +PFNGLUNIFORM2IPROC gles2wUniform2i; +PFNGLUNIFORM2IVPROC gles2wUniform2iv; +PFNGLUNIFORM3FPROC gles2wUniform3f; +PFNGLUNIFORM3FVPROC gles2wUniform3fv; +PFNGLUNIFORM3IPROC gles2wUniform3i; +PFNGLUNIFORM3IVPROC gles2wUniform3iv; +PFNGLUNIFORM4FPROC gles2wUniform4f; +PFNGLUNIFORM4FVPROC gles2wUniform4fv; +PFNGLUNIFORM4IPROC gles2wUniform4i; +PFNGLUNIFORM4IVPROC gles2wUniform4iv; +PFNGLUNIFORMMATRIX2FVPROC gles2wUniformMatrix2fv; +PFNGLUNIFORMMATRIX3FVPROC gles2wUniformMatrix3fv; +PFNGLUNIFORMMATRIX4FVPROC gles2wUniformMatrix4fv; +PFNGLUSEPROGRAMPROC gles2wUseProgram; +PFNGLVALIDATEPROGRAMPROC gles2wValidateProgram; +PFNGLVERTEXATTRIB1FPROC gles2wVertexAttrib1f; +PFNGLVERTEXATTRIB1FVPROC gles2wVertexAttrib1fv; +PFNGLVERTEXATTRIB2FPROC gles2wVertexAttrib2f; +PFNGLVERTEXATTRIB2FVPROC gles2wVertexAttrib2fv; +PFNGLVERTEXATTRIB3FPROC gles2wVertexAttrib3f; +PFNGLVERTEXATTRIB3FVPROC gles2wVertexAttrib3fv; +PFNGLVERTEXATTRIB4FPROC gles2wVertexAttrib4f; +PFNGLVERTEXATTRIB4FVPROC gles2wVertexAttrib4fv; +PFNGLVERTEXATTRIBPOINTERPROC gles2wVertexAttribPointer; +PFNGLVIEWPORTPROC gles2wViewport; +PFNGLEGLIMAGETARGETTEXTURE2DOESPROC gles2wEGLImageTargetTexture2DOES; +PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC gles2wEGLImageTargetRenderbufferStorageOES; +PFNGLGETPROGRAMBINARYOESPROC gles2wGetProgramBinaryOES; +PFNGLPROGRAMBINARYOESPROC gles2wProgramBinaryOES; +PFNGLMAPBUFFEROESPROC gles2wMapBufferOES; +PFNGLUNMAPBUFFEROESPROC gles2wUnmapBufferOES; +PFNGLGETBUFFERPOINTERVOESPROC gles2wGetBufferPointervOES; +PFNGLTEXIMAGE3DOESPROC gles2wTexImage3DOES; +PFNGLTEXSUBIMAGE3DOESPROC gles2wTexSubImage3DOES; +PFNGLCOPYTEXSUBIMAGE3DOESPROC gles2wCopyTexSubImage3DOES; +PFNGLCOMPRESSEDTEXIMAGE3DOESPROC gles2wCompressedTexImage3DOES; +PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC gles2wCompressedTexSubImage3DOES; +PFNGLFRAMEBUFFERTEXTURE3DOESPROC gles2wFramebufferTexture3DOES; +PFNGLBINDVERTEXARRAYOESPROC gles2wBindVertexArrayOES; +PFNGLDELETEVERTEXARRAYSOESPROC gles2wDeleteVertexArraysOES; +PFNGLGENVERTEXARRAYSOESPROC gles2wGenVertexArraysOES; +PFNGLISVERTEXARRAYOESPROC gles2wIsVertexArrayOES; +PFNGLDEBUGMESSAGECONTROLKHRPROC gles2wDebugMessageControlKHR; +PFNGLDEBUGMESSAGEINSERTKHRPROC gles2wDebugMessageInsertKHR; +PFNGLDEBUGMESSAGECALLBACKKHRPROC gles2wDebugMessageCallbackKHR; +PFNGLGETDEBUGMESSAGELOGKHRPROC gles2wGetDebugMessageLogKHR; +PFNGLPUSHDEBUGGROUPKHRPROC gles2wPushDebugGroupKHR; +PFNGLPOPDEBUGGROUPKHRPROC gles2wPopDebugGroupKHR; +PFNGLOBJECTLABELKHRPROC gles2wObjectLabelKHR; +PFNGLGETOBJECTLABELKHRPROC gles2wGetObjectLabelKHR; +PFNGLOBJECTPTRLABELKHRPROC gles2wObjectPtrLabelKHR; +PFNGLGETOBJECTPTRLABELKHRPROC gles2wGetObjectPtrLabelKHR; +PFNGLGETPOINTERVKHRPROC gles2wGetPointervKHR; +PFNGLGETPERFMONITORGROUPSAMDPROC gles2wGetPerfMonitorGroupsAMD; +PFNGLGETPERFMONITORCOUNTERSAMDPROC gles2wGetPerfMonitorCountersAMD; +PFNGLGETPERFMONITORGROUPSTRINGAMDPROC gles2wGetPerfMonitorGroupStringAMD; +PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC gles2wGetPerfMonitorCounterStringAMD; +PFNGLGETPERFMONITORCOUNTERINFOAMDPROC gles2wGetPerfMonitorCounterInfoAMD; +PFNGLGENPERFMONITORSAMDPROC gles2wGenPerfMonitorsAMD; +PFNGLDELETEPERFMONITORSAMDPROC gles2wDeletePerfMonitorsAMD; +PFNGLSELECTPERFMONITORCOUNTERSAMDPROC gles2wSelectPerfMonitorCountersAMD; +PFNGLBEGINPERFMONITORAMDPROC gles2wBeginPerfMonitorAMD; +PFNGLENDPERFMONITORAMDPROC gles2wEndPerfMonitorAMD; +PFNGLGETPERFMONITORCOUNTERDATAAMDPROC gles2wGetPerfMonitorCounterDataAMD; +PFNGLBLITFRAMEBUFFERANGLEPROC gles2wBlitFramebufferANGLE; +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC gles2wRenderbufferStorageMultisampleANGLE; +PFNGLDRAWARRAYSINSTANCEDANGLEPROC gles2wDrawArraysInstancedANGLE; +PFNGLDRAWELEMENTSINSTANCEDANGLEPROC gles2wDrawElementsInstancedANGLE; +PFNGLVERTEXATTRIBDIVISORANGLEPROC gles2wVertexAttribDivisorANGLE; +PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC gles2wGetTranslatedShaderSourceANGLE; +PFNGLDRAWARRAYSINSTANCEDEXTPROC gles2wDrawArraysInstancedEXT; +PFNGLDRAWELEMENTSINSTANCEDEXTPROC gles2wDrawElementsInstancedEXT; +PFNGLVERTEXATTRIBDIVISOREXTPROC gles2wVertexAttribDivisorEXT; +PFNGLCOPYTEXTURELEVELSAPPLEPROC gles2wCopyTextureLevelsAPPLE; +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC gles2wRenderbufferStorageMultisampleAPPLE; +PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC gles2wResolveMultisampleFramebufferAPPLE; +PFNGLFENCESYNCAPPLEPROC gles2wFenceSyncAPPLE; +PFNGLISSYNCAPPLEPROC gles2wIsSyncAPPLE; +PFNGLDELETESYNCAPPLEPROC gles2wDeleteSyncAPPLE; +PFNGLCLIENTWAITSYNCAPPLEPROC gles2wClientWaitSyncAPPLE; +PFNGLWAITSYNCAPPLEPROC gles2wWaitSyncAPPLE; +PFNGLGETINTEGER64VAPPLEPROC gles2wGetInteger64vAPPLE; +PFNGLGETSYNCIVAPPLEPROC gles2wGetSyncivAPPLE; +PFNGLLABELOBJECTEXTPROC gles2wLabelObjectEXT; +PFNGLGETOBJECTLABELEXTPROC gles2wGetObjectLabelEXT; +PFNGLINSERTEVENTMARKEREXTPROC gles2wInsertEventMarkerEXT; +PFNGLPUSHGROUPMARKEREXTPROC gles2wPushGroupMarkerEXT; +PFNGLPOPGROUPMARKEREXTPROC gles2wPopGroupMarkerEXT; +PFNGLDISCARDFRAMEBUFFEREXTPROC gles2wDiscardFramebufferEXT; +PFNGLGENQUERIESEXTPROC gles2wGenQueriesEXT; +PFNGLDELETEQUERIESEXTPROC gles2wDeleteQueriesEXT; +PFNGLISQUERYEXTPROC gles2wIsQueryEXT; +PFNGLBEGINQUERYEXTPROC gles2wBeginQueryEXT; +PFNGLENDQUERYEXTPROC gles2wEndQueryEXT; +PFNGLQUERYCOUNTEREXTPROC gles2wQueryCounterEXT; +PFNGLGETQUERYIVEXTPROC gles2wGetQueryivEXT; +PFNGLGETQUERYOBJECTIVEXTPROC gles2wGetQueryObjectivEXT; +PFNGLGETQUERYOBJECTUIVEXTPROC gles2wGetQueryObjectuivEXT; +PFNGLGETQUERYOBJECTI64VEXTPROC gles2wGetQueryObjecti64vEXT; +PFNGLGETQUERYOBJECTUI64VEXTPROC gles2wGetQueryObjectui64vEXT; +PFNGLMAPBUFFERRANGEEXTPROC gles2wMapBufferRangeEXT; +PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC gles2wFlushMappedBufferRangeEXT; +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC gles2wRenderbufferStorageMultisampleEXT; +PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC gles2wFramebufferTexture2DMultisampleEXT; +PFNGLREADBUFFERINDEXEDEXTPROC gles2wReadBufferIndexedEXT; +PFNGLDRAWBUFFERSINDEXEDEXTPROC gles2wDrawBuffersIndexedEXT; +PFNGLGETINTEGERI_VEXTPROC gles2wGetIntegeri_vEXT; +PFNGLMULTIDRAWARRAYSEXTPROC gles2wMultiDrawArraysEXT; +PFNGLMULTIDRAWELEMENTSEXTPROC gles2wMultiDrawElementsEXT; +PFNGLGETGRAPHICSRESETSTATUSEXTPROC gles2wGetGraphicsResetStatusEXT; +PFNGLREADNPIXELSEXTPROC gles2wReadnPixelsEXT; +PFNGLGETNUNIFORMFVEXTPROC gles2wGetnUniformfvEXT; +PFNGLGETNUNIFORMIVEXTPROC gles2wGetnUniformivEXT; +PFNGLUSEPROGRAMSTAGESEXTPROC gles2wUseProgramStagesEXT; +PFNGLACTIVESHADERPROGRAMEXTPROC gles2wActiveShaderProgramEXT; +PFNGLCREATESHADERPROGRAMVEXTPROC gles2wCreateShaderProgramvEXT; +PFNGLBINDPROGRAMPIPELINEEXTPROC gles2wBindProgramPipelineEXT; +PFNGLDELETEPROGRAMPIPELINESEXTPROC gles2wDeleteProgramPipelinesEXT; +PFNGLGENPROGRAMPIPELINESEXTPROC gles2wGenProgramPipelinesEXT; +PFNGLISPROGRAMPIPELINEEXTPROC gles2wIsProgramPipelineEXT; +PFNGLPROGRAMPARAMETERIEXTPROC gles2wProgramParameteriEXT; +PFNGLGETPROGRAMPIPELINEIVEXTPROC gles2wGetProgramPipelineivEXT; +PFNGLPROGRAMUNIFORM1IEXTPROC gles2wProgramUniform1iEXT; +PFNGLPROGRAMUNIFORM2IEXTPROC gles2wProgramUniform2iEXT; +PFNGLPROGRAMUNIFORM3IEXTPROC gles2wProgramUniform3iEXT; +PFNGLPROGRAMUNIFORM4IEXTPROC gles2wProgramUniform4iEXT; +PFNGLPROGRAMUNIFORM1FEXTPROC gles2wProgramUniform1fEXT; +PFNGLPROGRAMUNIFORM2FEXTPROC gles2wProgramUniform2fEXT; +PFNGLPROGRAMUNIFORM3FEXTPROC gles2wProgramUniform3fEXT; +PFNGLPROGRAMUNIFORM4FEXTPROC gles2wProgramUniform4fEXT; +PFNGLPROGRAMUNIFORM1IVEXTPROC gles2wProgramUniform1ivEXT; +PFNGLPROGRAMUNIFORM2IVEXTPROC gles2wProgramUniform2ivEXT; +PFNGLPROGRAMUNIFORM3IVEXTPROC gles2wProgramUniform3ivEXT; +PFNGLPROGRAMUNIFORM4IVEXTPROC gles2wProgramUniform4ivEXT; +PFNGLPROGRAMUNIFORM1FVEXTPROC gles2wProgramUniform1fvEXT; +PFNGLPROGRAMUNIFORM2FVEXTPROC gles2wProgramUniform2fvEXT; +PFNGLPROGRAMUNIFORM3FVEXTPROC gles2wProgramUniform3fvEXT; +PFNGLPROGRAMUNIFORM4FVEXTPROC gles2wProgramUniform4fvEXT; +PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC gles2wProgramUniformMatrix2fvEXT; +PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC gles2wProgramUniformMatrix3fvEXT; +PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC gles2wProgramUniformMatrix4fvEXT; +PFNGLVALIDATEPROGRAMPIPELINEEXTPROC gles2wValidateProgramPipelineEXT; +PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC gles2wGetProgramPipelineInfoLogEXT; +PFNGLTEXSTORAGE1DEXTPROC gles2wTexStorage1DEXT; +PFNGLTEXSTORAGE2DEXTPROC gles2wTexStorage2DEXT; +PFNGLTEXSTORAGE3DEXTPROC gles2wTexStorage3DEXT; +PFNGLTEXTURESTORAGE1DEXTPROC gles2wTextureStorage1DEXT; +PFNGLTEXTURESTORAGE2DEXTPROC gles2wTextureStorage2DEXT; +PFNGLTEXTURESTORAGE3DEXTPROC gles2wTextureStorage3DEXT; +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMGPROC gles2wRenderbufferStorageMultisampleIMG; +PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC gles2wFramebufferTexture2DMultisampleIMG; +PFNGLCOVERAGEMASKNVPROC gles2wCoverageMaskNV; +PFNGLCOVERAGEOPERATIONNVPROC gles2wCoverageOperationNV; +PFNGLDRAWBUFFERSNVPROC gles2wDrawBuffersNV; +PFNGLDRAWARRAYSINSTANCEDNVPROC gles2wDrawArraysInstancedNV; +PFNGLDRAWELEMENTSINSTANCEDNVPROC gles2wDrawElementsInstancedNV; +PFNGLDELETEFENCESNVPROC gles2wDeleteFencesNV; +PFNGLGENFENCESNVPROC gles2wGenFencesNV; +PFNGLISFENCENVPROC gles2wIsFenceNV; +PFNGLTESTFENCENVPROC gles2wTestFenceNV; +PFNGLGETFENCEIVNVPROC gles2wGetFenceivNV; +PFNGLFINISHFENCENVPROC gles2wFinishFenceNV; +PFNGLSETFENCENVPROC gles2wSetFenceNV; +PFNGLBLITFRAMEBUFFERNVPROC gles2wBlitFramebufferNV; +PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC gles2wRenderbufferStorageMultisampleNV; +PFNGLVERTEXATTRIBDIVISORNVPROC gles2wVertexAttribDivisorNV; +PFNGLREADBUFFERNVPROC gles2wReadBufferNV; +PFNGLALPHAFUNCQCOMPROC gles2wAlphaFuncQCOM; +PFNGLGETDRIVERCONTROLSQCOMPROC gles2wGetDriverControlsQCOM; +PFNGLGETDRIVERCONTROLSTRINGQCOMPROC gles2wGetDriverControlStringQCOM; +PFNGLENABLEDRIVERCONTROLQCOMPROC gles2wEnableDriverControlQCOM; +PFNGLDISABLEDRIVERCONTROLQCOMPROC gles2wDisableDriverControlQCOM; +PFNGLEXTGETTEXTURESQCOMPROC gles2wExtGetTexturesQCOM; +PFNGLEXTGETBUFFERSQCOMPROC gles2wExtGetBuffersQCOM; +PFNGLEXTGETRENDERBUFFERSQCOMPROC gles2wExtGetRenderbuffersQCOM; +PFNGLEXTGETFRAMEBUFFERSQCOMPROC gles2wExtGetFramebuffersQCOM; +PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC gles2wExtGetTexLevelParameterivQCOM; +PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC gles2wExtTexObjectStateOverrideiQCOM; +PFNGLEXTGETTEXSUBIMAGEQCOMPROC gles2wExtGetTexSubImageQCOM; +PFNGLEXTGETBUFFERPOINTERVQCOMPROC gles2wExtGetBufferPointervQCOM; +PFNGLEXTGETSHADERSQCOMPROC gles2wExtGetShadersQCOM; +PFNGLEXTGETPROGRAMSQCOMPROC gles2wExtGetProgramsQCOM; +PFNGLEXTISPROGRAMBINARYQCOMPROC gles2wExtIsProgramBinaryQCOM; +PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC gles2wExtGetProgramBinarySourceQCOM; +PFNGLSTARTTILINGQCOMPROC gles2wStartTilingQCOM; +PFNGLENDTILINGQCOMPROC gles2wEndTilingQCOM; + +static void load_procs(void) +{ + gles2wActiveTexture = (PFNGLACTIVETEXTUREPROC) get_proc("glActiveTexture"); + gles2wAttachShader = (PFNGLATTACHSHADERPROC) get_proc("glAttachShader"); + gles2wBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC) get_proc("glBindAttribLocation"); + gles2wBindBuffer = (PFNGLBINDBUFFERPROC) get_proc("glBindBuffer"); + gles2wBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC) get_proc("glBindFramebuffer"); + gles2wBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC) get_proc("glBindRenderbuffer"); + gles2wBindTexture = (PFNGLBINDTEXTUREPROC) get_proc("glBindTexture"); + gles2wBlendColor = (PFNGLBLENDCOLORPROC) get_proc("glBlendColor"); + gles2wBlendEquation = (PFNGLBLENDEQUATIONPROC) get_proc("glBlendEquation"); + gles2wBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC) get_proc("glBlendEquationSeparate"); + gles2wBlendFunc = (PFNGLBLENDFUNCPROC) get_proc("glBlendFunc"); + gles2wBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC) get_proc("glBlendFuncSeparate"); + gles2wBufferData = (PFNGLBUFFERDATAPROC) get_proc("glBufferData"); + gles2wBufferSubData = (PFNGLBUFFERSUBDATAPROC) get_proc("glBufferSubData"); + gles2wCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC) get_proc("glCheckFramebufferStatus"); + gles2wClear = (PFNGLCLEARPROC) get_proc("glClear"); + gles2wClearColor = (PFNGLCLEARCOLORPROC) get_proc("glClearColor"); + gles2wClearDepthf = (PFNGLCLEARDEPTHFPROC) get_proc("glClearDepthf"); + gles2wClearStencil = (PFNGLCLEARSTENCILPROC) get_proc("glClearStencil"); + gles2wColorMask = (PFNGLCOLORMASKPROC) get_proc("glColorMask"); + gles2wCompileShader = (PFNGLCOMPILESHADERPROC) get_proc("glCompileShader"); + gles2wCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC) get_proc("glCompressedTexImage2D"); + gles2wCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) get_proc("glCompressedTexSubImage2D"); + gles2wCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC) get_proc("glCopyTexImage2D"); + gles2wCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC) get_proc("glCopyTexSubImage2D"); + gles2wCreateProgram = (PFNGLCREATEPROGRAMPROC) get_proc("glCreateProgram"); + gles2wCreateShader = (PFNGLCREATESHADERPROC) get_proc("glCreateShader"); + gles2wCullFace = (PFNGLCULLFACEPROC) get_proc("glCullFace"); + gles2wDeleteBuffers = (PFNGLDELETEBUFFERSPROC) get_proc("glDeleteBuffers"); + gles2wDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC) get_proc("glDeleteFramebuffers"); + gles2wDeleteProgram = (PFNGLDELETEPROGRAMPROC) get_proc("glDeleteProgram"); + gles2wDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC) get_proc("glDeleteRenderbuffers"); + gles2wDeleteShader = (PFNGLDELETESHADERPROC) get_proc("glDeleteShader"); + gles2wDeleteTextures = (PFNGLDELETETEXTURESPROC) get_proc("glDeleteTextures"); + gles2wDepthFunc = (PFNGLDEPTHFUNCPROC) get_proc("glDepthFunc"); + gles2wDepthMask = (PFNGLDEPTHMASKPROC) get_proc("glDepthMask"); + gles2wDepthRangef = (PFNGLDEPTHRANGEFPROC) get_proc("glDepthRangef"); + gles2wDetachShader = (PFNGLDETACHSHADERPROC) get_proc("glDetachShader"); + gles2wDisable = (PFNGLDISABLEPROC) get_proc("glDisable"); + gles2wDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC) get_proc("glDisableVertexAttribArray"); + gles2wDrawArrays = (PFNGLDRAWARRAYSPROC) get_proc("glDrawArrays"); + gles2wDrawElements = (PFNGLDRAWELEMENTSPROC) get_proc("glDrawElements"); + gles2wEnable = (PFNGLENABLEPROC) get_proc("glEnable"); + gles2wEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC) get_proc("glEnableVertexAttribArray"); + gles2wFinish = (PFNGLFINISHPROC) get_proc("glFinish"); + gles2wFlush = (PFNGLFLUSHPROC) get_proc("glFlush"); + gles2wFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC) get_proc("glFramebufferRenderbuffer"); + gles2wFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC) get_proc("glFramebufferTexture2D"); + gles2wFrontFace = (PFNGLFRONTFACEPROC) get_proc("glFrontFace"); + gles2wGenBuffers = (PFNGLGENBUFFERSPROC) get_proc("glGenBuffers"); + gles2wGenerateMipmap = (PFNGLGENERATEMIPMAPPROC) get_proc("glGenerateMipmap"); + gles2wGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC) get_proc("glGenFramebuffers"); + gles2wGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC) get_proc("glGenRenderbuffers"); + gles2wGenTextures = (PFNGLGENTEXTURESPROC) get_proc("glGenTextures"); + gles2wGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC) get_proc("glGetActiveAttrib"); + gles2wGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC) get_proc("glGetActiveUniform"); + gles2wGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC) get_proc("glGetAttachedShaders"); + gles2wGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC) get_proc("glGetAttribLocation"); + gles2wGetBooleanv = (PFNGLGETBOOLEANVPROC) get_proc("glGetBooleanv"); + gles2wGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC) get_proc("glGetBufferParameteriv"); + gles2wGetError = (PFNGLGETERRORPROC) get_proc("glGetError"); + gles2wGetFloatv = (PFNGLGETFLOATVPROC) get_proc("glGetFloatv"); + gles2wGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) get_proc("glGetFramebufferAttachmentParameteriv"); + gles2wGetIntegerv = (PFNGLGETINTEGERVPROC) get_proc("glGetIntegerv"); + gles2wGetProgramiv = (PFNGLGETPROGRAMIVPROC) get_proc("glGetProgramiv"); + gles2wGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC) get_proc("glGetProgramInfoLog"); + gles2wGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC) get_proc("glGetRenderbufferParameteriv"); + gles2wGetShaderiv = (PFNGLGETSHADERIVPROC) get_proc("glGetShaderiv"); + gles2wGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC) get_proc("glGetShaderInfoLog"); + gles2wGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC) get_proc("glGetShaderPrecisionFormat"); + gles2wGetShaderSource = (PFNGLGETSHADERSOURCEPROC) get_proc("glGetShaderSource"); + gles2wGetString = (PFNGLGETSTRINGPROC) get_proc("glGetString"); + gles2wGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC) get_proc("glGetTexParameterfv"); + gles2wGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC) get_proc("glGetTexParameteriv"); + gles2wGetUniformfv = (PFNGLGETUNIFORMFVPROC) get_proc("glGetUniformfv"); + gles2wGetUniformiv = (PFNGLGETUNIFORMIVPROC) get_proc("glGetUniformiv"); + gles2wGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC) get_proc("glGetUniformLocation"); + gles2wGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC) get_proc("glGetVertexAttribfv"); + gles2wGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC) get_proc("glGetVertexAttribiv"); + gles2wGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC) get_proc("glGetVertexAttribPointerv"); + gles2wHint = (PFNGLHINTPROC) get_proc("glHint"); + gles2wIsBuffer = (PFNGLISBUFFERPROC) get_proc("glIsBuffer"); + gles2wIsEnabled = (PFNGLISENABLEDPROC) get_proc("glIsEnabled"); + gles2wIsFramebuffer = (PFNGLISFRAMEBUFFERPROC) get_proc("glIsFramebuffer"); + gles2wIsProgram = (PFNGLISPROGRAMPROC) get_proc("glIsProgram"); + gles2wIsRenderbuffer = (PFNGLISRENDERBUFFERPROC) get_proc("glIsRenderbuffer"); + gles2wIsShader = (PFNGLISSHADERPROC) get_proc("glIsShader"); + gles2wIsTexture = (PFNGLISTEXTUREPROC) get_proc("glIsTexture"); + gles2wLineWidth = (PFNGLLINEWIDTHPROC) get_proc("glLineWidth"); + gles2wLinkProgram = (PFNGLLINKPROGRAMPROC) get_proc("glLinkProgram"); + gles2wPixelStorei = (PFNGLPIXELSTOREIPROC) get_proc("glPixelStorei"); + gles2wPolygonOffset = (PFNGLPOLYGONOFFSETPROC) get_proc("glPolygonOffset"); + gles2wReadPixels = (PFNGLREADPIXELSPROC) get_proc("glReadPixels"); + gles2wReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC) get_proc("glReleaseShaderCompiler"); + gles2wRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC) get_proc("glRenderbufferStorage"); + gles2wSampleCoverage = (PFNGLSAMPLECOVERAGEPROC) get_proc("glSampleCoverage"); + gles2wScissor = (PFNGLSCISSORPROC) get_proc("glScissor"); + gles2wShaderBinary = (PFNGLSHADERBINARYPROC) get_proc("glShaderBinary"); + gles2wShaderSource = (PFNGLSHADERSOURCEPROC) get_proc("glShaderSource"); + gles2wStencilFunc = (PFNGLSTENCILFUNCPROC) get_proc("glStencilFunc"); + gles2wStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC) get_proc("glStencilFuncSeparate"); + gles2wStencilMask = (PFNGLSTENCILMASKPROC) get_proc("glStencilMask"); + gles2wStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC) get_proc("glStencilMaskSeparate"); + gles2wStencilOp = (PFNGLSTENCILOPPROC) get_proc("glStencilOp"); + gles2wStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC) get_proc("glStencilOpSeparate"); + gles2wTexImage2D = (PFNGLTEXIMAGE2DPROC) get_proc("glTexImage2D"); + gles2wTexParameterf = (PFNGLTEXPARAMETERFPROC) get_proc("glTexParameterf"); + gles2wTexParameterfv = (PFNGLTEXPARAMETERFVPROC) get_proc("glTexParameterfv"); + gles2wTexParameteri = (PFNGLTEXPARAMETERIPROC) get_proc("glTexParameteri"); + gles2wTexParameteriv = (PFNGLTEXPARAMETERIVPROC) get_proc("glTexParameteriv"); + gles2wTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC) get_proc("glTexSubImage2D"); + gles2wUniform1f = (PFNGLUNIFORM1FPROC) get_proc("glUniform1f"); + gles2wUniform1fv = (PFNGLUNIFORM1FVPROC) get_proc("glUniform1fv"); + gles2wUniform1i = (PFNGLUNIFORM1IPROC) get_proc("glUniform1i"); + gles2wUniform1iv = (PFNGLUNIFORM1IVPROC) get_proc("glUniform1iv"); + gles2wUniform2f = (PFNGLUNIFORM2FPROC) get_proc("glUniform2f"); + gles2wUniform2fv = (PFNGLUNIFORM2FVPROC) get_proc("glUniform2fv"); + gles2wUniform2i = (PFNGLUNIFORM2IPROC) get_proc("glUniform2i"); + gles2wUniform2iv = (PFNGLUNIFORM2IVPROC) get_proc("glUniform2iv"); + gles2wUniform3f = (PFNGLUNIFORM3FPROC) get_proc("glUniform3f"); + gles2wUniform3fv = (PFNGLUNIFORM3FVPROC) get_proc("glUniform3fv"); + gles2wUniform3i = (PFNGLUNIFORM3IPROC) get_proc("glUniform3i"); + gles2wUniform3iv = (PFNGLUNIFORM3IVPROC) get_proc("glUniform3iv"); + gles2wUniform4f = (PFNGLUNIFORM4FPROC) get_proc("glUniform4f"); + gles2wUniform4fv = (PFNGLUNIFORM4FVPROC) get_proc("glUniform4fv"); + gles2wUniform4i = (PFNGLUNIFORM4IPROC) get_proc("glUniform4i"); + gles2wUniform4iv = (PFNGLUNIFORM4IVPROC) get_proc("glUniform4iv"); + gles2wUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC) get_proc("glUniformMatrix2fv"); + gles2wUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC) get_proc("glUniformMatrix3fv"); + gles2wUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC) get_proc("glUniformMatrix4fv"); + gles2wUseProgram = (PFNGLUSEPROGRAMPROC) get_proc("glUseProgram"); + gles2wValidateProgram = (PFNGLVALIDATEPROGRAMPROC) get_proc("glValidateProgram"); + gles2wVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC) get_proc("glVertexAttrib1f"); + gles2wVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC) get_proc("glVertexAttrib1fv"); + gles2wVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC) get_proc("glVertexAttrib2f"); + gles2wVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC) get_proc("glVertexAttrib2fv"); + gles2wVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC) get_proc("glVertexAttrib3f"); + gles2wVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC) get_proc("glVertexAttrib3fv"); + gles2wVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC) get_proc("glVertexAttrib4f"); + gles2wVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC) get_proc("glVertexAttrib4fv"); + gles2wVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC) get_proc("glVertexAttribPointer"); + gles2wViewport = (PFNGLVIEWPORTPROC) get_proc("glViewport"); + gles2wEGLImageTargetTexture2DOES = (PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) get_proc("glEGLImageTargetTexture2DOES"); + gles2wEGLImageTargetRenderbufferStorageOES = (PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) get_proc("glEGLImageTargetRenderbufferStorageOES"); + gles2wGetProgramBinaryOES = (PFNGLGETPROGRAMBINARYOESPROC) get_proc("glGetProgramBinaryOES"); + gles2wProgramBinaryOES = (PFNGLPROGRAMBINARYOESPROC) get_proc("glProgramBinaryOES"); + gles2wMapBufferOES = (PFNGLMAPBUFFEROESPROC) get_proc("glMapBufferOES"); + gles2wUnmapBufferOES = (PFNGLUNMAPBUFFEROESPROC) get_proc("glUnmapBufferOES"); + gles2wGetBufferPointervOES = (PFNGLGETBUFFERPOINTERVOESPROC) get_proc("glGetBufferPointervOES"); + gles2wTexImage3DOES = (PFNGLTEXIMAGE3DOESPROC) get_proc("glTexImage3DOES"); + gles2wTexSubImage3DOES = (PFNGLTEXSUBIMAGE3DOESPROC) get_proc("glTexSubImage3DOES"); + gles2wCopyTexSubImage3DOES = (PFNGLCOPYTEXSUBIMAGE3DOESPROC) get_proc("glCopyTexSubImage3DOES"); + gles2wCompressedTexImage3DOES = (PFNGLCOMPRESSEDTEXIMAGE3DOESPROC) get_proc("glCompressedTexImage3DOES"); + gles2wCompressedTexSubImage3DOES = (PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC) get_proc("glCompressedTexSubImage3DOES"); + gles2wFramebufferTexture3DOES = (PFNGLFRAMEBUFFERTEXTURE3DOESPROC) get_proc("glFramebufferTexture3DOES"); + gles2wBindVertexArrayOES = (PFNGLBINDVERTEXARRAYOESPROC) get_proc("glBindVertexArrayOES"); + gles2wDeleteVertexArraysOES = (PFNGLDELETEVERTEXARRAYSOESPROC) get_proc("glDeleteVertexArraysOES"); + gles2wGenVertexArraysOES = (PFNGLGENVERTEXARRAYSOESPROC) get_proc("glGenVertexArraysOES"); + gles2wIsVertexArrayOES = (PFNGLISVERTEXARRAYOESPROC) get_proc("glIsVertexArrayOES"); + gles2wDebugMessageControlKHR = (PFNGLDEBUGMESSAGECONTROLKHRPROC) get_proc("glDebugMessageControlKHR"); + gles2wDebugMessageInsertKHR = (PFNGLDEBUGMESSAGEINSERTKHRPROC) get_proc("glDebugMessageInsertKHR"); + gles2wDebugMessageCallbackKHR = (PFNGLDEBUGMESSAGECALLBACKKHRPROC) get_proc("glDebugMessageCallbackKHR"); + gles2wGetDebugMessageLogKHR = (PFNGLGETDEBUGMESSAGELOGKHRPROC) get_proc("glGetDebugMessageLogKHR"); + gles2wPushDebugGroupKHR = (PFNGLPUSHDEBUGGROUPKHRPROC) get_proc("glPushDebugGroupKHR"); + gles2wPopDebugGroupKHR = (PFNGLPOPDEBUGGROUPKHRPROC) get_proc("glPopDebugGroupKHR"); + gles2wObjectLabelKHR = (PFNGLOBJECTLABELKHRPROC) get_proc("glObjectLabelKHR"); + gles2wGetObjectLabelKHR = (PFNGLGETOBJECTLABELKHRPROC) get_proc("glGetObjectLabelKHR"); + gles2wObjectPtrLabelKHR = (PFNGLOBJECTPTRLABELKHRPROC) get_proc("glObjectPtrLabelKHR"); + gles2wGetObjectPtrLabelKHR = (PFNGLGETOBJECTPTRLABELKHRPROC) get_proc("glGetObjectPtrLabelKHR"); + gles2wGetPointervKHR = (PFNGLGETPOINTERVKHRPROC) get_proc("glGetPointervKHR"); + gles2wGetPerfMonitorGroupsAMD = (PFNGLGETPERFMONITORGROUPSAMDPROC) get_proc("glGetPerfMonitorGroupsAMD"); + gles2wGetPerfMonitorCountersAMD = (PFNGLGETPERFMONITORCOUNTERSAMDPROC) get_proc("glGetPerfMonitorCountersAMD"); + gles2wGetPerfMonitorGroupStringAMD = (PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) get_proc("glGetPerfMonitorGroupStringAMD"); + gles2wGetPerfMonitorCounterStringAMD = (PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) get_proc("glGetPerfMonitorCounterStringAMD"); + gles2wGetPerfMonitorCounterInfoAMD = (PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) get_proc("glGetPerfMonitorCounterInfoAMD"); + gles2wGenPerfMonitorsAMD = (PFNGLGENPERFMONITORSAMDPROC) get_proc("glGenPerfMonitorsAMD"); + gles2wDeletePerfMonitorsAMD = (PFNGLDELETEPERFMONITORSAMDPROC) get_proc("glDeletePerfMonitorsAMD"); + gles2wSelectPerfMonitorCountersAMD = (PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) get_proc("glSelectPerfMonitorCountersAMD"); + gles2wBeginPerfMonitorAMD = (PFNGLBEGINPERFMONITORAMDPROC) get_proc("glBeginPerfMonitorAMD"); + gles2wEndPerfMonitorAMD = (PFNGLENDPERFMONITORAMDPROC) get_proc("glEndPerfMonitorAMD"); + gles2wGetPerfMonitorCounterDataAMD = (PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) get_proc("glGetPerfMonitorCounterDataAMD"); + gles2wBlitFramebufferANGLE = (PFNGLBLITFRAMEBUFFERANGLEPROC) get_proc("glBlitFramebufferANGLE"); + gles2wRenderbufferStorageMultisampleANGLE = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) get_proc("glRenderbufferStorageMultisampleANGLE"); + gles2wDrawArraysInstancedANGLE = (PFNGLDRAWARRAYSINSTANCEDANGLEPROC) get_proc("glDrawArraysInstancedANGLE"); + gles2wDrawElementsInstancedANGLE = (PFNGLDRAWELEMENTSINSTANCEDANGLEPROC) get_proc("glDrawElementsInstancedANGLE"); + gles2wVertexAttribDivisorANGLE = (PFNGLVERTEXATTRIBDIVISORANGLEPROC) get_proc("glVertexAttribDivisorANGLE"); + gles2wGetTranslatedShaderSourceANGLE = (PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) get_proc("glGetTranslatedShaderSourceANGLE"); + gles2wDrawArraysInstancedEXT = (PFNGLDRAWARRAYSINSTANCEDEXTPROC) get_proc("glDrawArraysInstancedEXT"); + gles2wDrawElementsInstancedEXT = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC) get_proc("glDrawElementsInstancedEXT"); + gles2wVertexAttribDivisorEXT = (PFNGLVERTEXATTRIBDIVISOREXTPROC) get_proc("glVertexAttribDivisorEXT"); + gles2wCopyTextureLevelsAPPLE = (PFNGLCOPYTEXTURELEVELSAPPLEPROC) get_proc("glCopyTextureLevelsAPPLE"); + gles2wRenderbufferStorageMultisampleAPPLE = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) get_proc("glRenderbufferStorageMultisampleAPPLE"); + gles2wResolveMultisampleFramebufferAPPLE = (PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) get_proc("glResolveMultisampleFramebufferAPPLE"); + gles2wFenceSyncAPPLE = (PFNGLFENCESYNCAPPLEPROC) get_proc("glFenceSyncAPPLE"); + gles2wIsSyncAPPLE = (PFNGLISSYNCAPPLEPROC) get_proc("glIsSyncAPPLE"); + gles2wDeleteSyncAPPLE = (PFNGLDELETESYNCAPPLEPROC) get_proc("glDeleteSyncAPPLE"); + gles2wClientWaitSyncAPPLE = (PFNGLCLIENTWAITSYNCAPPLEPROC) get_proc("glClientWaitSyncAPPLE"); + gles2wWaitSyncAPPLE = (PFNGLWAITSYNCAPPLEPROC) get_proc("glWaitSyncAPPLE"); + gles2wGetInteger64vAPPLE = (PFNGLGETINTEGER64VAPPLEPROC) get_proc("glGetInteger64vAPPLE"); + gles2wGetSyncivAPPLE = (PFNGLGETSYNCIVAPPLEPROC) get_proc("glGetSyncivAPPLE"); + gles2wLabelObjectEXT = (PFNGLLABELOBJECTEXTPROC) get_proc("glLabelObjectEXT"); + gles2wGetObjectLabelEXT = (PFNGLGETOBJECTLABELEXTPROC) get_proc("glGetObjectLabelEXT"); + gles2wInsertEventMarkerEXT = (PFNGLINSERTEVENTMARKEREXTPROC) get_proc("glInsertEventMarkerEXT"); + gles2wPushGroupMarkerEXT = (PFNGLPUSHGROUPMARKEREXTPROC) get_proc("glPushGroupMarkerEXT"); + gles2wPopGroupMarkerEXT = (PFNGLPOPGROUPMARKEREXTPROC) get_proc("glPopGroupMarkerEXT"); + gles2wDiscardFramebufferEXT = (PFNGLDISCARDFRAMEBUFFEREXTPROC) get_proc("glDiscardFramebufferEXT"); + gles2wGenQueriesEXT = (PFNGLGENQUERIESEXTPROC) get_proc("glGenQueriesEXT"); + gles2wDeleteQueriesEXT = (PFNGLDELETEQUERIESEXTPROC) get_proc("glDeleteQueriesEXT"); + gles2wIsQueryEXT = (PFNGLISQUERYEXTPROC) get_proc("glIsQueryEXT"); + gles2wBeginQueryEXT = (PFNGLBEGINQUERYEXTPROC) get_proc("glBeginQueryEXT"); + gles2wEndQueryEXT = (PFNGLENDQUERYEXTPROC) get_proc("glEndQueryEXT"); + gles2wQueryCounterEXT = (PFNGLQUERYCOUNTEREXTPROC) get_proc("glQueryCounterEXT"); + gles2wGetQueryivEXT = (PFNGLGETQUERYIVEXTPROC) get_proc("glGetQueryivEXT"); + gles2wGetQueryObjectivEXT = (PFNGLGETQUERYOBJECTIVEXTPROC) get_proc("glGetQueryObjectivEXT"); + gles2wGetQueryObjectuivEXT = (PFNGLGETQUERYOBJECTUIVEXTPROC) get_proc("glGetQueryObjectuivEXT"); + gles2wGetQueryObjecti64vEXT = (PFNGLGETQUERYOBJECTI64VEXTPROC) get_proc("glGetQueryObjecti64vEXT"); + gles2wGetQueryObjectui64vEXT = (PFNGLGETQUERYOBJECTUI64VEXTPROC) get_proc("glGetQueryObjectui64vEXT"); + gles2wMapBufferRangeEXT = (PFNGLMAPBUFFERRANGEEXTPROC) get_proc("glMapBufferRangeEXT"); + gles2wFlushMappedBufferRangeEXT = (PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC) get_proc("glFlushMappedBufferRangeEXT"); + gles2wRenderbufferStorageMultisampleEXT = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) get_proc("glRenderbufferStorageMultisampleEXT"); + gles2wFramebufferTexture2DMultisampleEXT = (PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) get_proc("glFramebufferTexture2DMultisampleEXT"); + gles2wReadBufferIndexedEXT = (PFNGLREADBUFFERINDEXEDEXTPROC) get_proc("glReadBufferIndexedEXT"); + gles2wDrawBuffersIndexedEXT = (PFNGLDRAWBUFFERSINDEXEDEXTPROC) get_proc("glDrawBuffersIndexedEXT"); + gles2wGetIntegeri_vEXT = (PFNGLGETINTEGERI_VEXTPROC) get_proc("glGetIntegeri_vEXT"); + gles2wMultiDrawArraysEXT = (PFNGLMULTIDRAWARRAYSEXTPROC) get_proc("glMultiDrawArraysEXT"); + gles2wMultiDrawElementsEXT = (PFNGLMULTIDRAWELEMENTSEXTPROC) get_proc("glMultiDrawElementsEXT"); + gles2wGetGraphicsResetStatusEXT = (PFNGLGETGRAPHICSRESETSTATUSEXTPROC) get_proc("glGetGraphicsResetStatusEXT"); + gles2wReadnPixelsEXT = (PFNGLREADNPIXELSEXTPROC) get_proc("glReadnPixelsEXT"); + gles2wGetnUniformfvEXT = (PFNGLGETNUNIFORMFVEXTPROC) get_proc("glGetnUniformfvEXT"); + gles2wGetnUniformivEXT = (PFNGLGETNUNIFORMIVEXTPROC) get_proc("glGetnUniformivEXT"); + gles2wUseProgramStagesEXT = (PFNGLUSEPROGRAMSTAGESEXTPROC) get_proc("glUseProgramStagesEXT"); + gles2wActiveShaderProgramEXT = (PFNGLACTIVESHADERPROGRAMEXTPROC) get_proc("glActiveShaderProgramEXT"); + gles2wCreateShaderProgramvEXT = (PFNGLCREATESHADERPROGRAMVEXTPROC) get_proc("glCreateShaderProgramvEXT"); + gles2wBindProgramPipelineEXT = (PFNGLBINDPROGRAMPIPELINEEXTPROC) get_proc("glBindProgramPipelineEXT"); + gles2wDeleteProgramPipelinesEXT = (PFNGLDELETEPROGRAMPIPELINESEXTPROC) get_proc("glDeleteProgramPipelinesEXT"); + gles2wGenProgramPipelinesEXT = (PFNGLGENPROGRAMPIPELINESEXTPROC) get_proc("glGenProgramPipelinesEXT"); + gles2wIsProgramPipelineEXT = (PFNGLISPROGRAMPIPELINEEXTPROC) get_proc("glIsProgramPipelineEXT"); + gles2wProgramParameteriEXT = (PFNGLPROGRAMPARAMETERIEXTPROC) get_proc("glProgramParameteriEXT"); + gles2wGetProgramPipelineivEXT = (PFNGLGETPROGRAMPIPELINEIVEXTPROC) get_proc("glGetProgramPipelineivEXT"); + gles2wProgramUniform1iEXT = (PFNGLPROGRAMUNIFORM1IEXTPROC) get_proc("glProgramUniform1iEXT"); + gles2wProgramUniform2iEXT = (PFNGLPROGRAMUNIFORM2IEXTPROC) get_proc("glProgramUniform2iEXT"); + gles2wProgramUniform3iEXT = (PFNGLPROGRAMUNIFORM3IEXTPROC) get_proc("glProgramUniform3iEXT"); + gles2wProgramUniform4iEXT = (PFNGLPROGRAMUNIFORM4IEXTPROC) get_proc("glProgramUniform4iEXT"); + gles2wProgramUniform1fEXT = (PFNGLPROGRAMUNIFORM1FEXTPROC) get_proc("glProgramUniform1fEXT"); + gles2wProgramUniform2fEXT = (PFNGLPROGRAMUNIFORM2FEXTPROC) get_proc("glProgramUniform2fEXT"); + gles2wProgramUniform3fEXT = (PFNGLPROGRAMUNIFORM3FEXTPROC) get_proc("glProgramUniform3fEXT"); + gles2wProgramUniform4fEXT = (PFNGLPROGRAMUNIFORM4FEXTPROC) get_proc("glProgramUniform4fEXT"); + gles2wProgramUniform1ivEXT = (PFNGLPROGRAMUNIFORM1IVEXTPROC) get_proc("glProgramUniform1ivEXT"); + gles2wProgramUniform2ivEXT = (PFNGLPROGRAMUNIFORM2IVEXTPROC) get_proc("glProgramUniform2ivEXT"); + gles2wProgramUniform3ivEXT = (PFNGLPROGRAMUNIFORM3IVEXTPROC) get_proc("glProgramUniform3ivEXT"); + gles2wProgramUniform4ivEXT = (PFNGLPROGRAMUNIFORM4IVEXTPROC) get_proc("glProgramUniform4ivEXT"); + gles2wProgramUniform1fvEXT = (PFNGLPROGRAMUNIFORM1FVEXTPROC) get_proc("glProgramUniform1fvEXT"); + gles2wProgramUniform2fvEXT = (PFNGLPROGRAMUNIFORM2FVEXTPROC) get_proc("glProgramUniform2fvEXT"); + gles2wProgramUniform3fvEXT = (PFNGLPROGRAMUNIFORM3FVEXTPROC) get_proc("glProgramUniform3fvEXT"); + gles2wProgramUniform4fvEXT = (PFNGLPROGRAMUNIFORM4FVEXTPROC) get_proc("glProgramUniform4fvEXT"); + gles2wProgramUniformMatrix2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) get_proc("glProgramUniformMatrix2fvEXT"); + gles2wProgramUniformMatrix3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) get_proc("glProgramUniformMatrix3fvEXT"); + gles2wProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) get_proc("glProgramUniformMatrix4fvEXT"); + gles2wValidateProgramPipelineEXT = (PFNGLVALIDATEPROGRAMPIPELINEEXTPROC) get_proc("glValidateProgramPipelineEXT"); + gles2wGetProgramPipelineInfoLogEXT = (PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC) get_proc("glGetProgramPipelineInfoLogEXT"); + gles2wTexStorage1DEXT = (PFNGLTEXSTORAGE1DEXTPROC) get_proc("glTexStorage1DEXT"); + gles2wTexStorage2DEXT = (PFNGLTEXSTORAGE2DEXTPROC) get_proc("glTexStorage2DEXT"); + gles2wTexStorage3DEXT = (PFNGLTEXSTORAGE3DEXTPROC) get_proc("glTexStorage3DEXT"); + gles2wTextureStorage1DEXT = (PFNGLTEXTURESTORAGE1DEXTPROC) get_proc("glTextureStorage1DEXT"); + gles2wTextureStorage2DEXT = (PFNGLTEXTURESTORAGE2DEXTPROC) get_proc("glTextureStorage2DEXT"); + gles2wTextureStorage3DEXT = (PFNGLTEXTURESTORAGE3DEXTPROC) get_proc("glTextureStorage3DEXT"); + gles2wRenderbufferStorageMultisampleIMG = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMGPROC) get_proc("glRenderbufferStorageMultisampleIMG"); + gles2wFramebufferTexture2DMultisampleIMG = (PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC) get_proc("glFramebufferTexture2DMultisampleIMG"); + gles2wCoverageMaskNV = (PFNGLCOVERAGEMASKNVPROC) get_proc("glCoverageMaskNV"); + gles2wCoverageOperationNV = (PFNGLCOVERAGEOPERATIONNVPROC) get_proc("glCoverageOperationNV"); + gles2wDrawBuffersNV = (PFNGLDRAWBUFFERSNVPROC) get_proc("glDrawBuffersNV"); + gles2wDrawArraysInstancedNV = (PFNGLDRAWARRAYSINSTANCEDNVPROC) get_proc("glDrawArraysInstancedNV"); + gles2wDrawElementsInstancedNV = (PFNGLDRAWELEMENTSINSTANCEDNVPROC) get_proc("glDrawElementsInstancedNV"); + gles2wDeleteFencesNV = (PFNGLDELETEFENCESNVPROC) get_proc("glDeleteFencesNV"); + gles2wGenFencesNV = (PFNGLGENFENCESNVPROC) get_proc("glGenFencesNV"); + gles2wIsFenceNV = (PFNGLISFENCENVPROC) get_proc("glIsFenceNV"); + gles2wTestFenceNV = (PFNGLTESTFENCENVPROC) get_proc("glTestFenceNV"); + gles2wGetFenceivNV = (PFNGLGETFENCEIVNVPROC) get_proc("glGetFenceivNV"); + gles2wFinishFenceNV = (PFNGLFINISHFENCENVPROC) get_proc("glFinishFenceNV"); + gles2wSetFenceNV = (PFNGLSETFENCENVPROC) get_proc("glSetFenceNV"); + gles2wBlitFramebufferNV = (PFNGLBLITFRAMEBUFFERNVPROC) get_proc("glBlitFramebufferNV"); + gles2wRenderbufferStorageMultisampleNV = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLENVPROC) get_proc("glRenderbufferStorageMultisampleNV"); + gles2wVertexAttribDivisorNV = (PFNGLVERTEXATTRIBDIVISORNVPROC) get_proc("glVertexAttribDivisorNV"); + gles2wReadBufferNV = (PFNGLREADBUFFERNVPROC) get_proc("glReadBufferNV"); + gles2wAlphaFuncQCOM = (PFNGLALPHAFUNCQCOMPROC) get_proc("glAlphaFuncQCOM"); + gles2wGetDriverControlsQCOM = (PFNGLGETDRIVERCONTROLSQCOMPROC) get_proc("glGetDriverControlsQCOM"); + gles2wGetDriverControlStringQCOM = (PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) get_proc("glGetDriverControlStringQCOM"); + gles2wEnableDriverControlQCOM = (PFNGLENABLEDRIVERCONTROLQCOMPROC) get_proc("glEnableDriverControlQCOM"); + gles2wDisableDriverControlQCOM = (PFNGLDISABLEDRIVERCONTROLQCOMPROC) get_proc("glDisableDriverControlQCOM"); + gles2wExtGetTexturesQCOM = (PFNGLEXTGETTEXTURESQCOMPROC) get_proc("glExtGetTexturesQCOM"); + gles2wExtGetBuffersQCOM = (PFNGLEXTGETBUFFERSQCOMPROC) get_proc("glExtGetBuffersQCOM"); + gles2wExtGetRenderbuffersQCOM = (PFNGLEXTGETRENDERBUFFERSQCOMPROC) get_proc("glExtGetRenderbuffersQCOM"); + gles2wExtGetFramebuffersQCOM = (PFNGLEXTGETFRAMEBUFFERSQCOMPROC) get_proc("glExtGetFramebuffersQCOM"); + gles2wExtGetTexLevelParameterivQCOM = (PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) get_proc("glExtGetTexLevelParameterivQCOM"); + gles2wExtTexObjectStateOverrideiQCOM = (PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) get_proc("glExtTexObjectStateOverrideiQCOM"); + gles2wExtGetTexSubImageQCOM = (PFNGLEXTGETTEXSUBIMAGEQCOMPROC) get_proc("glExtGetTexSubImageQCOM"); + gles2wExtGetBufferPointervQCOM = (PFNGLEXTGETBUFFERPOINTERVQCOMPROC) get_proc("glExtGetBufferPointervQCOM"); + gles2wExtGetShadersQCOM = (PFNGLEXTGETSHADERSQCOMPROC) get_proc("glExtGetShadersQCOM"); + gles2wExtGetProgramsQCOM = (PFNGLEXTGETPROGRAMSQCOMPROC) get_proc("glExtGetProgramsQCOM"); + gles2wExtIsProgramBinaryQCOM = (PFNGLEXTISPROGRAMBINARYQCOMPROC) get_proc("glExtIsProgramBinaryQCOM"); + gles2wExtGetProgramBinarySourceQCOM = (PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) get_proc("glExtGetProgramBinarySourceQCOM"); + gles2wStartTilingQCOM = (PFNGLSTARTTILINGQCOMPROC) get_proc("glStartTilingQCOM"); + gles2wEndTilingQCOM = (PFNGLENDTILINGQCOMPROC) get_proc("glEndTilingQCOM"); +} diff --git a/native/cocos/renderer/gfx-gles3/GFXGLES3.h b/native/cocos/renderer/gfx-gles3/GFXGLES3.h new file mode 100644 index 0000000000..f18c86d731 --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GFXGLES3.h @@ -0,0 +1,7 @@ +#ifndef CC_GFXGLES3_GLES3_H_ +#define CC_GFXGLES3_GLES3_H_ + +#include "GLES3Std.h" +#include "GLES3Device.h" + +#endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3BindingLayout.cc b/native/cocos/renderer/gfx-gles3/GLES3BindingLayout.cc new file mode 100644 index 0000000000..a01b8f3d81 --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3BindingLayout.cc @@ -0,0 +1,78 @@ +#include "GLES3Std.h" +#include "GLES3BindingLayout.h" +#include "GLES3Commands.h" +#include "GLES3Buffer.h" +#include "GLES3TextureView.h" +#include "GLES3Sampler.h" + +CC_NAMESPACE_BEGIN + +GLES3BindingLayout::GLES3BindingLayout(GFXDevice* device) + : GFXBindingLayout(device), + gpu_binding_layout_(nullptr) { +} + +GLES3BindingLayout::~GLES3BindingLayout() { +} + +bool GLES3BindingLayout::Initialize(const GFXBindingLayoutInfo &info) { + + if (info.bindings.size()) { + binding_units_.resize(info.bindings.size()); + for (size_t i = 0; i < binding_units_.size(); ++i) { + GFXBindingUnit& binding_unit = binding_units_[i]; + const GFXBinding& binding = info.bindings[i]; + binding_unit.binding = binding.binding; + binding_unit.type = binding.type; + binding_unit.name = binding.name; + } + } + + gpu_binding_layout_ = CC_NEW(GLES3GPUBindingLayout); + gpu_binding_layout_->gpu_bindings.resize(binding_units_.size()); + for (size_t i = 0; i < gpu_binding_layout_->gpu_bindings.size(); ++i) { + GLES3GPUBinding& gpu_binding = gpu_binding_layout_->gpu_bindings[i]; + const GFXBindingUnit& binding_unit = binding_units_[i]; + gpu_binding.binding = binding_unit.binding; + gpu_binding.type = binding_unit.type; + gpu_binding.name = binding_unit.name; + } + + return true; +} + +void GLES3BindingLayout::Destroy() { + if (gpu_binding_layout_) { + CC_DELETE(gpu_binding_layout_); + gpu_binding_layout_ = nullptr; + } +} + +void GLES3BindingLayout::Update() { + if (is_dirty_ && gpu_binding_layout_) { + for (size_t i = 0; i < binding_units_.size(); ++i) { + GFXBindingUnit& binding_unit = binding_units_[i]; + switch (binding_unit.type) { + case GFXBindingType::UNIFORM_BUFFER: { + if (binding_unit.buffer) { + gpu_binding_layout_->gpu_bindings[i].gpu_buffer = ((GLES3Buffer*)binding_unit.buffer)->gpu_buffer(); + } + break; + } + case GFXBindingType::SAMPLER: { + if (binding_unit.tex_view) { + gpu_binding_layout_->gpu_bindings[i].gpu_tex_view = ((GLES3TextureView*)binding_unit.tex_view)->gpu_tex_view(); + } + if (binding_unit.sampler) { + gpu_binding_layout_->gpu_bindings[i].gpu_sampler = ((GLES3Sampler*)binding_unit.sampler)->gpu_sampler(); + } + break; + } + default:; + } + } + is_dirty_ = false; + } +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles3/GLES3BindingLayout.h b/native/cocos/renderer/gfx-gles3/GLES3BindingLayout.h new file mode 100644 index 0000000000..d63d4cb88a --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3BindingLayout.h @@ -0,0 +1,26 @@ +#ifndef CC_GFXGLES3_GLES3_BINDING_LAYOUT_H_ +#define CC_GFXGLES3_GLES3_BINDING_LAYOUT_H_ + +CC_NAMESPACE_BEGIN + +class GLES3GPUBindingLayout; + +class CC_GLES3_API GLES3BindingLayout : public GFXBindingLayout { + public: + GLES3BindingLayout(GFXDevice* device); + ~GLES3BindingLayout(); + + public: + bool Initialize(const GFXBindingLayoutInfo& info); + void Destroy(); + void Update(); + + CC_INLINE GLES3GPUBindingLayout* gpu_binding_layout() const { return gpu_binding_layout_; } + + private: + GLES3GPUBindingLayout* gpu_binding_layout_; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3Buffer.cc b/native/cocos/renderer/gfx-gles3/GLES3Buffer.cc new file mode 100644 index 0000000000..9f6950244a --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3Buffer.cc @@ -0,0 +1,92 @@ +#include "GLES3Std.h" +#include "GLES3Buffer.h" +#include "GLES3Commands.h" + +CC_NAMESPACE_BEGIN + +GLES3Buffer::GLES3Buffer(GFXDevice* device) + : GFXBuffer(device), + gpu_buffer_(nullptr) { +} + +GLES3Buffer::~GLES3Buffer() { +} + +bool GLES3Buffer::Initialize(const GFXBufferInfo& info) { + + usage_ = info.usage; + mem_usage_ = info.mem_usage; + size_ = info.size; + stride_ = std::max(info.stride, 1U); + count_ = size_ / stride_; + flags_ = info.flags; + + if ((flags_ & GFXBufferFlagBit::BAKUP_BUFFER) && size_ > 0) { + buffer_ = (uint8_t*)CC_MALLOC(size_); + device_->mem_status().buffer_size += size_; + } + + gpu_buffer_ = CC_NEW(GLES3GPUBuffer); + gpu_buffer_->usage = usage_; + gpu_buffer_->mem_usage = mem_usage_; + gpu_buffer_->size = size_; + gpu_buffer_->stride = stride_; + gpu_buffer_->count = count_; + + if (!(usage_ & GFXBufferUsageBit::INDIRECT)) { + gpu_buffer_->buffer = buffer_; + } + + GLES3CmdFuncCreateBuffer((GLES3Device*)device_, gpu_buffer_); + device_->mem_status().buffer_size += size_; + + return true; +} + +void GLES3Buffer::Destroy() { + if (gpu_buffer_) { + GLES3CmdFuncDestroyBuffer((GLES3Device*)device_, gpu_buffer_); + device_->mem_status().buffer_size -= size_; + CC_DELETE(gpu_buffer_); + gpu_buffer_ = nullptr; + } + + if (buffer_) { + CC_FREE(buffer_); + device_->mem_status().buffer_size -= size_; + buffer_ = nullptr; + } +} + +void GLES3Buffer::Resize(uint size) { + if (size_ != size) { + const uint old_size = size_; + size_ = size; + count_ = size_ / stride_; + + GFXMemoryStatus& status = device_->mem_status(); + gpu_buffer_->size = size_; + gpu_buffer_->count = count_; + GLES3CmdFuncResizeBuffer((GLES3Device*)device_, gpu_buffer_); + status.buffer_size -= old_size; + status.buffer_size += size_; + + if (buffer_) { + const uint8_t* old_buff = buffer_; + buffer_ = (uint8_t*)CC_MALLOC(size_); + memcpy(buffer_, old_buff, old_size); + CC_FREE(buffer_); + status.buffer_size -= old_size; + status.buffer_size += size_; + } + } +} + +void GLES3Buffer::Update(void* buffer, uint offset, uint size) { + if (buffer_) { + memcpy(buffer_ + offset, buffer, size); + } + GLES3CmdFuncUpdateBuffer((GLES3Device*)device_, gpu_buffer_, buffer, offset, size); +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles3/GLES3Buffer.h b/native/cocos/renderer/gfx-gles3/GLES3Buffer.h new file mode 100644 index 0000000000..282f106f4e --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3Buffer.h @@ -0,0 +1,27 @@ +#ifndef CC_GFXGLES3_GLES3_BUFFER_H_ +#define CC_GFXGLES3_GLES3_BUFFER_H_ + +CC_NAMESPACE_BEGIN + +class GLES3GPUBuffer; + +class CC_GLES3_API GLES3Buffer : public GFXBuffer { +public: + GLES3Buffer(GFXDevice* device); + ~GLES3Buffer(); + +public: + bool Initialize(const GFXBufferInfo& info); + void Destroy(); + void Resize(uint size); + void Update(void* buffer, uint offset, uint size); + + CC_INLINE GLES3GPUBuffer* gpu_buffer() const { return gpu_buffer_; } + +private: + GLES3GPUBuffer* gpu_buffer_; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3CommandAllocator.cc b/native/cocos/renderer/gfx-gles3/GLES3CommandAllocator.cc new file mode 100644 index 0000000000..94a9e8fc7b --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3CommandAllocator.cc @@ -0,0 +1,40 @@ +#include "GLES3Std.h" +#include "GLES3CommandAllocator.h" + +CC_NAMESPACE_BEGIN + +GLES3CommandAllocator::GLES3CommandAllocator(GFXDevice* device) + : GFXCommandAllocator(device) { +} + +GLES3CommandAllocator::~GLES3CommandAllocator() { +} + +bool GLES3CommandAllocator::Initialize(const GFXCommandAllocatorInfo& info) { + return true; +} + +void GLES3CommandAllocator::Destroy() { +} + +void GLES3CommandAllocator::ClearCmds(GLES3CmdPackage* cmd_package) { + if (cmd_package->begin_render_pass_cmds.Size()) { + begin_render_pass_cmd_pool.FreeCmds(cmd_package->begin_render_pass_cmds); + } + if (cmd_package->bind_states_cmds.Size()) { + bind_states_cmd_pool.FreeCmds(cmd_package->bind_states_cmds); + } + if (cmd_package->draw_cmds.Size()) { + draw_cmd_pool.FreeCmds(cmd_package->draw_cmds); + } + if (cmd_package->update_buffer_cmds.Size()) { + update_buffer_cmd_pool.FreeCmds(cmd_package->update_buffer_cmds); + } + if (cmd_package->copy_buffer_to_texture_cmds.Size()) { + copy_buffer_to_texture_cmd_pool.FreeCmds(cmd_package->copy_buffer_to_texture_cmds); + } + + cmd_package->cmd_types.Clear(); +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles3/GLES3CommandAllocator.h b/native/cocos/renderer/gfx-gles3/GLES3CommandAllocator.h new file mode 100644 index 0000000000..851f579adf --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3CommandAllocator.h @@ -0,0 +1,36 @@ +#ifndef CC_GFXGLES3_GLES3_COMMAND_ALLOCATOR_H_ +#define CC_GFXGLES3_GLES3_COMMAND_ALLOCATOR_H_ + +#include "GLES3CommandPool.h" + +CC_NAMESPACE_BEGIN + +class CC_GLES3_API GLES3CommandAllocator : public GFXCommandAllocator { +public: + GLES3CommandAllocator(GFXDevice* device); + ~GLES3CommandAllocator(); + + GLES3CommandPool begin_render_pass_cmd_pool; + GLES3CommandPool bind_states_cmd_pool; + GLES3CommandPool draw_cmd_pool; + GLES3CommandPool update_buffer_cmd_pool; + GLES3CommandPool copy_buffer_to_texture_cmd_pool; + +public: + bool Initialize(const GFXCommandAllocatorInfo& info); + void Destroy(); + + void ClearCmds(GLES3CmdPackage* cmd_package); + + CC_INLINE void ReleaseCmds() { + begin_render_pass_cmd_pool.Release(); + bind_states_cmd_pool.Release(); + draw_cmd_pool.Release(); + update_buffer_cmd_pool.Release(); + copy_buffer_to_texture_cmd_pool.Release(); + } +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3CommandBuffer.cc b/native/cocos/renderer/gfx-gles3/GLES3CommandBuffer.cc new file mode 100644 index 0000000000..a92edc196e --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3CommandBuffer.cc @@ -0,0 +1,324 @@ +#include "GLES3Std.h" +#include "GLES3CommandBuffer.h" +#include "GLES3CommandAllocator.h" +#include "GLES3Framebuffer.h" +#include "GLES3PipelineState.h" +#include "GLES3BindingLayout.h" +#include "GLES3InputAssembler.h" +#include "GLES3Buffer.h" +#include "GLES3Texture.h" + +CC_NAMESPACE_BEGIN + +GLES3CommandBuffer::GLES3CommandBuffer(GFXDevice* device) + : GFXCommandBuffer(device), + cmd_package_(nullptr), + gles3_allocator_(nullptr), + is_in_render_pass_(false), + cur_gpu_pso_(nullptr), + cur_gpu_bl_(nullptr), + cur_gpu_ia_(nullptr), + cur_line_width_(1.0f), + is_state_invalid_(false) { +} + +GLES3CommandBuffer::~GLES3CommandBuffer() { +} + +bool GLES3CommandBuffer::Initialize(const GFXCommandBufferInfo& info) { + + if (!info.allocator) { + return false; + } + + allocator_ = info.allocator; + gles3_allocator_ = (GLES3CommandAllocator*)info.allocator; + type_ = info.type; + + cmd_package_ = CC_NEW(GLES3CmdPackage); + + return true; +} + +void GLES3CommandBuffer::Destroy() { + if (gles3_allocator_) { + gles3_allocator_->ClearCmds(cmd_package_); + gles3_allocator_ = nullptr; + } + allocator_ = nullptr; + + CC_SAFE_DELETE(cmd_package_); +} + +void GLES3CommandBuffer::Begin() { + gles3_allocator_->ClearCmds(cmd_package_); + cur_gpu_pso_ = nullptr; + cur_gpu_bl_ = nullptr; + cur_gpu_ia_ = nullptr; + num_draw_calls_ = 0; + num_tris_ = 0; +} + +void GLES3CommandBuffer::End() { + if (is_state_invalid_) { + BindStates(); + } + is_in_render_pass_ = false; +} + +void GLES3CommandBuffer::BeginRenderPass(GFXFramebuffer* fbo, const GFXRect& render_area, GFXClearFlags clear_flags, GFXColor* colors, uint count, float depth, int stencil) { + is_in_render_pass_ = true; + + GLES3CmdBeginRenderPass* cmd = gles3_allocator_->begin_render_pass_cmd_pool.Alloc(); + cmd->gpu_fbo = ((GLES3Framebuffer*)fbo)->gpu_fbo(); + cmd->render_area = render_area; + cmd->clear_flags = clear_flags; + cmd->num_clear_colors = count; + for (uint i = 0; i < count; ++i) { + cmd->clear_colors[i] = colors[i]; + } + cmd->clear_depth = depth; + cmd->clear_stencil = stencil; + + cmd_package_->begin_render_pass_cmds.Push(cmd); + cmd_package_->cmd_types.Push(GLES3CmdType::BEGIN_RENDER_PASS); +} + +void GLES3CommandBuffer::EndRenderPass() { + is_in_render_pass_ = false; + cmd_package_->cmd_types.Push(GLES3CmdType::END_RENDER_PASS); +} + +void GLES3CommandBuffer::BindPipelineState(GFXPipelineState* pso) { + cur_gpu_pso_ = ((GLES3PipelineState*)pso)->gpu_pso(); + is_state_invalid_ = true; +} + + +void GLES3CommandBuffer::BindBindingLayout(GFXBindingLayout* layout) { + cur_gpu_bl_ = ((GLES3BindingLayout*)layout)->gpu_binding_layout(); + is_state_invalid_ = true; +} + +void GLES3CommandBuffer::BindInputAssembler(GFXInputAssembler* ia) { + cur_gpu_ia_ = ((GLES3InputAssembler*)ia)->gpu_input_assembler(); + is_state_invalid_ = true; +} + +void GLES3CommandBuffer::SetViewport(const GFXViewport& vp) { + + if ((cur_viewport_.left != vp.left) || + (cur_viewport_.top != vp.top) || + (cur_viewport_.width != vp.width) || + (cur_viewport_.height != vp.height) || + math::IsNotEqualF(cur_viewport_.minDepth, vp.minDepth) || + math::IsNotEqualF(cur_viewport_.maxDepth, vp.maxDepth)) { + cur_viewport_ = vp; + is_state_invalid_ = true; + } +} + +void GLES3CommandBuffer::SetScissor(const GFXRect& rect) { + if ((cur_scissor_.x != rect.x) || + (cur_scissor_.y != rect.y) || + (cur_scissor_.width != rect.width) || + (cur_scissor_.height != rect.height)) { + cur_scissor_ = rect; + is_state_invalid_ = true; + } +} + +void GLES3CommandBuffer::SetLineWidth(const float width) { + if (math::IsNotEqualF(cur_line_width_, width)) { + cur_line_width_ = width; + is_state_invalid_ = true; + } +} + +void GLES3CommandBuffer::SetDepthBias(float constant, float clamp, float slope) { + if (math::IsNotEqualF(cur_depth_bias_.constant, constant) || + math::IsNotEqualF(cur_depth_bias_.clamp, clamp) || + math::IsNotEqualF(cur_depth_bias_.slope, slope)) { + cur_depth_bias_.constant = constant; + cur_depth_bias_.clamp = clamp; + cur_depth_bias_.slope = slope; + is_state_invalid_ = true; + } +} + +void GLES3CommandBuffer::SetBlendConstants(const GFXColor& constants) { + if (math::IsNotEqualF(cur_blend_constants_.r, constants.r) || + math::IsNotEqualF(cur_blend_constants_.g, constants.g) || + math::IsNotEqualF(cur_blend_constants_.b, constants.b) || + math::IsNotEqualF(cur_blend_constants_.a, constants.a)) { + cur_blend_constants_.r = constants.r; + cur_blend_constants_.g = constants.g; + cur_blend_constants_.b = constants.b; + cur_blend_constants_.a = constants.a; + is_state_invalid_ = true; + } +} + +void GLES3CommandBuffer::SetDepthBounds(float min_bounds, float max_bounds) { + if (math::IsNotEqualF(cur_depth_bounds_.min_bounds, min_bounds) || + math::IsNotEqualF(cur_depth_bounds_.max_bounds, max_bounds)) { + cur_depth_bounds_.min_bounds = min_bounds; + cur_depth_bounds_.max_bounds = max_bounds; + is_state_invalid_ = true; + } +} + +void GLES3CommandBuffer::SetStencilWriteMask(GFXStencilFace face, uint mask) { + if ((cur_stencil_write_mask_.face != face) || + (cur_stencil_write_mask_.write_mask != mask)) { + cur_stencil_write_mask_.face = face; + cur_stencil_write_mask_.write_mask = mask; + is_state_invalid_ = true; + } +} + +void GLES3CommandBuffer::SetStencilCompareMask(GFXStencilFace face, int ref, uint mask) { + if ((cur_stencil_compare_mask_.face != face) || + (cur_stencil_compare_mask_.refrence != ref) || + (cur_stencil_compare_mask_.compare_mask != mask)) { + cur_stencil_compare_mask_.face = face; + cur_stencil_compare_mask_.refrence = ref; + cur_stencil_compare_mask_.compare_mask = mask; + is_state_invalid_ = true; + } +} + +void GLES3CommandBuffer::Draw(GFXInputAssembler* ia) { + if ((type_ == GFXCommandBufferType::PRIMARY && is_in_render_pass_) || + (type_ == GFXCommandBufferType::SECONDARY)) { + if (is_state_invalid_) { + BindStates(); + } + + GLES3CmdDraw* cmd = gles3_allocator_->draw_cmd_pool.Alloc(); + ((GLES3InputAssembler*)ia)->ExtractCmdDraw(cmd); + cmd_package_->draw_cmds.Push(cmd); + cmd_package_->cmd_types.Push(GLES3CmdType::DRAW); + + ++num_draw_calls_; + if(cur_gpu_pso_) { + switch (cur_gpu_pso_->gl_primitive) { + case GL_TRIANGLES: { + num_tris_ += ia->index_count() / 3 * std::max(ia->instance_count(), 1U); + break; + } + case GL_TRIANGLE_STRIP: + case GL_TRIANGLE_FAN: { + num_tris_ += (ia->index_count() - 2) * std::max(ia->instance_count(), 1U); + break; + } + default: + break; + } + } + } else { + CC_LOG_ERROR("Command 'Draw' must be recorded inside a render pass."); + } +} + +void GLES3CommandBuffer::UpdateBuffer(GFXBuffer* buff, void* data, uint size, uint offset) { + if ((type_ == GFXCommandBufferType::PRIMARY && is_in_render_pass_) || + (type_ == GFXCommandBufferType::SECONDARY)) { + GLES3GPUBuffer* gpu_buffer = ((GLES3Buffer*)buff)->gpu_buffer(); + if (gpu_buffer) { + GLES3CmdUpdateBuffer* cmd = gles3_allocator_->update_buffer_cmd_pool.Alloc(); + cmd->gpu_buffer = gpu_buffer; + cmd->buffer = (uint8_t*)data; + cmd->size = size; + cmd->offset = offset; + + cmd_package_->update_buffer_cmds.Push(cmd); + cmd_package_->cmd_types.Push(GLES3CmdType::UPDATE_BUFFER); + } + } else { + CC_LOG_ERROR("Command 'UpdateBuffer' must be recorded inside a render pass."); + } +} + +void GLES3CommandBuffer::CopyBufferToTexture(GFXBuffer* src, GFXTexture* dst, GFXTextureLayout layout, GFXBufferTextureCopy* regions, uint count) { + if ((type_ == GFXCommandBufferType::PRIMARY && is_in_render_pass_) || + (type_ == GFXCommandBufferType::SECONDARY)) { + GLES3GPUBuffer* gpu_buffer = ((GLES3Buffer*)src)->gpu_buffer(); + GLES3GPUTexture* gpu_texture = ((GLES3Texture*)dst)->gpu_texture(); + if (gpu_buffer && gpu_texture) { + GLES3CmdCopyBufferToTexture* cmd = gles3_allocator_->copy_buffer_to_texture_cmd_pool.Alloc(); + cmd->gpu_buffer = gpu_buffer; + cmd->gpu_texture = gpu_texture; + cmd->dst_layout = layout; + cmd->regions.resize(count); + for (uint i = 0; i < count; ++i) { + cmd->regions[i] = regions[i]; + } + + cmd_package_->copy_buffer_to_texture_cmds.Push(cmd); + cmd_package_->cmd_types.Push(GLES3CmdType::COPY_BUFFER_TO_TEXTURE); + } + } else { + CC_LOG_ERROR("Command 'CopyBufferToTexture' must be recorded inside a render pass."); + } +} + +void GLES3CommandBuffer::Execute(GFXCommandBuffer** cmd_buffs, uint count) { + for (uint i = 0; i < count; ++i) { + GLES3CommandBuffer* cmd_buff = (GLES3CommandBuffer*)cmd_buffs[i]; + + for (uint j = 0; j < cmd_buff->cmd_package_->begin_render_pass_cmds.Size(); ++j) { + GLES3CmdBeginRenderPass* cmd = cmd_buff->cmd_package_->begin_render_pass_cmds[j]; + ++cmd->ref_count; + cmd_buff->cmd_package_->begin_render_pass_cmds.Push(cmd); + } + for (uint j = 0; j < cmd_buff->cmd_package_->bind_states_cmds.Size(); ++j) { + GLES3CmdBindStates* cmd = cmd_buff->cmd_package_->bind_states_cmds[j]; + ++cmd->ref_count; + cmd_buff->cmd_package_->bind_states_cmds.Push(cmd); + } + for (uint j = 0; j < cmd_buff->cmd_package_->draw_cmds.Size(); ++j) { + GLES3CmdDraw* cmd = cmd_buff->cmd_package_->draw_cmds[j]; + ++cmd->ref_count; + cmd_buff->cmd_package_->draw_cmds.Push(cmd); + } + for (uint j = 0; j < cmd_buff->cmd_package_->update_buffer_cmds.Size(); ++j) { + GLES3CmdUpdateBuffer* cmd = cmd_buff->cmd_package_->update_buffer_cmds[j]; + ++cmd->ref_count; + cmd_buff->cmd_package_->update_buffer_cmds.Push(cmd); + } + for (uint j = 0; j < cmd_buff->cmd_package_->copy_buffer_to_texture_cmds.Size(); ++j) { + GLES3CmdCopyBufferToTexture* cmd = cmd_buff->cmd_package_->copy_buffer_to_texture_cmds[j]; + ++cmd->ref_count; + cmd_buff->cmd_package_->copy_buffer_to_texture_cmds.Push(cmd); + } + cmd_package_->cmd_types.Concat(cmd_buff->cmd_package_->cmd_types); + + num_draw_calls_ += cmd_buff->num_draw_calls(); + num_tris_ += cmd_buff->num_tris(); + } +} + +void GLES3CommandBuffer::BindStates() { + GLES3CmdBindStates* cmd = gles3_allocator_->bind_states_cmd_pool.Alloc(); + cmd->gpu_pso = cur_gpu_pso_; + cmd->gpu_binding_layout = cur_gpu_bl_; + cmd->gpu_ia = cur_gpu_ia_; + cmd->viewport = cur_viewport_; + cmd->scissor = cur_scissor_; + cmd->line_width = cur_line_width_; + cmd->depth_bias = cur_depth_bias_; + cmd->blend_constants.r = cur_blend_constants_.r; + cmd->blend_constants.g = cur_blend_constants_.g; + cmd->blend_constants.b = cur_blend_constants_.b; + cmd->blend_constants.a = cur_blend_constants_.a; + cmd->depth_bounds = cur_depth_bounds_; + cmd->stencil_write_mask = cur_stencil_write_mask_; + cmd->stencil_compare_mask = cur_stencil_compare_mask_; + + cmd_package_->bind_states_cmds.Push(cmd); + cmd_package_->cmd_types.Push(GLES3CmdType::BIND_STATES); + is_state_invalid_ = false; +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles3/GLES3CommandBuffer.h b/native/cocos/renderer/gfx-gles3/GLES3CommandBuffer.h new file mode 100644 index 0000000000..f5b2617301 --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3CommandBuffer.h @@ -0,0 +1,64 @@ +#ifndef CC_GFXGLES3_GLES3_COMMAND_BUFFER_H_ +#define CC_GFXGLES3_GLES3_COMMAND_BUFFER_H_ + +#include "GLES3Commands.h" + +CC_NAMESPACE_BEGIN + +class GLES3CommandAllocator; + +class CC_GLES3_API GLES3CommandBuffer : public GFXCommandBuffer { + public: + GLES3CommandBuffer(GFXDevice* device); + ~GLES3CommandBuffer(); + + friend class GLES3Queue; + + public: + bool Initialize(const GFXCommandBufferInfo& info); + void Destroy(); + + void Begin(); + void End(); + void BeginRenderPass(GFXFramebuffer* fbo, const GFXRect& render_area, GFXClearFlags clear_flags, GFXColor* colors, uint count, float depth, int stencil); + void EndRenderPass(); + void BindPipelineState(GFXPipelineState* pso); + void BindBindingLayout(GFXBindingLayout* layout); + void BindInputAssembler(GFXInputAssembler* ia); + void SetViewport(const GFXViewport& vp); + void SetScissor(const GFXRect& rect); + void SetLineWidth(const float width); + void SetDepthBias(float constant, float clamp, float slope); + void SetBlendConstants(const GFXColor& constants); + void SetDepthBounds(float min_bounds, float max_bounds); + void SetStencilWriteMask(GFXStencilFace face, uint mask); + void SetStencilCompareMask(GFXStencilFace face, int ref, uint mask); + void Draw(GFXInputAssembler* ia); + void UpdateBuffer(GFXBuffer* buff, void* data, uint size, uint offset); + void CopyBufferToTexture(GFXBuffer* src, GFXTexture* dst, GFXTextureLayout layout, GFXBufferTextureCopy* regions, uint count); + void Execute(GFXCommandBuffer** cmd_buffs, uint count); + + private: + void BindStates(); + + private: + GLES3CmdPackage* cmd_package_; + GLES3CommandAllocator* gles3_allocator_; + bool is_in_render_pass_; + GLES3GPUPipelineState* cur_gpu_pso_; + GLES3GPUBindingLayout* cur_gpu_bl_; + GLES3GPUInputAssembler* cur_gpu_ia_; + GFXViewport cur_viewport_; + GFXRect cur_scissor_; + float cur_line_width_; + GLES3DepthBias cur_depth_bias_; + GFXColor cur_blend_constants_; + GLES3DepthBounds cur_depth_bounds_; + GLES3StencilWriteMask cur_stencil_write_mask_; + GLES3StencilCompareMask cur_stencil_compare_mask_; + bool is_state_invalid_; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3CommandPool.h b/native/cocos/renderer/gfx-gles3/GLES3CommandPool.h new file mode 100644 index 0000000000..7a5dc6125b --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3CommandPool.h @@ -0,0 +1,89 @@ +#ifndef CC_GFXGLES3_GLES3_COMMAND_POOL_H_ +#define CC_GFXGLES3_GLES3_COMMAND_POOL_H_ + +#include "GLES3Commands.h" + +CC_NAMESPACE_BEGIN + +template ::value>> +class GLES3CommandPool { + public: + GLES3CommandPool(): free_cmds_(1) { + frees_ = new T*[1]; + count_ = 1; + free_idx_ = 0; + for (uint i = 0; i < count_; ++i) { + frees_[i] = CC_NEW(T); + } + } + + ~GLES3CommandPool() { + for (uint i = 0; i < count_; ++i) { + CC_DELETE(frees_[i]); + } + delete [] (frees_); + + for (uint i = 0; i < free_cmds_.Size(); ++i) { + CC_DELETE(free_cmds_[i]); + } + free_cmds_.Clear(); + } + + T* Alloc() { + if (free_idx_ < 0) { + T** old_frees = frees_; + uint size = count_ * 2; + frees_ = new T*[size]; + uint increase = size - count_; + for (uint i = 0; i < increase; ++i) { + frees_[i] = CC_NEW(T); + } + for (uint i = increase, j = 0; i < size; ++i, ++j) { + frees_[i] = old_frees[j]; + } + delete [] (old_frees); + + count_ = size; + free_idx_ += (int)increase; + } + + T* cmd = frees_[free_idx_]; + frees_[free_idx_--] = nullptr; + ++cmd->ref_count; + return cmd; + } + + void Free(T* cmd) { + if (--cmd->ref_count == 0) { + free_cmds_.Push(cmd); + } + } + + void FreeCmds(CachedArray& cmds) { + for (uint i = 0; i < cmds.Size(); ++i) { + if (--cmds[i]->ref_count == 0) { + free_cmds_.Push(cmds[i]); + } + } + cmds.Clear(); + } + + void Release() { + for (uint i = 0; i < free_cmds_.Size(); ++i) { + T* cmd = free_cmds_[i]; + cmd->Clear(); + frees_[++free_idx_] = cmd; + } + free_cmds_.Clear(); + } + + private: + T** frees_ = nullptr; + uint count_ = 0; + CachedArray free_cmds_; + int free_idx_ = 0; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3Commands.cc b/native/cocos/renderer/gfx-gles3/GLES3Commands.cc new file mode 100644 index 0000000000..ea6f3f2baf --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3Commands.cc @@ -0,0 +1,1985 @@ +#include "GLES3Std.h" +#include "GLES3Commands.h" +#include "GLES3Device.h" +#include "GLES3StateCache.h" + +#define BUFFER_OFFSET(idx) (static_cast(0) + (idx)) + +CC_NAMESPACE_BEGIN + +GLenum MapGLInternalFormat(GFXFormat format) { + switch (format) { + case GFXFormat::A8: return GL_ALPHA; + case GFXFormat::L8: return GL_LUMINANCE; + case GFXFormat::LA8: return GL_LUMINANCE_ALPHA; + case GFXFormat::R8: return GL_R8; + case GFXFormat::R8SN: return GL_R8_SNORM; + case GFXFormat::R8UI: return GL_R8UI; + case GFXFormat::R8I: return GL_R8I; + case GFXFormat::RG8: return GL_RG8; + case GFXFormat::RG8SN: return GL_RG8_SNORM; + case GFXFormat::RG8UI: return GL_RG8UI; + case GFXFormat::RG8I: return GL_RG8I; + case GFXFormat::RGB8: return GL_RGB8; + case GFXFormat::RGB8SN: return GL_RGB8_SNORM; + case GFXFormat::RGB8UI: return GL_RGB8UI; + case GFXFormat::RGB8I: return GL_RGB8I; + case GFXFormat::RGBA8: return GL_RGBA8; + case GFXFormat::RGBA8SN: return GL_RGBA8_SNORM; + case GFXFormat::RGBA8UI: return GL_RGBA8UI; + case GFXFormat::RGBA8I: return GL_RGBA8I; + case GFXFormat::R16I: return GL_R16I; + case GFXFormat::R16UI: return GL_R16UI; + case GFXFormat::R16F: return GL_R16F; + case GFXFormat::RG16I: return GL_RG16I; + case GFXFormat::RG16UI: return GL_RG16UI; + case GFXFormat::RG16F: return GL_RG16F; + case GFXFormat::RGB16I: return GL_RGB16I; + case GFXFormat::RGB16UI: return GL_RGB16UI; + case GFXFormat::RGB16F: return GL_RGB16F; + case GFXFormat::RGBA16I: return GL_RGBA16I; + case GFXFormat::RGBA16UI: return GL_RGBA16UI; + case GFXFormat::RGBA16F: return GL_RGBA16F; + case GFXFormat::R32I: return GL_R32I; + case GFXFormat::R32UI: return GL_R32UI; + case GFXFormat::R32F: return GL_R32F; + case GFXFormat::RG32I: return GL_RG32I; + case GFXFormat::RG32UI: return GL_RG32UI; + case GFXFormat::RG32F: return GL_RG32F; + case GFXFormat::RGB32I: return GL_RGB32I; + case GFXFormat::RGB32UI: return GL_RGB32UI; + case GFXFormat::RGB32F: return GL_RGB32F; + case GFXFormat::RGBA32I: return GL_RGBA32I; + case GFXFormat::RGBA32UI: return GL_RGBA32UI; + case GFXFormat::RGBA32F: return GL_RGBA32F; + case GFXFormat::R5G6B5: return GL_RGB565; + case GFXFormat::RGB5A1: return GL_RGB5_A1; + case GFXFormat::RGBA4: return GL_RGBA4; + case GFXFormat::RGB10A2: return GL_RGB10_A2; + case GFXFormat::RGB10A2UI: return GL_RGB10_A2UI; + case GFXFormat::R11G11B10F: return GL_R11F_G11F_B10F; + case GFXFormat::D16: return GL_DEPTH_COMPONENT16; + case GFXFormat::D16S8: return GL_DEPTH_STENCIL; + case GFXFormat::D24: return GL_DEPTH_COMPONENT24; + case GFXFormat::D24S8: return GL_DEPTH24_STENCIL8; + case GFXFormat::D32F: return GL_DEPTH_COMPONENT32F; + case GFXFormat::D32F_S8: return GL_DEPTH32F_STENCIL8; + + case GFXFormat::BC1: return GL_COMPRESSED_RGB_S3TC_DXT1_EXT; + case GFXFormat::BC1_ALPHA: return GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; + case GFXFormat::BC1_SRGB: return GL_COMPRESSED_SRGB_S3TC_DXT1_EXT; + case GFXFormat::BC1_SRGB_ALPHA: return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT; + case GFXFormat::BC2: return GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; + case GFXFormat::BC2_SRGB: return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT; + case GFXFormat::BC3: return GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; + case GFXFormat::BC3_SRGB: return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT; + + case GFXFormat::ETC_RGB8: return GL_ETC1_RGB8_OES; + case GFXFormat::ETC2_RGB8: return GL_COMPRESSED_RGB8_ETC2; + case GFXFormat::ETC2_SRGB8: return GL_COMPRESSED_SRGB8_ETC2; + case GFXFormat::ETC2_RGB8_A1: return GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2; + case GFXFormat::ETC2_SRGB8_A1: return GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2; + case GFXFormat::ETC2_RGBA8: return GL_COMPRESSED_RGBA8_ETC2_EAC; + case GFXFormat::ETC2_SRGB8_A8: return GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC; + case GFXFormat::EAC_R11: return GL_COMPRESSED_R11_EAC; + case GFXFormat::EAC_R11SN: return GL_COMPRESSED_SIGNED_R11_EAC; + case GFXFormat::EAC_RG11: return GL_COMPRESSED_RG11_EAC; + case GFXFormat::EAC_RG11SN: return GL_COMPRESSED_SIGNED_RG11_EAC; + + case GFXFormat::PVRTC_RGB2: return GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG; + case GFXFormat::PVRTC_RGBA2: return GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; + case GFXFormat::PVRTC_RGB4: return GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG; + case GFXFormat::PVRTC_RGBA4: return GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; + + default: { + CC_ASSERTS(false, "Unsupported GFXFormat, convert to GL internal format failed."); + return GL_RGBA; + } + } +} + +GLenum MapGLFormat(GFXFormat format) { + switch (format) { + case GFXFormat::A8: return GL_ALPHA; + case GFXFormat::L8: return GL_LUMINANCE; + case GFXFormat::LA8: return GL_LUMINANCE_ALPHA; + case GFXFormat::R8: + case GFXFormat::R8SN: + case GFXFormat::R8UI: + case GFXFormat::R8I: return GL_RED; + case GFXFormat::RG8: + case GFXFormat::RG8SN: + case GFXFormat::RG8UI: + case GFXFormat::RG8I: return GL_RG; + case GFXFormat::RGB8: + case GFXFormat::RGB8SN: + case GFXFormat::RGB8UI: + case GFXFormat::RGB8I: return GL_RGB; + case GFXFormat::RGBA8: + case GFXFormat::RGBA8SN: + case GFXFormat::RGBA8UI: + case GFXFormat::RGBA8I: return GL_RGBA; + case GFXFormat::R16UI: + case GFXFormat::R16I: + case GFXFormat::R16F: return GL_RED; + case GFXFormat::RG16UI: + case GFXFormat::RG16I: + case GFXFormat::RG16F: return GL_RG; + case GFXFormat::RGB16UI: + case GFXFormat::RGB16I: + case GFXFormat::RGB16F: return GL_RGB; + case GFXFormat::RGBA16UI: + case GFXFormat::RGBA16I: + case GFXFormat::RGBA16F: return GL_RGBA; + case GFXFormat::R32UI: + case GFXFormat::R32I: + case GFXFormat::R32F: return GL_RED; + case GFXFormat::RG32UI: + case GFXFormat::RG32I: + case GFXFormat::RG32F: return GL_RG; + case GFXFormat::RGB32UI: + case GFXFormat::RGB32I: + case GFXFormat::RGB32F: return GL_RGB; + case GFXFormat::RGBA32UI: + case GFXFormat::RGBA32I: + case GFXFormat::RGBA32F: return GL_RGBA; + case GFXFormat::RGB10A2: return GL_RGBA; + case GFXFormat::R11G11B10F: return GL_RGB; + case GFXFormat::R5G6B5: return GL_RGB; + case GFXFormat::RGB5A1: return GL_RGBA; + case GFXFormat::RGBA4: return GL_RGBA; + case GFXFormat::D16: return GL_DEPTH_COMPONENT; + case GFXFormat::D16S8: return GL_DEPTH_STENCIL; + case GFXFormat::D24: return GL_DEPTH_COMPONENT; + case GFXFormat::D24S8: return GL_DEPTH_STENCIL; + case GFXFormat::D32F: return GL_DEPTH_COMPONENT; + case GFXFormat::D32F_S8: return GL_DEPTH_STENCIL; + + case GFXFormat::BC1: return GL_COMPRESSED_RGB_S3TC_DXT1_EXT; + case GFXFormat::BC1_ALPHA: return GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; + case GFXFormat::BC1_SRGB: return GL_COMPRESSED_SRGB_S3TC_DXT1_EXT; + case GFXFormat::BC1_SRGB_ALPHA: return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT; + case GFXFormat::BC2: return GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; + case GFXFormat::BC2_SRGB: return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT; + case GFXFormat::BC3: return GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; + case GFXFormat::BC3_SRGB: return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT; + + case GFXFormat::ETC_RGB8: return GL_ETC1_RGB8_OES; + + case GFXFormat::PVRTC_RGB2: return GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG; + case GFXFormat::PVRTC_RGBA2: return GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG; + case GFXFormat::PVRTC_RGB4: return GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG; + case GFXFormat::PVRTC_RGBA4: return GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG; + + default: { + CC_ASSERTS(false, "Unsupported GFXFormat, convert to WebGL format failed."); + return GL_RGBA; + } + } +} + +GLenum MapGLType(GFXType type) { + switch (type) { + case GFXType::BOOL: return GL_BOOL; + case GFXType::BOOL2: return GL_BOOL_VEC2; + case GFXType::BOOL3: return GL_BOOL_VEC3; + case GFXType::BOOL4: return GL_BOOL_VEC4; + case GFXType::INT: return GL_INT; + case GFXType::INT2: return GL_INT_VEC2; + case GFXType::INT3: return GL_INT_VEC3; + case GFXType::INT4: return GL_INT_VEC4; + case GFXType::UINT: return GL_UNSIGNED_INT; + case GFXType::FLOAT: return GL_FLOAT; + case GFXType::FLOAT2: return GL_FLOAT_VEC2; + case GFXType::FLOAT3: return GL_FLOAT_VEC3; + case GFXType::FLOAT4: return GL_FLOAT_VEC4; + case GFXType::MAT2: return GL_FLOAT_MAT2; + case GFXType::MAT2X3: return GL_FLOAT_MAT2x3; + case GFXType::MAT2X4: return GL_FLOAT_MAT2x4; + case GFXType::MAT3X2: return GL_FLOAT_MAT3x2; + case GFXType::MAT3: return GL_FLOAT_MAT3; + case GFXType::MAT3X4: return GL_FLOAT_MAT3x4; + case GFXType::MAT4X2: return GL_FLOAT_MAT4x2; + case GFXType::MAT4X3: return GL_FLOAT_MAT4x3; + case GFXType::MAT4: return GL_FLOAT_MAT4; + case GFXType::SAMPLER2D: return GL_SAMPLER_2D; + case GFXType::SAMPLER2D_ARRAY: return GL_SAMPLER_2D_ARRAY; + case GFXType::SAMPLER3D: return GL_SAMPLER_3D; + case GFXType::SAMPLER_CUBE: return GL_SAMPLER_CUBE; + default: { + CC_ASSERTS(false, "Unsupported GLType, convert to GL type failed."); + return GL_NONE; + } + } +} + +GFXType MapGFXType(GLenum gl_type) { + switch (gl_type) { + case GL_BOOL: return GFXType::BOOL; + case GL_BOOL_VEC2: return GFXType::BOOL2; + case GL_BOOL_VEC3: return GFXType::BOOL3; + case GL_BOOL_VEC4: return GFXType::BOOL4; + case GL_INT: return GFXType::INT; + case GL_INT_VEC2: return GFXType::INT2; + case GL_INT_VEC3: return GFXType::INT3; + case GL_INT_VEC4: return GFXType::INT4; + case GL_UNSIGNED_INT: return GFXType::UINT; + case GL_UNSIGNED_INT_VEC2: return GFXType::UINT2; + case GL_UNSIGNED_INT_VEC3: return GFXType::UINT3; + case GL_UNSIGNED_INT_VEC4: return GFXType::UINT4; + case GL_FLOAT: return GFXType::FLOAT; + case GL_FLOAT_VEC2: return GFXType::FLOAT2; + case GL_FLOAT_VEC3: return GFXType::FLOAT3; + case GL_FLOAT_VEC4: return GFXType::FLOAT4; + case GL_FLOAT_MAT2: return GFXType::MAT2; + case GL_FLOAT_MAT2x3: return GFXType::MAT2X3; + case GL_FLOAT_MAT2x4: return GFXType::MAT2X4; + case GL_FLOAT_MAT3x2: return GFXType::MAT3X2; + case GL_FLOAT_MAT3: return GFXType::MAT3; + case GL_FLOAT_MAT3x4: return GFXType::MAT3X4; + case GL_FLOAT_MAT4x2: return GFXType::MAT4X2; + case GL_FLOAT_MAT4x3: return GFXType::MAT4X3; + case GL_FLOAT_MAT4: return GFXType::MAT4; + case GL_SAMPLER_2D: return GFXType::SAMPLER2D; + case GL_SAMPLER_2D_ARRAY: return GFXType::SAMPLER2D_ARRAY; + case GL_SAMPLER_3D: return GFXType::SAMPLER3D; + case GL_SAMPLER_CUBE: return GFXType::SAMPLER_CUBE; + default: { + CC_ASSERTS(false, "Unsupported GLType, convert to GFXType failed."); + return GFXType::UNKNOWN; + } + } +} + +GLenum GFXFormatToGLType(GFXFormat format) { + switch (format) { + case GFXFormat::R8: return GL_UNSIGNED_BYTE; + case GFXFormat::R8SN: return GL_BYTE; + case GFXFormat::R8UI: return GL_UNSIGNED_BYTE; + case GFXFormat::R8I: return GL_BYTE; + case GFXFormat::R16F: return GL_HALF_FLOAT; + case GFXFormat::R16UI: return GL_UNSIGNED_SHORT; + case GFXFormat::R16I: return GL_SHORT; + case GFXFormat::R32F: return GL_FLOAT; + case GFXFormat::R32UI: return GL_UNSIGNED_INT; + case GFXFormat::R32I: return GL_INT; + + case GFXFormat::RG8: return GL_UNSIGNED_BYTE; + case GFXFormat::RG8SN: return GL_BYTE; + case GFXFormat::RG8UI: return GL_UNSIGNED_BYTE; + case GFXFormat::RG8I: return GL_BYTE; + case GFXFormat::RG16F: return GL_HALF_FLOAT; + case GFXFormat::RG16UI: return GL_UNSIGNED_SHORT; + case GFXFormat::RG16I: return GL_SHORT; + case GFXFormat::RG32F: return GL_FLOAT; + case GFXFormat::RG32UI: return GL_UNSIGNED_INT; + case GFXFormat::RG32I: return GL_INT; + + case GFXFormat::RGB8: return GL_UNSIGNED_BYTE; + case GFXFormat::SRGB8: return GL_UNSIGNED_BYTE; + case GFXFormat::RGB8SN: return GL_BYTE; + case GFXFormat::RGB8UI: return GL_UNSIGNED_BYTE; + case GFXFormat::RGB8I: return GL_BYTE; + case GFXFormat::RGB16F: return GL_HALF_FLOAT; + case GFXFormat::RGB16UI: return GL_UNSIGNED_SHORT; + case GFXFormat::RGB16I: return GL_SHORT; + case GFXFormat::RGB32F: return GL_FLOAT; + case GFXFormat::RGB32UI: return GL_UNSIGNED_INT; + case GFXFormat::RGB32I: return GL_INT; + + case GFXFormat::RGBA8: return GL_UNSIGNED_BYTE; + case GFXFormat::SRGB8_A8: return GL_UNSIGNED_BYTE; + case GFXFormat::RGBA8SN: return GL_BYTE; + case GFXFormat::RGBA8UI: return GL_UNSIGNED_BYTE; + case GFXFormat::RGBA8I: return GL_BYTE; + case GFXFormat::RGBA16F: return GL_HALF_FLOAT; + case GFXFormat::RGBA16UI: return GL_UNSIGNED_SHORT; + case GFXFormat::RGBA16I: return GL_SHORT; + case GFXFormat::RGBA32F: return GL_FLOAT; + case GFXFormat::RGBA32UI: return GL_UNSIGNED_INT; + case GFXFormat::RGBA32I: return GL_INT; + + case GFXFormat::R5G6B5: return GL_UNSIGNED_SHORT_5_6_5; + case GFXFormat::R11G11B10F: return GL_UNSIGNED_INT_10F_11F_11F_REV; + case GFXFormat::RGB5A1: return GL_UNSIGNED_SHORT_5_5_5_1; + case GFXFormat::RGBA4: return GL_UNSIGNED_SHORT_4_4_4_4; + case GFXFormat::RGB10A2: return GL_UNSIGNED_INT_2_10_10_10_REV; + case GFXFormat::RGB10A2UI: return GL_UNSIGNED_INT_2_10_10_10_REV; + case GFXFormat::RGB9E5: return GL_FLOAT; + + case GFXFormat::D16: return GL_UNSIGNED_SHORT; + case GFXFormat::D16S8: return GL_UNSIGNED_SHORT; + case GFXFormat::D24: return GL_UNSIGNED_INT; + case GFXFormat::D24S8: return GL_UNSIGNED_INT_24_8; + case GFXFormat::D32F: return GL_FLOAT; + case GFXFormat::D32F_S8: return GL_FLOAT_32_UNSIGNED_INT_24_8_REV; + + case GFXFormat::BC1: return GL_UNSIGNED_BYTE; + case GFXFormat::BC1_SRGB: return GL_UNSIGNED_BYTE; + case GFXFormat::BC2: return GL_UNSIGNED_BYTE; + case GFXFormat::BC2_SRGB: return GL_UNSIGNED_BYTE; + case GFXFormat::BC3: return GL_UNSIGNED_BYTE; + case GFXFormat::BC3_SRGB: return GL_UNSIGNED_BYTE; + case GFXFormat::BC4: return GL_UNSIGNED_BYTE; + case GFXFormat::BC4_SNORM: return GL_BYTE; + case GFXFormat::BC5: return GL_UNSIGNED_BYTE; + case GFXFormat::BC5_SNORM: return GL_BYTE; + case GFXFormat::BC6H_SF16: return GL_FLOAT; + case GFXFormat::BC6H_UF16: return GL_FLOAT; + case GFXFormat::BC7: return GL_UNSIGNED_BYTE; + case GFXFormat::BC7_SRGB: return GL_UNSIGNED_BYTE; + + case GFXFormat::ETC_RGB8: return GL_UNSIGNED_BYTE; + case GFXFormat::ETC2_RGB8: return GL_UNSIGNED_BYTE; + case GFXFormat::ETC2_SRGB8: return GL_UNSIGNED_BYTE; + case GFXFormat::ETC2_RGB8_A1: return GL_UNSIGNED_BYTE; + case GFXFormat::ETC2_SRGB8_A1: return GL_UNSIGNED_BYTE; + case GFXFormat::EAC_R11: return GL_UNSIGNED_BYTE; + case GFXFormat::EAC_R11SN: return GL_BYTE; + case GFXFormat::EAC_RG11: return GL_UNSIGNED_BYTE; + case GFXFormat::EAC_RG11SN: return GL_BYTE; + + case GFXFormat::PVRTC_RGB2: return GL_UNSIGNED_BYTE; + case GFXFormat::PVRTC_RGBA2: return GL_UNSIGNED_BYTE; + case GFXFormat::PVRTC_RGB4: return GL_UNSIGNED_BYTE; + case GFXFormat::PVRTC_RGBA4: return GL_UNSIGNED_BYTE; + case GFXFormat::PVRTC2_2BPP: return GL_UNSIGNED_BYTE; + case GFXFormat::PVRTC2_4BPP: return GL_UNSIGNED_BYTE; + + default: { + return GL_UNSIGNED_BYTE; + } + } +} + +uint GLTypeSize(GLenum gl_type) { + switch (gl_type) { + case GL_BOOL: return 4; + case GL_BOOL_VEC2: return 8; + case GL_BOOL_VEC3: return 12; + case GL_BOOL_VEC4: return 16; + case GL_INT: return 4; + case GL_INT_VEC2: return 8; + case GL_INT_VEC3: return 12; + case GL_INT_VEC4: return 16; + case GL_UNSIGNED_INT: return 4; + case GL_UNSIGNED_INT_VEC2: return 8; + case GL_UNSIGNED_INT_VEC3: return 12; + case GL_UNSIGNED_INT_VEC4: return 16; + case GL_FLOAT: return 4; + case GL_FLOAT_VEC2: return 8; + case GL_FLOAT_VEC3: return 12; + case GL_FLOAT_VEC4: return 16; + case GL_FLOAT_MAT2: return 16; + case GL_FLOAT_MAT2x3: return 24; + case GL_FLOAT_MAT2x4: return 32; + case GL_FLOAT_MAT3x2: return 24; + case GL_FLOAT_MAT3: return 36; + case GL_FLOAT_MAT3x4: return 48; + case GL_FLOAT_MAT4x2: return 32; + case GL_FLOAT_MAT4x3: return 48; + case GL_FLOAT_MAT4: return 64; + case GL_SAMPLER_2D: return 4; + case GL_SAMPLER_2D_ARRAY: return 4; + case GL_SAMPLER_2D_ARRAY_SHADOW: return 4; + case GL_SAMPLER_3D: return 4; + case GL_SAMPLER_CUBE: return 4; + case GL_INT_SAMPLER_2D: return 4; + case GL_INT_SAMPLER_2D_ARRAY: return 4; + case GL_INT_SAMPLER_3D: return 4; + case GL_INT_SAMPLER_CUBE: return 4; + case GL_UNSIGNED_INT_SAMPLER_2D: return 4; + case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY: return 4; + case GL_UNSIGNED_INT_SAMPLER_3D: return 4; + case GL_UNSIGNED_INT_SAMPLER_CUBE: return 4; + default: { + CC_ASSERTS(false, "Unsupported GLType, get type failed."); + return 0; + } + } +} + +uint GLComponentCount (GLenum gl_type) { + switch (gl_type) { + case GL_FLOAT_MAT2: return 2; + case GL_FLOAT_MAT2x3: return 2; + case GL_FLOAT_MAT2x4: return 2; + case GL_FLOAT_MAT3x2: return 3; + case GL_FLOAT_MAT3: return 3; + case GL_FLOAT_MAT3x4: return 3; + case GL_FLOAT_MAT4x2: return 4; + case GL_FLOAT_MAT4x3: return 4; + case GL_FLOAT_MAT4: return 4; + default: { + return 1; + } + } +} + +const GLenum GLES3_WRAPS[] = { + GL_REPEAT, + GL_MIRRORED_REPEAT, + GL_CLAMP_TO_EDGE, + GL_CLAMP_TO_EDGE, +}; + +const GLenum GLES3_CMP_FUNCS[] = { + GL_NEVER, + GL_LESS, + GL_EQUAL, + GL_LEQUAL, + GL_GREATER, + GL_NOTEQUAL, + GL_GEQUAL, + GL_ALWAYS, +}; + +const GLenum GLES3_STENCIL_OPS[] = { + GL_ZERO, + GL_KEEP, + GL_REPLACE, + GL_INCR, + GL_DECR, + GL_INVERT, + GL_INCR_WRAP, + GL_DECR_WRAP, +}; + +const GLenum GLES3_BLEND_OPS[] = { + GL_FUNC_ADD, + GL_FUNC_SUBTRACT, + GL_FUNC_REVERSE_SUBTRACT, + GL_FUNC_ADD, + GL_FUNC_ADD, +}; + +const GLenum GLES3_BLEND_FACTORS[] = { + GL_ZERO, + GL_ONE, + GL_SRC_ALPHA, + GL_DST_ALPHA, + GL_ONE_MINUS_SRC_ALPHA, + GL_ONE_MINUS_DST_ALPHA, + GL_SRC_COLOR, + GL_DST_COLOR, + GL_ONE_MINUS_SRC_COLOR, + GL_ONE_MINUS_DST_COLOR, + GL_SRC_ALPHA_SATURATE, + GL_CONSTANT_COLOR, + GL_ONE_MINUS_CONSTANT_COLOR, + GL_CONSTANT_ALPHA, + GL_ONE_MINUS_CONSTANT_ALPHA, +}; + +void GLES3CmdFuncCreateBuffer(GLES3Device* device, GLES3GPUBuffer* gpu_buffer) { + GLenum gl_usage = (gpu_buffer->mem_usage & GFXMemoryUsageBit::HOST ? GL_DYNAMIC_DRAW : GL_STATIC_DRAW); + + if (gpu_buffer->usage & GFXBufferUsageBit::VERTEX) { + gpu_buffer->gl_target = GL_ARRAY_BUFFER; + glGenBuffers(1, &gpu_buffer->gl_buffer); + if (gpu_buffer->size) { + if (device->use_vao()) { + if (device->state_cache->gl_vao) { + glBindVertexArray(0); + device->state_cache->gl_vao = 0; + } + } + + if (device->state_cache->gl_array_buffer != gpu_buffer->gl_buffer) { + glBindBuffer(GL_ARRAY_BUFFER, gpu_buffer->gl_buffer); + } + + glBufferData(GL_ARRAY_BUFFER, gpu_buffer->size, nullptr, gl_usage); + glBindBuffer(GL_ARRAY_BUFFER, 0); + device->state_cache->gl_array_buffer = 0; + } + } else if (gpu_buffer->usage & GFXBufferUsageBit::INDEX) { + gpu_buffer->gl_target = GL_ELEMENT_ARRAY_BUFFER; + glGenBuffers(1, &gpu_buffer->gl_buffer); + if (gpu_buffer->size) { + if (device->use_vao()) { + if (device->state_cache->gl_vao) { + glBindVertexArray(0); + device->state_cache->gl_vao = 0; + } + } + + if (device->state_cache->gl_element_array_buffer != gpu_buffer->gl_buffer) { + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, gpu_buffer->gl_buffer); + } + + glBufferData(GL_ELEMENT_ARRAY_BUFFER, gpu_buffer->size, nullptr, gl_usage); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + device->state_cache->gl_element_array_buffer = 0; + } + } else if (gpu_buffer->usage & GFXBufferUsageBit::UNIFORM) { + gpu_buffer->gl_target = GL_UNIFORM_BUFFER; + glGenBuffers(1, &gpu_buffer->gl_buffer); + if (gpu_buffer->size) { + if (device->state_cache->gl_uniform_buffer != gpu_buffer->gl_buffer) { + glBindBuffer(GL_UNIFORM_BUFFER, gpu_buffer->gl_buffer); + } + + glBufferData(GL_UNIFORM_BUFFER, gpu_buffer->size, nullptr, gl_usage); + glBindBuffer(GL_UNIFORM_BUFFER, 0); + device->state_cache->gl_uniform_buffer = 0; + } + } else if (gpu_buffer->usage & GFXBufferUsageBit::INDIRECT){ + gpu_buffer->indirect_buff.draws.resize(gpu_buffer->count); + gpu_buffer->gl_target = GL_NONE; + } else if ((gpu_buffer->usage & GFXBufferUsageBit::TRANSFER_DST) || + (gpu_buffer->usage & GFXBufferUsageBit::TRANSFER_SRC)) { + gpu_buffer->gl_target = GL_NONE; + } else { + CC_ASSERTS(false, "Unsupported GFXBufferType, create buffer failed.") + gpu_buffer->gl_target = GL_NONE; + } +} + +void GLES3CmdFuncDestroyBuffer(GLES3Device* device, GLES3GPUBuffer* gpu_buffer) { + if (gpu_buffer->gl_buffer) { + glDeleteBuffers(1, &gpu_buffer->gl_buffer); + gpu_buffer->gl_buffer = 0; + } +} + +void GLES3CmdFuncResizeBuffer(GLES3Device* device, GLES3GPUBuffer* gpu_buffer) { + GLenum gl_usage = (gpu_buffer->mem_usage & GFXMemoryUsageBit::HOST ? GL_DYNAMIC_DRAW : GL_STATIC_DRAW); + + if (gpu_buffer->usage & GFXBufferUsageBit::VERTEX) { + gpu_buffer->gl_target = GL_ARRAY_BUFFER; + if (gpu_buffer->size) { + if (device->use_vao()) { + if (device->state_cache->gl_vao) { + glBindVertexArray(0); + device->state_cache->gl_vao = 0; + } + } + + if (device->state_cache->gl_array_buffer != gpu_buffer->gl_buffer) { + glBindBuffer(GL_ARRAY_BUFFER, gpu_buffer->gl_buffer); + } + + glBufferData(GL_ARRAY_BUFFER, gpu_buffer->size, nullptr, gl_usage); + glBindBuffer(GL_ARRAY_BUFFER, 0); + device->state_cache->gl_array_buffer = 0; + } + } else if (gpu_buffer->usage & GFXBufferUsageBit::INDEX) { + gpu_buffer->gl_target = GL_ELEMENT_ARRAY_BUFFER; + if (gpu_buffer->size) { + if (device->use_vao()) { + if (device->state_cache->gl_vao) { + glBindVertexArray(0); + device->state_cache->gl_vao = 0; + } + } + + if (device->state_cache->gl_element_array_buffer != gpu_buffer->gl_buffer) { + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, gpu_buffer->gl_buffer); + } + + glBufferData(GL_ELEMENT_ARRAY_BUFFER, gpu_buffer->size, nullptr, gl_usage); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + device->state_cache->gl_element_array_buffer = 0; + } + } else if (gpu_buffer->usage & GFXBufferUsageBit::UNIFORM) { + gpu_buffer->gl_target = GL_UNIFORM_BUFFER; + if (gpu_buffer->size) { + if (device->state_cache->gl_uniform_buffer != gpu_buffer->gl_buffer) { + glBindBuffer(GL_UNIFORM_BUFFER, gpu_buffer->gl_buffer); + } + + glBufferData(GL_UNIFORM_BUFFER, gpu_buffer->size, nullptr, gl_usage); + glBindBuffer(GL_UNIFORM_BUFFER, 0); + device->state_cache->gl_uniform_buffer = 0; + } + } else if (gpu_buffer->usage & GFXBufferUsageBit::INDIRECT) { + gpu_buffer->indirect_buff.draws.resize(gpu_buffer->count); + gpu_buffer->gl_target = GL_NONE; + } else if ((gpu_buffer->usage & GFXBufferUsageBit::TRANSFER_DST) || + (gpu_buffer->usage & GFXBufferUsageBit::TRANSFER_SRC)) { + gpu_buffer->gl_target = GL_NONE; + } else { + CC_ASSERTS(false, "Unsupported GFXBufferType, resize buffer failed.") + gpu_buffer->gl_target = GL_NONE; + } +} + +void GLES3CmdFuncUpdateBuffer(GLES3Device* device, GLES3GPUBuffer* gpu_buffer, void* buffer, uint offset, uint size) { + if (gpu_buffer->usage & GFXBufferUsageBit::INDIRECT) { + memcpy((uint8_t*)gpu_buffer->indirect_buff.draws.data() + offset, buffer, size); + } else { + switch (gpu_buffer->gl_target) { + case GL_ARRAY_BUFFER: { + if (device->state_cache->gl_vao) { + glBindVertexArray(0); + device->state_cache->gl_vao = 0; + } + if (device->state_cache->gl_array_buffer != gpu_buffer->gl_buffer) { + glBindBuffer(GL_ARRAY_BUFFER, gpu_buffer->gl_buffer); + device->state_cache->gl_array_buffer = gpu_buffer->gl_buffer; + } + glBufferSubData(GL_ARRAY_BUFFER, offset, size, buffer); + break; + } + case GL_ELEMENT_ARRAY_BUFFER: { + if (device->state_cache->gl_vao) { + glBindVertexArray(0); + device->state_cache->gl_vao = 0; + } + if (device->state_cache->gl_element_array_buffer != gpu_buffer->gl_buffer) { + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, gpu_buffer->gl_buffer); + device->state_cache->gl_element_array_buffer = gpu_buffer->gl_buffer; + } + glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, offset, size, buffer); + break; + } + case GL_UNIFORM_BUFFER: { + if (device->state_cache->gl_uniform_buffer != gpu_buffer->gl_buffer) { + glBindBuffer(GL_UNIFORM_BUFFER, gpu_buffer->gl_buffer); + device->state_cache->gl_uniform_buffer = gpu_buffer->gl_buffer; + } + glBufferSubData(GL_UNIFORM_BUFFER, offset, size, buffer); + break; + } + default: + CC_ASSERTS(false, "Unsupported GFXBufferType, update buffer failed.") + break; + } + } +} + +void GLES3CmdFuncCreateTexture(GLES3Device* device, GLES3GPUTexture* gpu_texture) { + gpu_texture->gl_internal_fmt = MapGLInternalFormat(gpu_texture->format); + gpu_texture->gl_format = MapGLFormat(gpu_texture->format); + gpu_texture->gl_type = GFXFormatToGLType(gpu_texture->format); + + switch (gpu_texture->view_type) { + case GFXTextureViewType::TV2D: { + gpu_texture->view_type = GFXTextureViewType::TV2D; + gpu_texture->gl_target = GL_TEXTURE_2D; + glGenTextures(1, &gpu_texture->gl_texture); + if (gpu_texture->size > 0) { + GLuint gl_texture = device->state_cache->gl_textures[device->state_cache->tex_uint]; + if (gpu_texture->gl_texture != gl_texture) { + glBindTexture(GL_TEXTURE_2D, gl_texture); + gpu_texture->gl_texture = gl_texture; + } + uint w = gpu_texture->width; + uint h = gpu_texture->height; + if (!GFX_FORMAT_INFOS[(int)gpu_texture->format].is_compressed) { + for (uint i = 0; i < gpu_texture->mip_level; ++i) { + glTexImage2D(GL_TEXTURE_2D, i, gpu_texture->gl_internal_fmt, w, h, 0, gpu_texture->gl_format, gpu_texture->gl_type, nullptr); + w = std::max(1U, w >> 1); + h = std::max(1U, w >> 1); + } + } else { + for (uint i = 0; i < gpu_texture->mip_level; ++i) { + uint img_size = GFXFormatSize(gpu_texture->format, w, h, 1); + glCompressedTexImage2D(GL_TEXTURE_2D, i, gpu_texture->gl_internal_fmt, w, h, 0, img_size, nullptr); + w = std::max(1U, w >> 1); + h = std::max(1U, w >> 1); + } + } + } + break; + } + case GFXTextureViewType::CUBE: { + gpu_texture->view_type = GFXTextureViewType::CUBE; + gpu_texture->gl_target = GL_TEXTURE_CUBE_MAP; + glGenTextures(1, &gpu_texture->gl_texture); + if (gpu_texture->size > 0) { + GLuint gl_texture = device->state_cache->gl_textures[device->state_cache->tex_uint]; + if (gpu_texture->gl_texture != gl_texture) { + glBindTexture(GL_TEXTURE_CUBE_MAP, gl_texture); + gpu_texture->gl_texture = gl_texture; + } + if (!GFX_FORMAT_INFOS[(int)gpu_texture->format].is_compressed) { + for (uint f = 0; f < 6; ++f) { + uint w = gpu_texture->width; + uint h = gpu_texture->height; + for (uint i = 0; i < gpu_texture->mip_level; ++i) { + glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + f, i, gpu_texture->gl_internal_fmt, w, h, 0, gpu_texture->gl_format, gpu_texture->gl_type, nullptr); + w = std::max(1U, w >> 1); + h = std::max(1U, w >> 1); + } + } + } else { + for (uint f = 0; f < 6; ++f) { + uint w = gpu_texture->width; + uint h = gpu_texture->height; + for (uint i = 0; i < gpu_texture->mip_level; ++i) { + uint img_size = GFXFormatSize(gpu_texture->format, w, h, 1); + glCompressedTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + f, i, gpu_texture->gl_internal_fmt, w, h, 0, img_size, nullptr); + w = std::max(1U, w >> 1); + h = std::max(1U, w >> 1); + } + } + } + } + break; + } + default: + CC_ASSERTS(false, "Unsupported GFXTextureType, create texture failed."); + break; + } +} + +void GLES3CmdFuncDestroyTexture(GLES3Device* device, GLES3GPUTexture* gpu_texture) { + if (gpu_texture->gl_texture) { + glDeleteTextures(1, &gpu_texture->gl_texture); + gpu_texture->gl_texture = 0; + } +} + +void GLES3CmdFuncResizeTexture(GLES3Device* device, GLES3GPUTexture* gpu_texture) { + gpu_texture->gl_internal_fmt = MapGLInternalFormat(gpu_texture->format); + gpu_texture->gl_format = MapGLFormat(gpu_texture->format); + gpu_texture->gl_type = GFXFormatToGLType(gpu_texture->format); + + switch (gpu_texture->view_type) { + case GFXTextureViewType::TV2D: { + gpu_texture->view_type = GFXTextureViewType::TV2D; + gpu_texture->gl_target = GL_TEXTURE_2D; + if (gpu_texture->size > 0) { + GLuint gl_texture = device->state_cache->gl_textures[device->state_cache->tex_uint]; + if (gpu_texture->gl_texture != gl_texture) { + glBindTexture(GL_TEXTURE_2D, gl_texture); + gpu_texture->gl_texture = gl_texture; + } + uint w = gpu_texture->width; + uint h = gpu_texture->height; + if (!GFX_FORMAT_INFOS[(int)gpu_texture->format].is_compressed) { + for (uint i = 0; i < gpu_texture->mip_level; ++i) { + glTexImage2D(GL_TEXTURE_2D, i, gpu_texture->gl_internal_fmt, w, h, 0, gpu_texture->gl_format, gpu_texture->gl_type, nullptr); + w = std::max(1U, w >> 1); + h = std::max(1U, w >> 1); + } + } else { + for (uint i = 0; i < gpu_texture->mip_level; ++i) { + uint img_size = GFXFormatSize(gpu_texture->format, w, h, 1); + glCompressedTexImage2D(GL_TEXTURE_2D, i, gpu_texture->gl_internal_fmt, w, h, 0, img_size, nullptr); + w = std::max(1U, w >> 1); + h = std::max(1U, w >> 1); + } + } + } + break; + } + case GFXTextureViewType::CUBE: { + gpu_texture->view_type = GFXTextureViewType::CUBE; + gpu_texture->gl_target = GL_TEXTURE_CUBE_MAP; + if (gpu_texture->size > 0) { + GLuint gl_texture = device->state_cache->gl_textures[device->state_cache->tex_uint]; + if (gpu_texture->gl_texture != gl_texture) { + glBindTexture(GL_TEXTURE_CUBE_MAP, gl_texture); + gpu_texture->gl_texture = gl_texture; + } + if (!GFX_FORMAT_INFOS[(int)gpu_texture->format].is_compressed) { + for (uint f = 0; f < 6; ++f) { + uint w = gpu_texture->width; + uint h = gpu_texture->height; + for (uint i = 0; i < gpu_texture->mip_level; ++i) { + glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + f, i, gpu_texture->gl_internal_fmt, w, h, 0, gpu_texture->gl_format, gpu_texture->gl_type, nullptr); + w = std::max(1U, w >> 1); + h = std::max(1U, w >> 1); + } + } + } else { + for (uint f = 0; f < 6; ++f) { + uint w = gpu_texture->width; + uint h = gpu_texture->height; + for (uint i = 0; i < gpu_texture->mip_level; ++i) { + uint img_size = GFXFormatSize(gpu_texture->format, w, h, 1); + glCompressedTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + f, i, gpu_texture->gl_internal_fmt, w, h, 0, img_size, nullptr); + w = std::max(1U, w >> 1); + h = std::max(1U, w >> 1); + } + } + } + } + break; + } + default: + CC_ASSERTS(false, "Unsupported GFXTextureType, resize texture failed."); + break; + } +} + +void GLES3CmdFuncCreateSampler(GLES3Device* device, GLES3GPUSampler* gpu_sampler) { + glGenSamplers(1, &gpu_sampler->gl_sampler); + if (gpu_sampler->min_filter == GFXFilter::LINEAR || gpu_sampler->min_filter == GFXFilter::ANISOTROPIC) { + if (gpu_sampler->mip_filter == GFXFilter::LINEAR || gpu_sampler->mip_filter == GFXFilter::ANISOTROPIC) { + gpu_sampler->gl_min_filter = GL_LINEAR_MIPMAP_LINEAR; + } else if (gpu_sampler->mip_filter == GFXFilter::POINT) { + gpu_sampler->gl_min_filter = GL_LINEAR_MIPMAP_NEAREST; + } else { + gpu_sampler->gl_min_filter = GL_LINEAR; + } + } else { + if (gpu_sampler->mip_filter == GFXFilter::LINEAR || gpu_sampler->mip_filter == GFXFilter::ANISOTROPIC) { + gpu_sampler->gl_min_filter = GL_NEAREST_MIPMAP_LINEAR; + } else if (gpu_sampler->mip_filter == GFXFilter::POINT) { + gpu_sampler->gl_min_filter = GL_NEAREST_MIPMAP_NEAREST; + } else { + gpu_sampler->gl_min_filter = GL_NEAREST; + } + } + + if (gpu_sampler->mag_filter == GFXFilter::LINEAR || gpu_sampler->mag_filter == GFXFilter::ANISOTROPIC) { + gpu_sampler->gl_mag_filter = GL_LINEAR; + } else { + gpu_sampler->gl_mag_filter = GL_NEAREST; + } + + gpu_sampler->gl_wrap_s = GLES3_WRAPS[(int)gpu_sampler->address_u]; + gpu_sampler->gl_wrap_t = GLES3_WRAPS[(int)gpu_sampler->address_v]; + gpu_sampler->gl_wrap_r = GLES3_WRAPS[(int)gpu_sampler->address_w]; + glSamplerParameteri(gpu_sampler->gl_sampler, GL_TEXTURE_MIN_FILTER, gpu_sampler->gl_min_filter); + glSamplerParameteri(gpu_sampler->gl_sampler, GL_TEXTURE_MAG_FILTER, gpu_sampler->gl_mag_filter); + glSamplerParameteri(gpu_sampler->gl_sampler, GL_TEXTURE_WRAP_S, gpu_sampler->gl_wrap_s); + glSamplerParameteri(gpu_sampler->gl_sampler, GL_TEXTURE_WRAP_T, gpu_sampler->gl_wrap_t); + glSamplerParameteri(gpu_sampler->gl_sampler, GL_TEXTURE_WRAP_R, gpu_sampler->gl_wrap_r); + glSamplerParameteri(gpu_sampler->gl_sampler, GL_TEXTURE_MIN_LOD, gpu_sampler->min_lod); + glSamplerParameteri(gpu_sampler->gl_sampler, GL_TEXTURE_MAX_LOD, gpu_sampler->max_lod); +} + +void GLES3CmdFuncDestroySampler(GLES3Device* device, GLES3GPUSampler* gpu_sampler) { + if (gpu_sampler->gl_sampler) { + glDeleteSamplers(1, &gpu_sampler->gl_sampler); + gpu_sampler->gl_sampler = 0; + } +} + +void GLES3CmdFuncCreateShader(GLES3Device* device, GLES3GPUShader* gpu_shader) { + GLenum gl_shader_type = 0; + String shader_type_str; + GLint status; + + for (size_t i = 0; i < gpu_shader->gpu_stages.size(); ++i) { + GLES3GPUShaderStage& gpu_stage = gpu_shader->gpu_stages[i]; + + switch (gpu_stage.type) { + case GFXShaderType::VERTEX: { + gl_shader_type = GL_VERTEX_SHADER; + shader_type_str = "Vertex Shader"; + break; + } + case GFXShaderType::FRAGMENT: { + gl_shader_type = GL_FRAGMENT_SHADER; + shader_type_str = "Fragment Shader"; + break; + } + default: { + CC_ASSERTS(false, "Unsupported GFXShaderType"); + return; + } + } + + gpu_stage.gl_shader = glCreateShader(gl_shader_type); + const char* shader_src = gpu_stage.source.c_str(); + glShaderSource(gpu_stage.gl_shader, 1, (const GLchar**)&shader_src, nullptr); + glCompileShader(gpu_stage.gl_shader); + + glGetShaderiv(gpu_stage.gl_shader, GL_COMPILE_STATUS, &status); + if (status != 1) { + GLint log_size = 0; + glGetShaderiv(gpu_stage.gl_shader, GL_INFO_LOG_LENGTH, &log_size); + + ++log_size; + GLchar* logs = (GLchar*)CC_MALLOC(log_size); + glGetShaderInfoLog(gpu_stage.gl_shader, log_size, nullptr, logs); + + CC_LOG_ERROR("%s in %s compilation failed.", shader_type_str.c_str(), gpu_shader->name.c_str()); + CC_LOG_ERROR("Shader source:", gpu_stage.source.c_str()); + CC_LOG_ERROR(logs); + + glDeleteShader(gpu_stage.gl_shader); + gpu_stage.gl_shader = 0; + return; + } + } + + gpu_shader->gl_program = glCreateProgram(); + + // link program + for (size_t i = 0; i < gpu_shader->gpu_stages.size(); ++i) { + GLES3GPUShaderStage& gpu_stage = gpu_shader->gpu_stages[i]; + glAttachShader(gpu_shader->gl_program, gpu_stage.gl_shader); + } + + glLinkProgram(gpu_shader->gl_program); + glGetProgramiv(gpu_shader->gl_program, GL_LINK_STATUS, &status); + if (status != 1) { + CC_LOG_ERROR("Failed to link Shader [%s].", gpu_shader->name.c_str()); + GLint log_size = 0; + glGetProgramiv(gpu_shader->gl_program, GL_INFO_LOG_LENGTH, &log_size); + if (log_size) { + ++log_size; + GLchar* logs = (GLchar*)CC_MALLOC(log_size); + glGetProgramInfoLog(gpu_shader->gl_program, log_size, nullptr, logs); + + CC_LOG_ERROR("Failed to link shader '%s'.", gpu_shader->name.c_str()); + CC_LOG_ERROR(logs); + + for (size_t i = 0; i < gpu_shader->gpu_stages.size(); ++i) { + GLES3GPUShaderStage& gpu_stage = gpu_shader->gpu_stages[i]; + glDeleteShader(gpu_stage.gl_shader); + gpu_stage.gl_shader = 0; + } + return; + } + } + + CC_LOG_INFO("Shader '%s' compilation successed.", gpu_shader->name.c_str()); + + GLint attr_max_length = 0; + GLint attr_count = 0; + glGetProgramiv(gpu_shader->gl_program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &attr_max_length); + glGetProgramiv(gpu_shader->gl_program, GL_ACTIVE_ATTRIBUTES, &attr_count); + + GLchar gl_name[256]; + GLsizei gl_length; + GLsizei gl_size; + GLenum gl_type; + + gpu_shader->gpu_inputs.resize(attr_count); + for (GLint i = 0; i < attr_count; ++i) { + GLES3GPUInput& gpu_input = gpu_shader->gpu_inputs[i]; + + memset(gl_name, 0, sizeof(gl_name)); + glGetActiveAttrib(gpu_shader->gl_program, i, attr_max_length, &gl_length, &gl_size, &gl_type, gl_name); + char* offset = strchr(gl_name, '['); + if (offset) { + gl_name[offset - gl_name] = '\0'; + } + + gpu_input.gl_loc = glGetAttribLocation(gpu_shader->gl_program, gl_name); + gpu_input.binding = gpu_input.gl_loc; + gpu_input.name = gl_name; + gpu_input.type = MapGFXType(gl_type); + gpu_input.stride = GLTypeSize(gl_type); + gpu_input.count = gl_size; + gpu_input.size = gpu_input.stride * gpu_input.count; + gpu_input.gl_type = gl_type; + } + + // create uniform blocks + GLint block_count; + glGetProgramiv(gpu_shader->gl_program, GL_ACTIVE_UNIFORM_BLOCKS, &block_count); + if (block_count) { + GLint gl_block_size = 0; + GLint gl_block_uniforms = 0; + uint32_t block_idx = 0; + + gpu_shader->gpu_blocks.resize(block_count); + for (GLint i = 0; i < block_count; ++i) { + GLES3GPUUniformBlock& gpu_block = gpu_shader->gpu_blocks[i]; + memset(gl_name, 0, sizeof(gl_name)); + glGetActiveUniformBlockName(gpu_shader->gl_program, i, 255, &gl_length, gl_name); + + char* offset = strchr(gl_name, '['); + if (offset) { + gl_name[offset - gl_name] = '\0'; + } + + gpu_block.name = gl_name; + gpu_block.binding = GFX_INVALID_BINDING; + for (size_t b = 0; b < gpu_shader->blocks.size(); ++b) { + GFXUniformBlock& block = gpu_shader->blocks[b]; + if (block.name == gpu_block.name) { + gpu_block.binding = block.binding; + break; + } + } + + if (gpu_block.binding != GFX_INVALID_BINDING) { + block_idx = i; + + glUniformBlockBinding(gpu_shader->gl_program, block_idx, gpu_block.binding); + + glGetActiveUniformBlockiv(gpu_shader->gl_program, i, GL_UNIFORM_BLOCK_DATA_SIZE, &gl_block_size); + glGetActiveUniformBlockiv(gpu_shader->gl_program, i, GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS, &gl_block_uniforms); + glUniformBlockBinding(gpu_shader->gl_program, block_idx, gpu_block.binding); + + gpu_block.size = gl_block_size; + gpu_block.uniforms.resize(gl_block_uniforms); + + vector::type u_indices(gl_block_uniforms); + glGetActiveUniformBlockiv(gpu_shader->gl_program, i, GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES, &u_indices[0]); + // vector::type u_sizes(gl_block_uniforms); + // glGetActiveUniformsiv(gpu_shader->gl_program, gl_block_uniforms, (const GLuint*)u_indices.data(), GL_UNIFORM_SIZE, &u_sizes[0]); + vector::type u_offsets(gl_block_uniforms); + glGetActiveUniformsiv(gpu_shader->gl_program, gl_block_uniforms, (const GLuint*)u_indices.data(), GL_UNIFORM_OFFSET, &u_offsets[0]); + + for (GLint u = 0; u < gl_block_uniforms; ++u) { + GLES3GPUUniform& uniform = gpu_block.uniforms[u]; + + GLint idx = u_indices[u]; + memset(gl_name, 0, sizeof(gl_name)); + glGetActiveUniform(gpu_shader->gl_program, idx, 255, &gl_length, &gl_size, &gl_type, gl_name); + offset = strchr(gl_name, '['); + if (offset) { + gl_name[offset - gl_name] = '\0'; + } + + uniform.binding = GFX_INVALID_BINDING; + uniform.name = gl_name; + uniform.type = MapGFXType(gl_type); + uniform.stride = GFX_TYPE_SIZES[(int)uniform.type]; + uniform.count = gl_size; + uniform.size = uniform.stride * uniform.count; + uniform.offset = u_offsets[u]; + uniform.gl_type = gl_type; + uniform.gl_loc = -1; + } + } // if + } + } // if + + // create uniform samplers + if (gpu_shader->samplers.size()) { + gpu_shader->gpu_samplers.resize(gpu_shader->samplers.size()); + + for (size_t i = 0; i < gpu_shader->gpu_samplers.size(); ++i) { + GFXUniformSampler& sampler = gpu_shader->samplers[i]; + GLES3GPUUniformSampler& gpu_sampler = gpu_shader->gpu_samplers[i]; + gpu_sampler.binding = sampler.binding; + gpu_sampler.name = sampler.name; + gpu_sampler.type = sampler.type; + gpu_sampler.gl_type = MapGLType(gpu_sampler.type); + gpu_sampler.gl_loc = -1; + } + } + + // parse uniforms + GLint active_uniforms; + glGetProgramiv(gpu_shader->gl_program, GL_ACTIVE_UNIFORMS, &active_uniforms); + + GLint unit_idx = 0; + + GLES3GPUUniformSamplerList active_gpu_samplers; + + for (GLint i = 0; i < active_uniforms; ++i) { + memset(gl_name, 0, sizeof(gl_name)); + glGetActiveUniform(gpu_shader->gl_program, i, 255, &gl_length, &gl_size, &gl_type, gl_name); + char* u_offset = strchr(gl_name, '['); + if (u_offset) { + gl_name[u_offset - gl_name] = '\0'; + } + + bool is_sampler = (gl_type == GL_SAMPLER_2D) || + (gl_type == GL_SAMPLER_3D) || + (gl_type == GL_SAMPLER_CUBE) || + (gl_type == GL_SAMPLER_CUBE_SHADOW) || + (gl_type == GL_SAMPLER_2D_ARRAY) || + (gl_type == GL_SAMPLER_2D_ARRAY_SHADOW); + if (is_sampler) { + String u_name = gl_name; + for (size_t s = 0; s < gpu_shader->gpu_samplers.size(); ++s) { + GLES3GPUUniformSampler& gpu_sampler = gpu_shader->gpu_samplers[s]; + if (gpu_sampler.name == u_name) { + gpu_sampler.units.resize(gl_size); + for (GLsizei u = 0; u < gl_size; ++u) { + gpu_sampler.units[u] = unit_idx + u; + } + + gpu_sampler.gl_loc = glGetAttribLocation(gpu_shader->gl_program, gl_name); + unit_idx += gl_size; + + active_gpu_samplers.push_back(gpu_sampler); + break; + } + } + } // if + } // for + + if (active_gpu_samplers.size()) { + if (device->state_cache->gl_program != gpu_shader->gl_program) { + glUseProgram(gpu_shader->gl_program); + device->state_cache->gl_program = gpu_shader->gl_program; + } + + for (size_t i = 0; i < active_gpu_samplers.size(); ++i) { + GLES3GPUUniformSampler& gpu_sampler = active_gpu_samplers[i]; + glUniform1iv(gpu_sampler.gl_loc, (GLsizei)gpu_sampler.units.size(), gpu_sampler.units.data()); + } + } +} + +void GLES3CmdFuncDestroyShader(GLES3Device* device, GLES3GPUShader* gpu_shader) { + for (size_t i = 0; i < gpu_shader->gpu_stages.size(); ++i) { + GLES3GPUShaderStage& gpu_stage = gpu_shader->gpu_stages[i]; + if (gpu_stage.gl_shader) { + glDeleteShader(gpu_stage.gl_shader); + gpu_stage.gl_shader = 0; + } + } + if (gpu_shader->gl_program) { + glDeleteProgram(gpu_shader->gl_program); + gpu_shader->gl_program = 0; + } +} + +void GLES3CmdFuncCreateInputAssembler(GLES3Device* device, GLES3GPUInputAssembler* gpu_ia) { + + if (gpu_ia->gpu_index_buffer) { + switch (gpu_ia->gpu_index_buffer->stride) { + case 1: gpu_ia->gl_index_type = GL_UNSIGNED_BYTE; break; + case 2: gpu_ia->gl_index_type = GL_UNSIGNED_SHORT; break; + case 4: gpu_ia->gl_index_type = GL_UNSIGNED_INT; break; + default: { + CC_LOG_ERROR("Illegal index buffer stride."); + } + } + } + + uint stream_offsets[GFX_MAX_VERTEX_ATTRIBUTES] = {0}; + + gpu_ia->gpu_attribs.resize(gpu_ia->attribs.size()); + for (size_t i = 0; i < gpu_ia->gpu_attribs.size(); ++i) { + GLES3GPUAttribute& gpu_attrib = gpu_ia->gpu_attribs[i]; + const GFXAttribute& attrib = gpu_ia->attribs[i]; + + GLES3GPUBuffer* gpu_vb = (GLES3GPUBuffer*)gpu_ia->gpu_vertex_buffers[attrib.stream]; + + gpu_attrib.name = attrib.name; + gpu_attrib.gl_type = GFXFormatToGLType(attrib.format); + gpu_attrib.size = GFX_FORMAT_INFOS[(int)attrib.format].size; + gpu_attrib.count = GFX_FORMAT_INFOS[(int)attrib.format].count; + gpu_attrib.component_count = GLComponentCount(gpu_attrib.gl_type); + gpu_attrib.is_normalized = attrib.is_normalized; + gpu_attrib.is_instanced = attrib.is_instanced; + gpu_attrib.offset = stream_offsets[attrib.stream]; + + if (gpu_vb) { + gpu_attrib.gl_buffer = gpu_vb->gl_buffer; + gpu_attrib.stride = gpu_vb->stride; + } + } +} + +void GLES3CmdFuncDestroyInputAssembler(GLES3Device* device, GLES3GPUInputAssembler* gpu_ia) { + for (auto it = gpu_ia->gl_vaos.begin(); it != gpu_ia->gl_vaos.end(); ++it) { + glDeleteVertexArrays(1, &it->second); + } + gpu_ia->gl_vaos.clear(); +} + +void GLES3CmdFuncCreateFramebuffer(GLES3Device* device, GLES3GPUFramebuffer* gpu_fbo) { + if (gpu_fbo->is_offscreen) { + glGenFramebuffers(1, &gpu_fbo->gl_fbo); + if (device->state_cache->gl_fbo != gpu_fbo->gl_fbo) { + glBindFramebuffer(GL_FRAMEBUFFER, gpu_fbo->gl_fbo); + device->state_cache->gl_fbo = gpu_fbo->gl_fbo; + } + + GLenum attachments[GFX_MAX_ATTACHMENTS] = {0}; + uint attachment_count = 0; + + for (size_t i = 0; i < gpu_fbo->gpu_color_views.size(); ++i) { + GLES3GPUTextureView* gpu_color_view = gpu_fbo->gpu_color_views[i]; + if (gpu_color_view && gpu_color_view->gpu_texture) { + glFramebufferTexture2D(GL_FRAMEBUFFER, (GLenum)(GL_COLOR_ATTACHMENT0 + i), gpu_color_view->gpu_texture->gl_target, gpu_color_view->gpu_texture->gl_texture, gpu_color_view->base_level); + + attachments[attachment_count++] = (GLenum)(GL_COLOR_ATTACHMENT0 + i); + } + } + + if (gpu_fbo->gpu_depth_stencil_view) { + GLES3GPUTextureView* gpu_dsv = gpu_fbo->gpu_depth_stencil_view; + const GLenum gl_attachment = GFX_FORMAT_INFOS[(int)gpu_dsv->format].has_stencil ? GL_DEPTH_STENCIL_ATTACHMENT : GL_DEPTH_ATTACHMENT; + glFramebufferTexture2D(GL_FRAMEBUFFER, gl_attachment, gpu_dsv->gpu_texture->gl_target, gpu_dsv->gpu_texture->gl_texture, gpu_dsv->base_level); + } + + glDrawBuffers(attachment_count, attachments); + + GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + if (status != GL_FRAMEBUFFER_COMPLETE) { + switch (status) { + case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT: { + CC_LOG_ERROR("glCheckFramebufferStatus() - FRAMEBUFFER_INCOMPLETE_ATTACHMENT"); + break; + } + case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: { + CC_LOG_ERROR("glCheckFramebufferStatus() - FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT"); + break; + } + case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS: { + CC_LOG_ERROR("glCheckFramebufferStatus() - FRAMEBUFFER_INCOMPLETE_DIMENSIONS"); + break; + } + case GL_FRAMEBUFFER_UNSUPPORTED: { + CC_LOG_ERROR("glCheckFramebufferStatus() - FRAMEBUFFER_UNSUPPORTED"); + break; + } + default:; + } + } + } +} + +void GLES3CmdFuncDestroyFramebuffer(GLES3Device* device, GLES3GPUFramebuffer* gpu_fbo) { + if (gpu_fbo->gl_fbo) { + glDeleteFramebuffers(1, &gpu_fbo->gl_fbo); + gpu_fbo->gl_fbo = 0; + } +} + +void GLES3CmdFuncExecuteCmds(GLES3Device* device, GLES3CmdPackage* cmd_package) { + static uint cmd_indices[(int)GLES3CmdType::COUNT] = {0}; + static GLenum gl_attachments[GFX_MAX_ATTACHMENTS] = {0}; + + memset(cmd_indices, 0, sizeof(cmd_indices)); + + GLES3StateCache* cache = device->state_cache; + GLES3GPURenderPass* gpu_render_pass = nullptr; + bool is_shader_changed = false; + GLES3GPUPipelineState* gpu_pso = nullptr; + GLenum gl_primitive = 0; + GLES3GPUInputAssembler* gpu_ia = nullptr; + GLES3CmdBeginRenderPass* cmd_begin_render_pass = nullptr; + + for (uint i = 0; i < cmd_package->cmd_types.Size(); ++i) { + GLES3CmdType cmd_type = cmd_package->cmd_types[i]; + uint cmd_idx = cmd_indices[(int)cmd_type]; + + switch (cmd_type) { + case GLES3CmdType::BEGIN_RENDER_PASS: { + GLES3CmdBeginRenderPass* cmd = cmd_package->begin_render_pass_cmds[cmd_idx]; + cmd_begin_render_pass = cmd; + if (cmd->gpu_fbo) { + if (cache->gl_fbo != cmd->gpu_fbo->gl_fbo) { + glBindFramebuffer(GL_FRAMEBUFFER, cmd->gpu_fbo->gl_fbo); + cache->gl_fbo = cmd->gpu_fbo->gl_fbo; + } + + if (cache->viewport.left != cmd->render_area.x || + cache->viewport.top != cmd->render_area.y || + cache->viewport.width != cmd->render_area.width || + cache->viewport.height != cmd->render_area.height) { + glViewport(cmd->render_area.x, cmd->render_area.y, cmd->render_area.width, cmd->render_area.height); + cache->viewport.left = cmd->render_area.x; + cache->viewport.top = cmd->render_area.y; + cache->viewport.width = cmd->render_area.width; + cache->viewport.height = cmd->render_area.height; + } + + if (cache->scissor.x != cmd->render_area.x || + cache->scissor.y != cmd->render_area.y || + cache->scissor.width != cmd->render_area.width || + cache->scissor.height != cmd->render_area.height) { + glScissor(cmd->render_area.x, cmd->render_area.y, cmd->render_area.width, cmd->render_area.height); + cache->scissor.x = cmd->render_area.x; + cache->scissor.y = cmd->render_area.y; + cache->scissor.width = cmd->render_area.width; + cache->scissor.height = cmd->render_area.height; + } + + GLbitfield gl_clears = 0; + uint num_attachments = 0; + + gpu_render_pass = cmd->gpu_fbo->gpu_render_pass; + for (uint j = 0; j < cmd->num_clear_colors; ++j) { + const GFXColorAttachment& color_attachment = gpu_render_pass->color_attachments[j]; + if (color_attachment.format != GFXFormat::UNKNOWN) { + switch (color_attachment.load_op) { + case GFXLoadOp::LOAD: break; // GL default behaviour + case GFXLoadOp::CLEAR: { + if (cmd->clear_flags & GFXClearFlagBit::COLOR) { + if (cache->bs.targets[0].blend_color_mask != GFXColorMask::ALL) { + glColorMask(true, true, true, true); + } + + if (cmd->gpu_fbo->is_offscreen) { + static float f_colors[4]; + f_colors[0] = cmd->clear_colors[j].r; + f_colors[1] = cmd->clear_colors[j].g; + f_colors[2] = cmd->clear_colors[j].b; + f_colors[3] = cmd->clear_colors[j].a; + glClearBufferfv(GL_COLOR, j, f_colors); + } else { + const GFXColor& color = cmd->clear_colors[j]; + glClearColor(color.r, color.g, color.b, color.a); + gl_clears |= GL_COLOR_BUFFER_BIT; + } + } + break; + } + case GFXLoadOp::DISCARD: { + // invalidate fbo + gl_attachments[num_attachments++] = (cmd->gpu_fbo->is_offscreen ? GL_COLOR_ATTACHMENT0 + j : GL_COLOR); + break; + } + default:; + } + } + } // for + + if (gpu_render_pass->depth_stencil_attachment.format != GFXFormat::UNKNOWN) { + bool has_depth = GFX_FORMAT_INFOS[(int)gpu_render_pass->depth_stencil_attachment.format].has_depth; + if (has_depth) { + switch (gpu_render_pass->depth_stencil_attachment.depth_load_op) { + case GFXLoadOp::LOAD: break; // GL default behaviour + case GFXLoadOp::CLEAR: { + if (cache->dss.depth_write) { + glDepthMask(true); + } + glClearDepthf(cmd->clear_depth); + gl_clears |= GL_DEPTH_BUFFER_BIT; + break; + } + case GFXLoadOp::DISCARD: { + // invalidate fbo + gl_attachments[num_attachments++] = (cmd->gpu_fbo->is_offscreen ? GL_DEPTH_ATTACHMENT : GL_DEPTH); + break; + } + default:; + } + } // if (has_depth) + bool has_stencils = GFX_FORMAT_INFOS[(int)gpu_render_pass->depth_stencil_attachment.format].has_stencil; + if (has_stencils) { + switch (gpu_render_pass->depth_stencil_attachment.depth_load_op) { + case GFXLoadOp::LOAD: break; // GL default behaviour + case GFXLoadOp::CLEAR: { + if (!cache->dss.stencil_write_mask_front) { + glStencilMaskSeparate(GL_FRONT, 0xffffffff); + } + if (!cache->dss.stencil_write_mask_back) { + glStencilMaskSeparate(GL_BACK, 0xffffffff); + } + glClearStencil(cmd->clear_stencil); + gl_clears |= GL_STENCIL_BUFFER_BIT; + break; + } + case GFXLoadOp::DISCARD: { + // invalidate fbo + gl_attachments[num_attachments++] = (cmd->gpu_fbo->is_offscreen ? GL_STENCIL_ATTACHMENT : GL_STENCIL); + break; + } + default:; + } + } // if (has_stencils) + } // if + + if (num_attachments) { + glInvalidateFramebuffer(GL_FRAMEBUFFER, num_attachments, gl_attachments); + } + + if (gl_clears) { + glClear(gl_clears); + } + + // restore states + if (gl_clears & GL_COLOR_BUFFER_BIT) { + GFXColorMask color_mask = cache->bs.targets[0].blend_color_mask; + if (color_mask != GFXColorMask::ALL) { + glColorMask((GLboolean)(color_mask & GFXColorMask::R), + (GLboolean)(color_mask & GFXColorMask::G), + (GLboolean)(color_mask & GFXColorMask::B), + (GLboolean)(color_mask & GFXColorMask::A)); + } + } + + if ((gl_clears & GL_COLOR_BUFFER_BIT) && !cache->dss.depth_write) { + glDepthMask(false); + } + + if (gl_clears & GL_STENCIL_BUFFER_BIT) { + if (!cache->dss.stencil_write_mask_front) { + glStencilMaskSeparate(GL_FRONT, 0); + } + if (!cache->dss.stencil_write_mask_back) { + glStencilMaskSeparate(GL_BACK, 0); + } + } + } + break; + } + case GLES3CmdType::END_RENDER_PASS: { + GLES3CmdBeginRenderPass* cmd = cmd_begin_render_pass; + uint num_attachments = 0; + for (uint j = 0; j < cmd->num_clear_colors; ++j) { + const GFXColorAttachment& color_attachment = gpu_render_pass->color_attachments[j]; + if (color_attachment.format != GFXFormat::UNKNOWN) { + switch (color_attachment.load_op) { + case GFXLoadOp::LOAD: break; // GL default behaviour + case GFXLoadOp::CLEAR: break; + case GFXLoadOp::DISCARD: { + // invalidate fbo + gl_attachments[num_attachments++] = (cmd->gpu_fbo->is_offscreen ? GL_COLOR_ATTACHMENT0 + j : GL_COLOR); + break; + } + default:; + } + } + } // for + + if (gpu_render_pass->depth_stencil_attachment.format != GFXFormat::UNKNOWN) { + bool has_depth = GFX_FORMAT_INFOS[(int)gpu_render_pass->depth_stencil_attachment.format].has_depth; + if (has_depth) { + switch (gpu_render_pass->depth_stencil_attachment.depth_load_op) { + case GFXLoadOp::LOAD: break; // GL default behaviour + case GFXLoadOp::CLEAR: break; + case GFXLoadOp::DISCARD: { + // invalidate fbo + gl_attachments[num_attachments++] = (cmd->gpu_fbo->is_offscreen ? GL_DEPTH_ATTACHMENT : GL_DEPTH); + break; + } + default:; + } + } // if (has_depth) + bool has_stencils = GFX_FORMAT_INFOS[(int)gpu_render_pass->depth_stencil_attachment.format].has_stencil; + if (has_stencils) { + switch (gpu_render_pass->depth_stencil_attachment.depth_load_op) { + case GFXLoadOp::LOAD: break; // GL default behaviour + case GFXLoadOp::CLEAR: break; + case GFXLoadOp::DISCARD: { + // invalidate fbo + gl_attachments[num_attachments++] = (cmd->gpu_fbo->is_offscreen ? GL_STENCIL_ATTACHMENT : GL_STENCIL); + break; + } + default:; + } + } // if (has_stencils) + } // if + + if (num_attachments) { + glInvalidateFramebuffer(GL_FRAMEBUFFER, num_attachments, gl_attachments); + } + break; + } + case GLES3CmdType::BIND_STATES: { + GLES3CmdBindStates* cmd = cmd_package->bind_states_cmds[cmd_idx]; + is_shader_changed = false; + if (cmd->gpu_pso) { + gpu_pso = cmd->gpu_pso; + gl_primitive = gpu_pso->gl_primitive; + + if (gpu_pso->gpu_shader) { + if (cache->gl_program != gpu_pso->gpu_shader->gl_program) { + glUseProgram(cache->gl_program); + cache->gl_program = gpu_pso->gpu_shader->gl_program; + is_shader_changed = true; + } + } + + // bind rasterizer state + if (cache->rs.cull_mode != gpu_pso->rs.cull_mode) { + switch (gpu_pso->rs.cull_mode) { + case GFXCullMode::NONE: { + if (cache->is_cull_face_enabled) { + glDisable(GL_CULL_FACE); + cache->is_cull_face_enabled = false; + } + } break; + case GFXCullMode::FRONT: { + if (!cache->is_cull_face_enabled) { + glEnable(GL_CULL_FACE); + cache->is_cull_face_enabled = true; + } + glCullFace(GL_FRONT); + } break; + case GFXCullMode::BACK: { + if (!cache->is_cull_face_enabled) { + glEnable(GL_CULL_FACE); + cache->is_cull_face_enabled = true; + } + glCullFace(GL_BACK); + } break; + default: + break; + } + cache->rs.cull_mode = gpu_pso->rs.cull_mode; + } + } + if (cache->rs.is_front_face_ccw != gpu_pso->rs.is_front_face_ccw) { + glFrontFace(gpu_pso->rs.is_front_face_ccw? GL_CCW : GL_CW); + cache->rs.is_front_face_ccw = gpu_pso->rs.is_front_face_ccw; + } + if ((cache->rs.depth_bias != gpu_pso->rs.depth_bias) || + (cache->rs.depth_bias_slope != gpu_pso->rs.depth_bias_slope)){ + glPolygonOffset(cache->rs.depth_bias, cache->rs.depth_bias_slope); + cache->rs.depth_bias_slope = gpu_pso->rs.depth_bias_slope; + } + if (cache->rs.line_width != gpu_pso->rs.line_width) { + glLineWidth(gpu_pso->rs.line_width); + cache->rs.line_width = gpu_pso->rs.line_width; + } + + // bind depth-stencil state + if (cache->dss.depth_test != gpu_pso->dss.depth_test) { + if (gpu_pso->dss.depth_test) { + glEnable(GL_DEPTH_TEST); + } else { + glDisable(GL_DEPTH_TEST); + } + cache->dss.depth_test = gpu_pso->dss.depth_test; + } + if (cache->dss.depth_write != gpu_pso->dss.depth_write) { + glDepthMask(gpu_pso->dss.depth_write); + cache->dss.depth_write = gpu_pso->dss.depth_write; + } + if (cache->dss.depth_func != gpu_pso->dss.depth_func) { + glDepthFunc(GLES3_CMP_FUNCS[(int)gpu_pso->dss.depth_func]); + cache->dss.depth_func = gpu_pso->dss.depth_func; + } + + // bind depth-stencil state - front + if (cache->dss.stencil_test_front != gpu_pso->dss.stencil_test_front || + cache->dss.stencil_test_back != gpu_pso->dss.stencil_test_back) { + if (gpu_pso->dss.stencil_test_front || gpu_pso->dss.stencil_test_back) { + if (!cache->is_stencil_test_enabled) { + glEnable(GL_STENCIL_TEST); + cache->is_stencil_test_enabled = true; + } + } else { + if (cache->is_stencil_test_enabled) { + glDisable(GL_STENCIL_TEST); + cache->is_stencil_test_enabled = false; + } + } + } + if (cache->dss.stencil_func_front != gpu_pso->dss.stencil_func_front || + cache->dss.stencil_ref_front != gpu_pso->dss.stencil_ref_front || + cache->dss.stencil_read_mask_front != gpu_pso->dss.stencil_read_mask_front) { + glStencilFuncSeparate(GL_FRONT, + GLES3_CMP_FUNCS[(int)gpu_pso->dss.stencil_func_front], + gpu_pso->dss.stencil_ref_front, + gpu_pso->dss.stencil_read_mask_front); + } + if (cache->dss.stencil_fail_op_front != gpu_pso->dss.stencil_fail_op_front || + cache->dss.stencil_z_fail_op_front != gpu_pso->dss.stencil_z_fail_op_front || + cache->dss.stencil_pass_op_front != gpu_pso->dss.stencil_pass_op_front) { + glStencilOpSeparate(GL_FRONT, + GLES3_STENCIL_OPS[(int)gpu_pso->dss.stencil_fail_op_front], + GLES3_STENCIL_OPS[(int)gpu_pso->dss.stencil_z_fail_op_front], + GLES3_STENCIL_OPS[(int)gpu_pso->dss.stencil_pass_op_front]); + } + if (cache->dss.stencil_write_mask_front != gpu_pso->dss.stencil_write_mask_front) { + glStencilMaskSeparate(GL_FRONT, gpu_pso->dss.stencil_write_mask_front); + cache->dss.stencil_write_mask_front = gpu_pso->dss.stencil_write_mask_front; + } + + // bind depth-stencil state - back + if (cache->dss.stencil_func_back != gpu_pso->dss.stencil_func_back || + cache->dss.stencil_ref_back != gpu_pso->dss.stencil_ref_back || + cache->dss.stencil_read_mask_back != gpu_pso->dss.stencil_read_mask_back) { + glStencilFuncSeparate(GL_BACK, + GLES3_CMP_FUNCS[(int)gpu_pso->dss.stencil_func_front], + gpu_pso->dss.stencil_ref_back, + gpu_pso->dss.stencil_read_mask_back); + } + if (cache->dss.stencil_fail_op_back != gpu_pso->dss.stencil_fail_op_back || + cache->dss.stencil_z_fail_op_back != gpu_pso->dss.stencil_z_fail_op_back || + cache->dss.stencil_pass_op_back != gpu_pso->dss.stencil_pass_op_back) { + glStencilOpSeparate(GL_BACK, + GLES3_STENCIL_OPS[(int)gpu_pso->dss.stencil_fail_op_back], + GLES3_STENCIL_OPS[(int)gpu_pso->dss.stencil_z_fail_op_back], + GLES3_STENCIL_OPS[(int)gpu_pso->dss.stencil_pass_op_back]); + } + if (cache->dss.stencil_write_mask_back != gpu_pso->dss.stencil_write_mask_back) { + glStencilMaskSeparate(GL_BACK, gpu_pso->dss.stencil_write_mask_back); + cache->dss.stencil_write_mask_back = gpu_pso->dss.stencil_write_mask_back; + } + + // bind blend state + if (cache->bs.is_a2c != gpu_pso->bs.is_a2c) { + if (cache->bs.is_a2c) { + glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE); + } else { + glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE); + } + } + if (cache->bs.blend_color.r != gpu_pso->bs.blend_color.r || + cache->bs.blend_color.g != gpu_pso->bs.blend_color.g || + cache->bs.blend_color.b != gpu_pso->bs.blend_color.b || + cache->bs.blend_color.a != gpu_pso->bs.blend_color.a) { + + glBlendColor(gpu_pso->bs.blend_color.r, + gpu_pso->bs.blend_color.g, + gpu_pso->bs.blend_color.b, + gpu_pso->bs.blend_color.a); + cache->bs.blend_color = gpu_pso->bs.blend_color; + } + + GFXBlendTarget& cache_target = cache->bs.targets[0]; + const GFXBlendTarget& target = gpu_pso->bs.targets[0]; + if (cache_target.is_blend != target.is_blend) { + if (cache_target.is_blend) { + glEnable(GL_BLEND); + } else { + glDisable(GL_BLEND); + } + cache_target.is_blend = target.is_blend; + } + if (cache_target.blend_eq != target.blend_eq || + cache_target.blend_alpha_eq != target.blend_alpha_eq) { + glBlendEquationSeparate(GLES3_BLEND_OPS[(int)target.blend_eq], + GLES3_BLEND_OPS[(int)target.blend_alpha_eq]); + cache_target.blend_eq = target.blend_eq; + cache_target.blend_alpha_eq = target.blend_alpha_eq; + } + if (cache_target.blend_src != target.blend_src || + cache_target.blend_dst != target.blend_dst || + cache_target.blend_src_alpha != target.blend_src_alpha || + cache_target.blend_dst_alpha != target.blend_dst_alpha) { + glBlendFuncSeparate(GLES3_BLEND_FACTORS[(int)target.blend_src], + GLES3_BLEND_FACTORS[(int)target.blend_dst], + GLES3_BLEND_FACTORS[(int)target.blend_src_alpha], + GLES3_BLEND_FACTORS[(int)target.blend_dst_alpha]); + cache_target.blend_src = target.blend_src; + cache_target.blend_dst = target.blend_dst; + cache_target.blend_src_alpha = target.blend_src_alpha; + cache_target.blend_dst_alpha = target.blend_dst_alpha; + } + if (cache_target.blend_color_mask != target.blend_color_mask) { + glColorMask((GLboolean)(target.blend_color_mask & GFXColorMask::R), + (GLboolean)(target.blend_color_mask & GFXColorMask::G), + (GLboolean)(target.blend_color_mask & GFXColorMask::B), + (GLboolean)(target.blend_color_mask & GFXColorMask::A)); + cache_target.blend_color_mask = target.blend_color_mask; + } + + // bind shader resources + if (cmd->gpu_binding_layout && gpu_pso->gpu_shader) { + for(size_t j = 0; j < cmd->gpu_binding_layout->gpu_bindings.size(); ++j) { + const GLES3GPUBinding& gpu_binding = cmd->gpu_binding_layout->gpu_bindings[j]; + switch (gpu_binding.type) { + case GFXBindingType::UNIFORM_BUFFER: { + if (gpu_binding.gpu_buffer) { + for (size_t k = 0; k < gpu_pso->gpu_shader->gpu_blocks.size(); ++k) { + const GLES3GPUUniformBlock& gpu_block = gpu_pso->gpu_shader->gpu_blocks[k]; + if (cache->gl_bind_ubos[gpu_block.binding] != gpu_binding.gpu_buffer->gl_buffer) { + glBindBufferBase(GL_UNIFORM_BUFFER, gpu_block.binding, gpu_binding.gpu_buffer->gl_buffer); + cache->gl_bind_ubos[gpu_block.binding] = gpu_binding.gpu_buffer->gl_buffer; + cache->gl_uniform_buffer = gpu_binding.gpu_buffer->gl_buffer; + } + } + } + break; + } + case GFXBindingType::SAMPLER: { + if (gpu_binding.gpu_sampler) { + for (size_t k = 0; k < gpu_pso->gpu_shader->gpu_samplers.size(); ++k) { + const GLES3GPUUniformSampler& gpu_sampler = gpu_pso->gpu_shader->gpu_samplers[k]; + if (gpu_sampler.binding == gpu_binding.binding) { + for (size_t u = 0; u < gpu_sampler.units.size(); ++u) { + uint unit = (uint)gpu_sampler.units[u]; + + if (gpu_binding.gpu_tex_view && (gpu_binding.gpu_tex_view->gpu_texture->size > 0)) { + GLuint gl_texture = gpu_binding.gpu_tex_view->gpu_texture->gl_texture; + if (cache->gl_textures[unit] != gl_texture) { + if (cache->tex_uint != unit) { + glActiveTexture(GL_TEXTURE0 + unit); + cache->tex_uint = unit; + } + glBindTexture(gpu_binding.gpu_tex_view->gpu_texture->gl_target, gl_texture); + cache->gl_textures[unit] = gl_texture; + } + + if (cache->gl_samplers[unit] != gpu_binding.gpu_sampler->gl_sampler) { + glBindSampler(unit, gpu_binding.gpu_sampler->gl_sampler); + cache->gl_samplers[unit] = gpu_binding.gpu_sampler->gl_sampler; + } + } + } + break; + } + } + } + break; + } + default: + break; + } + } + } // if + + // bind vao + if (cmd->gpu_ia && gpu_pso->gpu_shader && + (is_shader_changed || gpu_ia != cmd->gpu_ia)) { + gpu_ia = cmd->gpu_ia; + if (device->use_vao()) { + const auto it = gpu_ia->gl_vaos.find(gpu_pso->gpu_shader->gl_program); + if (it != gpu_ia->gl_vaos.end()) { + GLuint gl_vao = it->second; + if (!gl_vao) { + glGenVertexArrays(1, &gl_vao); + gpu_ia->gl_vaos.insert(std::make_pair(gpu_pso->gpu_shader->gl_program, gl_vao)); + glBindVertexArray(gl_vao); + glBindBuffer(GL_ARRAY_BUFFER, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + + for (size_t j = 0; j < gpu_pso->gpu_shader->gpu_inputs.size(); ++j) { + const GLES3GPUInput& gpu_input = gpu_pso->gpu_shader->gpu_inputs[j]; + for (size_t a = 0; a < gpu_ia->attribs.size(); ++a) { + const GLES3GPUAttribute& gpu_attrib = gpu_ia->gpu_attribs[a]; + if (gpu_attrib.name == gpu_input.name) { + glBindBuffer(GL_ARRAY_BUFFER, gpu_attrib.gl_buffer); + + for (uint c = 0; c < gpu_attrib.component_count; ++c) { + GLint gl_loc = gpu_input.gl_loc + c; + uint attrib_offset = gpu_attrib.offset + gpu_attrib.size * c; + glEnableVertexAttribArray(gl_loc); + + cache->gl_enabled_attrib_locs[gl_loc] = true; + glVertexAttribPointer(gl_loc, gpu_attrib.count, gpu_attrib.gl_type, gpu_attrib.is_normalized, gpu_attrib.stride, BUFFER_OFFSET(attrib_offset)); + glVertexAttribDivisor(gl_loc, gpu_attrib.is_instanced ? 1 : 0); + } + break; + } + } // for + } // for + + if (gpu_ia->gpu_index_buffer) { + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, gpu_ia->gpu_index_buffer->gl_buffer); + } + + glBindVertexArray(0); + glBindBuffer(GL_ARRAY_BUFFER, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); + cache->gl_vao = 0; + cache->gl_array_buffer = 0; + cache->gl_element_array_buffer = 0; + } + + if (cache->gl_vao != gl_vao) { + glBindVertexArray(gl_vao); + cache->gl_vao = gl_vao; + } + } else { + for (uint a = 0; a < GFX_MAX_VERTEX_ATTRIBUTES; ++a) { + cache->gl_current_attrib_locs[a] = false; + } + + for (size_t j = 0; j < gpu_pso->gpu_shader->gpu_inputs.size(); ++j) { + const GLES3GPUInput& gpu_input = gpu_pso->gpu_shader->gpu_inputs[j]; + for (size_t a = 0; a < gpu_ia->attribs.size(); ++a) { + const GLES3GPUAttribute& gpu_attrib = gpu_ia->gpu_attribs[a]; + if (gpu_attrib.name == gpu_input.name) { + glBindBuffer(GL_ARRAY_BUFFER, gpu_attrib.gl_buffer); + + for (uint c = 0; c < gpu_attrib.component_count; ++c) { + GLint gl_loc = gpu_input.gl_loc + c; + uint attrib_offset = gpu_attrib.offset + gpu_attrib.size * c; + glEnableVertexAttribArray(gl_loc); + + cache->gl_enabled_attrib_locs[gl_loc] = true; + glVertexAttribPointer(gl_loc, gpu_attrib.count, gpu_attrib.gl_type, gpu_attrib.is_normalized, gpu_attrib.stride, BUFFER_OFFSET(attrib_offset)); + glVertexAttribDivisor(gl_loc, gpu_attrib.is_instanced ? 1 : 0); + } + break; + } + } // for + } // for + + if (gpu_ia->gpu_index_buffer) { + if (cache->gl_element_array_buffer != gpu_ia->gpu_index_buffer->gl_buffer) { + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, gpu_ia->gpu_index_buffer->gl_buffer); + cache->gl_element_array_buffer = gpu_ia->gpu_index_buffer->gl_buffer; + } + } + + for (uint a = 0; a < GFX_MAX_VERTEX_ATTRIBUTES; ++a) { + if (cache->gl_enabled_attrib_locs[a] != cache->gl_current_attrib_locs[a]) { + glDisableVertexAttribArray(a); + cache->gl_enabled_attrib_locs[a] = false; + } + } + } + } // if + } + + break; + } + case GLES3CmdType::DRAW: { + GLES3CmdDraw* cmd = cmd_package->draw_cmds[cmd_idx]; + if (gpu_ia && gpu_pso) { + if (!gpu_ia->gpu_indirect_buffer) { + if (gpu_ia->gpu_index_buffer && cmd->draw_info.index_count >= 0) { + uint8_t* offset = 0; + offset += cmd->draw_info.first_index * gpu_ia->gpu_index_buffer->stride; + if (cmd->draw_info.instance_count == 0) { + glDrawElements(gl_primitive, cmd->draw_info.index_count, gpu_ia->gl_index_type, offset); + } else { + glDrawElementsInstanced(gl_primitive, cmd->draw_info.index_count, gpu_ia->gl_index_type, offset, cmd->draw_info.instance_count); + } + } else { + if (cmd->draw_info.instance_count == 0) { + glDrawArrays(gl_primitive, cmd->draw_info.first_index, cmd->draw_info.vertex_count); + } else { + glDrawArraysInstanced(gl_primitive, cmd->draw_info.first_index, cmd->draw_info.vertex_count, cmd->draw_info.instance_count); + } + } + } else { + for (size_t j = 0; j < gpu_ia->gpu_indirect_buffer->indirect_buff.draws.size(); ++j) { + GFXDrawInfo& draw = gpu_ia->gpu_indirect_buffer->indirect_buff.draws[j]; + if (gpu_ia->gpu_index_buffer && draw.index_count >= 0) { + uint8_t* offset = 0; + offset += draw.first_index * gpu_ia->gpu_index_buffer->stride; + if (cmd->draw_info.instance_count == 0) { + glDrawElements(gl_primitive, draw.index_count, gpu_ia->gl_index_type, offset); + } else { + glDrawElementsInstanced(gl_primitive, draw.index_count, gpu_ia->gl_index_type, offset, cmd->draw_info.instance_count); + } + } else { + if (cmd->draw_info.instance_count == 0) { + glDrawArrays(gl_primitive, draw.first_index, draw.vertex_count); + } else { + glDrawArraysInstanced(gl_primitive, draw.first_index, draw.vertex_count, cmd->draw_info.instance_count); + } + } + } + } + } + break; + } + case GLES3CmdType::UPDATE_BUFFER: { + GLES3CmdUpdateBuffer* cmd = cmd_package->update_buffer_cmds[cmd_idx]; + GLES3CmdFuncUpdateBuffer(device, cmd->gpu_buffer, cmd->buffer, cmd->offset, cmd->size); + break; + } + case GLES3CmdType::COPY_BUFFER_TO_TEXTURE: { + GLES3CmdCopyBufferToTexture* cmd = cmd_package->copy_buffer_to_texture_cmds[cmd_idx]; + GLES3CmdFuncCopyBuffersToTexture(device, &(cmd->gpu_buffer->buffer), 1, cmd->gpu_texture, cmd->regions); + break; + } + default: + break; + } + } +} + +void GLES3CmdFuncCopyBuffersToTexture(GLES3Device* device, uint8_t** buffers, uint count, GLES3GPUTexture* gpu_texture, const GFXBufferTextureCopyList& regions) { + GLuint gl_texture = device->state_cache->gl_textures[device->state_cache->tex_uint]; + if (gl_texture != gpu_texture->gl_texture) { + glBindTexture(gpu_texture->gl_target, gpu_texture->gl_texture); + device->state_cache->gl_textures[device->state_cache->tex_uint] = gl_texture; + } + + bool is_compressed = GFX_FORMAT_INFOS[(int)gpu_texture->format].is_compressed; + uint n = 0; + + switch (gpu_texture->gl_target) { + case GL_TEXTURE_2D: { + uint w; + uint h; + for (size_t i = 0; i < regions.size(); ++i) { + const GFXBufferTextureCopy& region = regions[i]; + n = 0; + w = region.tex_extent.width; + h = region.tex_extent.height; + for (uint m = region.tex_subres.base_mip_level; m < region.tex_subres.base_mip_level + region.tex_subres.level_count; ++m) { + uint8_t* buff = region.buff_offset + region.buff_tex_height * region.buff_stride + buffers[n++]; + if (!is_compressed) { + glTexSubImage2D(GL_TEXTURE_2D, m, region.tex_offset.x, region.tex_offset.y, w, h, gpu_texture->gl_format, gpu_texture->gl_type, (GLvoid*)buff); + } else { + GLsizei memSize = (GLsizei)GFXFormatSize(gpu_texture->format, w, h, 1); + glCompressedTexSubImage2D(GL_TEXTURE_2D, m, region.tex_offset.x, region.tex_offset.y, w, h, gpu_texture->gl_format, memSize, (GLvoid*)buff); + } + + w = std::max(w >> 1, 1U); + h = std::max(h >> 1, 1U); + } + } + break; + } + case GL_TEXTURE_2D_ARRAY: { + uint w; + uint h; + for (size_t i = 0; i < regions.size(); ++i) { + const GFXBufferTextureCopy& region = regions[i]; + n = 0; + uint d = region.tex_subres.layer_count; + uint layer_count = d + region.tex_subres.base_array_layer; + + for (uint z = region.tex_subres.base_array_layer; z < layer_count; ++z) { + w = region.tex_extent.width; + h = region.tex_extent.height; + for (uint m = region.tex_subres.base_mip_level; m < region.tex_subres.base_mip_level + region.tex_subres.level_count; ++m) { + uint8_t* buff = region.buff_offset + region.buff_tex_height * region.buff_stride + buffers[n++]; + if (!is_compressed) { + glTexSubImage3D(GL_TEXTURE_2D_ARRAY, m, region.tex_offset.x, region.tex_offset.y, z, + w, h, d, gpu_texture->gl_format, gpu_texture->gl_type, (GLvoid*)buff); + } + else { + GLsizei memSize = (GLsizei)GFXFormatSize(gpu_texture->format, w, h, 1); + glCompressedTexSubImage3D(GL_TEXTURE_2D_ARRAY, m, region.tex_offset.x, region.tex_offset.y, z, + w, h, d, gpu_texture->gl_format, memSize, (GLvoid*)buff); + } + + w = std::max(w >> 1, 1U); + h = std::max(h >> 1, 1U); + } + } + } + break; + } + case GL_TEXTURE_3D: { + uint w; + uint h; + uint d; + for (size_t i = 0; i < regions.size(); ++i) { + const GFXBufferTextureCopy& region = regions[i]; + n = 0; + w = region.tex_extent.width; + h = region.tex_extent.height; + d = region.tex_extent.depth; + for (uint m = region.tex_subres.base_mip_level; m < region.tex_subres.base_mip_level + region.tex_subres.level_count; ++m) { + uint8_t* buff = region.buff_offset + region.buff_tex_height * region.buff_stride + buffers[n++]; + if (!is_compressed) { + glTexSubImage3D(GL_TEXTURE_3D, m, region.tex_offset.x, region.tex_offset.y, region.tex_offset.z, + w, h, d, gpu_texture->gl_format, gpu_texture->gl_type, (GLvoid*)buff); + } + else { + GLsizei memSize = (GLsizei)GFXFormatSize(gpu_texture->format, w, d + 1, 1); + glCompressedTexSubImage3D(GL_TEXTURE_3D, m, region.tex_offset.x, region.tex_offset.y, region.tex_offset.z, + w, h, d, gpu_texture->gl_format, memSize, (GLvoid*)buff); + } + + w = std::max(w >> 1, 1U); + h = std::max(h >> 1, 1U); + d = std::max(d >> 1, 1U); + } + } + break; + } + case GL_TEXTURE_CUBE_MAP: { + uint w; + uint h; + uint f; + for (size_t i = 0; i < regions.size(); ++i) { + const GFXBufferTextureCopy& region = regions[i]; + n = 0; + + uint face_count = region.tex_subres.base_array_layer + region.tex_subres.layer_count; + for (f = region.tex_subres.base_array_layer; f < face_count; ++f) { + w = region.tex_extent.width; + h = region.tex_extent.height; + + for (uint m = region.tex_subres.base_mip_level; m < region.tex_subres.base_mip_level + region.tex_subres.level_count; ++m) { + uint8_t* buff = region.buff_offset + region.buff_tex_height * region.buff_stride + buffers[n++]; + if (!is_compressed) { + glTexSubImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + f, m, region.tex_offset.x, region.tex_offset.y, w, h, gpu_texture->gl_format, gpu_texture->gl_type, (GLvoid*)buff); + } + else { + GLsizei memSize = (GLsizei)GFXFormatSize(gpu_texture->format, w, h, 1); + glCompressedTexSubImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + f, m, region.tex_offset.x, region.tex_offset.y, w, h, gpu_texture->gl_format, memSize, (GLvoid*)buff); + } + + w = std::max(w >> 1, 1U); + h = std::max(h >> 1, 1U); + } + } + } + break; + } + default: + CC_ASSERTS(false, "Unsupported GFXTextureType, copy buffers to texture failed."); + break; + } +} + + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles3/GLES3Commands.h b/native/cocos/renderer/gfx-gles3/GLES3Commands.h new file mode 100644 index 0000000000..85e56dbcf0 --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3Commands.h @@ -0,0 +1,193 @@ +#ifndef CC_GFXGLES3_COMMANDS_H_ +#define CC_GFXGLES3_COMMANDS_H_ + +#include "GLES3GPUObjects.h" + +CC_NAMESPACE_BEGIN + +class GLES3Device; + +struct GLES3DepthBias { + float constant = 0.0f; + float clamp = 0.0f; + float slope = 0.0f; +}; + +struct GLES3DepthBounds { + float min_bounds = 0.0f; + float max_bounds = 0.0f; +}; + +struct GLES3StencilWriteMask { + GFXStencilFace face = GFXStencilFace::FRONT; + GLuint write_mask = 0; +}; + +struct GLES3StencilCompareMask { + GFXStencilFace face = GFXStencilFace::FRONT; + GLint refrence = 0; + GLuint compare_mask = 0; +}; + +struct GLES3TextureSubres { + uint base_mip_level = 0; + uint level_count = 1; + uint base_array_layer = 0; + uint layer_count = 1; +}; + +struct GLES3BufferTextureCopy { + uint buff_offset = 0; + uint buff_stride = 0; + uint buff_tex_height = 0; + uint tex_offset[3] = {0}; + uint tex_extent[3] = {0}; + GLES3TextureSubres tex_subres; +}; + +enum class GLES3CmdType : uint8_t { + BEGIN_RENDER_PASS, + END_RENDER_PASS, + BIND_STATES, + DRAW, + UPDATE_BUFFER, + COPY_BUFFER_TO_TEXTURE, + COUNT, +}; + +class GLES3Cmd : public Object { + public: + GLES3CmdType type; + uint ref_count = 0; + + GLES3Cmd(GLES3CmdType _type) : type(_type) {} + virtual ~GLES3Cmd() {} + + virtual void Clear() = 0; +}; + +class GLES3CmdBeginRenderPass : public GLES3Cmd { + public: + GLES3GPUFramebuffer* gpu_fbo = nullptr; + GFXRect render_area; + GFXClearFlags clear_flags = GFXClearFlagBit::NONE; + uint num_clear_colors = 0; + GFXColor clear_colors[GFX_MAX_ATTACHMENTS]; + float clear_depth = 1.0f; + int clear_stencil = 0; + + GLES3CmdBeginRenderPass() : GLES3Cmd(GLES3CmdType::BEGIN_RENDER_PASS) {} + + void Clear() { + gpu_fbo = nullptr; + num_clear_colors = 0; + } +}; + +enum class GLES3State : uint8_t { + VIEWPORT, + SCISSOR, + LINE_WIDTH, + DEPTH_BIAS, + BLEND_CONSTANTS, + DEPTH_BOUNDS, + STENCIL_WRITE_MASK, + STENCIL_COMPARE_MASK, + COUNT, +}; + +class GLES3CmdBindStates : public GLES3Cmd { + public: + GLES3GPUPipelineState* gpu_pso = nullptr; + GLES3GPUBindingLayout* gpu_binding_layout = nullptr; + GLES3GPUInputAssembler* gpu_ia = nullptr; + uint8_t state_flags[(int)GLES3State::COUNT] = {0}; + GFXViewport viewport; + GFXRect scissor; + float line_width = 1.0f; + GLES3DepthBias depth_bias; + GFXColor blend_constants; + GLES3DepthBounds depth_bounds; + GLES3StencilWriteMask stencil_write_mask; + GLES3StencilCompareMask stencil_compare_mask; + + GLES3CmdBindStates() : GLES3Cmd(GLES3CmdType::BIND_STATES) {} + + void Clear() { + gpu_pso = nullptr; + gpu_binding_layout = nullptr; + gpu_ia = nullptr; + memset(state_flags, 0, sizeof(state_flags)); + } +}; + +class GLES3CmdDraw : public GLES3Cmd { + public: + GFXDrawInfo draw_info; + + GLES3CmdDraw() : GLES3Cmd(GLES3CmdType::DRAW) {} + void Clear() {} +}; + +class GLES3CmdUpdateBuffer : public GLES3Cmd { + public: + GLES3GPUBuffer* gpu_buffer = nullptr; + uint8_t* buffer = nullptr; + uint size = 0; + uint offset = 0; + + GLES3CmdUpdateBuffer() : GLES3Cmd(GLES3CmdType::UPDATE_BUFFER) {} + + void Clear() { + gpu_buffer = nullptr; + buffer = nullptr; + } +}; + +class GLES3CmdCopyBufferToTexture : public GLES3Cmd { + public: + GLES3GPUBuffer* gpu_buffer = nullptr; + GLES3GPUTexture* gpu_texture = nullptr; + GFXTextureLayout dst_layout; + GFXBufferTextureCopyList regions; + + GLES3CmdCopyBufferToTexture() : GLES3Cmd(GLES3CmdType::COPY_BUFFER_TO_TEXTURE) {} + + void Clear() { + gpu_buffer = nullptr; + gpu_texture = nullptr; + regions.clear(); + } +}; + +class GLES3CmdPackage : public Object { + public: + CachedArray cmd_types; + CachedArray begin_render_pass_cmds; + CachedArray bind_states_cmds; + CachedArray draw_cmds; + CachedArray update_buffer_cmds; + CachedArray copy_buffer_to_texture_cmds; +}; + +CC_GLES3_API void GLES3CmdFuncCreateBuffer(GLES3Device* device, GLES3GPUBuffer* gpu_buffer); +CC_GLES3_API void GLES3CmdFuncDestroyBuffer(GLES3Device* device, GLES3GPUBuffer* gpu_buffer); +CC_GLES3_API void GLES3CmdFuncResizeBuffer(GLES3Device* device, GLES3GPUBuffer* gpu_buffer); +CC_GLES3_API void GLES3CmdFuncUpdateBuffer(GLES3Device* device, GLES3GPUBuffer* gpu_buffer, void* buffer, uint offset, uint size); +CC_GLES3_API void GLES3CmdFuncCreateTexture(GLES3Device* device, GLES3GPUTexture* gpu_texture); +CC_GLES3_API void GLES3CmdFuncDestroyTexture(GLES3Device* device, GLES3GPUTexture* gpu_texture); +CC_GLES3_API void GLES3CmdFuncResizeTexture(GLES3Device* device, GLES3GPUTexture* gpu_texture); +CC_GLES3_API void GLES3CmdFuncCreateSampler(GLES3Device* device, GLES3GPUSampler* gpu_sampler); +CC_GLES3_API void GLES3CmdFuncDestroySampler(GLES3Device* device, GLES3GPUSampler* gpu_sampler); +CC_GLES3_API void GLES3CmdFuncCreateShader(GLES3Device* device, GLES3GPUShader* gpu_shader); +CC_GLES3_API void GLES3CmdFuncDestroyShader(GLES3Device* device, GLES3GPUShader* gpu_shader); +CC_GLES3_API void GLES3CmdFuncCreateInputAssembler(GLES3Device* device, GLES3GPUInputAssembler* gpu_ia); +CC_GLES3_API void GLES3CmdFuncDestroyInputAssembler(GLES3Device* device, GLES3GPUInputAssembler* gpu_ia); +CC_GLES3_API void GLES3CmdFuncCreateFramebuffer(GLES3Device* device, GLES3GPUFramebuffer* gpu_fbo); +CC_GLES3_API void GLES3CmdFuncDestroyFramebuffer(GLES3Device* device, GLES3GPUFramebuffer* gpu_fbo); +CC_GLES3_API void GLES3CmdFuncExecuteCmds(GLES3Device* device, GLES3CmdPackage* cmd_package); +CC_GLES3_API void GLES3CmdFuncCopyBuffersToTexture(GLES3Device* device, uint8_t** buffers, uint count, GLES3GPUTexture* gpu_texture, const GFXBufferTextureCopyList& regions); + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3Device.cc b/native/cocos/renderer/gfx-gles3/GLES3Device.cc new file mode 100644 index 0000000000..1bcb5f00d3 --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3Device.cc @@ -0,0 +1,262 @@ +#include "GLES3Std.h" +#include "GLES3Device.h" +#include "GLES3StateCache.h" +#include "GLES3EGLContext.h" +#include "GLES3Window.h" +#include "GLES3Queue.h" +#include "GLES3CommandAllocator.h" +#include "GLES3CommandBuffer.h" +#include "GLES3Buffer.h" +#include "GLES3Texture.h" +#include "GLES3TextureView.h" +#include "GLES3Sampler.h" +#include "GLES3Shader.h" +#include "GLES3InputAssembler.h" +#include "GLES3RenderPass.h" +#include "GLES3Framebuffer.h" +#include "GLES3BindingLayout.h" + +CC_NAMESPACE_BEGIN + +GLES3Device::GLES3Device() + : state_cache(nullptr), + use_vao_(true) { +} + +GLES3Device::~GLES3Device() { +} + +bool GLES3Device::Initialize(const GFXDeviceInfo& info) { + + api_ = GFXAPI::GLES3; + width_ = info.width; + height_ = info.height; + native_width_ = info.native_width; + native_height_ = info.native_height; + window_handle_ = info.window_handle; + + state_cache = CC_NEW(GLES3StateCache); + + GFXContextInfo ctx_info; + ctx_info.window_handle = window_handle_; + ctx_info.shared_ctx = info.shared_ctx; + + context_ = CC_NEW(GLES3EGLContext(this)); + if (!context_->Initialize(ctx_info)) { + Destroy(); + return false; + } + + String extStr = (const char*)glGetString(GL_EXTENSIONS); + extensions_ = StringUtil::Split(extStr, " "); + + features_[(int)GFXFeature::TEXTURE_FLOAT] = true; + features_[(int)GFXFeature::TEXTURE_HALF_FLOAT] = true; + features_[(int)GFXFeature::FORMAT_R11G11B10F] = true; + features_[(int)GFXFeature::FORMAT_D24S8] = true; + features_[(int)GFXFeature::MSAA] = true; + + if (CheckExtension("color_buffer_float")) { + features_[(int)GFXFeature::COLOR_FLOAT] = true; + } + if (CheckExtension("color_buffer_half_float")) { + features_[(int)GFXFeature::COLOR_HALF_FLOAT] = true; + } + if (CheckExtension("texture_float_linear")) { + features_[(int)GFXFeature::TEXTURE_FLOAT_LINEAR] = true; + } + if (CheckExtension("texture_half_float_linear")) { + features_[(int)GFXFeature::TEXTURE_HALF_FLOAT_LINEAR] = true; + } + + String compressed_fmts; + + if (CheckExtension("compressed_ETC1")) { + features_[(int)GFXFeature::FORMAT_ETC1] = true; + compressed_fmts += "etc1 "; + } + + features_[(int)GFXFeature::FORMAT_ETC2] = true; + compressed_fmts += "etc2 "; + + if (CheckExtension("texture_compression_pvrtc")) { + features_[(int)GFXFeature::FORMAT_PVRTC] = true; + compressed_fmts += "pvrtc "; + } + + if (CheckExtension("texture_compression_astc")) { + features_[(int)GFXFeature::FORMAT_ASTC] = true; + compressed_fmts += "astc "; + } + + renderer_ = (const char*)glGetString(GL_RENDERER); + vendor_ = (const char*)glGetString(GL_VENDOR); + version_ = (const char*)glGetString(GL_VERSION); + + CC_LOG_INFO("RENDERER: %s", renderer_.c_str()); + CC_LOG_INFO("VENDOR: %s", vendor_.c_str()); + CC_LOG_INFO("VERSION: %s", version_.c_str()); + CC_LOG_INFO("SCREEN_SIZE: %d x %d", width_, height_); + CC_LOG_INFO("NATIVE_SIZE: %d x %d", native_width_, native_height_); + CC_LOG_INFO("USE_VAO: %s", use_vao_ ? "true" : "false"); + CC_LOG_INFO("COMPRESSED_FORMATS: %s", compressed_fmts.c_str()); + + GFXWindowInfo window_info; + window_info.color_fmt = context_->color_fmt(); + window_info.depth_stencil_fmt = context_->depth_stencil_fmt(); + window_info.is_offscreen = false; + window_ = CreateGFXWindow(window_info); + + GFXQueueInfo queue_info; + queue_info.type = GFXQueueType::GRAPHICS; + queue_ = CreateGFXQueue(queue_info); + + GFXCommandAllocatorInfo cmd_alloc_info; + cmd_allocator_ = CreateGFXCommandAllocator(cmd_alloc_info); + + return true; +} + +void GLES3Device::Destroy() { + CC_SAFE_DESTROY(cmd_allocator_); + CC_SAFE_DESTROY(queue_); + CC_SAFE_DESTROY(window_); + CC_SAFE_DESTROY(context_); + CC_SAFE_DELETE(state_cache); +} + +void GLES3Device::Resize(uint width, uint height) { + +} + +void GLES3Device::Present() { + ((GLES3CommandAllocator*)cmd_allocator_)->ReleaseCmds(); + GLES3Queue* queue = (GLES3Queue*)queue_; + num_draw_calls_ += queue->num_draw_calls_; + num_tris_ += queue->num_tris_; + + context_->Present(); + + // Clear queue stats + queue->num_draw_calls_ = 0; + queue->num_tris_ = 0; +} + +GFXWindow* GLES3Device::CreateGFXWindow(const GFXWindowInfo& info) { + GFXWindow* gfx_window = CC_NEW(GLES3Window(this)); + if (gfx_window->Initialize(info)) { + return gfx_window; + } else { + return nullptr; + } +} + +GFXQueue* GLES3Device::CreateGFXQueue(const GFXQueueInfo& info) { + GFXQueue* gfx_queue = CC_NEW(GLES3Queue(this)); + if (gfx_queue->Initialize(info)) { + return gfx_queue; + } else { + return nullptr; + } +} + +GFXCommandAllocator* GLES3Device::CreateGFXCommandAllocator(const GFXCommandAllocatorInfo& info) { + GFXCommandAllocator* gfx_cmd_allocator = CC_NEW(GLES3CommandAllocator(this)); + if (gfx_cmd_allocator->Initialize(info)) { + return gfx_cmd_allocator; + } else { + return nullptr; + } +} + +GFXCommandBuffer* GLES3Device::CreateGFXCommandBuffer(const GFXCommandBufferInfo& info) { + GFXCommandBuffer* gfx_cmd_buff = CC_NEW(GLES3CommandBuffer(this)); + if (gfx_cmd_buff->Initialize(info)) { + return gfx_cmd_buff; + } else { + return nullptr; + } +} + +GFXBuffer* GLES3Device::CreateGFXBuffer(const GFXBufferInfo& info) { + GFXBuffer* gfx_buffer = CC_NEW(GLES3Buffer(this)); + if (gfx_buffer->Initialize(info)) { + return gfx_buffer; + } else { + return nullptr; + } +} + +GFXTexture* GLES3Device::CreateGFXTexture(const GFXTextureInfo& info) { + GFXTexture* gfx_texture = CC_NEW(GLES3Texture(this)); + if (gfx_texture->Initialize(info)) { + return gfx_texture; + } else { + return nullptr; + } +} + +GFXTextureView* GLES3Device::CreateGFXTextureView(const GFXTextureViewInfo& info) { + GFXTextureView* gfx_tex_view = CC_NEW(GLES3TextureView(this)); + if (gfx_tex_view->Initialize(info)) { + return gfx_tex_view; + } else { + return nullptr; + } +} + +GFXSampler* GLES3Device::CreateGFXSampler(const GFXSamplerInfo& info) { + GFXSampler* gfx_sampler = CC_NEW(GLES3Sampler(this)); + if (gfx_sampler->Initialize(info)) { + return gfx_sampler; + } else { + return nullptr; + } +} + +GFXShader* GLES3Device::CreateGFXShader(const GFXShaderInfo& info) { + GFXShader* gfx_shader = CC_NEW(GLES3Shader(this)); + if (gfx_shader->Initialize(info)) { + return gfx_shader; + } else { + return nullptr; + } +} + +GFXInputAssembler* GLES3Device::CreateGFXInputAssembler(const GFXInputAssemblerInfo& info) { + GFXInputAssembler* gfx_input_assembler = CC_NEW(GLES3InputAssembler(this)); + if (gfx_input_assembler->Initialize(info)) { + return gfx_input_assembler; + } else { + return nullptr; + } +} + +GFXRenderPass* GLES3Device::CreateGFXRenderPass(const GFXRenderPassInfo& info) { + GFXRenderPass* gfx_render_pass = CC_NEW(GLES3RenderPass(this)); + if (gfx_render_pass->Initialize(info)) { + return gfx_render_pass; + } else { + return nullptr; + } +} + +GFXFramebuffer* GLES3Device::CreateGFXFramebuffer(const GFXFramebufferInfo& info) { + GFXFramebuffer* gfx_framebuffer = CC_NEW(GLES3Framebuffer(this)); + if (gfx_framebuffer->Initialize(info)) { + return gfx_framebuffer; + } else { + return nullptr; + } +} + +GFXBindingLayout* GLES3Device::CreateGFXBindingLayout(const GFXBindingLayoutInfo& info) { + GFXBindingLayout* gfx_binding_layout = CC_NEW(GLES3BindingLayout(this)); + if (gfx_binding_layout->Initialize(info)) { + return gfx_binding_layout; + } else { + return nullptr; + } +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles3/GLES3Device.h b/native/cocos/renderer/gfx-gles3/GLES3Device.h new file mode 100644 index 0000000000..1e7cee9fee --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3Device.h @@ -0,0 +1,52 @@ +#ifndef CC_GFXGLES3_GLES3_DEVICE_H_ +#define CC_GFXGLES3_GLES3_DEVICE_H_ + +CC_NAMESPACE_BEGIN + +class GLES3StateCache; + +class CC_GLES3_API GLES3Device : public GFXDevice { +public: + GLES3Device(); + ~GLES3Device(); + + GLES3StateCache* state_cache; + +public: + bool Initialize(const GFXDeviceInfo& info); + void Destroy(); + void Resize(uint width, uint height); + void Present(); + GFXWindow* CreateGFXWindow(const GFXWindowInfo& info); + GFXQueue* CreateGFXQueue(const GFXQueueInfo& info); + GFXCommandAllocator* CreateGFXCommandAllocator(const GFXCommandAllocatorInfo& info); + GFXCommandBuffer* CreateGFXCommandBuffer(const GFXCommandBufferInfo& info); + GFXBuffer* CreateGFXBuffer(const GFXBufferInfo& info); + GFXTexture* CreateGFXTexture(const GFXTextureInfo& info); + GFXTextureView* CreateGFXTextureView(const GFXTextureViewInfo& info); + GFXSampler* CreateGFXSampler(const GFXSamplerInfo& info); + GFXShader* CreateGFXShader(const GFXShaderInfo& info); + GFXInputAssembler* CreateGFXInputAssembler(const GFXInputAssemblerInfo& info); + GFXRenderPass* CreateGFXRenderPass(const GFXRenderPassInfo& info); + GFXFramebuffer* CreateGFXFramebuffer(const GFXFramebufferInfo& info); + GFXBindingLayout* CreateGFXBindingLayout(const GFXBindingLayoutInfo& info); + + CC_INLINE bool use_vao() const { return use_vao_; } + + CC_INLINE bool CheckExtension(const String& extension) const { + for (size_t i = 0; i < extensions_.size(); ++i) { + if (extensions_[i].find(extension) != String::npos) { + return true; + } + } + return false; + } + + private: + StringArray extensions_; + bool use_vao_; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3EGLContext.cc b/native/cocos/renderer/gfx-gles3/GLES3EGLContext.cc new file mode 100644 index 0000000000..66bcf9b006 --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3EGLContext.cc @@ -0,0 +1,441 @@ +#include "GLES3Std.h" +#include "GLES3EGLContext.h" +#include "gles3w.h" + +// #define CC_GFX_DEBUG + +CC_NAMESPACE_BEGIN + +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) + +void APIENTRY GLES3EGLDebugProc(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam) +{ + String source_desc; + switch (source) + { + case GL_DEBUG_SOURCE_API_KHR: source_desc = "API"; break; + case GL_DEBUG_SOURCE_SHADER_COMPILER_KHR: source_desc = "SHADER_COMPILER"; break; + case GL_DEBUG_SOURCE_WINDOW_SYSTEM_KHR: source_desc = "WINDOW_SYSTEM"; break; + case GL_DEBUG_SOURCE_THIRD_PARTY_KHR: source_desc = "THIRD_PARTY"; break; + case GL_DEBUG_SOURCE_APPLICATION_KHR: source_desc = "APPLICATION"; break; + default: source_desc = "OTHER"; + } + + String type_desc; + switch (severity) + { + case GL_DEBUG_TYPE_ERROR_KHR: type_desc = "ERROR"; break; + case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR: type_desc = "PEPRECATED_BEHAVIOR"; break; + case GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR: type_desc = "UNDEFINED_BEHAVIOR"; break; + case GL_DEBUG_TYPE_PERFORMANCE_KHR: type_desc = "PERFORMANCE"; break; + case GL_DEBUG_TYPE_PORTABILITY_KHR: type_desc = "PORTABILITY"; break; + case GL_DEBUG_TYPE_MARKER_KHR: type_desc = "MARKER"; break; + case GL_DEBUG_TYPE_PUSH_GROUP_KHR: type_desc = "PUSH_GROUP"; break; + case GL_DEBUG_TYPE_POP_GROUP_KHR: type_desc = "POP_GROUP"; break; + default: type_desc = "OTHER"; + } + + String severity_desc; + switch (severity) + { + case GL_DEBUG_SEVERITY_HIGH_KHR: severity_desc = "HIGH"; break; + case GL_DEBUG_SEVERITY_MEDIUM_KHR: severity_desc = "MEDIUM"; break; + case GL_DEBUG_SEVERITY_LOW_KHR: severity_desc = "LOW"; break; + default: severity_desc = "NOTIFICATION"; + } + + String msg = StringUtil::Format("source: %s, type: %s, severity: %s, message: %s", + source_desc.c_str(), type_desc.c_str(), severity_desc.c_str(), message); + + if (severity == GL_DEBUG_SEVERITY_HIGH_KHR) + { +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) + CC_ASSERTS(false, msg.c_str()); +#else + CC_LOG_ERROR(msg.c_str()); +#endif + } else { + CC_LOG_DEBUG(msg.c_str()); + } +} + +#endif + +GLES3EGLContext::GLES3EGLContext(GFXDevice* device) + : GFXContext(device), + is_primary_ctx_(false), + native_display_(0), + egl_display_(EGL_NO_DISPLAY), + egl_config_(EGL_NO_CONFIG_KHR), + egl_surface_(EGL_NO_SURFACE), + egl_context_(EGL_NO_CONTEXT), + egl_shared_ctx_(EGL_NO_CONTEXT), + major_ver_(0), + minor_ver_(0), + is_initialized(false) { +} + +GLES3EGLContext::~GLES3EGLContext() { +} + +bool GLES3EGLContext::Initialize(const GFXContextInfo &info) { + + vsync_mode_ = info.vsync_mode; + window_handle_ = info.window_handle; + + ////////////////////////////////////////////////////////////////////////// + + if (!info.shared_ctx) + { + is_primary_ctx_ = true; + window_handle_ = info.window_handle; + +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) + native_display_ = (NativeDisplayType)GetDC((HWND)window_handle_); + if (!native_display_) { + return false; + } + + egl_display_ = eglGetDisplay(native_display_); + if (egl_display_ == EGL_NO_DISPLAY) { + egl_display_ = eglGetDisplay((EGLNativeDisplayType)EGL_DEFAULT_DISPLAY); + } +#else + egl_display_ = eglGetDisplay((EGLNativeDisplayType)EGL_DEFAULT_DISPLAY); +#endif + // If a display still couldn't be obtained, return an error. + if (egl_display_ == EGL_NO_DISPLAY) { + CC_LOG_ERROR("eglGetDisplay() - FAILED."); + return false; + } + + EGLint major = 0; + EGLint minor = 0; + if (eglInitialize(egl_display_, &major, &minor) != EGL_TRUE) { + CC_LOG_ERROR("Couldn't initialize EGLDisplay."); + return false; + } + + // Make OpenGL ES the current API. + // EGL needs a way to know that any subsequent EGL calls are going to be affecting OpenGL ES, + // rather than any other API (such as OpenVG). + eglBindAPI(EGL_OPENGL_ES_API); + + if (!gles3wInit()) + { + return false; + } + + color_fmt_ = GFXFormat::RGBA8; + depth_stencil_fmt_ = GFXFormat::D24S8; + + const EGLint attribs[] = { + EGL_SURFACE_TYPE, EGL_WINDOW_BIT | EGL_PBUFFER_BIT, + // EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, + EGL_RENDERABLE_TYPE, EGL_OPENGL_ES3_BIT_KHR, + // EGL_BUFFER_SIZE, colorBuffSize, + EGL_BLUE_SIZE, 8, + EGL_GREEN_SIZE, 8, + EGL_RED_SIZE, 8, + EGL_ALPHA_SIZE, 8, + EGL_DEPTH_SIZE, 24, + EGL_STENCIL_SIZE, 8, + EGL_NONE + }; + + // Find a suitable EGLConfig + // eglChooseConfig is provided by EGL to provide an easy way to select an appropriate configuration. It takes in the capabilities + // specified in the attribute list, and returns a list of available configurations that match or exceed the capabilities requested. + // Details of all the possible attributes and how they are selected for by this function are available in the EGL reference pages here: + // http://www.khronos.org/registry/egl/sdk/docs/man/xhtml/eglChooseConfig.html + // It is also possible to simply get the entire list of configurations and use a custom algorithm to choose a suitable one, as many + // advanced applications choose to do. For this application however, taking the first EGLConfig that the function returns suits + // its needs perfectly, so we limit it to returning a single EGLConfig. + + EGLint num_configs; + if (eglChooseConfig(egl_display_, attribs, &egl_config_, 1, &num_configs) == EGL_FALSE || num_configs <= 0) + { + CC_LOG_ERROR("Choosing configuration failed."); + return false; + } + + EGLint depth = attribs[13]; + EGLint stencil = attribs[15]; + CC_LOG_INFO("Setup EGLConfig: depth [%d] stencil [%d]", depth, stencil); + + if (depth == 16 && stencil == 0) { + depth_stencil_fmt_ = GFXFormat::D16; + } else if (depth == 16 && stencil == 8) { + depth_stencil_fmt_ = GFXFormat::D16S8; + } else if (depth == 24 && stencil == 0) { + depth_stencil_fmt_ = GFXFormat::D24; + } else if (depth == 24 && stencil == 8) { + depth_stencil_fmt_ = GFXFormat::D24S8; + } else if (depth == 32 && stencil == 0) { + depth_stencil_fmt_ = GFXFormat::D32F; + } else if (depth == 32 && stencil == 8) { + depth_stencil_fmt_ = GFXFormat::D32F_S8; + } else { + CC_LOG_ERROR("Unknown depth stencil format."); + return false; + } + + CC_LOG_INFO("Chosen EGLConfig: color [%s], depth stencil [%s].", + GFX_FORMAT_INFOS[(int)color_fmt_].name.c_str(), + GFX_FORMAT_INFOS[(int)depth_stencil_fmt_].name.c_str()); + + /* EGL_NATIVE_VISUAL_ID is an attribute of the EGLConfig that is + * guaranteed to be accepted by ANativeWindow_setBuffersGeometry(). + * As soon as we picked a EGLConfig, we can safely reconfigure the + * ANativeWindow buffers to match, using EGL_NATIVE_VISUAL_ID. */ + +#if (CC_PLATFORM == CC_PLATFORM_ANDROID) + EGLint n_fmt; + if (eglGetConfigAttrib(egl_display_, egl_config_, EGL_NATIVE_VISUAL_ID, &n_fmt) == EGL_FALSE) { + CC_LOG_ERROR("Getting configuration attributes failed."); + return false; + } + + uint width = device_->width(); + uint height = device_->height(); + ANativeWindow_setBuffersGeometry((ANativeWindow*)window_handle_, width, height, n_fmt); +#endif + + egl_surface_ = eglCreateWindowSurface(egl_display_, egl_config_, (EGLNativeWindowType)window_handle_, NULL); + if (egl_surface_ == EGL_NO_SURFACE) { + CC_LOG_ERROR("Window surface created failed."); + return false; + } + + //String egl_vendor = eglQueryString(egl_display_, EGL_VENDOR); + //String egl_version = eglQueryString(egl_display_, EGL_VERSION); + + extensions_ = StringUtil::Split((const char*)eglQueryString(egl_display_, EGL_EXTENSIONS), " "); + + major_ver_ = 3; + minor_ver_ = 0; + EGLint ctx_attribs[32]; + uint n = 0; + + bool has_khr_create_ctx = CheckExtension(CC_TOSTR(EGL_KHR_create_context)); + if (has_khr_create_ctx) { + for (int m = 2; m >= 0; --m) { + n = 0; + ctx_attribs[n++] = EGL_CONTEXT_MAJOR_VERSION_KHR; + ctx_attribs[n++] = major_ver_; + ctx_attribs[n++] = EGL_CONTEXT_MINOR_VERSION_KHR; + ctx_attribs[n++] = m; + +#ifdef CC_GFX_DEBUG + ctx_attribs[n++] = EGL_CONTEXT_FLAGS_KHR; + ctx_attribs[n++] = EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR; +#endif + ctx_attribs[n] = EGL_NONE; + + egl_context_ = eglCreateContext(egl_display_, egl_config_, NULL, ctx_attribs); + if (egl_context_) { + minor_ver_ = m; + break; + } + } + } else { + ctx_attribs[n++] = EGL_CONTEXT_CLIENT_VERSION; + ctx_attribs[n++] = major_ver_; + ctx_attribs[n] = EGL_NONE; + egl_context_ = eglCreateContext(egl_display_, egl_config_, NULL, ctx_attribs); + } + + if (!egl_context_) { + CC_LOG_ERROR("Create EGL context failed."); + return false; + } + + egl_shared_ctx_ = egl_context_; + } else { + GLES3EGLContext* shared_ctx = (GLES3EGLContext*)info.shared_ctx; + + major_ver_ = shared_ctx->major_ver(); + minor_ver_ = shared_ctx->minor_ver(); + native_display_ = shared_ctx->native_display(); + egl_display_ = shared_ctx->egl_display(); + egl_config_ = shared_ctx->egl_config(); + egl_shared_ctx_ = shared_ctx->egl_shared_ctx(); + color_fmt_ = shared_ctx->color_fmt(); + depth_stencil_fmt_ = shared_ctx->depth_stencil_fmt(); + + EGLint pbuff_attribs[] = + { + EGL_WIDTH, 2, + EGL_HEIGHT, 2, + EGL_LARGEST_PBUFFER, EGL_TRUE, + EGL_TEXTURE_FORMAT, EGL_NO_TEXTURE, + EGL_TEXTURE_TARGET, EGL_NO_TEXTURE, + EGL_NONE + }; + + egl_surface_ = eglCreatePbufferSurface(egl_display_, egl_config_, pbuff_attribs); + if (egl_surface_ == EGL_NO_SURFACE) { + CC_LOG_ERROR("eglCreatePbufferSurface - FAILED"); + return false; + } + + major_ver_ = 3; + minor_ver_ = shared_ctx->minor_ver(); + + bool has_khr_create_ctx = CheckExtension(CC_TOSTR(EGL_KHR_create_context)); + if (!has_khr_create_ctx) + { + CC_LOG_INFO("EGL context creation: EGL_KHR_create_context not supported. Minor version will be discarded, and debug disabled."); + minor_ver_ = 0; + } + + EGLint ctx_attribs[32]; + uint n = 0; + + if (has_khr_create_ctx) + { + ctx_attribs[n++] = EGL_CONTEXT_MAJOR_VERSION_KHR; + ctx_attribs[n++] = major_ver_; + ctx_attribs[n++] = EGL_CONTEXT_MINOR_VERSION_KHR; + ctx_attribs[n++] = minor_ver_; + +#ifdef CC_GFX_DEBUG + ctx_attribs[n++] = EGL_CONTEXT_FLAGS_KHR; + ctx_attribs[n++] = EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR; +#endif + } + else + { + ctx_attribs[n++] = EGL_CONTEXT_CLIENT_VERSION; + ctx_attribs[n++] = major_ver_; + } + + ctx_attribs[n] = EGL_NONE; + + egl_context_ = eglCreateContext(egl_display_, egl_config_, egl_shared_ctx_, ctx_attribs); + if (!egl_context_) { + CC_LOG_ERROR("Create EGL context with share context [0x%p] failed.", egl_shared_ctx_); + return false; + } + } + + if (!MakeCurrent()) { + return false; + } + + return true; +} + +void GLES3EGLContext::Destroy() { + if (egl_context_ != EGL_NO_CONTEXT) { + eglDestroyContext(egl_display_, egl_context_); + egl_context_ = EGL_NO_CONTEXT; + } + + if (egl_surface_ != EGL_NO_SURFACE) { + eglDestroySurface(egl_display_, egl_surface_); + egl_surface_ = EGL_NO_SURFACE; + } + + eglMakeCurrent(egl_display_, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); + +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) + if (is_primary_ctx_ && native_display_) + { + ReleaseDC((HWND)window_handle_, native_display_); + } +#endif + + is_primary_ctx_ = false; + window_handle_ = 0; + native_display_ = 0; + vsync_mode_ = GFXVsyncMode::OFF; + is_initialized = false; +} + +bool GLES3EGLContext::CheckExtension(const String& extension) const { + return (std::find(extensions_.begin(), extensions_.end(), extension) != extensions_.end()); +} + +bool GLES3EGLContext::MakeCurrent() { + if (eglMakeCurrent(egl_display_, egl_surface_, egl_surface_, egl_context_)) { + if (!is_initialized) { + // Turn on or off the vertical sync depending on the input bool value. + int interval = 1; + switch (vsync_mode_) { + case GFXVsyncMode::OFF: interval = 0; break; + case GFXVsyncMode::ON: interval = 1; break; + case GFXVsyncMode::RELAXED: interval = -1; break; + case GFXVsyncMode::MAILBOX: interval = 0; break; + case GFXVsyncMode::HALF: interval = 2; break; + default:; + } + + if (eglSwapInterval(egl_display_, interval) != 1) { + CC_LOG_ERROR("wglSwapInterval() - FAILED."); + return false; + } + +#if defined(CC_GFX_DEBUG) + glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS_KHR); + glDebugMessageControlKHR(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, NULL, GL_TRUE); + glDebugMessageCallbackKHR(GLES3EGLDebugProc, NULL); +#endif + + ////////////////////////////////////////////////////////////////////////// + + glPixelStorei(GL_PACK_ALIGNMENT, 1); + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + glActiveTexture(GL_TEXTURE0); + + ////////////////////////////////////////////////////////////////////////// + + glEnable(GL_CULL_FACE); + glCullFace(GL_BACK); + + glFrontFace(GL_CW); + + //glDisable(GL_MULTISAMPLE); + + ////////////////////////////////////////////////////////////////////////// + // DepthStencilState + glEnable(GL_DEPTH_TEST); + glDepthMask(GL_TRUE); + glDepthFunc(GL_LESS); + + glStencilFuncSeparate(GL_FRONT, GL_ALWAYS, 1, 0xffffffff); + glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_KEEP, GL_KEEP); + glStencilMaskSeparate(GL_FRONT, 0xffffffff); + glStencilFuncSeparate(GL_BACK, GL_ALWAYS, 1, 0xffffffff); + glStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_KEEP); + glStencilMaskSeparate(GL_BACK, 0xffffffff); + + glDisable(GL_STENCIL_TEST); + + ////////////////////////////////////////////////////////////////////////// + // BlendState + + glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE); + glDisable(GL_BLEND); + glBlendEquationSeparate(GL_FUNC_ADD, GL_FUNC_ADD); + glBlendFuncSeparate(GL_ONE, GL_ZERO, GL_ONE, GL_ZERO); + glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); + glBlendColor((GLclampf)0.0f, (GLclampf)0.0f, (GLclampf)0.0f, (GLclampf)0.0f); + + is_initialized = true; + } + + CC_LOG_DEBUG("eglMakeCurrent() - SUCCESSED, NativeDisplayType: 0x%p, EGLContext: 0x%p", native_display_, egl_context_); + return true; + } else { + CC_LOG_ERROR("eglMakeCurrent() - FAILED, Error: %d, NativeDisplayType: 0x%p, EGLContext: 0x%p", GetLastError(), native_display_, egl_context_); + return false; + } +} + +void GLES3EGLContext::Present() +{ + eglSwapBuffers(egl_display_, egl_surface_); +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles3/GLES3EGLContext.h b/native/cocos/renderer/gfx-gles3/GLES3EGLContext.h new file mode 100644 index 0000000000..9c1aa3ceca --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3EGLContext.h @@ -0,0 +1,71 @@ +#ifndef CC_GFXGLES3_GLES3_EGL_CONTEXT_H_ +#define CC_GFXGLES3_GLES3_EGL_CONTEXT_H_ + +#if (CC_PLATFORM == CC_PLATFORM_MAC_IOS) +# ifdef __OBJC__ +# include +# endif +#else +# include +# include +# include +#endif + +#ifndef EGL_KHR_create_context +#define EGL_KHR_create_context 1 +#define EGL_CONTEXT_MAJOR_VERSION_KHR EGL_CONTEXT_CLIENT_VERSION +#define EGL_CONTEXT_MINOR_VERSION_KHR 0x30FB +#define EGL_CONTEXT_FLAGS_KHR 0x30FC +#define EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR 0x30FD +#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR 0x31BD +#define EGL_NO_RESET_NOTIFICATION_KHR 0x31BE +#define EGL_LOSE_CONTEXT_ON_RESET_KHR 0x31BF +#define EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR 0x00000001 +#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR 0x00000002 +#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR 0x00000004 +#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR 0x00000001 +#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR 0x00000002 +#define EGL_OPENGL_ES3_BIT_KHR 0x00000040 +#endif + +CC_NAMESPACE_BEGIN + +class CC_GLES3_API GLES3EGLContext : public GFXContext { +public: + GLES3EGLContext(GFXDevice* device); + ~GLES3EGLContext(); + +public: + bool Initialize(const GFXContextInfo& info); + void Destroy(); + void Present(); + bool MakeCurrent(); + + bool CheckExtension(const String& extension) const; + + CC_INLINE NativeDisplayType native_display() const { return native_display_; } + CC_INLINE EGLDisplay egl_display() const { return egl_display_; } + CC_INLINE EGLConfig egl_config() const { return egl_config_; } + CC_INLINE EGLSurface egl_surface() const { return egl_surface_; } + CC_INLINE EGLContext egl_context() const { return egl_context_; } + CC_INLINE EGLContext egl_shared_ctx() const { return egl_shared_ctx_; } + CC_INLINE int major_ver() const { return major_ver_; } + CC_INLINE int minor_ver() const { return minor_ver_; } + +private: + bool is_primary_ctx_; + NativeDisplayType native_display_; + EGLDisplay egl_display_; + EGLConfig egl_config_; + EGLSurface egl_surface_; + EGLContext egl_context_; + EGLContext egl_shared_ctx_; + int major_ver_; + int minor_ver_; + StringArray extensions_; + bool is_initialized; +}; + +CC_NAMESPACE_END + +#endif // CC_GFXGLES3_GLES3_EGL_CONTEXT_H_ diff --git a/native/cocos/renderer/gfx-gles3/GLES3Framebuffer.cc b/native/cocos/renderer/gfx-gles3/GLES3Framebuffer.cc new file mode 100644 index 0000000000..8925b46dd0 --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3Framebuffer.cc @@ -0,0 +1,54 @@ +#include "GLES3Std.h" +#include "GLES3Framebuffer.h" +#include "GLES3RenderPass.h" +#include "GLES3Commands.h" +#include "GLES3TextureView.h" + +CC_NAMESPACE_BEGIN + +GLES3Framebuffer::GLES3Framebuffer(GFXDevice* device) + : GFXFramebuffer(device), + gpu_fbo_(nullptr) { +} + +GLES3Framebuffer::~GLES3Framebuffer() { +} + +bool GLES3Framebuffer::Initialize(const GFXFramebufferInfo &info) { + + render_pass_ = info.render_pass; + color_views_ = info.color_views; + depth_stencil_view_ = info.depth_stencil_view; + is_offscreen_ = info.is_offscreen; + + gpu_fbo_ = CC_NEW(GLES3GPUFramebuffer); + gpu_fbo_->gpu_render_pass = ((GLES3RenderPass*)render_pass_)->gpu_render_pass(); + + if (is_offscreen_) { + gpu_fbo_->gpu_color_views.resize(color_views_.size()); + for (size_t i = 0; i < color_views_.size(); ++i) { + GLES3TextureView* color_view = (GLES3TextureView*)color_views_[i]; + gpu_fbo_->gpu_color_views[i] = color_view->gpu_tex_view(); + } + + if (depth_stencil_view_) { + gpu_fbo_->gpu_depth_stencil_view = ((GLES3TextureView*)depth_stencil_view_)->gpu_tex_view(); + } + + gpu_fbo_->is_offscreen = is_offscreen_; + + GLES3CmdFuncCreateFramebuffer((GLES3Device*)device_, gpu_fbo_); + } + + return true; +} + +void GLES3Framebuffer::Destroy() { + if (gpu_fbo_) { + CC_DELETE(gpu_fbo_); + GLES3CmdFuncDestroyFramebuffer((GLES3Device*)device_, gpu_fbo_); + gpu_fbo_ = nullptr; + } +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles3/GLES3Framebuffer.h b/native/cocos/renderer/gfx-gles3/GLES3Framebuffer.h new file mode 100644 index 0000000000..ff2bd0844d --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3Framebuffer.h @@ -0,0 +1,25 @@ +#ifndef CC_GFXGLES3_GLES3_FRAMEBUFFER_H_ +#define CC_GFXGLES3_GLES3_FRAMEBUFFER_H_ + +CC_NAMESPACE_BEGIN + +class GLES3GPUFramebuffer; + +class CC_GLES3_API GLES3Framebuffer : public GFXFramebuffer { + public: + GLES3Framebuffer(GFXDevice* device); + ~GLES3Framebuffer(); + + public: + bool Initialize(const GFXFramebufferInfo& info); + void Destroy(); + + CC_INLINE GLES3GPUFramebuffer* gpu_fbo() const { return gpu_fbo_; } + + private: + GLES3GPUFramebuffer* gpu_fbo_; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3GPUObjects.h b/native/cocos/renderer/gfx-gles3/GLES3GPUObjects.h new file mode 100644 index 0000000000..ae6df1d51f --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3GPUObjects.h @@ -0,0 +1,216 @@ +#ifndef CC_GFXGLES3_GPU_OBJECTS_H_ +#define CC_GFXGLES3_GPU_OBJECTS_H_ + +#include "gles3w.h" + +CC_NAMESPACE_BEGIN + +class GLES3GPUBuffer : public Object { + public: + GFXBufferUsage usage = GFXBufferUsage::NONE; + GFXMemoryUsage mem_usage = GFXMemoryUsage::NONE; + uint size = 0; + uint stride = 0; + uint count = 0; + GLenum gl_target = 0; + GLuint gl_buffer = 0; + uint8_t* buffer = nullptr; + GFXIndirectBuffer indirect_buff; +}; +typedef vector::type GLES3GPUBufferList; + +class GLES3GPUTexture : public Object { + public: + GFXTextureType type = GFXTextureType::TEX2D; + GFXTextureViewType view_type = GFXTextureViewType::TV2D; + GFXFormat format = GFXFormat::UNKNOWN; + GFXTextureUsage usage = GFXTextureUsageBit::NONE; + uint width = 0; + uint height = 0; + uint depth = 1; + uint size = 0; + uint array_layer = 1; + uint mip_level = 1; + GFXSampleCount samples = GFXSampleCount::X1; + GFXTextureFlags flags = GFXTextureFlagBit::NONE; + bool is_pot = false; + GLenum gl_target = 0; + GLenum gl_internal_fmt = 0; + GLenum gl_format = 0; + GLenum gl_type = 0; + GLenum gl_usage = 0; + GLuint gl_texture = 0; + GLenum gl_wrap_s = 0; + GLenum gl_wrap_t = 0; + GLenum gl_min_filter = 0; + GLenum gl_mag_filter = 0; +}; + +class GLES3GPUTextureView : public Object { + public: + GLES3GPUTexture* gpu_texture = nullptr; + GFXTextureViewType type = GFXTextureViewType::TV2D; + GFXFormat format = GFXFormat::UNKNOWN; + uint base_level = 0; + uint level_count = 1; +}; + +typedef vector::type GLES3GPUTextureViewList; + +class GLES3GPUSampler : public Object { + public: + GFXFilter min_filter = GFXFilter::NONE; + GFXFilter mag_filter = GFXFilter::NONE; + GFXFilter mip_filter = GFXFilter::NONE; + GFXAddress address_u = GFXAddress::CLAMP; + GFXAddress address_v = GFXAddress::CLAMP; + GFXAddress address_w = GFXAddress::CLAMP; + uint min_lod = 0; + uint max_lod = 1000; + GLuint gl_sampler = 0; + GLenum gl_min_filter = 0; + GLenum gl_mag_filter = 0; + GLenum gl_wrap_s = 0; + GLenum gl_wrap_t = 0; + GLenum gl_wrap_r = 0; +}; + +struct GLES3GPUInput { + uint binding; + String name; + GFXType type; + uint stride; + uint count; + uint size; + GLenum gl_type; + GLint gl_loc; +}; +typedef vector::type GLES3GPUInputList; + +struct GLES3GPUUniform { + uint binding; + String name; + GFXType type; + uint stride; + uint count; + uint size; + uint offset; + GLenum gl_type; + GLint gl_loc; +}; +typedef vector::type GLES3GPUUniformList; + +struct GLES3GPUUniformBlock { + uint binding; + uint idx; + String name; + uint size; + GLES3GPUUniformList uniforms; + GLES3GPUUniformList active_uniforms; +}; +typedef vector::type GLES3GPUUniformBlockList; + +struct GLES3GPUUniformSampler { + uint binding; + String name; + GFXType type; + vector::type units; + GLenum gl_type; + GLint gl_loc; +}; +typedef vector::type GLES3GPUUniformSamplerList; + +struct GLES3GPUShaderStage { + GFXShaderType type; + String source; + GFXShaderMacroList macros; + GLuint gl_shader = 0; +}; +typedef vector::type GLES3GPUShaderStageList; + +class GLES3GPUShader : public Object { +public: + String name; + GFXUniformBlockList blocks; + GFXUniformSamplerList samplers; + GLuint gl_program = 0; + GLES3GPUShaderStageList gpu_stages; + GLES3GPUInputList gpu_inputs; + GLES3GPUUniformBlockList gpu_blocks; + GLES3GPUUniformSamplerList gpu_samplers; +}; + +struct GLES3GPUAttribute { + String name; + GLuint gl_buffer = 0; + GLenum gl_type = 0; + uint size = 0; + uint count = 0; + uint stride = 1; + uint component_count = 1; + bool is_normalized = false; + bool is_instanced = false; + uint offset = 0; +}; +typedef vector::type GLES3GPUAttributeList; + +class GLES3GPUInputAssembler : public Object { + public: + GFXAttributeList attribs; + GLES3GPUBufferList gpu_vertex_buffers; + GLES3GPUBuffer* gpu_index_buffer; + GLES3GPUBuffer* gpu_indirect_buffer; + GLES3GPUAttributeList gpu_attribs; + GLenum gl_index_type; + map::type gl_vaos; +}; + +class GLES3GPURenderPass : public Object { + public: + GFXColorAttachmentList color_attachments; + GFXDepthStencilAttachment depth_stencil_attachment; +}; + +class GLES3GPUFramebuffer : public Object { + public: + GLES3GPURenderPass* gpu_render_pass = nullptr; + GLES3GPUTextureViewList gpu_color_views; + GLES3GPUTextureView* gpu_depth_stencil_view = nullptr; + bool is_offscreen = false; + GLuint gl_fbo = 0; +}; + +class GLES3GPUPipelineLayout : public Object { + public: +}; + +class GLES3GPUPipelineState : public Object { + public: + GLenum gl_primitive = GL_TRIANGLES; + GLES3GPUShader* gpu_shader = nullptr; + GFXRasterizerState rs; + GFXDepthStencilState dss; + GFXBlendState bs; + GFXDynamicStateList dynamic_states; + GLES3GPUPipelineLayout* gpu_layout = nullptr; + GLES3GPURenderPass* gpu_render_pass = nullptr; +}; + +struct GLES3GPUBinding { + uint binding = GFX_INVALID_BINDING; + GFXBindingType type = GFXBindingType::UNKNOWN; + String name; + GLES3GPUBuffer* gpu_buffer = nullptr; + GLES3GPUTextureView* gpu_tex_view = nullptr; + GLES3GPUSampler* gpu_sampler = nullptr; +}; +typedef vector::type GLES3GPUBindingList; + +class GLES3GPUBindingLayout : public Object { + public: + GLES3GPUBindingList gpu_bindings; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3InputAssembler.cc b/native/cocos/renderer/gfx-gles3/GLES3InputAssembler.cc new file mode 100644 index 0000000000..acb962dd79 --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3InputAssembler.cc @@ -0,0 +1,60 @@ +#include "GLES3Std.h" +#include "GLES3InputAssembler.h" +#include "GLES3Commands.h" +#include "GLES3Buffer.h" + +CC_NAMESPACE_BEGIN + +GLES3InputAssembler::GLES3InputAssembler(GFXDevice* device) + : GFXInputAssembler(device), + gpu_input_assembler_(nullptr) { +} + +GLES3InputAssembler::~GLES3InputAssembler() { +} + +bool GLES3InputAssembler::Initialize(const GFXInputAssemblerInfo &info) { + + attributes_ = info.attributes; + vertex_buffers_ = info.vertex_buffers; + index_buffer_ = info.index_buffer; + indirect_buffer_ = info.indirect_buffer; + + if (index_buffer_) { + index_count_ = index_buffer_->count(); + } else if (vertex_buffers_.size()) { + vertex_count_ = vertex_buffers_[0]->count(); + } + + gpu_input_assembler_ = CC_NEW(GLES3GPUInputAssembler); + gpu_input_assembler_->attribs = attributes_; + gpu_input_assembler_->gpu_vertex_buffers.resize(vertex_buffers_.size()); + for (size_t i = 0; i < gpu_input_assembler_->gpu_vertex_buffers.size(); ++i) { + GLES3Buffer* vb = (GLES3Buffer*)vertex_buffers_[i]; + gpu_input_assembler_->gpu_vertex_buffers[i] = vb->gpu_buffer(); + } + + GLES3CmdFuncCreateInputAssembler((GLES3Device*)device_, gpu_input_assembler_); + + return true; +} + +void GLES3InputAssembler::Destroy() { + if (gpu_input_assembler_) { + GLES3CmdFuncDestroyInputAssembler((GLES3Device*)device_, gpu_input_assembler_); + CC_DELETE(gpu_input_assembler_); + gpu_input_assembler_ = nullptr; + } +} + +void GLES3InputAssembler::ExtractCmdDraw(GLES3CmdDraw* cmd) { + cmd->draw_info.vertex_count = vertex_count_; + cmd->draw_info.first_vertex = first_vertex_; + cmd->draw_info.index_count = index_count_; + cmd->draw_info.first_index = first_index_; + cmd->draw_info.vertex_offset = vertex_offset_; + cmd->draw_info.instance_count = instance_count_; + cmd->draw_info.first_instance = first_instance_; +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles3/GLES3InputAssembler.h b/native/cocos/renderer/gfx-gles3/GLES3InputAssembler.h new file mode 100644 index 0000000000..d23f410789 --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3InputAssembler.h @@ -0,0 +1,28 @@ +#ifndef CC_GFXGLES3_GLES3_INPUT_ASSEMBLER_H_ +#define CC_GFXGLES3_GLES3_INPUT_ASSEMBLER_H_ + +CC_NAMESPACE_BEGIN + +class GLES3GPUInputAssembler; +class GLES3CmdDraw; + +class CC_GLES3_API GLES3InputAssembler : public GFXInputAssembler { + public: + GLES3InputAssembler(GFXDevice* device); + ~GLES3InputAssembler(); + + public: + bool Initialize(const GFXInputAssemblerInfo& info); + void Destroy(); + + void ExtractCmdDraw(GLES3CmdDraw* cmd); + + CC_INLINE GLES3GPUInputAssembler* gpu_input_assembler() const { return gpu_input_assembler_; } + + private: + GLES3GPUInputAssembler* gpu_input_assembler_; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3PipelineLayout.cc b/native/cocos/renderer/gfx-gles3/GLES3PipelineLayout.cc new file mode 100644 index 0000000000..a2feecec62 --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3PipelineLayout.cc @@ -0,0 +1,31 @@ +#include "GLES3Std.h" +#include "GLES3PipelineLayout.h" +#include "GLES3Commands.h" + +CC_NAMESPACE_BEGIN + +GLES3PipelineLayout::GLES3PipelineLayout(GFXDevice* device) + : GFXPipelineLayout(device), + gpu_pipeline_layout_(nullptr) { +} + +GLES3PipelineLayout::~GLES3PipelineLayout() { +} + +bool GLES3PipelineLayout::Initialize(const GFXPipelineLayoutInfo &info) { + + layouts_ = info.layouts; + push_constant_ranges_ = info.push_constant_ranges; + + gpu_pipeline_layout_ = CC_NEW(GLES3GPUPipelineLayout); + return true; +} + +void GLES3PipelineLayout::Destroy() { + if (gpu_pipeline_layout_) { + CC_DELETE(gpu_pipeline_layout_); + gpu_pipeline_layout_ = nullptr; + } +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles3/GLES3PipelineLayout.h b/native/cocos/renderer/gfx-gles3/GLES3PipelineLayout.h new file mode 100644 index 0000000000..99541d6877 --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3PipelineLayout.h @@ -0,0 +1,24 @@ +#ifndef CC_GFXGLES3_GLES3_PIPELINE_LAYOUT_H_ +#define CC_GFXGLES3_GLES3_PIPELINE_LAYOUT_H_ + +CC_NAMESPACE_BEGIN + +class GLES3GPUPipelineLayout; + +class CC_GLES3_API GLES3PipelineLayout : public GFXPipelineLayout { + public: + GLES3PipelineLayout(GFXDevice* device); + ~GLES3PipelineLayout(); + + public: + bool Initialize(const GFXPipelineLayoutInfo& info); + void Destroy(); + + CC_INLINE GLES3GPUPipelineLayout* gpu_pipeline_layout() const { return gpu_pipeline_layout_; } + private: + GLES3GPUPipelineLayout* gpu_pipeline_layout_; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3PipelineState.cc b/native/cocos/renderer/gfx-gles3/GLES3PipelineState.cc new file mode 100644 index 0000000000..8070fab5a2 --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3PipelineState.cc @@ -0,0 +1,67 @@ +#include "GLES3Std.h" +#include "GLES3PipelineState.h" +#include "GLES3Commands.h" +#include "GLES3Shader.h" +#include "GLES3RenderPass.h" +#include "GLES3PipelineLayout.h" + +CC_NAMESPACE_BEGIN + +const GLenum GLES3Primitives [] = { + GL_POINTS, + GL_LINES, + GL_LINE_STRIP, + GL_LINE_LOOP, + GL_NONE, + GL_NONE, + GL_NONE, + GL_TRIANGLES, + GL_TRIANGLE_STRIP, + GL_TRIANGLE_FAN, + GL_NONE, + GL_NONE, + GL_NONE, + GL_NONE, +}; + +GLES3PipelineState::GLES3PipelineState(GFXDevice* device) + : GFXPipelineState(device), + gpu_pso_(nullptr) { +} + +GLES3PipelineState::~GLES3PipelineState() { +} + +bool GLES3PipelineState::Initialize(const GFXPipelineStateInfo &info) { + + primitive_ = info.primitive; + shader_ = info.shader; + is_ = info.is; + rs_ = info.rs; + dss_ = info.dss; + bs_ = info.bs; + dynamic_states_ = info.dynamic_states; + layout_ = info.layout; + render_pass_ = info.render_pass; + + gpu_pso_ = CC_NEW(GLES3GPUPipelineState); + gpu_pso_->gl_primitive = GLES3Primitives[(int)primitive_]; + gpu_pso_->gpu_shader = ((GLES3Shader*)shader_)->gpu_shader(); + gpu_pso_->rs = rs_; + gpu_pso_->dss = dss_; + gpu_pso_->bs = bs_; + gpu_pso_->dynamic_states = dynamic_states_; + gpu_pso_->gpu_layout = ((GLES3PipelineLayout*)layout_)->gpu_pipeline_layout(); + gpu_pso_->gpu_render_pass = ((GLES3RenderPass*)render_pass_)->gpu_render_pass(); + + return true; +} + +void GLES3PipelineState::Destroy() { + if (gpu_pso_) { + CC_DELETE(gpu_pso_); + gpu_pso_ = nullptr; + } +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles3/GLES3PipelineState.h b/native/cocos/renderer/gfx-gles3/GLES3PipelineState.h new file mode 100644 index 0000000000..c06e317f6f --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3PipelineState.h @@ -0,0 +1,25 @@ +#ifndef CC_GFXGLES3_GLES3_PIPELINE_STATE_H_ +#define CC_GFXGLES3_GLES3_PIPELINE_STATE_H_ + +CC_NAMESPACE_BEGIN + +class GLES3GPUPipelineState; + +class CC_GLES3_API GLES3PipelineState : public GFXPipelineState { + public: + GLES3PipelineState(GFXDevice* device); + ~GLES3PipelineState(); + + public: + bool Initialize(const GFXPipelineStateInfo& info); + void Destroy(); + + CC_INLINE GLES3GPUPipelineState* gpu_pso() const { return gpu_pso_; } + + private: + GLES3GPUPipelineState* gpu_pso_; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3Queue.cc b/native/cocos/renderer/gfx-gles3/GLES3Queue.cc new file mode 100644 index 0000000000..765d2554d0 --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3Queue.cc @@ -0,0 +1,36 @@ +#include "GLES3Std.h" +#include "GLES3Queue.h" +#include "GLES3Commands.h" +#include "GLES3CommandBuffer.h" + +CC_NAMESPACE_BEGIN + +GLES3Queue::GLES3Queue(GFXDevice* device) + : GFXQueue(device), + is_async_(false) { +} + +GLES3Queue::~GLES3Queue() { +} + +bool GLES3Queue::Initialize(const GFXQueueInfo &info) { + type_ = info.type; + + return true; +} + +void GLES3Queue::Destroy() { +} + +void GLES3Queue::submit(GFXCommandBuffer** cmd_buffs, uint count) { + if (!is_async_) { + for (uint i = 0; i < count; ++i) { + GLES3CommandBuffer* cmd_buff = (GLES3CommandBuffer*)cmd_buffs[i]; + GLES3CmdFuncExecuteCmds((GLES3Device*)device_, cmd_buff->cmd_package_); + num_draw_calls_ += cmd_buff->num_draw_calls_; + num_tris_ += cmd_buff->num_tris_; + } + } +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles3/GLES3Queue.h b/native/cocos/renderer/gfx-gles3/GLES3Queue.h new file mode 100644 index 0000000000..04654c323b --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3Queue.h @@ -0,0 +1,28 @@ +#ifndef CC_GFXGLES3_GLES3_QUEUE_H_ +#define CC_GFXGLES3_GLES3_QUEUE_H_ + +CC_NAMESPACE_BEGIN + +class CC_GLES3_API GLES3Queue : public GFXQueue { + public: + GLES3Queue(GFXDevice* device); + ~GLES3Queue(); + + friend class GLES3Device; + + public: + bool Initialize(const GFXQueueInfo& info); + void Destroy(); + void submit(GFXCommandBuffer** cmd_buffs, uint count); + + CC_INLINE bool is_async() const { return is_async_; } + + private: + bool is_async_; + uint num_draw_calls_; + uint num_tris_; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3RenderPass.cc b/native/cocos/renderer/gfx-gles3/GLES3RenderPass.cc new file mode 100644 index 0000000000..1fb804e1fc --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3RenderPass.cc @@ -0,0 +1,34 @@ +#include "GLES3Std.h" +#include "GLES3RenderPass.h" +#include "GLES3Commands.h" + +CC_NAMESPACE_BEGIN + +GLES3RenderPass::GLES3RenderPass(GFXDevice* device) + : GFXRenderPass(device), + gpu_render_pass_(nullptr) { +} + +GLES3RenderPass::~GLES3RenderPass() { +} + +bool GLES3RenderPass::Initialize(const GFXRenderPassInfo &info) { + + color_attachments_ = info.color_attachments; + depth_stencil_attachment_ = info.depth_stencil_attachment; + + gpu_render_pass_ = CC_NEW(GLES3GPURenderPass); + gpu_render_pass_->color_attachments = color_attachments_; + gpu_render_pass_->depth_stencil_attachment = depth_stencil_attachment_; + + return true; +} + +void GLES3RenderPass::Destroy() { + if (gpu_render_pass_) { + CC_DELETE(gpu_render_pass_); + gpu_render_pass_ = nullptr; + } +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles3/GLES3RenderPass.h b/native/cocos/renderer/gfx-gles3/GLES3RenderPass.h new file mode 100644 index 0000000000..97b77a5746 --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3RenderPass.h @@ -0,0 +1,25 @@ +#ifndef CC_GFXGLES3_GLES3_RENDER_PASS_H_ +#define CC_GFXGLES3_GLES3_RENDER_PASS_H_ + +CC_NAMESPACE_BEGIN + +class GLES3GPURenderPass; + +class CC_GLES3_API GLES3RenderPass : public GFXRenderPass { + public: + GLES3RenderPass(GFXDevice* device); + ~GLES3RenderPass(); + + public: + bool Initialize(const GFXRenderPassInfo& info); + void Destroy(); + + CC_INLINE GLES3GPURenderPass* gpu_render_pass() const { return gpu_render_pass_; } + + private: + GLES3GPURenderPass* gpu_render_pass_; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3Sampler.cc b/native/cocos/renderer/gfx-gles3/GLES3Sampler.cc new file mode 100644 index 0000000000..735b969cd7 --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3Sampler.cc @@ -0,0 +1,53 @@ +#include "GLES3Std.h" +#include "GLES3Sampler.h" +#include "GLES3Commands.h" + +CC_NAMESPACE_BEGIN + +GLES3Sampler::GLES3Sampler(GFXDevice* device) + : GFXSampler(device), + gpu_sampler_(nullptr) { +} + +GLES3Sampler::~GLES3Sampler() { +} + +bool GLES3Sampler::Initialize(const GFXSamplerInfo &info) { + name_ = info.name; + min_filter_ = info.min_filter; + mag_filter_ = info.mag_filter; + mip_filter_ = info.mip_filter; + address_u_ = info.address_u; + address_v_ = info.address_v; + address_w_ = info.address_w; + max_anisotropy_ = info.max_anisotropy; + cmp_func_ = info.cmp_func; + border_color_ = info.border_color; + min_lod_ = info.min_lod; + max_lod_ = info.max_lod; + mip_lod_bias_ = info.mip_lod_bias; + + gpu_sampler_ = CC_NEW(GLES3GPUSampler); + gpu_sampler_->min_filter = min_filter_; + gpu_sampler_->mag_filter = mag_filter_; + gpu_sampler_->mip_filter = mip_filter_; + gpu_sampler_->address_u = address_u_; + gpu_sampler_->address_v = address_v_; + gpu_sampler_->address_w = address_w_; + gpu_sampler_->min_lod = min_lod_; + gpu_sampler_->max_lod = max_lod_; + + GLES3CmdFuncCreateSampler((GLES3Device*)device_, gpu_sampler_); + + return true; +} + +void GLES3Sampler::Destroy() { + if (gpu_sampler_) { + GLES3CmdFuncDestroySampler((GLES3Device*)device_, gpu_sampler_); + CC_DELETE(gpu_sampler_); + gpu_sampler_ = nullptr; + } +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles3/GLES3Sampler.h b/native/cocos/renderer/gfx-gles3/GLES3Sampler.h new file mode 100644 index 0000000000..48c14131e2 --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3Sampler.h @@ -0,0 +1,25 @@ +#ifndef CC_GFXGLES3_GLES3_SAMPLER_H_ +#define CC_GFXGLES3_GLES3_SAMPLER_H_ + +CC_NAMESPACE_BEGIN + +class GLES3GPUSampler; + +class CC_GLES3_API GLES3Sampler : public GFXSampler { +public: + GLES3Sampler(GFXDevice* device); + ~GLES3Sampler(); + +public: + bool Initialize(const GFXSamplerInfo& info); + void Destroy(); + + CC_INLINE GLES3GPUSampler* gpu_sampler() const { return gpu_sampler_; } + +private: + GLES3GPUSampler* gpu_sampler_; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3Shader.cc b/native/cocos/renderer/gfx-gles3/GLES3Shader.cc new file mode 100644 index 0000000000..ea00d90199 --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3Shader.cc @@ -0,0 +1,35 @@ +#include "GLES3Std.h" +#include "GLES3Shader.h" +#include "GLES3Commands.h" + +CC_NAMESPACE_BEGIN + +GLES3Shader::GLES3Shader(GFXDevice* device) + : GFXShader(device), + gpu_shader_(nullptr) { +} + +GLES3Shader::~GLES3Shader() { +} + +bool GLES3Shader::Initialize(const GFXShaderInfo &info) { + name_ = info.name; + stages_ = info.stages; + blocks_ = info.blocks; + samplers_ = info.samplers; + + gpu_shader_ = CC_NEW(GLES3GPUShader); + GLES3CmdFuncCreateShader((GLES3Device*)device_, gpu_shader_); + + return true; +} + +void GLES3Shader::Destroy() { + if (gpu_shader_) { + GLES3CmdFuncDestroyShader((GLES3Device*)device_, gpu_shader_); + CC_DELETE(gpu_shader_); + gpu_shader_ = nullptr; + } +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles3/GLES3Shader.h b/native/cocos/renderer/gfx-gles3/GLES3Shader.h new file mode 100644 index 0000000000..bb2015a35d --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3Shader.h @@ -0,0 +1,24 @@ +#ifndef CC_GFXGLES3_GLES3_SHADER_H_ +#define CC_GFXGLES3_GLES3_SHADER_H_ + +CC_NAMESPACE_BEGIN + +class GLES3GPUShader; + +class CC_GLES3_API GLES3Shader : public GFXShader { + public: + GLES3Shader(GFXDevice* device); + ~GLES3Shader(); + + public: + bool Initialize(const GFXShaderInfo& info); + void Destroy(); + + CC_INLINE GLES3GPUShader* gpu_shader() const { return gpu_shader_; } + private: + GLES3GPUShader* gpu_shader_; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3StateCache.h b/native/cocos/renderer/gfx-gles3/GLES3StateCache.h new file mode 100644 index 0000000000..afbc6ae1a7 --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3StateCache.h @@ -0,0 +1,36 @@ +#ifndef CC_GFXGLES3_STATE_CACHE_H_ +#define CC_GFXGLES3_STATE_CACHE_H_ + +#include "gles3w.h" + +CC_NAMESPACE_BEGIN + +class GLES3StateCache : public Object { + public: + GLuint gl_array_buffer = 0; + GLuint gl_element_array_buffer = 0; + GLuint gl_uniform_buffer = 0; + GLuint gl_bind_ubos[GFX_MAX_BUFFER_BINDINGS] = { 0 }; + GLuint gl_vao = 0; + uint tex_uint = 0; + GLuint gl_textures[GFX_MAX_TEXTURE_UNITS] = { 0 }; + GLuint gl_samplers[GFX_MAX_TEXTURE_UNITS] = { 0 }; + GLuint gl_program = 0; + bool gl_enabled_attrib_locs[GFX_MAX_VERTEX_ATTRIBUTES] = { false }; + bool gl_current_attrib_locs[GFX_MAX_VERTEX_ATTRIBUTES] = { false }; + GLuint gl_fbo = 0; + GLuint gl_read_fbo = 0; + GFXViewport viewport; + GFXRect scissor; + GFXRasterizerState rs; + GFXDepthStencilState dss; + GFXBlendState bs; + bool is_cull_face_enabled = false; + bool is_stencil_test_enabled = false; + + GLES3StateCache() {} +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3Std.cc b/native/cocos/renderer/gfx-gles3/GLES3Std.cc new file mode 100644 index 0000000000..1daef89c30 --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3Std.cc @@ -0,0 +1 @@ +#include "GLES3Std.h" \ No newline at end of file diff --git a/native/cocos/renderer/gfx-gles3/GLES3Std.h b/native/cocos/renderer/gfx-gles3/GLES3Std.h new file mode 100644 index 0000000000..f7bfcfb39e --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3Std.h @@ -0,0 +1,16 @@ +#ifndef __CC_GFXGLES3_GLES3_STD_H__ +#define __CC_GFXGLES3_GLES3_STD_H__ + +#include + +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) +# ifdef CC_GLES3_EXPORTS +# define CC_GLES3_API __declspec(dllexport) +# else +# define CC_GLES3_API __declspec(dllimport) +# endif +#else +# define CC_GLES3_API +#endif + +#endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3Texture.cc b/native/cocos/renderer/gfx-gles3/GLES3Texture.cc new file mode 100644 index 0000000000..a0c43ef703 --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3Texture.cc @@ -0,0 +1,129 @@ +#include "GLES3Std.h" +#include "GLES3Texture.h" +#include "GLES3Commands.h" + +CC_NAMESPACE_BEGIN + +GLES3Texture::GLES3Texture(GFXDevice* device) + : GFXTexture(device), + gpu_texture_(nullptr) { +} + +GLES3Texture::~GLES3Texture() { +} + +bool GLES3Texture::Initialize(const GFXTextureInfo &info) { + + type_ = info.type; + usage_ = info.usage; + format_ = info.format; + width_ = info.width; + height_ = info.height; + depth_ = info.depth; + array_layer_ = info.array_layer; + mip_level_ = info.mip_level; + samples_ = info.samples; + flags_ = info.flags; + size_ = GFXFormatSize(format_, width_, height_, depth_); + + if (flags_ & GFXTextureFlags::BAKUP_BUFFER) { + buffer_ = (uint8_t*)CC_MALLOC(size_); + device_->mem_status().texture_size += size_; + } + + gpu_texture_ = CC_NEW(GLES3GPUTexture); + gpu_texture_->type = type_; + + switch (type_) { + case GFXTextureType::TEX1D: { + if (array_layer_) { + gpu_texture_->view_type = array_layer_ <= 1 ? GFXTextureViewType::TV1D : GFXTextureViewType::TV1D_ARRAY; + } else { + gpu_texture_->view_type = GFXTextureViewType::TV1D; + } + break; + } + case GFXTextureType::TEX2D: { + if (array_layer_) { + if (array_layer_ <= 1) { + gpu_texture_->view_type = GFXTextureViewType::TV2D; + } else if (flags_ & GFXTextureFlagBit::CUBEMAP) { + gpu_texture_->view_type = GFXTextureViewType::CUBE; + } else { + gpu_texture_->view_type = GFXTextureViewType::TV2D_ARRAY; + } + } else { + gpu_texture_->view_type = GFXTextureViewType::TV2D; + } + break; + } + case GFXTextureType::TEX3D: { + gpu_texture_->view_type = GFXTextureViewType::TV3D; + break; + } + default: { + gpu_texture_->view_type = GFXTextureViewType::TV2D; + } + } + + gpu_texture_->format = format_; + gpu_texture_->usage = usage_; + gpu_texture_->width = width_; + gpu_texture_->height = height_; + gpu_texture_->depth = depth_; + gpu_texture_->size = size_; + gpu_texture_->array_layer = array_layer_; + gpu_texture_->mip_level = mip_level_; + gpu_texture_->samples = samples_; + gpu_texture_->flags = flags_; + gpu_texture_->is_pot = math::IsPowerOfTwo(width_) && math::IsPowerOfTwo(height_); + + GLES3CmdFuncCreateTexture((GLES3Device*)device_, gpu_texture_); + device_->mem_status().texture_size += size_; + + return true; +} + +void GLES3Texture::Destroy() { + if (gpu_texture_) { + GLES3CmdFuncDestroyTexture((GLES3Device*)device_, gpu_texture_); + device_->mem_status().texture_size -= size_; + CC_DELETE(gpu_texture_); + gpu_texture_ = nullptr; + } + + if (buffer_) { + CC_FREE(buffer_); + device_->mem_status().texture_size -= size_; + buffer_ = nullptr; + } +} + +void GLES3Texture::Resize(uint width, uint height) { + uint size = GFXFormatSize(format_, width, height, depth_); + if (size_ != size) { + const uint old_size = size_; + width_ = width; + height_ = height; + size_ = size; + + GFXMemoryStatus& status = device_->mem_status(); + gpu_texture_->width = width_; + gpu_texture_->height = height_; + gpu_texture_->size = size_; + GLES3CmdFuncResizeTexture((GLES3Device*)device_, gpu_texture_); + status.buffer_size -= old_size; + status.buffer_size += size_; + + if (buffer_) { + const uint8_t* old_buff = buffer_; + buffer_ = (uint8_t*)CC_MALLOC(size_); + memcpy(buffer_, old_buff, old_size); + CC_FREE(buffer_); + status.buffer_size -= old_size; + status.buffer_size += size_; + } + } +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles3/GLES3Texture.h b/native/cocos/renderer/gfx-gles3/GLES3Texture.h new file mode 100644 index 0000000000..0c353516b3 --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3Texture.h @@ -0,0 +1,26 @@ +#ifndef CC_GFXGLES3_GLES3_TEXTURE_H_ +#define CC_GFXGLES3_GLES3_TEXTURE_H_ + +CC_NAMESPACE_BEGIN + +class GLES3GPUTexture; + +class CC_GLES3_API GLES3Texture : public GFXTexture { + public: + GLES3Texture(GFXDevice* device); + ~GLES3Texture(); + + public: + bool Initialize(const GFXTextureInfo& info); + void Destroy(); + void Resize(uint width, uint height); + + CC_INLINE GLES3GPUTexture* gpu_texture() const { return gpu_texture_; } + + private: + GLES3GPUTexture* gpu_texture_; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3TextureView.cc b/native/cocos/renderer/gfx-gles3/GLES3TextureView.cc new file mode 100644 index 0000000000..f2417598bb --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3TextureView.cc @@ -0,0 +1,44 @@ +#include "GLES3Std.h" +#include "GLES3TextureView.h" +#include "GLES3Texture.h" +#include "GLES3Commands.h" + +CC_NAMESPACE_BEGIN + +GLES3TextureView::GLES3TextureView(GFXDevice* device) + : GFXTextureView(device), + gpu_tex_view_(nullptr) { +} + +GLES3TextureView::~GLES3TextureView() { +} + +bool GLES3TextureView::Initialize(const GFXTextureViewInfo &info) { + + texture_ = info.texture; + type_ = info.type; + format_ = info.format; + base_layer_ = info.base_layer; + level_count_ = info.level_count; + base_layer_ = info.base_layer; + layer_count_ = info.layer_count; + + gpu_tex_view_ = CC_NEW(GLES3GPUTextureView); + gpu_tex_view_->gpu_texture = ((GLES3GPUTexture*)texture_); + gpu_tex_view_->type = type_; + gpu_tex_view_->format = format_; + gpu_tex_view_->base_level = info.base_level; + gpu_tex_view_->level_count = info.level_count; + + return true; +} + +void GLES3TextureView::Destroy() { + if (gpu_tex_view_) { + CC_DELETE(gpu_tex_view_); + gpu_tex_view_ = nullptr; + } + texture_ = nullptr; +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles3/GLES3TextureView.h b/native/cocos/renderer/gfx-gles3/GLES3TextureView.h new file mode 100644 index 0000000000..9ec7ab7c11 --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3TextureView.h @@ -0,0 +1,25 @@ +#ifndef CC_GFXGLES3_GLES3_TEXTURE_VIEW_H_ +#define CC_GFXGLES3_GLES3_TEXTURE_VIEW_H_ + +CC_NAMESPACE_BEGIN + +class GLES3GPUTextureView; + +class CC_GLES3_API GLES3TextureView : public GFXTextureView { +public: + GLES3TextureView(GFXDevice* device); + ~GLES3TextureView(); + +public: + bool Initialize(const GFXTextureViewInfo& info); + void Destroy(); + + CC_INLINE GLES3GPUTextureView* gpu_tex_view() const { return gpu_tex_view_; } + +private: + GLES3GPUTextureView* gpu_tex_view_; +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles3/GLES3Window.cc b/native/cocos/renderer/gfx-gles3/GLES3Window.cc new file mode 100644 index 0000000000..ef8414b902 --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3Window.cc @@ -0,0 +1,155 @@ +#include "GLES3Std.h" +#include "GLES3Window.h" + +CC_NAMESPACE_BEGIN + +GLES3Window::GLES3Window(GFXDevice* device) + : GFXWindow(device) { +} + +GLES3Window::~GLES3Window() { +} + +bool GLES3Window::Initialize(const GFXWindowInfo &info) { + title_ = info.title; + left_ = info.left; + top_ = info.top; + width_ = info.width; + height_ = info.height; + native_width_ = width_; + native_height_ = height_; + color_fmt_ = info.color_fmt; + depth_stencil_fmt_ = info.depth_stencil_fmt; + is_offscreen_ = info.is_offscreen; + is_fullscreen_ = info.is_fullscreen; + + // Create render pass + + GFXRenderPassInfo render_pass_info; + + GFXColorAttachment color_attachment; + color_attachment.format = color_fmt_; + color_attachment.load_op = GFXLoadOp::CLEAR; + color_attachment.store_op = GFXStoreOp::STORE; + color_attachment.sample_count = 1; + color_attachment.begin_layout = GFXTextureLayout::COLOR_ATTACHMENT_OPTIMAL; + color_attachment.end_layout = GFXTextureLayout::COLOR_ATTACHMENT_OPTIMAL; + render_pass_info.color_attachments.emplace_back(color_attachment); + + GFXDepthStencilAttachment& depth_stencil_attachment = render_pass_info.depth_stencil_attachment; + render_pass_info.depth_stencil_attachment.format = depth_stencil_fmt_; + depth_stencil_attachment.depth_load_op = GFXLoadOp::LOAD; + depth_stencil_attachment.depth_store_op = GFXStoreOp::STORE; + depth_stencil_attachment.stencil_load_op = GFXLoadOp::LOAD; + depth_stencil_attachment.stencil_store_op = GFXStoreOp::STORE; + depth_stencil_attachment.sample_count = 1; + depth_stencil_attachment.begin_layout = GFXTextureLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL; + depth_stencil_attachment.end_layout = GFXTextureLayout::DEPTH_STENCIL_ATTACHMENT_OPTIMAL; + + render_pass_ = device_->CreateGFXRenderPass(render_pass_info); + + // Create texture & texture views + if (is_offscreen_) { + if (color_fmt_ != GFXFormat::UNKNOWN) { + GFXTextureInfo color_tex_info; + color_tex_info.type = GFXTextureType::TEX2D; + color_tex_info.usage = GFXTextureUsageBit::COLOR_ATTACHMENT | GFXTextureUsageBit::SAMPLED; + color_tex_info.format = color_fmt_; + color_tex_info.width = width_; + color_tex_info.height = height_; + color_tex_info.depth = 1; + color_tex_info.array_layer = 1; + color_tex_info.mip_level = 1; + color_texture_ = device_->CreateGFXTexture(color_tex_info); + + GFXTextureViewInfo color_tex_view_info; + color_tex_view_info.type = GFXTextureViewType::TV2D; + color_tex_view_info.format = color_fmt_; + color_tex_view_info.base_level = 0; + color_tex_view_info.level_count = 1; + color_tex_view_info.base_layer = 0; + color_tex_view_info.layer_count = 1; + color_tex_view_ = device_->CreateGFXTextureView(color_tex_view_info); + } + if (depth_stencil_fmt_ != GFXFormat::UNKNOWN) { + GFXTextureInfo depth_stecnil_tex_info; + depth_stecnil_tex_info.type = GFXTextureType::TEX2D; + depth_stecnil_tex_info.usage = GFXTextureUsageBit::DEPTH_STENCIL_ATTACHMENT | GFXTextureUsageBit::SAMPLED; + depth_stecnil_tex_info.format = depth_stencil_fmt_; + depth_stecnil_tex_info.width = width_; + depth_stecnil_tex_info.height = height_; + depth_stecnil_tex_info.depth = 1; + depth_stecnil_tex_info.array_layer = 1; + depth_stecnil_tex_info.mip_level = 1; + depth_stencil_texture_ = device_->CreateGFXTexture(depth_stecnil_tex_info); + + GFXTextureViewInfo depth_stecnil_tex_view_info; + depth_stecnil_tex_view_info.type = GFXTextureViewType::TV2D; + depth_stecnil_tex_view_info.format = color_fmt_; + depth_stecnil_tex_view_info.base_level = 0; + depth_stecnil_tex_view_info.level_count = 1; + depth_stecnil_tex_view_info.base_layer = 0; + depth_stecnil_tex_view_info.layer_count = 1; + depth_stencil_tex_view_ = device_->CreateGFXTextureView(depth_stecnil_tex_view_info); + } + } + + GFXFramebufferInfo fbo_info; + fbo_info.render_pass = render_pass_; + fbo_info.color_views.push_back(color_tex_view_); + fbo_info.depth_stencil_view = depth_stencil_tex_view_; + fbo_info.is_offscreen = is_offscreen_; + framebuffer_ = device_->CreateGFXFramebuffer(fbo_info); + + return true; +} + +void GLES3Window::Destroy() { + CC_SAFE_DESTROY(render_pass_); + CC_SAFE_DESTROY(color_tex_view_); + CC_SAFE_DESTROY(color_texture_); + CC_SAFE_DESTROY(depth_stencil_tex_view_); + CC_SAFE_DESTROY(depth_stencil_texture_); + CC_SAFE_DESTROY(framebuffer_); +} + +void GLES3Window::Resize(uint width, uint height) { + width_ = width; + height_ = height; + if (width > native_width_ || height > native_height_) { + native_width_ = width; + native_height_ = height; + + if (color_texture_) { + color_texture_->Resize(width, height); + color_tex_view_->Destroy(); + + GFXTextureViewInfo color_tex_view_info; + color_tex_view_info.type = GFXTextureViewType::TV2D; + color_tex_view_info.format = color_fmt_; + color_tex_view_->Initialize(color_tex_view_info); + } + + if (depth_stencil_texture_) { + depth_stencil_texture_->Resize(width, height); + depth_stencil_tex_view_->Destroy(); + + GFXTextureViewInfo depth_stencil_tex_view__info; + depth_stencil_tex_view__info.type = GFXTextureViewType::TV2D; + depth_stencil_tex_view__info.format = depth_stencil_fmt_; + depth_stencil_tex_view_->Initialize(depth_stencil_tex_view__info); + } + + if (framebuffer_) { + framebuffer_->Destroy(); + + GFXFramebufferInfo fbo_info; + fbo_info.render_pass = render_pass_; + fbo_info.color_views.push_back(color_tex_view_); + fbo_info.depth_stencil_view = depth_stencil_tex_view_; + framebuffer_->Initialize(fbo_info); + } + } +} + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-gles3/GLES3Window.h b/native/cocos/renderer/gfx-gles3/GLES3Window.h new file mode 100644 index 0000000000..bae21275df --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/GLES3Window.h @@ -0,0 +1,19 @@ +#ifndef CC_GFXGLES3_GLES3_WINDOW_H_ +#define CC_GFXGLES3_GLES3_WINDOW_H_ + +CC_NAMESPACE_BEGIN + +class CC_GLES3_API GLES3Window : public GFXWindow { +public: + GLES3Window(GFXDevice* device); + ~GLES3Window(); + +public: + bool Initialize(const GFXWindowInfo& info); + void Destroy(); + void Resize(uint width, uint height); +}; + +CC_NAMESPACE_END + +#endif diff --git a/native/cocos/renderer/gfx-gles3/gles3w.c b/native/cocos/renderer/gfx-gles3/gles3w.c new file mode 100755 index 0000000000..9a46a8a8da --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/gles3w.c @@ -0,0 +1,772 @@ +#include "gles3w.h" + +#if defined(_WIN32) && !defined(ANDROID) +#define WIN32_LEAN_AND_MEAN 1 +#include +#include + +static HMODULE libgl; + +static int open_libgl(void) +{ + libgl = LoadLibraryA("libGLESv2.dll"); + return (libgl != NULL); +} + +static void close_libgl(void) +{ + FreeLibrary(libgl); +} + +static void *get_proc(const char *proc) +{ + void *res; + + res = (void*)eglGetProcAddress(proc); + if (!res) + res = (void*)GetProcAddress(libgl, proc); + return res; +} +#elif defined(__APPLE__) || defined(__APPLE_CC__) +#import +#import +#import +#import +#import +#import + +// Routine to run a system command and retrieve the output. +// From http://stackoverflow.com/questions/478898/how-to-execute-a-command-and-get-output-of-command-within-c +std::string ES3_EXEC(const char* cmd) { + FILE* pipe = popen(cmd, "r"); + if (!pipe) return "ERROR"; + char buffer[128]; + std::string result = ""; + while(!feof(pipe)) { + if(fgets(buffer, 128, pipe) != NULL) + result += buffer; + } + pclose(pipe); + return result; +} + +static CFBundleRef g_es3Bundle; +static CFURLRef g_es3BundleURL; + +static int open_libgl(void) +{ + CFStringRef frameworkPath = CFSTR("/System/Library/Frameworks/OpenGLES.framework"); + NSString *sysVersion = [UIDevice currentDevice].systemVersion; + NSArray *sysVersionComponents = [sysVersion componentsSeparatedByString:@"."]; + //BOOL isSimulator = ([[UIDevice currentDevice].model rangeOfString:@"Simulator"].location != NSNotFound); + +#if TARGET_IPHONE_SIMULATOR + bool isSimulator = true; +#else + bool isSimulator = false; +#endif + if(isSimulator) + { + // Ask where Xcode is installed + std::string xcodePath = "/Applications/Xcode.app/Contents/Developer\n"; + + // The result contains an end line character. Remove it. + size_t pos = xcodePath.find("\n"); + xcodePath.erase(pos); + + char tempPath[PATH_MAX]; + sprintf(tempPath, + "%s/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator%s.%s.sdk/System/Library/Frameworks/OpenGLES.framework", + xcodePath.c_str(), + [[sysVersionComponents objectAtIndex:0] cStringUsingEncoding:NSUTF8StringEncoding], + [[sysVersionComponents objectAtIndex:1] cStringUsingEncoding:NSUTF8StringEncoding]); + frameworkPath = CFStringCreateWithCString(kCFAllocatorDefault, tempPath, kCFStringEncodingUTF8); + } + + g_es3BundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, + frameworkPath, + kCFURLPOSIXPathStyle, true); + + CFRelease(frameworkPath); + + g_es3Bundle = CFBundleCreate(kCFAllocatorDefault, g_es3BundleURL); + + return (g_es3Bundle != NULL); +} + +static void close_libgl(void) +{ + CFRelease(g_es3Bundle); + CFRelease(g_es3BundleURL); +} + +static void *get_proc(const char *proc) +{ + void *res; + + CFStringRef procname = CFStringCreateWithCString(kCFAllocatorDefault, proc, + kCFStringEncodingASCII); + res = CFBundleGetFunctionPointerForName(g_es3Bundle, procname); + CFRelease(procname); + return res; +} +#else +#include +#include + +static void *libgl; + +static int open_libgl(void) +{ + libgl = dlopen("libGLESv2.so", RTLD_LAZY | RTLD_GLOBAL); + return (libgl != NULL); +} + +static void close_libgl(void) +{ + dlclose(libgl); +} + +static void *get_proc(const char *proc) +{ + void *res; + res = dlsym(libgl, proc); + return res; +} +#endif + +static struct { + int major, minor; +} version; + +static int parse_version(void) +{ + if (!glGetIntegerv) + return -1; + + glGetIntegerv(GL_MAJOR_VERSION, &version.major); + glGetIntegerv(GL_MINOR_VERSION, &version.minor); + + if (version.major < 3) + return -1; + return 0; +} + +static void load_procs(void); + +int gles3wInit(void) +{ + if (!open_libgl()) + { + return 0; + } + + load_procs(); + close_libgl(); + parse_version(); + + return 1; +} + +int gles3wIsSupported(int major, int minor) +{ + if (major <= 3) + return 0; + if (version.major == major) + return version.minor >= minor; + return version.major >= major; +} + +void *gles3wGetProcAddress(const char *proc) +{ + return get_proc(proc); +} + +PFNGLACTIVETEXTUREPROC gles3wActiveTexture; +PFNGLATTACHSHADERPROC gles3wAttachShader; +PFNGLBINDATTRIBLOCATIONPROC gles3wBindAttribLocation; +PFNGLBINDBUFFERPROC gles3wBindBuffer; +PFNGLBINDFRAMEBUFFERPROC gles3wBindFramebuffer; +PFNGLBINDRENDERBUFFERPROC gles3wBindRenderbuffer; +PFNGLBINDTEXTUREPROC gles3wBindTexture; +PFNGLBLENDCOLORPROC gles3wBlendColor; +PFNGLBLENDEQUATIONPROC gles3wBlendEquation; +PFNGLBLENDEQUATIONSEPARATEPROC gles3wBlendEquationSeparate; +PFNGLBLENDFUNCPROC gles3wBlendFunc; +PFNGLBLENDFUNCSEPARATEPROC gles3wBlendFuncSeparate; +PFNGLBUFFERDATAPROC gles3wBufferData; +PFNGLBUFFERSUBDATAPROC gles3wBufferSubData; +PFNGLCHECKFRAMEBUFFERSTATUSPROC gles3wCheckFramebufferStatus; +PFNGLCLEARPROC gles3wClear; +PFNGLCLEARCOLORPROC gles3wClearColor; +PFNGLCLEARDEPTHFPROC gles3wClearDepthf; +PFNGLCLEARSTENCILPROC gles3wClearStencil; +PFNGLCOLORMASKPROC gles3wColorMask; +PFNGLCOMPILESHADERPROC gles3wCompileShader; +PFNGLCOMPRESSEDTEXIMAGE2DPROC gles3wCompressedTexImage2D; +PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC gles3wCompressedTexSubImage2D; +PFNGLCOPYTEXIMAGE2DPROC gles3wCopyTexImage2D; +PFNGLCOPYTEXSUBIMAGE2DPROC gles3wCopyTexSubImage2D; +PFNGLCREATEPROGRAMPROC gles3wCreateProgram; +PFNGLCREATESHADERPROC gles3wCreateShader; +PFNGLCULLFACEPROC gles3wCullFace; +PFNGLDELETEBUFFERSPROC gles3wDeleteBuffers; +PFNGLDELETEFRAMEBUFFERSPROC gles3wDeleteFramebuffers; +PFNGLDELETEPROGRAMPROC gles3wDeleteProgram; +PFNGLDELETERENDERBUFFERSPROC gles3wDeleteRenderbuffers; +PFNGLDELETESHADERPROC gles3wDeleteShader; +PFNGLDELETETEXTURESPROC gles3wDeleteTextures; +PFNGLDEPTHFUNCPROC gles3wDepthFunc; +PFNGLDEPTHMASKPROC gles3wDepthMask; +PFNGLDEPTHRANGEFPROC gles3wDepthRangef; +PFNGLDETACHSHADERPROC gles3wDetachShader; +PFNGLDISABLEPROC gles3wDisable; +PFNGLDISABLEVERTEXATTRIBARRAYPROC gles3wDisableVertexAttribArray; +PFNGLDRAWARRAYSPROC gles3wDrawArrays; +PFNGLDRAWELEMENTSPROC gles3wDrawElements; +PFNGLENABLEPROC gles3wEnable; +PFNGLENABLEVERTEXATTRIBARRAYPROC gles3wEnableVertexAttribArray; +PFNGLFINISHPROC gles3wFinish; +PFNGLFLUSHPROC gles3wFlush; +PFNGLFRAMEBUFFERRENDERBUFFERPROC gles3wFramebufferRenderbuffer; +PFNGLFRAMEBUFFERTEXTURE2DPROC gles3wFramebufferTexture2D; +PFNGLFRONTFACEPROC gles3wFrontFace; +PFNGLGENBUFFERSPROC gles3wGenBuffers; +PFNGLGENERATEMIPMAPPROC gles3wGenerateMipmap; +PFNGLGENFRAMEBUFFERSPROC gles3wGenFramebuffers; +PFNGLGENRENDERBUFFERSPROC gles3wGenRenderbuffers; +PFNGLGENTEXTURESPROC gles3wGenTextures; +PFNGLGETACTIVEATTRIBPROC gles3wGetActiveAttrib; +PFNGLGETACTIVEUNIFORMPROC gles3wGetActiveUniform; +PFNGLGETATTACHEDSHADERSPROC gles3wGetAttachedShaders; +PFNGLGETATTRIBLOCATIONPROC gles3wGetAttribLocation; +PFNGLGETBOOLEANVPROC gles3wGetBooleanv; +PFNGLGETBUFFERPARAMETERIVPROC gles3wGetBufferParameteriv; +PFNGLGETERRORPROC gles3wGetError; +PFNGLGETFLOATVPROC gles3wGetFloatv; +PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC gles3wGetFramebufferAttachmentParameteriv; +PFNGLGETINTEGERVPROC gles3wGetIntegerv; +PFNGLGETPROGRAMIVPROC gles3wGetProgramiv; +PFNGLGETPROGRAMINFOLOGPROC gles3wGetProgramInfoLog; +PFNGLGETRENDERBUFFERPARAMETERIVPROC gles3wGetRenderbufferParameteriv; +PFNGLGETSHADERIVPROC gles3wGetShaderiv; +PFNGLGETSHADERINFOLOGPROC gles3wGetShaderInfoLog; +PFNGLGETSHADERPRECISIONFORMATPROC gles3wGetShaderPrecisionFormat; +PFNGLGETSHADERSOURCEPROC gles3wGetShaderSource; +PFNGLGETSTRINGPROC gles3wGetString; +PFNGLGETTEXPARAMETERFVPROC gles3wGetTexParameterfv; +PFNGLGETTEXPARAMETERIVPROC gles3wGetTexParameteriv; +PFNGLGETUNIFORMFVPROC gles3wGetUniformfv; +PFNGLGETUNIFORMIVPROC gles3wGetUniformiv; +PFNGLGETUNIFORMLOCATIONPROC gles3wGetUniformLocation; +PFNGLGETVERTEXATTRIBFVPROC gles3wGetVertexAttribfv; +PFNGLGETVERTEXATTRIBIVPROC gles3wGetVertexAttribiv; +PFNGLGETVERTEXATTRIBPOINTERVPROC gles3wGetVertexAttribPointerv; +PFNGLHINTPROC gles3wHint; +PFNGLISBUFFERPROC gles3wIsBuffer; +PFNGLISENABLEDPROC gles3wIsEnabled; +PFNGLISFRAMEBUFFERPROC gles3wIsFramebuffer; +PFNGLISPROGRAMPROC gles3wIsProgram; +PFNGLISRENDERBUFFERPROC gles3wIsRenderbuffer; +PFNGLISSHADERPROC gles3wIsShader; +PFNGLISTEXTUREPROC gles3wIsTexture; +PFNGLLINEWIDTHPROC gles3wLineWidth; +PFNGLLINKPROGRAMPROC gles3wLinkProgram; +PFNGLPIXELSTOREIPROC gles3wPixelStorei; +PFNGLPOLYGONOFFSETPROC gles3wPolygonOffset; +PFNGLREADPIXELSPROC gles3wReadPixels; +PFNGLRELEASESHADERCOMPILERPROC gles3wReleaseShaderCompiler; +PFNGLRENDERBUFFERSTORAGEPROC gles3wRenderbufferStorage; +PFNGLSAMPLECOVERAGEPROC gles3wSampleCoverage; +PFNGLSCISSORPROC gles3wScissor; +PFNGLSHADERBINARYPROC gles3wShaderBinary; +PFNGLSHADERSOURCEPROC gles3wShaderSource; +PFNGLSTENCILFUNCPROC gles3wStencilFunc; +PFNGLSTENCILFUNCSEPARATEPROC gles3wStencilFuncSeparate; +PFNGLSTENCILMASKPROC gles3wStencilMask; +PFNGLSTENCILMASKSEPARATEPROC gles3wStencilMaskSeparate; +PFNGLSTENCILOPPROC gles3wStencilOp; +PFNGLSTENCILOPSEPARATEPROC gles3wStencilOpSeparate; +PFNGLTEXIMAGE2DPROC gles3wTexImage2D; +PFNGLTEXPARAMETERFPROC gles3wTexParameterf; +PFNGLTEXPARAMETERFVPROC gles3wTexParameterfv; +PFNGLTEXPARAMETERIPROC gles3wTexParameteri; +PFNGLTEXPARAMETERIVPROC gles3wTexParameteriv; +PFNGLTEXSUBIMAGE2DPROC gles3wTexSubImage2D; +PFNGLUNIFORM1FPROC gles3wUniform1f; +PFNGLUNIFORM1FVPROC gles3wUniform1fv; +PFNGLUNIFORM1IPROC gles3wUniform1i; +PFNGLUNIFORM1IVPROC gles3wUniform1iv; +PFNGLUNIFORM2FPROC gles3wUniform2f; +PFNGLUNIFORM2FVPROC gles3wUniform2fv; +PFNGLUNIFORM2IPROC gles3wUniform2i; +PFNGLUNIFORM2IVPROC gles3wUniform2iv; +PFNGLUNIFORM3FPROC gles3wUniform3f; +PFNGLUNIFORM3FVPROC gles3wUniform3fv; +PFNGLUNIFORM3IPROC gles3wUniform3i; +PFNGLUNIFORM3IVPROC gles3wUniform3iv; +PFNGLUNIFORM4FPROC gles3wUniform4f; +PFNGLUNIFORM4FVPROC gles3wUniform4fv; +PFNGLUNIFORM4IPROC gles3wUniform4i; +PFNGLUNIFORM4IVPROC gles3wUniform4iv; +PFNGLUNIFORMMATRIX2FVPROC gles3wUniformMatrix2fv; +PFNGLUNIFORMMATRIX3FVPROC gles3wUniformMatrix3fv; +PFNGLUNIFORMMATRIX4FVPROC gles3wUniformMatrix4fv; +PFNGLUSEPROGRAMPROC gles3wUseProgram; +PFNGLVALIDATEPROGRAMPROC gles3wValidateProgram; +PFNGLVERTEXATTRIB1FPROC gles3wVertexAttrib1f; +PFNGLVERTEXATTRIB1FVPROC gles3wVertexAttrib1fv; +PFNGLVERTEXATTRIB2FPROC gles3wVertexAttrib2f; +PFNGLVERTEXATTRIB2FVPROC gles3wVertexAttrib2fv; +PFNGLVERTEXATTRIB3FPROC gles3wVertexAttrib3f; +PFNGLVERTEXATTRIB3FVPROC gles3wVertexAttrib3fv; +PFNGLVERTEXATTRIB4FPROC gles3wVertexAttrib4f; +PFNGLVERTEXATTRIB4FVPROC gles3wVertexAttrib4fv; +PFNGLVERTEXATTRIBPOINTERPROC gles3wVertexAttribPointer; +PFNGLVIEWPORTPROC gles3wViewport; +PFNGLREADBUFFERPROC gles3wReadBuffer; +PFNGLDRAWRANGEELEMENTSPROC gles3wDrawRangeElements; +PFNGLTEXIMAGE3DPROC gles3wTexImage3D; +PFNGLTEXSUBIMAGE3DPROC gles3wTexSubImage3D; +PFNGLCOPYTEXSUBIMAGE3DPROC gles3wCopyTexSubImage3D; +PFNGLCOMPRESSEDTEXIMAGE3DPROC gles3wCompressedTexImage3D; +PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC gles3wCompressedTexSubImage3D; +PFNGLGENQUERIESPROC gles3wGenQueries; +PFNGLDELETEQUERIESPROC gles3wDeleteQueries; +PFNGLISQUERYPROC gles3wIsQuery; +PFNGLBEGINQUERYPROC gles3wBeginQuery; +PFNGLENDQUERYPROC gles3wEndQuery; +PFNGLGETQUERYIVPROC gles3wGetQueryiv; +PFNGLGETQUERYOBJECTUIVPROC gles3wGetQueryObjectuiv; +PFNGLUNMAPBUFFERPROC gles3wUnmapBuffer; +PFNGLGETBUFFERPOINTERVPROC gles3wGetBufferPointerv; +PFNGLDRAWBUFFERSPROC gles3wDrawBuffers; +PFNGLUNIFORMMATRIX2X3FVPROC gles3wUniformMatrix2x3fv; +PFNGLUNIFORMMATRIX3X2FVPROC gles3wUniformMatrix3x2fv; +PFNGLUNIFORMMATRIX2X4FVPROC gles3wUniformMatrix2x4fv; +PFNGLUNIFORMMATRIX4X2FVPROC gles3wUniformMatrix4x2fv; +PFNGLUNIFORMMATRIX3X4FVPROC gles3wUniformMatrix3x4fv; +PFNGLUNIFORMMATRIX4X3FVPROC gles3wUniformMatrix4x3fv; +PFNGLBLITFRAMEBUFFERPROC gles3wBlitFramebuffer; +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC gles3wRenderbufferStorageMultisample; +PFNGLFRAMEBUFFERTEXTURELAYERPROC gles3wFramebufferTextureLayer; +PFNGLMAPBUFFERRANGEPROC gles3wMapBufferRange; +PFNGLFLUSHMAPPEDBUFFERRANGEPROC gles3wFlushMappedBufferRange; +PFNGLBINDVERTEXARRAYPROC gles3wBindVertexArray; +PFNGLDELETEVERTEXARRAYSPROC gles3wDeleteVertexArrays; +PFNGLGENVERTEXARRAYSPROC gles3wGenVertexArrays; +PFNGLISVERTEXARRAYPROC gles3wIsVertexArray; +PFNGLGETINTEGERI_VPROC gles3wGetIntegeri_v; +PFNGLBEGINTRANSFORMFEEDBACKPROC gles3wBeginTransformFeedback; +PFNGLENDTRANSFORMFEEDBACKPROC gles3wEndTransformFeedback; +PFNGLBINDBUFFERRANGEPROC gles3wBindBufferRange; +PFNGLBINDBUFFERBASEPROC gles3wBindBufferBase; +PFNGLTRANSFORMFEEDBACKVARYINGSPROC gles3wTransformFeedbackVaryings; +PFNGLGETTRANSFORMFEEDBACKVARYINGPROC gles3wGetTransformFeedbackVarying; +PFNGLVERTEXATTRIBIPOINTERPROC gles3wVertexAttribIPointer; +PFNGLGETVERTEXATTRIBIIVPROC gles3wGetVertexAttribIiv; +PFNGLGETVERTEXATTRIBIUIVPROC gles3wGetVertexAttribIuiv; +PFNGLVERTEXATTRIBI4IPROC gles3wVertexAttribI4i; +PFNGLVERTEXATTRIBI4UIPROC gles3wVertexAttribI4ui; +PFNGLVERTEXATTRIBI4IVPROC gles3wVertexAttribI4iv; +PFNGLVERTEXATTRIBI4UIVPROC gles3wVertexAttribI4uiv; +PFNGLGETUNIFORMUIVPROC gles3wGetUniformuiv; +PFNGLGETFRAGDATALOCATIONPROC gles3wGetFragDataLocation; +PFNGLUNIFORM1UIPROC gles3wUniform1ui; +PFNGLUNIFORM2UIPROC gles3wUniform2ui; +PFNGLUNIFORM3UIPROC gles3wUniform3ui; +PFNGLUNIFORM4UIPROC gles3wUniform4ui; +PFNGLUNIFORM1UIVPROC gles3wUniform1uiv; +PFNGLUNIFORM2UIVPROC gles3wUniform2uiv; +PFNGLUNIFORM3UIVPROC gles3wUniform3uiv; +PFNGLUNIFORM4UIVPROC gles3wUniform4uiv; +PFNGLCLEARBUFFERIVPROC gles3wClearBufferiv; +PFNGLCLEARBUFFERUIVPROC gles3wClearBufferuiv; +PFNGLCLEARBUFFERFVPROC gles3wClearBufferfv; +PFNGLCLEARBUFFERFIPROC gles3wClearBufferfi; +PFNGLGETSTRINGIPROC gles3wGetStringi; +PFNGLCOPYBUFFERSUBDATAPROC gles3wCopyBufferSubData; +PFNGLGETUNIFORMINDICESPROC gles3wGetUniformIndices; +PFNGLGETACTIVEUNIFORMSIVPROC gles3wGetActiveUniformsiv; +PFNGLGETUNIFORMBLOCKINDEXPROC gles3wGetUniformBlockIndex; +PFNGLGETACTIVEUNIFORMBLOCKIVPROC gles3wGetActiveUniformBlockiv; +PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC gles3wGetActiveUniformBlockName; +PFNGLUNIFORMBLOCKBINDINGPROC gles3wUniformBlockBinding; +PFNGLDRAWARRAYSINSTANCEDPROC gles3wDrawArraysInstanced; +PFNGLDRAWELEMENTSINSTANCEDPROC gles3wDrawElementsInstanced; +PFNGLFENCESYNCPROC gles3wFenceSync; +PFNGLISSYNCPROC gles3wIsSync; +PFNGLDELETESYNCPROC gles3wDeleteSync; +PFNGLCLIENTWAITSYNCPROC gles3wClientWaitSync; +PFNGLWAITSYNCPROC gles3wWaitSync; +PFNGLGETINTEGER64VPROC gles3wGetInteger64v; +PFNGLGETSYNCIVPROC gles3wGetSynciv; +PFNGLGETINTEGER64I_VPROC gles3wGetInteger64i_v; +PFNGLGETBUFFERPARAMETERI64VPROC gles3wGetBufferParameteri64v; +PFNGLGENSAMPLERSPROC gles3wGenSamplers; +PFNGLDELETESAMPLERSPROC gles3wDeleteSamplers; +PFNGLISSAMPLERPROC gles3wIsSampler; +PFNGLBINDSAMPLERPROC gles3wBindSampler; +PFNGLSAMPLERPARAMETERIPROC gles3wSamplerParameteri; +PFNGLSAMPLERPARAMETERIVPROC gles3wSamplerParameteriv; +PFNGLSAMPLERPARAMETERFPROC gles3wSamplerParameterf; +PFNGLSAMPLERPARAMETERFVPROC gles3wSamplerParameterfv; +PFNGLGETSAMPLERPARAMETERIVPROC gles3wGetSamplerParameteriv; +PFNGLGETSAMPLERPARAMETERFVPROC gles3wGetSamplerParameterfv; +PFNGLVERTEXATTRIBDIVISORPROC gles3wVertexAttribDivisor; +PFNGLBINDTRANSFORMFEEDBACKPROC gles3wBindTransformFeedback; +PFNGLDELETETRANSFORMFEEDBACKSPROC gles3wDeleteTransformFeedbacks; +PFNGLGENTRANSFORMFEEDBACKSPROC gles3wGenTransformFeedbacks; +PFNGLISTRANSFORMFEEDBACKPROC gles3wIsTransformFeedback; +PFNGLPAUSETRANSFORMFEEDBACKPROC gles3wPauseTransformFeedback; +PFNGLRESUMETRANSFORMFEEDBACKPROC gles3wResumeTransformFeedback; +PFNGLGETPROGRAMBINARYPROC gles3wGetProgramBinary; +PFNGLPROGRAMBINARYPROC gles3wProgramBinary; +PFNGLPROGRAMPARAMETERIPROC gles3wProgramParameteri; +PFNGLINVALIDATEFRAMEBUFFERPROC gles3wInvalidateFramebuffer; +PFNGLINVALIDATESUBFRAMEBUFFERPROC gles3wInvalidateSubFramebuffer; +PFNGLTEXSTORAGE2DPROC gles3wTexStorage2D; +PFNGLTEXSTORAGE3DPROC gles3wTexStorage3D; +PFNGLGETINTERNALFORMATIVPROC gles3wGetInternalformativ; +PFNGLUSEPROGRAMSTAGESEXTPROC gles3wUseProgramStagesEXT; +PFNGLACTIVESHADERPROGRAMEXTPROC gles3wActiveShaderProgramEXT; +PFNGLCREATESHADERPROGRAMVEXTPROC gles3wCreateShaderProgramvEXT; +PFNGLBINDPROGRAMPIPELINEEXTPROC gles3wBindProgramPipelineEXT; +PFNGLDELETEPROGRAMPIPELINESEXTPROC gles3wDeleteProgramPipelinesEXT; +PFNGLGENPROGRAMPIPELINESEXTPROC gles3wGenProgramPipelinesEXT; +PFNGLISPROGRAMPIPELINEEXTPROC gles3wIsProgramPipelineEXT; +PFNGLPROGRAMPARAMETERIEXTPROC gles3wProgramParameteriEXT; +PFNGLGETPROGRAMPIPELINEIVEXTPROC gles3wGetProgramPipelineivEXT; +PFNGLPROGRAMUNIFORM1IEXTPROC gles3wProgramUniform1iEXT; +PFNGLPROGRAMUNIFORM2IEXTPROC gles3wProgramUniform2iEXT; +PFNGLPROGRAMUNIFORM3IEXTPROC gles3wProgramUniform3iEXT; +PFNGLPROGRAMUNIFORM4IEXTPROC gles3wProgramUniform4iEXT; +PFNGLPROGRAMUNIFORM1FEXTPROC gles3wProgramUniform1fEXT; +PFNGLPROGRAMUNIFORM2FEXTPROC gles3wProgramUniform2fEXT; +PFNGLPROGRAMUNIFORM3FEXTPROC gles3wProgramUniform3fEXT; +PFNGLPROGRAMUNIFORM4FEXTPROC gles3wProgramUniform4fEXT; +PFNGLPROGRAMUNIFORM1IVEXTPROC gles3wProgramUniform1ivEXT; +PFNGLPROGRAMUNIFORM2IVEXTPROC gles3wProgramUniform2ivEXT; +PFNGLPROGRAMUNIFORM3IVEXTPROC gles3wProgramUniform3ivEXT; +PFNGLPROGRAMUNIFORM4IVEXTPROC gles3wProgramUniform4ivEXT; +PFNGLPROGRAMUNIFORM1FVEXTPROC gles3wProgramUniform1fvEXT; +PFNGLPROGRAMUNIFORM2FVEXTPROC gles3wProgramUniform2fvEXT; +PFNGLPROGRAMUNIFORM3FVEXTPROC gles3wProgramUniform3fvEXT; +PFNGLPROGRAMUNIFORM4FVEXTPROC gles3wProgramUniform4fvEXT; +PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC gles3wProgramUniformMatrix2fvEXT; +PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC gles3wProgramUniformMatrix3fvEXT; +PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC gles3wProgramUniformMatrix4fvEXT; +PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC gles3wProgramUniformMatrix2x3fvEXT; +PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC gles3wProgramUniformMatrix3x2fvEXT; +PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC gles3wProgramUniformMatrix2x4fvEXT; +PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC gles3wProgramUniformMatrix4x2fvEXT; +PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC gles3wProgramUniformMatrix3x4fvEXT; +PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC gles3wProgramUniformMatrix4x3fvEXT; +PFNGLVALIDATEPROGRAMPIPELINEEXTPROC gles3wValidateProgramPipelineEXT; +PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC gles3wGetProgramPipelineInfoLogEXT; +PFNGLLABELOBJECTEXTPROC gles3wLabelObjectEXT; +PFNGLGETOBJECTLABELEXTPROC gles3wGetObjectLabelEXT; +PFNGLINSERTEVENTMARKEREXTPROC gles3wInsertEventMarkerEXT; +PFNGLPUSHGROUPMARKEREXTPROC gles3wPushGroupMarkerEXT; +PFNGLPOPGROUPMARKEREXTPROC gles3wPopGroupMarkerEXT; + +PFNGLDEBUGMESSAGECONTROLKHRPROC gles3wDebugMessageControlKHR; +PFNGLDEBUGMESSAGECALLBACKKHRPROC gles3wDebugMessageCallbackKHR; +PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC gles3wFramebufferTexture2DMultisampleEXT; +PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC gles3wFramebufferTexture2DMultisampleIMG; + +static void load_procs(void) +{ + gles3wActiveTexture = (PFNGLACTIVETEXTUREPROC) get_proc("glActiveTexture"); + gles3wAttachShader = (PFNGLATTACHSHADERPROC) get_proc("glAttachShader"); + gles3wBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC) get_proc("glBindAttribLocation"); + gles3wBindBuffer = (PFNGLBINDBUFFERPROC) get_proc("glBindBuffer"); + gles3wBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC) get_proc("glBindFramebuffer"); + gles3wBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC) get_proc("glBindRenderbuffer"); + gles3wBindTexture = (PFNGLBINDTEXTUREPROC) get_proc("glBindTexture"); + gles3wBlendColor = (PFNGLBLENDCOLORPROC) get_proc("glBlendColor"); + gles3wBlendEquation = (PFNGLBLENDEQUATIONPROC) get_proc("glBlendEquation"); + gles3wBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC) get_proc("glBlendEquationSeparate"); + gles3wBlendFunc = (PFNGLBLENDFUNCPROC) get_proc("glBlendFunc"); + gles3wBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC) get_proc("glBlendFuncSeparate"); + gles3wBufferData = (PFNGLBUFFERDATAPROC) get_proc("glBufferData"); + gles3wBufferSubData = (PFNGLBUFFERSUBDATAPROC) get_proc("glBufferSubData"); + gles3wCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC) get_proc("glCheckFramebufferStatus"); + gles3wClear = (PFNGLCLEARPROC) get_proc("glClear"); + gles3wClearColor = (PFNGLCLEARCOLORPROC) get_proc("glClearColor"); + gles3wClearDepthf = (PFNGLCLEARDEPTHFPROC) get_proc("glClearDepthf"); + gles3wClearStencil = (PFNGLCLEARSTENCILPROC) get_proc("glClearStencil"); + gles3wColorMask = (PFNGLCOLORMASKPROC) get_proc("glColorMask"); + gles3wCompileShader = (PFNGLCOMPILESHADERPROC) get_proc("glCompileShader"); + gles3wCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC) get_proc("glCompressedTexImage2D"); + gles3wCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) get_proc("glCompressedTexSubImage2D"); + gles3wCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC) get_proc("glCopyTexImage2D"); + gles3wCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC) get_proc("glCopyTexSubImage2D"); + gles3wCreateProgram = (PFNGLCREATEPROGRAMPROC) get_proc("glCreateProgram"); + gles3wCreateShader = (PFNGLCREATESHADERPROC) get_proc("glCreateShader"); + gles3wCullFace = (PFNGLCULLFACEPROC) get_proc("glCullFace"); + gles3wDeleteBuffers = (PFNGLDELETEBUFFERSPROC) get_proc("glDeleteBuffers"); + gles3wDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC) get_proc("glDeleteFramebuffers"); + gles3wDeleteProgram = (PFNGLDELETEPROGRAMPROC) get_proc("glDeleteProgram"); + gles3wDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC) get_proc("glDeleteRenderbuffers"); + gles3wDeleteShader = (PFNGLDELETESHADERPROC) get_proc("glDeleteShader"); + gles3wDeleteTextures = (PFNGLDELETETEXTURESPROC) get_proc("glDeleteTextures"); + gles3wDepthFunc = (PFNGLDEPTHFUNCPROC) get_proc("glDepthFunc"); + gles3wDepthMask = (PFNGLDEPTHMASKPROC) get_proc("glDepthMask"); + gles3wDepthRangef = (PFNGLDEPTHRANGEFPROC) get_proc("glDepthRangef"); + gles3wDetachShader = (PFNGLDETACHSHADERPROC) get_proc("glDetachShader"); + gles3wDisable = (PFNGLDISABLEPROC) get_proc("glDisable"); + gles3wDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC) get_proc("glDisableVertexAttribArray"); + gles3wDrawArrays = (PFNGLDRAWARRAYSPROC) get_proc("glDrawArrays"); + gles3wDrawElements = (PFNGLDRAWELEMENTSPROC) get_proc("glDrawElements"); + gles3wEnable = (PFNGLENABLEPROC) get_proc("glEnable"); + gles3wEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC) get_proc("glEnableVertexAttribArray"); + gles3wFinish = (PFNGLFINISHPROC) get_proc("glFinish"); + gles3wFlush = (PFNGLFLUSHPROC) get_proc("glFlush"); + gles3wFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC) get_proc("glFramebufferRenderbuffer"); + gles3wFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC) get_proc("glFramebufferTexture2D"); + gles3wFrontFace = (PFNGLFRONTFACEPROC) get_proc("glFrontFace"); + gles3wGenBuffers = (PFNGLGENBUFFERSPROC) get_proc("glGenBuffers"); + gles3wGenerateMipmap = (PFNGLGENERATEMIPMAPPROC) get_proc("glGenerateMipmap"); + gles3wGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC) get_proc("glGenFramebuffers"); + gles3wGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC) get_proc("glGenRenderbuffers"); + gles3wGenTextures = (PFNGLGENTEXTURESPROC) get_proc("glGenTextures"); + gles3wGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC) get_proc("glGetActiveAttrib"); + gles3wGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC) get_proc("glGetActiveUniform"); + gles3wGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC) get_proc("glGetAttachedShaders"); + gles3wGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC) get_proc("glGetAttribLocation"); + gles3wGetBooleanv = (PFNGLGETBOOLEANVPROC) get_proc("glGetBooleanv"); + gles3wGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC) get_proc("glGetBufferParameteriv"); + gles3wGetError = (PFNGLGETERRORPROC) get_proc("glGetError"); + gles3wGetFloatv = (PFNGLGETFLOATVPROC) get_proc("glGetFloatv"); + gles3wGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) get_proc("glGetFramebufferAttachmentParameteriv"); + gles3wGetIntegerv = (PFNGLGETINTEGERVPROC) get_proc("glGetIntegerv"); + gles3wGetProgramiv = (PFNGLGETPROGRAMIVPROC) get_proc("glGetProgramiv"); + gles3wGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC) get_proc("glGetProgramInfoLog"); + gles3wGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC) get_proc("glGetRenderbufferParameteriv"); + gles3wGetShaderiv = (PFNGLGETSHADERIVPROC) get_proc("glGetShaderiv"); + gles3wGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC) get_proc("glGetShaderInfoLog"); + gles3wGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC) get_proc("glGetShaderPrecisionFormat"); + gles3wGetShaderSource = (PFNGLGETSHADERSOURCEPROC) get_proc("glGetShaderSource"); + gles3wGetString = (PFNGLGETSTRINGPROC) get_proc("glGetString"); + gles3wGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC) get_proc("glGetTexParameterfv"); + gles3wGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC) get_proc("glGetTexParameteriv"); + gles3wGetUniformfv = (PFNGLGETUNIFORMFVPROC) get_proc("glGetUniformfv"); + gles3wGetUniformiv = (PFNGLGETUNIFORMIVPROC) get_proc("glGetUniformiv"); + gles3wGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC) get_proc("glGetUniformLocation"); + gles3wGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC) get_proc("glGetVertexAttribfv"); + gles3wGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC) get_proc("glGetVertexAttribiv"); + gles3wGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC) get_proc("glGetVertexAttribPointerv"); + gles3wHint = (PFNGLHINTPROC) get_proc("glHint"); + gles3wIsBuffer = (PFNGLISBUFFERPROC) get_proc("glIsBuffer"); + gles3wIsEnabled = (PFNGLISENABLEDPROC) get_proc("glIsEnabled"); + gles3wIsFramebuffer = (PFNGLISFRAMEBUFFERPROC) get_proc("glIsFramebuffer"); + gles3wIsProgram = (PFNGLISPROGRAMPROC) get_proc("glIsProgram"); + gles3wIsRenderbuffer = (PFNGLISRENDERBUFFERPROC) get_proc("glIsRenderbuffer"); + gles3wIsShader = (PFNGLISSHADERPROC) get_proc("glIsShader"); + gles3wIsTexture = (PFNGLISTEXTUREPROC) get_proc("glIsTexture"); + gles3wLineWidth = (PFNGLLINEWIDTHPROC) get_proc("glLineWidth"); + gles3wLinkProgram = (PFNGLLINKPROGRAMPROC) get_proc("glLinkProgram"); + gles3wPixelStorei = (PFNGLPIXELSTOREIPROC) get_proc("glPixelStorei"); + gles3wPolygonOffset = (PFNGLPOLYGONOFFSETPROC) get_proc("glPolygonOffset"); + gles3wReadPixels = (PFNGLREADPIXELSPROC) get_proc("glReadPixels"); + gles3wReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC) get_proc("glReleaseShaderCompiler"); + gles3wRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC) get_proc("glRenderbufferStorage"); + gles3wSampleCoverage = (PFNGLSAMPLECOVERAGEPROC) get_proc("glSampleCoverage"); + gles3wScissor = (PFNGLSCISSORPROC) get_proc("glScissor"); + gles3wShaderBinary = (PFNGLSHADERBINARYPROC) get_proc("glShaderBinary"); + gles3wShaderSource = (PFNGLSHADERSOURCEPROC) get_proc("glShaderSource"); + gles3wStencilFunc = (PFNGLSTENCILFUNCPROC) get_proc("glStencilFunc"); + gles3wStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC) get_proc("glStencilFuncSeparate"); + gles3wStencilMask = (PFNGLSTENCILMASKPROC) get_proc("glStencilMask"); + gles3wStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC) get_proc("glStencilMaskSeparate"); + gles3wStencilOp = (PFNGLSTENCILOPPROC) get_proc("glStencilOp"); + gles3wStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC) get_proc("glStencilOpSeparate"); + gles3wTexImage2D = (PFNGLTEXIMAGE2DPROC) get_proc("glTexImage2D"); + gles3wTexParameterf = (PFNGLTEXPARAMETERFPROC) get_proc("glTexParameterf"); + gles3wTexParameterfv = (PFNGLTEXPARAMETERFVPROC) get_proc("glTexParameterfv"); + gles3wTexParameteri = (PFNGLTEXPARAMETERIPROC) get_proc("glTexParameteri"); + gles3wTexParameteriv = (PFNGLTEXPARAMETERIVPROC) get_proc("glTexParameteriv"); + gles3wTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC) get_proc("glTexSubImage2D"); + gles3wUniform1f = (PFNGLUNIFORM1FPROC) get_proc("glUniform1f"); + gles3wUniform1fv = (PFNGLUNIFORM1FVPROC) get_proc("glUniform1fv"); + gles3wUniform1i = (PFNGLUNIFORM1IPROC) get_proc("glUniform1i"); + gles3wUniform1iv = (PFNGLUNIFORM1IVPROC) get_proc("glUniform1iv"); + gles3wUniform2f = (PFNGLUNIFORM2FPROC) get_proc("glUniform2f"); + gles3wUniform2fv = (PFNGLUNIFORM2FVPROC) get_proc("glUniform2fv"); + gles3wUniform2i = (PFNGLUNIFORM2IPROC) get_proc("glUniform2i"); + gles3wUniform2iv = (PFNGLUNIFORM2IVPROC) get_proc("glUniform2iv"); + gles3wUniform3f = (PFNGLUNIFORM3FPROC) get_proc("glUniform3f"); + gles3wUniform3fv = (PFNGLUNIFORM3FVPROC) get_proc("glUniform3fv"); + gles3wUniform3i = (PFNGLUNIFORM3IPROC) get_proc("glUniform3i"); + gles3wUniform3iv = (PFNGLUNIFORM3IVPROC) get_proc("glUniform3iv"); + gles3wUniform4f = (PFNGLUNIFORM4FPROC) get_proc("glUniform4f"); + gles3wUniform4fv = (PFNGLUNIFORM4FVPROC) get_proc("glUniform4fv"); + gles3wUniform4i = (PFNGLUNIFORM4IPROC) get_proc("glUniform4i"); + gles3wUniform4iv = (PFNGLUNIFORM4IVPROC) get_proc("glUniform4iv"); + gles3wUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC) get_proc("glUniformMatrix2fv"); + gles3wUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC) get_proc("glUniformMatrix3fv"); + gles3wUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC) get_proc("glUniformMatrix4fv"); + gles3wUseProgram = (PFNGLUSEPROGRAMPROC) get_proc("glUseProgram"); + gles3wValidateProgram = (PFNGLVALIDATEPROGRAMPROC) get_proc("glValidateProgram"); + gles3wVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC) get_proc("glVertexAttrib1f"); + gles3wVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC) get_proc("glVertexAttrib1fv"); + gles3wVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC) get_proc("glVertexAttrib2f"); + gles3wVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC) get_proc("glVertexAttrib2fv"); + gles3wVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC) get_proc("glVertexAttrib3f"); + gles3wVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC) get_proc("glVertexAttrib3fv"); + gles3wVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC) get_proc("glVertexAttrib4f"); + gles3wVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC) get_proc("glVertexAttrib4fv"); + gles3wVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC) get_proc("glVertexAttribPointer"); + gles3wViewport = (PFNGLVIEWPORTPROC) get_proc("glViewport"); + gles3wReadBuffer = (PFNGLREADBUFFERPROC) get_proc("glReadBuffer"); + gles3wDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC) get_proc("glDrawRangeElements"); + gles3wTexImage3D = (PFNGLTEXIMAGE3DPROC) get_proc("glTexImage3D"); + gles3wTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC) get_proc("glTexSubImage3D"); + gles3wCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC) get_proc("glCopyTexSubImage3D"); + gles3wCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC) get_proc("glCompressedTexImage3D"); + gles3wCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) get_proc("glCompressedTexSubImage3D"); + gles3wGenQueries = (PFNGLGENQUERIESPROC) get_proc("glGenQueries"); + gles3wDeleteQueries = (PFNGLDELETEQUERIESPROC) get_proc("glDeleteQueries"); + gles3wIsQuery = (PFNGLISQUERYPROC) get_proc("glIsQuery"); + gles3wBeginQuery = (PFNGLBEGINQUERYPROC) get_proc("glBeginQuery"); + gles3wEndQuery = (PFNGLENDQUERYPROC) get_proc("glEndQuery"); + gles3wGetQueryiv = (PFNGLGETQUERYIVPROC) get_proc("glGetQueryiv"); + gles3wGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC) get_proc("glGetQueryObjectuiv"); + gles3wUnmapBuffer = (PFNGLUNMAPBUFFERPROC) get_proc("glUnmapBuffer"); + gles3wGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC) get_proc("glGetBufferPointerv"); + gles3wDrawBuffers = (PFNGLDRAWBUFFERSPROC) get_proc("glDrawBuffers"); + gles3wUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC) get_proc("glUniformMatrix2x3fv"); + gles3wUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC) get_proc("glUniformMatrix3x2fv"); + gles3wUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC) get_proc("glUniformMatrix2x4fv"); + gles3wUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC) get_proc("glUniformMatrix4x2fv"); + gles3wUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC) get_proc("glUniformMatrix3x4fv"); + gles3wUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC) get_proc("glUniformMatrix4x3fv"); + gles3wBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC) get_proc("glBlitFramebuffer"); + gles3wRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) get_proc("glRenderbufferStorageMultisample"); + gles3wFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC) get_proc("glFramebufferTextureLayer"); + gles3wMapBufferRange = (PFNGLMAPBUFFERRANGEPROC) get_proc("glMapBufferRange"); + gles3wFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC) get_proc("glFlushMappedBufferRange"); + gles3wBindVertexArray = (PFNGLBINDVERTEXARRAYPROC) get_proc("glBindVertexArray"); + gles3wDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC) get_proc("glDeleteVertexArrays"); + gles3wGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC) get_proc("glGenVertexArrays"); + gles3wIsVertexArray = (PFNGLISVERTEXARRAYPROC) get_proc("glIsVertexArray"); + gles3wGetIntegeri_v = (PFNGLGETINTEGERI_VPROC) get_proc("glGetIntegeri_v"); + gles3wBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC) get_proc("glBeginTransformFeedback"); + gles3wEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC) get_proc("glEndTransformFeedback"); + gles3wBindBufferRange = (PFNGLBINDBUFFERRANGEPROC) get_proc("glBindBufferRange"); + gles3wBindBufferBase = (PFNGLBINDBUFFERBASEPROC) get_proc("glBindBufferBase"); + gles3wTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC) get_proc("glTransformFeedbackVaryings"); + gles3wGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) get_proc("glGetTransformFeedbackVarying"); + gles3wVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC) get_proc("glVertexAttribIPointer"); + gles3wGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC) get_proc("glGetVertexAttribIiv"); + gles3wGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC) get_proc("glGetVertexAttribIuiv"); + gles3wVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC) get_proc("glVertexAttribI4i"); + gles3wVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC) get_proc("glVertexAttribI4ui"); + gles3wVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC) get_proc("glVertexAttribI4iv"); + gles3wVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC) get_proc("glVertexAttribI4uiv"); + gles3wGetUniformuiv = (PFNGLGETUNIFORMUIVPROC) get_proc("glGetUniformuiv"); + gles3wGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC) get_proc("glGetFragDataLocation"); + gles3wUniform1ui = (PFNGLUNIFORM1UIPROC) get_proc("glUniform1ui"); + gles3wUniform2ui = (PFNGLUNIFORM2UIPROC) get_proc("glUniform2ui"); + gles3wUniform3ui = (PFNGLUNIFORM3UIPROC) get_proc("glUniform3ui"); + gles3wUniform4ui = (PFNGLUNIFORM4UIPROC) get_proc("glUniform4ui"); + gles3wUniform1uiv = (PFNGLUNIFORM1UIVPROC) get_proc("glUniform1uiv"); + gles3wUniform2uiv = (PFNGLUNIFORM2UIVPROC) get_proc("glUniform2uiv"); + gles3wUniform3uiv = (PFNGLUNIFORM3UIVPROC) get_proc("glUniform3uiv"); + gles3wUniform4uiv = (PFNGLUNIFORM4UIVPROC) get_proc("glUniform4uiv"); + gles3wClearBufferiv = (PFNGLCLEARBUFFERIVPROC) get_proc("glClearBufferiv"); + gles3wClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC) get_proc("glClearBufferuiv"); + gles3wClearBufferfv = (PFNGLCLEARBUFFERFVPROC) get_proc("glClearBufferfv"); + gles3wClearBufferfi = (PFNGLCLEARBUFFERFIPROC) get_proc("glClearBufferfi"); + gles3wGetStringi = (PFNGLGETSTRINGIPROC) get_proc("glGetStringi"); + gles3wCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC) get_proc("glCopyBufferSubData"); + gles3wGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC) get_proc("glGetUniformIndices"); + gles3wGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC) get_proc("glGetActiveUniformsiv"); + gles3wGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC) get_proc("glGetUniformBlockIndex"); + gles3wGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC) get_proc("glGetActiveUniformBlockiv"); + gles3wGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) get_proc("glGetActiveUniformBlockName"); + gles3wUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC) get_proc("glUniformBlockBinding"); + gles3wDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC) get_proc("glDrawArraysInstanced"); + gles3wDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC) get_proc("glDrawElementsInstanced"); + gles3wFenceSync = (PFNGLFENCESYNCPROC) get_proc("glFenceSync"); + gles3wIsSync = (PFNGLISSYNCPROC) get_proc("glIsSync"); + gles3wDeleteSync = (PFNGLDELETESYNCPROC) get_proc("glDeleteSync"); + gles3wClientWaitSync = (PFNGLCLIENTWAITSYNCPROC) get_proc("glClientWaitSync"); + gles3wWaitSync = (PFNGLWAITSYNCPROC) get_proc("glWaitSync"); + gles3wGetInteger64v = (PFNGLGETINTEGER64VPROC) get_proc("glGetInteger64v"); + gles3wGetSynciv = (PFNGLGETSYNCIVPROC) get_proc("glGetSynciv"); + gles3wGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC) get_proc("glGetInteger64i_v"); + gles3wGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC) get_proc("glGetBufferParameteri64v"); + gles3wGenSamplers = (PFNGLGENSAMPLERSPROC) get_proc("glGenSamplers"); + gles3wDeleteSamplers = (PFNGLDELETESAMPLERSPROC) get_proc("glDeleteSamplers"); + gles3wIsSampler = (PFNGLISSAMPLERPROC) get_proc("glIsSampler"); + gles3wBindSampler = (PFNGLBINDSAMPLERPROC) get_proc("glBindSampler"); + gles3wSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC) get_proc("glSamplerParameteri"); + gles3wSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC) get_proc("glSamplerParameteriv"); + gles3wSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC) get_proc("glSamplerParameterf"); + gles3wSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC) get_proc("glSamplerParameterfv"); + gles3wGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC) get_proc("glGetSamplerParameteriv"); + gles3wGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC) get_proc("glGetSamplerParameterfv"); + gles3wVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC) get_proc("glVertexAttribDivisor"); + gles3wBindTransformFeedback = (PFNGLBINDTRANSFORMFEEDBACKPROC) get_proc("glBindTransformFeedback"); + gles3wDeleteTransformFeedbacks = (PFNGLDELETETRANSFORMFEEDBACKSPROC) get_proc("glDeleteTransformFeedbacks"); + gles3wGenTransformFeedbacks = (PFNGLGENTRANSFORMFEEDBACKSPROC) get_proc("glGenTransformFeedbacks"); + gles3wIsTransformFeedback = (PFNGLISTRANSFORMFEEDBACKPROC) get_proc("glIsTransformFeedback"); + gles3wPauseTransformFeedback = (PFNGLPAUSETRANSFORMFEEDBACKPROC) get_proc("glPauseTransformFeedback"); + gles3wResumeTransformFeedback = (PFNGLRESUMETRANSFORMFEEDBACKPROC) get_proc("glResumeTransformFeedback"); + gles3wGetProgramBinary = (PFNGLGETPROGRAMBINARYPROC) get_proc("glGetProgramBinary"); + gles3wProgramBinary = (PFNGLPROGRAMBINARYPROC) get_proc("glProgramBinary"); + gles3wProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC) get_proc("glProgramParameteri"); + gles3wInvalidateFramebuffer = (PFNGLINVALIDATEFRAMEBUFFERPROC) get_proc("glInvalidateFramebuffer"); + gles3wInvalidateSubFramebuffer = (PFNGLINVALIDATESUBFRAMEBUFFERPROC) get_proc("glInvalidateSubFramebuffer"); + gles3wTexStorage2D = (PFNGLTEXSTORAGE2DPROC) get_proc("glTexStorage2D"); + gles3wTexStorage3D = (PFNGLTEXSTORAGE3DPROC) get_proc("glTexStorage3D"); + gles3wGetInternalformativ = (PFNGLGETINTERNALFORMATIVPROC) get_proc("glGetInternalformativ"); + gles3wLabelObjectEXT = (PFNGLLABELOBJECTEXTPROC) get_proc("glLabelObjectEXT"); + gles3wGetObjectLabelEXT = (PFNGLGETOBJECTLABELEXTPROC) get_proc("glGetObjectLabelEXT"); + gles3wInsertEventMarkerEXT = (PFNGLINSERTEVENTMARKEREXTPROC) get_proc("glInsertEventMarkerEXT"); + gles3wPushGroupMarkerEXT = (PFNGLPUSHGROUPMARKEREXTPROC) get_proc("glPushGroupMarkerEXT"); + gles3wPopGroupMarkerEXT = (PFNGLPOPGROUPMARKEREXTPROC) get_proc("glPopGroupMarkerEXT"); + gles3wUseProgramStagesEXT = (PFNGLUSEPROGRAMSTAGESEXTPROC) get_proc("glUseProgramStagesEXT"); + gles3wActiveShaderProgramEXT = (PFNGLACTIVESHADERPROGRAMEXTPROC) get_proc("glActiveShaderProgramEXT"); + gles3wCreateShaderProgramvEXT = (PFNGLCREATESHADERPROGRAMVEXTPROC) get_proc("glCreateShaderProgramvEXT"); + gles3wBindProgramPipelineEXT = (PFNGLBINDPROGRAMPIPELINEEXTPROC) get_proc("glBindProgramPipelineEXT"); + gles3wDeleteProgramPipelinesEXT = (PFNGLDELETEPROGRAMPIPELINESEXTPROC) get_proc("glDeleteProgramPipelinesEXT"); + gles3wGenProgramPipelinesEXT = (PFNGLGENPROGRAMPIPELINESEXTPROC) get_proc("glGenProgramPipelinesEXT"); + gles3wIsProgramPipelineEXT = (PFNGLISPROGRAMPIPELINEEXTPROC) get_proc("glIsProgramPipelineEXT"); + gles3wProgramParameteriEXT = (PFNGLPROGRAMPARAMETERIEXTPROC) get_proc("glProgramParameteriEXT"); + gles3wGetProgramPipelineivEXT = (PFNGLGETPROGRAMPIPELINEIVEXTPROC) get_proc("glGetProgramPipelineivEXT"); + gles3wProgramUniform1iEXT = (PFNGLPROGRAMUNIFORM1IEXTPROC) get_proc("glProgramUniform1iEXT"); + gles3wProgramUniform2iEXT = (PFNGLPROGRAMUNIFORM2IEXTPROC) get_proc("glProgramUniform2iEXT"); + gles3wProgramUniform3iEXT = (PFNGLPROGRAMUNIFORM3IEXTPROC) get_proc("glProgramUniform3iEXT"); + gles3wProgramUniform4iEXT = (PFNGLPROGRAMUNIFORM4IEXTPROC) get_proc("glProgramUniform4iEXT"); + gles3wProgramUniform1fEXT = (PFNGLPROGRAMUNIFORM1FEXTPROC) get_proc("glProgramUniform1fEXT"); + gles3wProgramUniform2fEXT = (PFNGLPROGRAMUNIFORM2FEXTPROC) get_proc("glProgramUniform2fEXT"); + gles3wProgramUniform3fEXT = (PFNGLPROGRAMUNIFORM3FEXTPROC) get_proc("glProgramUniform3fEXT"); + gles3wProgramUniform4fEXT = (PFNGLPROGRAMUNIFORM4FEXTPROC) get_proc("glProgramUniform4fEXT"); + gles3wProgramUniform1ivEXT = (PFNGLPROGRAMUNIFORM1IVEXTPROC) get_proc("glProgramUniform1ivEXT"); + gles3wProgramUniform2ivEXT = (PFNGLPROGRAMUNIFORM2IVEXTPROC) get_proc("glProgramUniform2ivEXT"); + gles3wProgramUniform3ivEXT = (PFNGLPROGRAMUNIFORM3IVEXTPROC) get_proc("glProgramUniform3ivEXT"); + gles3wProgramUniform4ivEXT = (PFNGLPROGRAMUNIFORM4IVEXTPROC) get_proc("glProgramUniform4ivEXT"); + gles3wProgramUniform1fvEXT = (PFNGLPROGRAMUNIFORM1FVEXTPROC) get_proc("glProgramUniform1fvEXT"); + gles3wProgramUniform2fvEXT = (PFNGLPROGRAMUNIFORM2FVEXTPROC) get_proc("glProgramUniform2fvEXT"); + gles3wProgramUniform3fvEXT = (PFNGLPROGRAMUNIFORM3FVEXTPROC) get_proc("glProgramUniform3fvEXT"); + gles3wProgramUniform4fvEXT = (PFNGLPROGRAMUNIFORM4FVEXTPROC) get_proc("glProgramUniform4fvEXT"); + gles3wProgramUniformMatrix2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) get_proc("glProgramUniformMatrix2fvEXT"); + gles3wProgramUniformMatrix3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) get_proc("glProgramUniformMatrix3fvEXT"); + gles3wProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) get_proc("glProgramUniformMatrix4fvEXT"); + gles3wProgramUniformMatrix2x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) get_proc("glProgramUniformMatrix2x3fvEXT"); + gles3wProgramUniformMatrix4x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) get_proc("glProgramUniformMatrix3x2fvEXT"); + gles3wProgramUniformMatrix2x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) get_proc("glProgramUniformMatrix2x4fvEXT"); + gles3wProgramUniformMatrix4x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) get_proc("glProgramUniformMatrix4x2fvEXT"); + gles3wProgramUniformMatrix3x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) get_proc("glProgramUniformMatrix3x4fvEXT"); + gles3wProgramUniformMatrix4x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) get_proc("glProgramUniformMatrix4x3fvEXT"); + gles3wValidateProgramPipelineEXT = (PFNGLVALIDATEPROGRAMPIPELINEEXTPROC) get_proc("glValidateProgramPipelineEXT"); + gles3wGetProgramPipelineInfoLogEXT = (PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC) get_proc("glGetProgramPipelineInfoLogEXT"); + + gles3wDebugMessageControlKHR = (PFNGLDEBUGMESSAGECONTROLKHRPROC)get_proc("glDebugMessageControlKHR"); + gles3wDebugMessageCallbackKHR = (PFNGLDEBUGMESSAGECALLBACKKHRPROC)get_proc("glDebugMessageCallbackKHR"); + gles3wFramebufferTexture2DMultisampleEXT = (PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC)get_proc("glFramebufferTexture2DMultisampleEXT"); + gles3wFramebufferTexture2DMultisampleIMG = (PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC)get_proc("glFramebufferTexture2DMultisampleIMG"); +} diff --git a/native/cocos/renderer/gfx-gles3/gles3w.h b/native/cocos/renderer/gfx-gles3/gles3w.h new file mode 100755 index 0000000000..b442398ad9 --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/gles3w.h @@ -0,0 +1,933 @@ +#ifndef __gles3w_h_ +#define __gles3w_h_ + +#if defined(__APPLE__) || defined(__APPLE_CC__) +# include + // Prevent Apple's non-standard extension header from being included +# define __gl_es30ext_h_ +#else +# include +#endif + +#include +#include +#include +#include + +#ifndef __gl3_h_ +#define __gl3_h_ +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef GL_EXT_texture_sRGB +#define GL_EXT_texture_sRGB 1 + +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB8_EXT 0x8C41 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 +#define GL_SLUMINANCE_EXT 0x8C46 +#define GL_SLUMINANCE8_EXT 0x8C47 +#define GL_COMPRESSED_SRGB_EXT 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 +#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B +#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F + +#endif /* GL_EXT_texture_sRGB */ + +/* gles3w api */ +int gles3wInit(); +int gles3wIsSupported(int major, int minor); +void *gles3wGetProcAddress(const char *proc); + +/* OpenGL functions */ +typedef void (GL_APIENTRY* PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (GL_APIENTRY* PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (GL_APIENTRY* PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar* name); +typedef void (GL_APIENTRY* PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); +typedef void (GL_APIENTRY* PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); +typedef void (GL_APIENTRY* PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); +typedef void (GL_APIENTRY* PFNGLBINDTEXTUREPROC) (GLenum target, GLuint texture); +typedef void (GL_APIENTRY* PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +typedef void (GL_APIENTRY* PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (GL_APIENTRY* PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); +typedef void (GL_APIENTRY* PFNGLBLENDFUNCPROC) (GLenum sfactor, GLenum dfactor); +typedef void (GL_APIENTRY* PFNGLBLENDFUNCSEPARATEPROC) (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (GL_APIENTRY* PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage); +typedef void (GL_APIENTRY* PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data); +typedef GLenum (GL_APIENTRY* PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); +typedef void (GL_APIENTRY* PFNGLCLEARPROC) (GLbitfield mask); +typedef void (GL_APIENTRY* PFNGLCLEARCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +typedef void (GL_APIENTRY* PFNGLCLEARDEPTHFPROC) (GLfloat depth); +typedef void (GL_APIENTRY* PFNGLCLEARSTENCILPROC) (GLint s); +typedef void (GL_APIENTRY* PFNGLCOLORMASKPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +typedef void (GL_APIENTRY* PFNGLCOMPILESHADERPROC) (GLuint shader); +typedef void (GL_APIENTRY* PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data); +typedef void (GL_APIENTRY* PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data); +typedef void (GL_APIENTRY* PFNGLCOPYTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GL_APIENTRY* PFNGLCOPYTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef GLuint (GL_APIENTRY* PFNGLCREATEPROGRAMPROC) (void); +typedef GLuint (GL_APIENTRY* PFNGLCREATESHADERPROC) (GLenum type); +typedef void (GL_APIENTRY* PFNGLCULLFACEPROC) (GLenum mode); +typedef void (GL_APIENTRY* PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint* buffers); +typedef void (GL_APIENTRY* PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint* framebuffers); +typedef void (GL_APIENTRY* PFNGLDELETEPROGRAMPROC) (GLuint program); +typedef void (GL_APIENTRY* PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint* renderbuffers); +typedef void (GL_APIENTRY* PFNGLDELETESHADERPROC) (GLuint shader); +typedef void (GL_APIENTRY* PFNGLDELETETEXTURESPROC) (GLsizei n, const GLuint* textures); +typedef void (GL_APIENTRY* PFNGLDEPTHFUNCPROC) (GLenum func); +typedef void (GL_APIENTRY* PFNGLDEPTHMASKPROC) (GLboolean flag); +typedef void (GL_APIENTRY* PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f); +typedef void (GL_APIENTRY* PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (GL_APIENTRY* PFNGLDISABLEPROC) (GLenum cap); +typedef void (GL_APIENTRY* PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (GL_APIENTRY* PFNGLDRAWARRAYSPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (GL_APIENTRY* PFNGLDRAWELEMENTSPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices); +typedef void (GL_APIENTRY* PFNGLENABLEPROC) (GLenum cap); +typedef void (GL_APIENTRY* PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (GL_APIENTRY* PFNGLFINISHPROC) (void); +typedef void (GL_APIENTRY* PFNGLFLUSHPROC) (void); +typedef void (GL_APIENTRY* PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GL_APIENTRY* PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GL_APIENTRY* PFNGLFRONTFACEPROC) (GLenum mode); +typedef void (GL_APIENTRY* PFNGLGENBUFFERSPROC) (GLsizei n, GLuint* buffers); +typedef void (GL_APIENTRY* PFNGLGENERATEMIPMAPPROC) (GLenum target); +typedef void (GL_APIENTRY* PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint* framebuffers); +typedef void (GL_APIENTRY* PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (GL_APIENTRY* PFNGLGENTEXTURESPROC) (GLsizei n, GLuint* textures); +typedef void (GL_APIENTRY* PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name); +typedef void (GL_APIENTRY* PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name); +typedef void (GL_APIENTRY* PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders); +typedef GLint (GL_APIENTRY* PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar* name); +typedef void (GL_APIENTRY* PFNGLGETBOOLEANVPROC) (GLenum pname, GLboolean* params); +typedef void (GL_APIENTRY* PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLenum (GL_APIENTRY* PFNGLGETERRORPROC) (void); +typedef void (GL_APIENTRY* PFNGLGETFLOATVPROC) (GLenum pname, GLfloat* params); +typedef void (GL_APIENTRY* PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); +typedef void (GL_APIENTRY* PFNGLGETINTEGERVPROC) (GLenum pname, GLint* params); +typedef void (GL_APIENTRY* PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint* params); +typedef void (GL_APIENTRY* PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog); +typedef void (GL_APIENTRY* PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GL_APIENTRY* PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint* params); +typedef void (GL_APIENTRY* PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog); +typedef void (GL_APIENTRY* PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision); +typedef void (GL_APIENTRY* PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source); +typedef const GLubyte* (GL_APIENTRY* PFNGLGETSTRINGPROC) (GLenum name); +typedef void (GL_APIENTRY* PFNGLGETTEXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GL_APIENTRY* PFNGLGETTEXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GL_APIENTRY* PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat* params); +typedef void (GL_APIENTRY* PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint* params); +typedef GLint (GL_APIENTRY* PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar* name); +typedef void (GL_APIENTRY* PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GL_APIENTRY* PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint* params); +typedef void (GL_APIENTRY* PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid** pointer); +typedef void (GL_APIENTRY* PFNGLHINTPROC) (GLenum target, GLenum mode); +typedef GLboolean (GL_APIENTRY* PFNGLISBUFFERPROC) (GLuint buffer); +typedef GLboolean (GL_APIENTRY* PFNGLISENABLEDPROC) (GLenum cap); +typedef GLboolean (GL_APIENTRY* PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); +typedef GLboolean (GL_APIENTRY* PFNGLISPROGRAMPROC) (GLuint program); +typedef GLboolean (GL_APIENTRY* PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); +typedef GLboolean (GL_APIENTRY* PFNGLISSHADERPROC) (GLuint shader); +typedef GLboolean (GL_APIENTRY* PFNGLISTEXTUREPROC) (GLuint texture); +typedef void (GL_APIENTRY* PFNGLLINEWIDTHPROC) (GLfloat width); +typedef void (GL_APIENTRY* PFNGLLINKPROGRAMPROC) (GLuint program); +typedef void (GL_APIENTRY* PFNGLPIXELSTOREIPROC) (GLenum pname, GLint param); +typedef void (GL_APIENTRY* PFNGLPOLYGONOFFSETPROC) (GLfloat factor, GLfloat units); +typedef void (GL_APIENTRY* PFNGLREADPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels); +typedef void (GL_APIENTRY* PFNGLRELEASESHADERCOMPILERPROC) (void); +typedef void (GL_APIENTRY* PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRY* PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert); +typedef void (GL_APIENTRY* PFNGLSCISSORPROC) (GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GL_APIENTRY* PFNGLSHADERBINARYPROC) (GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length); +typedef void (GL_APIENTRY* PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length); +typedef void (GL_APIENTRY* PFNGLSTENCILFUNCPROC) (GLenum func, GLint ref, GLuint mask); +typedef void (GL_APIENTRY* PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask); +typedef void (GL_APIENTRY* PFNGLSTENCILMASKPROC) (GLuint mask); +typedef void (GL_APIENTRY* PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); +typedef void (GL_APIENTRY* PFNGLSTENCILOPPROC) (GLenum fail, GLenum zfail, GLenum zpass); +typedef void (GL_APIENTRY* PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum fail, GLenum zfail, GLenum zpass); +typedef void (GL_APIENTRY* PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels); +typedef void (GL_APIENTRY* PFNGLTEXPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (GL_APIENTRY* PFNGLTEXPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GL_APIENTRY* PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GL_APIENTRY* PFNGLTEXPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GL_APIENTRY* PFNGLTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels); +typedef void (GL_APIENTRY* PFNGLUNIFORM1FPROC) (GLint location, GLfloat x); +typedef void (GL_APIENTRY* PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat* v); +typedef void (GL_APIENTRY* PFNGLUNIFORM1IPROC) (GLint location, GLint x); +typedef void (GL_APIENTRY* PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint* v); +typedef void (GL_APIENTRY* PFNGLUNIFORM2FPROC) (GLint location, GLfloat x, GLfloat y); +typedef void (GL_APIENTRY* PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat* v); +typedef void (GL_APIENTRY* PFNGLUNIFORM2IPROC) (GLint location, GLint x, GLint y); +typedef void (GL_APIENTRY* PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint* v); +typedef void (GL_APIENTRY* PFNGLUNIFORM3FPROC) (GLint location, GLfloat x, GLfloat y, GLfloat z); +typedef void (GL_APIENTRY* PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat* v); +typedef void (GL_APIENTRY* PFNGLUNIFORM3IPROC) (GLint location, GLint x, GLint y, GLint z); +typedef void (GL_APIENTRY* PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint* v); +typedef void (GL_APIENTRY* PFNGLUNIFORM4FPROC) (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GL_APIENTRY* PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat* v); +typedef void (GL_APIENTRY* PFNGLUNIFORM4IPROC) (GLint location, GLint x, GLint y, GLint z, GLint w); +typedef void (GL_APIENTRY* PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint* v); +typedef void (GL_APIENTRY* PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GL_APIENTRY* PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GL_APIENTRY* PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GL_APIENTRY* PFNGLUSEPROGRAMPROC) (GLuint program); +typedef void (GL_APIENTRY* PFNGLVALIDATEPROGRAMPROC) (GLuint program); +typedef void (GL_APIENTRY* PFNGLVERTEXATTRIB1FPROC) (GLuint indx, GLfloat x); +typedef void (GL_APIENTRY* PFNGLVERTEXATTRIB1FVPROC) (GLuint indx, const GLfloat* values); +typedef void (GL_APIENTRY* PFNGLVERTEXATTRIB2FPROC) (GLuint indx, GLfloat x, GLfloat y); +typedef void (GL_APIENTRY* PFNGLVERTEXATTRIB2FVPROC) (GLuint indx, const GLfloat* values); +typedef void (GL_APIENTRY* PFNGLVERTEXATTRIB3FPROC) (GLuint indx, GLfloat x, GLfloat y, GLfloat z); +typedef void (GL_APIENTRY* PFNGLVERTEXATTRIB3FVPROC) (GLuint indx, const GLfloat* values); +typedef void (GL_APIENTRY* PFNGLVERTEXATTRIB4FPROC) (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GL_APIENTRY* PFNGLVERTEXATTRIB4FVPROC) (GLuint indx, const GLfloat* values); +typedef void (GL_APIENTRY* PFNGLVERTEXATTRIBPOINTERPROC) (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr); +typedef void (GL_APIENTRY* PFNGLVIEWPORTPROC) (GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GL_APIENTRY* PFNGLREADBUFFERPROC) (GLenum mode); +typedef void (GL_APIENTRY* PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices); +typedef void (GL_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 (GL_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 (GL_APIENTRY* PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GL_APIENTRY* PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data); +typedef void (GL_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 (GL_APIENTRY* PFNGLGENQUERIESPROC) (GLsizei n, GLuint* ids); +typedef void (GL_APIENTRY* PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint* ids); +typedef GLboolean (GL_APIENTRY* PFNGLISQUERYPROC) (GLuint id); +typedef void (GL_APIENTRY* PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); +typedef void (GL_APIENTRY* PFNGLENDQUERYPROC) (GLenum target); +typedef void (GL_APIENTRY* PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GL_APIENTRY* PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint* params); +typedef GLboolean (GL_APIENTRY* PFNGLUNMAPBUFFERPROC) (GLenum target); +typedef void (GL_APIENTRY* PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid** params); +typedef void (GL_APIENTRY* PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum* bufs); +typedef void (GL_APIENTRY* PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GL_APIENTRY* PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GL_APIENTRY* PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GL_APIENTRY* PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GL_APIENTRY* PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GL_APIENTRY* PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GL_APIENTRY* PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef void (GL_APIENTRY* PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRY* PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef GLvoid* (GL_APIENTRY* PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (GL_APIENTRY* PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); +typedef void (GL_APIENTRY* PFNGLBINDVERTEXARRAYPROC) (GLuint array); +typedef void (GL_APIENTRY* PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint* arrays); +typedef void (GL_APIENTRY* PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint* arrays); +typedef GLboolean (GL_APIENTRY* PFNGLISVERTEXARRAYPROC) (GLuint array); +typedef void (GL_APIENTRY* PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint* data); +typedef void (GL_APIENTRY* PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode); +typedef void (GL_APIENTRY* PFNGLENDTRANSFORMFEEDBACKPROC) (void); +typedef void (GL_APIENTRY* PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GL_APIENTRY* PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (GL_APIENTRY* PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar* const* varyings, GLenum bufferMode); +typedef void (GL_APIENTRY* PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name); +typedef void (GL_APIENTRY* PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer); +typedef void (GL_APIENTRY* PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint* params); +typedef void (GL_APIENTRY* PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint* params); +typedef void (GL_APIENTRY* PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GL_APIENTRY* PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GL_APIENTRY* PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint* v); +typedef void (GL_APIENTRY* PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint* v); +typedef void (GL_APIENTRY* PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint* params); +typedef GLint (GL_APIENTRY* PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (GL_APIENTRY* PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0); +typedef void (GL_APIENTRY* PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (GL_APIENTRY* PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (GL_APIENTRY* PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (GL_APIENTRY* PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint* value); +typedef void (GL_APIENTRY* PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint* value); +typedef void (GL_APIENTRY* PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint* value); +typedef void (GL_APIENTRY* PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint* value); +typedef void (GL_APIENTRY* PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint* value); +typedef void (GL_APIENTRY* PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint* value); +typedef void (GL_APIENTRY* PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat* value); +typedef void (GL_APIENTRY* PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); +typedef const GLubyte* (GL_APIENTRY* PFNGLGETSTRINGIPROC) (GLenum name, GLuint index); +typedef void (GL_APIENTRY* PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (GL_APIENTRY* PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar* const* uniformNames, GLuint* uniformIndices); +typedef void (GL_APIENTRY* PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params); +typedef GLuint (GL_APIENTRY* PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar* uniformBlockName); +typedef void (GL_APIENTRY* PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params); +typedef void (GL_APIENTRY* PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName); +typedef void (GL_APIENTRY* PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); +typedef void (GL_APIENTRY* PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instanceCount); +typedef void (GL_APIENTRY* PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices, GLsizei instanceCount); +typedef GLsync (GL_APIENTRY* PFNGLFENCESYNCPROC) (GLenum condition, GLbitfield flags); +typedef GLboolean (GL_APIENTRY* PFNGLISSYNCPROC) (GLsync sync); +typedef void (GL_APIENTRY* PFNGLDELETESYNCPROC) (GLsync sync); +typedef GLenum (GL_APIENTRY* PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); +typedef void (GL_APIENTRY* PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); +typedef void (GL_APIENTRY* PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64* params); +typedef void (GL_APIENTRY* PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values); +typedef void (GL_APIENTRY* PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64* data); +typedef void (GL_APIENTRY* PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64* params); +typedef void (GL_APIENTRY* PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint* samplers); +typedef void (GL_APIENTRY* PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint* samplers); +typedef GLboolean (GL_APIENTRY* PFNGLISSAMPLERPROC) (GLuint sampler); +typedef void (GL_APIENTRY* PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler); +typedef void (GL_APIENTRY* PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param); +typedef void (GL_APIENTRY* PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint* param); +typedef void (GL_APIENTRY* PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param); +typedef void (GL_APIENTRY* PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat* param); +typedef void (GL_APIENTRY* PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint* params); +typedef void (GL_APIENTRY* PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat* params); +typedef void (GL_APIENTRY* PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); +typedef void (GL_APIENTRY* PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id); +typedef void (GL_APIENTRY* PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint* ids); +typedef void (GL_APIENTRY* PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint* ids); +typedef GLboolean (GL_APIENTRY* PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id); +typedef void (GL_APIENTRY* PFNGLPAUSETRANSFORMFEEDBACKPROC) (void); +typedef void (GL_APIENTRY* PFNGLRESUMETRANSFORMFEEDBACKPROC) (void); +typedef void (GL_APIENTRY* PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, GLvoid* binary); +typedef void (GL_APIENTRY* PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const GLvoid* binary, GLsizei length); +typedef void (GL_APIENTRY* PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); +typedef void (GL_APIENTRY* PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments); +typedef void (GL_APIENTRY* PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GL_APIENTRY* PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GL_APIENTRY* PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); +typedef void (GL_APIENTRY* PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params); +typedef void (GL_APIENTRY* PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar *label); +typedef void (GL_APIENTRY* PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei *length, GLchar *label); +typedef void (GL_APIENTRY* PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker); +typedef void (GL_APIENTRY* PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker); +typedef void (GL_APIENTRY* PFNGLPOPGROUPMARKEREXTPROC) (void); +typedef void (GL_APIENTRY* PFNGLUSEPROGRAMSTAGESEXTPROC) (GLuint pipeline, GLbitfield stages, GLuint program); +typedef void (GL_APIENTRY* PFNGLACTIVESHADERPROGRAMEXTPROC) (GLuint pipeline, GLuint program); +typedef GLuint (GL_APIENTRY* PFNGLCREATESHADERPROGRAMVEXTPROC) (GLenum type, GLsizei count, const GLchar **strings); +typedef void (GL_APIENTRY* PFNGLBINDPROGRAMPIPELINEEXTPROC) (GLuint pipeline); +typedef void (GL_APIENTRY* PFNGLDELETEPROGRAMPIPELINESEXTPROC) (GLsizei n, const GLuint *pipelines); +typedef void (GL_APIENTRY* PFNGLGENPROGRAMPIPELINESEXTPROC) (GLsizei n, GLuint *pipelines); +typedef GLboolean (GL_APIENTRY* PFNGLISPROGRAMPIPELINEEXTPROC) (GLuint pipeline); +typedef void (GL_APIENTRY* PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); +typedef void (GL_APIENTRY* PFNGLGETPROGRAMPIPELINEIVEXTPROC) (GLuint pipeline, GLenum pname, GLint *params); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint x); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint x, GLint y); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat x); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRY* PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GL_APIENTRY* PFNGLVALIDATEPROGRAMPIPELINEEXTPROC) (GLuint pipeline); +typedef void (GL_APIENTRY* PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); + +typedef void (GL_APIENTRY* PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC) (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei); + +extern PFNGLACTIVETEXTUREPROC gles3wActiveTexture; +extern PFNGLATTACHSHADERPROC gles3wAttachShader; +extern PFNGLBINDATTRIBLOCATIONPROC gles3wBindAttribLocation; +extern PFNGLBINDBUFFERPROC gles3wBindBuffer; +extern PFNGLBINDFRAMEBUFFERPROC gles3wBindFramebuffer; +extern PFNGLBINDRENDERBUFFERPROC gles3wBindRenderbuffer; +extern PFNGLBINDTEXTUREPROC gles3wBindTexture; +extern PFNGLBLENDCOLORPROC gles3wBlendColor; +extern PFNGLBLENDEQUATIONPROC gles3wBlendEquation; +extern PFNGLBLENDEQUATIONSEPARATEPROC gles3wBlendEquationSeparate; +extern PFNGLBLENDFUNCPROC gles3wBlendFunc; +extern PFNGLBLENDFUNCSEPARATEPROC gles3wBlendFuncSeparate; +extern PFNGLBUFFERDATAPROC gles3wBufferData; +extern PFNGLBUFFERSUBDATAPROC gles3wBufferSubData; +extern PFNGLCHECKFRAMEBUFFERSTATUSPROC gles3wCheckFramebufferStatus; +extern PFNGLCLEARPROC gles3wClear; +extern PFNGLCLEARCOLORPROC gles3wClearColor; +extern PFNGLCLEARDEPTHFPROC gles3wClearDepthf; +extern PFNGLCLEARSTENCILPROC gles3wClearStencil; +extern PFNGLCOLORMASKPROC gles3wColorMask; +extern PFNGLCOMPILESHADERPROC gles3wCompileShader; +extern PFNGLCOMPRESSEDTEXIMAGE2DPROC gles3wCompressedTexImage2D; +extern PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC gles3wCompressedTexSubImage2D; +extern PFNGLCOPYTEXIMAGE2DPROC gles3wCopyTexImage2D; +extern PFNGLCOPYTEXSUBIMAGE2DPROC gles3wCopyTexSubImage2D; +extern PFNGLCREATEPROGRAMPROC gles3wCreateProgram; +extern PFNGLCREATESHADERPROC gles3wCreateShader; +extern PFNGLCULLFACEPROC gles3wCullFace; +extern PFNGLDELETEBUFFERSPROC gles3wDeleteBuffers; +extern PFNGLDELETEFRAMEBUFFERSPROC gles3wDeleteFramebuffers; +extern PFNGLDELETEPROGRAMPROC gles3wDeleteProgram; +extern PFNGLDELETERENDERBUFFERSPROC gles3wDeleteRenderbuffers; +extern PFNGLDELETESHADERPROC gles3wDeleteShader; +extern PFNGLDELETETEXTURESPROC gles3wDeleteTextures; +extern PFNGLDEPTHFUNCPROC gles3wDepthFunc; +extern PFNGLDEPTHMASKPROC gles3wDepthMask; +extern PFNGLDEPTHRANGEFPROC gles3wDepthRangef; +extern PFNGLDETACHSHADERPROC gles3wDetachShader; +extern PFNGLDISABLEPROC gles3wDisable; +extern PFNGLDISABLEVERTEXATTRIBARRAYPROC gles3wDisableVertexAttribArray; +extern PFNGLDRAWARRAYSPROC gles3wDrawArrays; +extern PFNGLDRAWELEMENTSPROC gles3wDrawElements; +extern PFNGLENABLEPROC gles3wEnable; +extern PFNGLENABLEVERTEXATTRIBARRAYPROC gles3wEnableVertexAttribArray; +extern PFNGLFINISHPROC gles3wFinish; +extern PFNGLFLUSHPROC gles3wFlush; +extern PFNGLFRAMEBUFFERRENDERBUFFERPROC gles3wFramebufferRenderbuffer; +extern PFNGLFRAMEBUFFERTEXTURE2DPROC gles3wFramebufferTexture2D; +extern PFNGLFRONTFACEPROC gles3wFrontFace; +extern PFNGLGENBUFFERSPROC gles3wGenBuffers; +extern PFNGLGENERATEMIPMAPPROC gles3wGenerateMipmap; +extern PFNGLGENFRAMEBUFFERSPROC gles3wGenFramebuffers; +extern PFNGLGENRENDERBUFFERSPROC gles3wGenRenderbuffers; +extern PFNGLGENTEXTURESPROC gles3wGenTextures; +extern PFNGLGETACTIVEATTRIBPROC gles3wGetActiveAttrib; +extern PFNGLGETACTIVEUNIFORMPROC gles3wGetActiveUniform; +extern PFNGLGETATTACHEDSHADERSPROC gles3wGetAttachedShaders; +extern PFNGLGETATTRIBLOCATIONPROC gles3wGetAttribLocation; +extern PFNGLGETBOOLEANVPROC gles3wGetBooleanv; +extern PFNGLGETBUFFERPARAMETERIVPROC gles3wGetBufferParameteriv; +extern PFNGLGETERRORPROC gles3wGetError; +extern PFNGLGETFLOATVPROC gles3wGetFloatv; +extern PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC gles3wGetFramebufferAttachmentParameteriv; +extern PFNGLGETINTEGERVPROC gles3wGetIntegerv; +extern PFNGLGETPROGRAMIVPROC gles3wGetProgramiv; +extern PFNGLGETPROGRAMINFOLOGPROC gles3wGetProgramInfoLog; +extern PFNGLGETRENDERBUFFERPARAMETERIVPROC gles3wGetRenderbufferParameteriv; +extern PFNGLGETSHADERIVPROC gles3wGetShaderiv; +extern PFNGLGETSHADERINFOLOGPROC gles3wGetShaderInfoLog; +extern PFNGLGETSHADERPRECISIONFORMATPROC gles3wGetShaderPrecisionFormat; +extern PFNGLGETSHADERSOURCEPROC gles3wGetShaderSource; +extern PFNGLGETSTRINGPROC gles3wGetString; +extern PFNGLGETTEXPARAMETERFVPROC gles3wGetTexParameterfv; +extern PFNGLGETTEXPARAMETERIVPROC gles3wGetTexParameteriv; +extern PFNGLGETUNIFORMFVPROC gles3wGetUniformfv; +extern PFNGLGETUNIFORMIVPROC gles3wGetUniformiv; +extern PFNGLGETUNIFORMLOCATIONPROC gles3wGetUniformLocation; +extern PFNGLGETVERTEXATTRIBFVPROC gles3wGetVertexAttribfv; +extern PFNGLGETVERTEXATTRIBIVPROC gles3wGetVertexAttribiv; +extern PFNGLGETVERTEXATTRIBPOINTERVPROC gles3wGetVertexAttribPointerv; +extern PFNGLHINTPROC gles3wHint; +extern PFNGLISBUFFERPROC gles3wIsBuffer; +extern PFNGLISENABLEDPROC gles3wIsEnabled; +extern PFNGLISFRAMEBUFFERPROC gles3wIsFramebuffer; +extern PFNGLISPROGRAMPROC gles3wIsProgram; +extern PFNGLISRENDERBUFFERPROC gles3wIsRenderbuffer; +extern PFNGLISSHADERPROC gles3wIsShader; +extern PFNGLISTEXTUREPROC gles3wIsTexture; +extern PFNGLLINEWIDTHPROC gles3wLineWidth; +extern PFNGLLINKPROGRAMPROC gles3wLinkProgram; +extern PFNGLPIXELSTOREIPROC gles3wPixelStorei; +extern PFNGLPOLYGONOFFSETPROC gles3wPolygonOffset; +extern PFNGLREADPIXELSPROC gles3wReadPixels; +extern PFNGLRELEASESHADERCOMPILERPROC gles3wReleaseShaderCompiler; +extern PFNGLRENDERBUFFERSTORAGEPROC gles3wRenderbufferStorage; +extern PFNGLSAMPLECOVERAGEPROC gles3wSampleCoverage; +extern PFNGLSCISSORPROC gles3wScissor; +extern PFNGLSHADERBINARYPROC gles3wShaderBinary; +extern PFNGLSHADERSOURCEPROC gles3wShaderSource; +extern PFNGLSTENCILFUNCPROC gles3wStencilFunc; +extern PFNGLSTENCILFUNCSEPARATEPROC gles3wStencilFuncSeparate; +extern PFNGLSTENCILMASKPROC gles3wStencilMask; +extern PFNGLSTENCILMASKSEPARATEPROC gles3wStencilMaskSeparate; +extern PFNGLSTENCILOPPROC gles3wStencilOp; +extern PFNGLSTENCILOPSEPARATEPROC gles3wStencilOpSeparate; +extern PFNGLTEXIMAGE2DPROC gles3wTexImage2D; +extern PFNGLTEXPARAMETERFPROC gles3wTexParameterf; +extern PFNGLTEXPARAMETERFVPROC gles3wTexParameterfv; +extern PFNGLTEXPARAMETERIPROC gles3wTexParameteri; +extern PFNGLTEXPARAMETERIVPROC gles3wTexParameteriv; +extern PFNGLTEXSUBIMAGE2DPROC gles3wTexSubImage2D; +extern PFNGLUNIFORM1FPROC gles3wUniform1f; +extern PFNGLUNIFORM1FVPROC gles3wUniform1fv; +extern PFNGLUNIFORM1IPROC gles3wUniform1i; +extern PFNGLUNIFORM1IVPROC gles3wUniform1iv; +extern PFNGLUNIFORM2FPROC gles3wUniform2f; +extern PFNGLUNIFORM2FVPROC gles3wUniform2fv; +extern PFNGLUNIFORM2IPROC gles3wUniform2i; +extern PFNGLUNIFORM2IVPROC gles3wUniform2iv; +extern PFNGLUNIFORM3FPROC gles3wUniform3f; +extern PFNGLUNIFORM3FVPROC gles3wUniform3fv; +extern PFNGLUNIFORM3IPROC gles3wUniform3i; +extern PFNGLUNIFORM3IVPROC gles3wUniform3iv; +extern PFNGLUNIFORM4FPROC gles3wUniform4f; +extern PFNGLUNIFORM4FVPROC gles3wUniform4fv; +extern PFNGLUNIFORM4IPROC gles3wUniform4i; +extern PFNGLUNIFORM4IVPROC gles3wUniform4iv; +extern PFNGLUNIFORMMATRIX2FVPROC gles3wUniformMatrix2fv; +extern PFNGLUNIFORMMATRIX3FVPROC gles3wUniformMatrix3fv; +extern PFNGLUNIFORMMATRIX4FVPROC gles3wUniformMatrix4fv; +extern PFNGLUSEPROGRAMPROC gles3wUseProgram; +extern PFNGLVALIDATEPROGRAMPROC gles3wValidateProgram; +extern PFNGLVERTEXATTRIB1FPROC gles3wVertexAttrib1f; +extern PFNGLVERTEXATTRIB1FVPROC gles3wVertexAttrib1fv; +extern PFNGLVERTEXATTRIB2FPROC gles3wVertexAttrib2f; +extern PFNGLVERTEXATTRIB2FVPROC gles3wVertexAttrib2fv; +extern PFNGLVERTEXATTRIB3FPROC gles3wVertexAttrib3f; +extern PFNGLVERTEXATTRIB3FVPROC gles3wVertexAttrib3fv; +extern PFNGLVERTEXATTRIB4FPROC gles3wVertexAttrib4f; +extern PFNGLVERTEXATTRIB4FVPROC gles3wVertexAttrib4fv; +extern PFNGLVERTEXATTRIBPOINTERPROC gles3wVertexAttribPointer; +extern PFNGLVIEWPORTPROC gles3wViewport; +extern PFNGLREADBUFFERPROC gles3wReadBuffer; +extern PFNGLDRAWRANGEELEMENTSPROC gles3wDrawRangeElements; +extern PFNGLTEXIMAGE3DPROC gles3wTexImage3D; +extern PFNGLTEXSUBIMAGE3DPROC gles3wTexSubImage3D; +extern PFNGLCOPYTEXSUBIMAGE3DPROC gles3wCopyTexSubImage3D; +extern PFNGLCOMPRESSEDTEXIMAGE3DPROC gles3wCompressedTexImage3D; +extern PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC gles3wCompressedTexSubImage3D; +extern PFNGLGENQUERIESPROC gles3wGenQueries; +extern PFNGLDELETEQUERIESPROC gles3wDeleteQueries; +extern PFNGLISQUERYPROC gles3wIsQuery; +extern PFNGLBEGINQUERYPROC gles3wBeginQuery; +extern PFNGLENDQUERYPROC gles3wEndQuery; +extern PFNGLGETQUERYIVPROC gles3wGetQueryiv; +extern PFNGLGETQUERYOBJECTUIVPROC gles3wGetQueryObjectuiv; +extern PFNGLUNMAPBUFFERPROC gles3wUnmapBuffer; +extern PFNGLGETBUFFERPOINTERVPROC gles3wGetBufferPointerv; +extern PFNGLDRAWBUFFERSPROC gles3wDrawBuffers; +extern PFNGLUNIFORMMATRIX2X3FVPROC gles3wUniformMatrix2x3fv; +extern PFNGLUNIFORMMATRIX3X2FVPROC gles3wUniformMatrix3x2fv; +extern PFNGLUNIFORMMATRIX2X4FVPROC gles3wUniformMatrix2x4fv; +extern PFNGLUNIFORMMATRIX4X2FVPROC gles3wUniformMatrix4x2fv; +extern PFNGLUNIFORMMATRIX3X4FVPROC gles3wUniformMatrix3x4fv; +extern PFNGLUNIFORMMATRIX4X3FVPROC gles3wUniformMatrix4x3fv; +extern PFNGLBLITFRAMEBUFFERPROC gles3wBlitFramebuffer; +extern PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC gles3wRenderbufferStorageMultisample; +extern PFNGLFRAMEBUFFERTEXTURELAYERPROC gles3wFramebufferTextureLayer; +extern PFNGLMAPBUFFERRANGEPROC gles3wMapBufferRange; +extern PFNGLFLUSHMAPPEDBUFFERRANGEPROC gles3wFlushMappedBufferRange; +extern PFNGLBINDVERTEXARRAYPROC gles3wBindVertexArray; +extern PFNGLDELETEVERTEXARRAYSPROC gles3wDeleteVertexArrays; +extern PFNGLGENVERTEXARRAYSPROC gles3wGenVertexArrays; +extern PFNGLISVERTEXARRAYPROC gles3wIsVertexArray; +extern PFNGLGETINTEGERI_VPROC gles3wGetIntegeri_v; +extern PFNGLBEGINTRANSFORMFEEDBACKPROC gles3wBeginTransformFeedback; +extern PFNGLENDTRANSFORMFEEDBACKPROC gles3wEndTransformFeedback; +extern PFNGLBINDBUFFERRANGEPROC gles3wBindBufferRange; +extern PFNGLBINDBUFFERBASEPROC gles3wBindBufferBase; +extern PFNGLTRANSFORMFEEDBACKVARYINGSPROC gles3wTransformFeedbackVaryings; +extern PFNGLGETTRANSFORMFEEDBACKVARYINGPROC gles3wGetTransformFeedbackVarying; +extern PFNGLVERTEXATTRIBIPOINTERPROC gles3wVertexAttribIPointer; +extern PFNGLGETVERTEXATTRIBIIVPROC gles3wGetVertexAttribIiv; +extern PFNGLGETVERTEXATTRIBIUIVPROC gles3wGetVertexAttribIuiv; +extern PFNGLVERTEXATTRIBI4IPROC gles3wVertexAttribI4i; +extern PFNGLVERTEXATTRIBI4UIPROC gles3wVertexAttribI4ui; +extern PFNGLVERTEXATTRIBI4IVPROC gles3wVertexAttribI4iv; +extern PFNGLVERTEXATTRIBI4UIVPROC gles3wVertexAttribI4uiv; +extern PFNGLGETUNIFORMUIVPROC gles3wGetUniformuiv; +extern PFNGLGETFRAGDATALOCATIONPROC gles3wGetFragDataLocation; +extern PFNGLUNIFORM1UIPROC gles3wUniform1ui; +extern PFNGLUNIFORM2UIPROC gles3wUniform2ui; +extern PFNGLUNIFORM3UIPROC gles3wUniform3ui; +extern PFNGLUNIFORM4UIPROC gles3wUniform4ui; +extern PFNGLUNIFORM1UIVPROC gles3wUniform1uiv; +extern PFNGLUNIFORM2UIVPROC gles3wUniform2uiv; +extern PFNGLUNIFORM3UIVPROC gles3wUniform3uiv; +extern PFNGLUNIFORM4UIVPROC gles3wUniform4uiv; +extern PFNGLCLEARBUFFERIVPROC gles3wClearBufferiv; +extern PFNGLCLEARBUFFERUIVPROC gles3wClearBufferuiv; +extern PFNGLCLEARBUFFERFVPROC gles3wClearBufferfv; +extern PFNGLCLEARBUFFERFIPROC gles3wClearBufferfi; +extern PFNGLGETSTRINGIPROC gles3wGetStringi; +extern PFNGLCOPYBUFFERSUBDATAPROC gles3wCopyBufferSubData; +extern PFNGLGETUNIFORMINDICESPROC gles3wGetUniformIndices; +extern PFNGLGETACTIVEUNIFORMSIVPROC gles3wGetActiveUniformsiv; +extern PFNGLGETUNIFORMBLOCKINDEXPROC gles3wGetUniformBlockIndex; +extern PFNGLGETACTIVEUNIFORMBLOCKIVPROC gles3wGetActiveUniformBlockiv; +extern PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC gles3wGetActiveUniformBlockName; +extern PFNGLUNIFORMBLOCKBINDINGPROC gles3wUniformBlockBinding; +extern PFNGLDRAWARRAYSINSTANCEDPROC gles3wDrawArraysInstanced; +extern PFNGLDRAWELEMENTSINSTANCEDPROC gles3wDrawElementsInstanced; +extern PFNGLFENCESYNCPROC gles3wFenceSync; +extern PFNGLISSYNCPROC gles3wIsSync; +extern PFNGLDELETESYNCPROC gles3wDeleteSync; +extern PFNGLCLIENTWAITSYNCPROC gles3wClientWaitSync; +extern PFNGLWAITSYNCPROC gles3wWaitSync; +extern PFNGLGETINTEGER64VPROC gles3wGetInteger64v; +extern PFNGLGETSYNCIVPROC gles3wGetSynciv; +extern PFNGLGETINTEGER64I_VPROC gles3wGetInteger64i_v; +extern PFNGLGETBUFFERPARAMETERI64VPROC gles3wGetBufferParameteri64v; +extern PFNGLGENSAMPLERSPROC gles3wGenSamplers; +extern PFNGLDELETESAMPLERSPROC gles3wDeleteSamplers; +extern PFNGLISSAMPLERPROC gles3wIsSampler; +extern PFNGLBINDSAMPLERPROC gles3wBindSampler; +extern PFNGLSAMPLERPARAMETERIPROC gles3wSamplerParameteri; +extern PFNGLSAMPLERPARAMETERIVPROC gles3wSamplerParameteriv; +extern PFNGLSAMPLERPARAMETERFPROC gles3wSamplerParameterf; +extern PFNGLSAMPLERPARAMETERFVPROC gles3wSamplerParameterfv; +extern PFNGLGETSAMPLERPARAMETERIVPROC gles3wGetSamplerParameteriv; +extern PFNGLGETSAMPLERPARAMETERFVPROC gles3wGetSamplerParameterfv; +extern PFNGLVERTEXATTRIBDIVISORPROC gles3wVertexAttribDivisor; +extern PFNGLBINDTRANSFORMFEEDBACKPROC gles3wBindTransformFeedback; +extern PFNGLDELETETRANSFORMFEEDBACKSPROC gles3wDeleteTransformFeedbacks; +extern PFNGLGENTRANSFORMFEEDBACKSPROC gles3wGenTransformFeedbacks; +extern PFNGLISTRANSFORMFEEDBACKPROC gles3wIsTransformFeedback; +extern PFNGLPAUSETRANSFORMFEEDBACKPROC gles3wPauseTransformFeedback; +extern PFNGLRESUMETRANSFORMFEEDBACKPROC gles3wResumeTransformFeedback; +extern PFNGLGETPROGRAMBINARYPROC gles3wGetProgramBinary; +extern PFNGLPROGRAMBINARYPROC gles3wProgramBinary; +extern PFNGLPROGRAMPARAMETERIPROC gles3wProgramParameteri; +extern PFNGLINVALIDATEFRAMEBUFFERPROC gles3wInvalidateFramebuffer; +extern PFNGLINVALIDATESUBFRAMEBUFFERPROC gles3wInvalidateSubFramebuffer; +extern PFNGLTEXSTORAGE2DPROC gles3wTexStorage2D; +extern PFNGLTEXSTORAGE3DPROC gles3wTexStorage3D; +extern PFNGLGETINTERNALFORMATIVPROC gles3wGetInternalformativ; +extern PFNGLLABELOBJECTEXTPROC gles3wLabelObjectEXT; +extern PFNGLGETOBJECTLABELEXTPROC gles3wGetObjectLabelEXT; +extern PFNGLINSERTEVENTMARKEREXTPROC gles3wInsertEventMarkerEXT; +extern PFNGLPUSHGROUPMARKEREXTPROC gles3wPushGroupMarkerEXT; +extern PFNGLPOPGROUPMARKEREXTPROC gles3wPopGroupMarkerEXT; +extern PFNGLUSEPROGRAMSTAGESEXTPROC gles3wUseProgramStagesEXT; +extern PFNGLACTIVESHADERPROGRAMEXTPROC gles3wActiveShaderProgramEXT; +extern PFNGLCREATESHADERPROGRAMVEXTPROC gles3wCreateShaderProgramvEXT; +extern PFNGLBINDPROGRAMPIPELINEEXTPROC gles3wBindProgramPipelineEXT; +extern PFNGLDELETEPROGRAMPIPELINESEXTPROC gles3wDeleteProgramPipelinesEXT; +extern PFNGLGENPROGRAMPIPELINESEXTPROC gles3wGenProgramPipelinesEXT; +extern PFNGLISPROGRAMPIPELINEEXTPROC gles3wIsProgramPipelineEXT; +extern PFNGLPROGRAMPARAMETERIEXTPROC gles3wProgramParameteriEXT; +extern PFNGLGETPROGRAMPIPELINEIVEXTPROC gles3wGetProgramPipelineivEXT; +extern PFNGLPROGRAMUNIFORM1IEXTPROC gles3wProgramUniform1iEXT; +extern PFNGLPROGRAMUNIFORM2IEXTPROC gles3wProgramUniform2iEXT; +extern PFNGLPROGRAMUNIFORM3IEXTPROC gles3wProgramUniform3iEXT; +extern PFNGLPROGRAMUNIFORM4IEXTPROC gles3wProgramUniform4iEXT; +extern PFNGLPROGRAMUNIFORM1FEXTPROC gles3wProgramUniform1fEXT; +extern PFNGLPROGRAMUNIFORM2FEXTPROC gles3wProgramUniform2fEXT; +extern PFNGLPROGRAMUNIFORM3FEXTPROC gles3wProgramUniform3fEXT; +extern PFNGLPROGRAMUNIFORM4FEXTPROC gles3wProgramUniform4fEXT; +extern PFNGLPROGRAMUNIFORM1IVEXTPROC gles3wProgramUniform1ivEXT; +extern PFNGLPROGRAMUNIFORM2IVEXTPROC gles3wProgramUniform2ivEXT; +extern PFNGLPROGRAMUNIFORM3IVEXTPROC gles3wProgramUniform3ivEXT; +extern PFNGLPROGRAMUNIFORM4IVEXTPROC gles3wProgramUniform4ivEXT; +extern PFNGLPROGRAMUNIFORM1FVEXTPROC gles3wProgramUniform1fvEXT; +extern PFNGLPROGRAMUNIFORM2FVEXTPROC gles3wProgramUniform2fvEXT; +extern PFNGLPROGRAMUNIFORM3FVEXTPROC gles3wProgramUniform3fvEXT; +extern PFNGLPROGRAMUNIFORM4FVEXTPROC gles3wProgramUniform4fvEXT; +extern PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC gles3wProgramUniformMatrix2fvEXT; +extern PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC gles3wProgramUniformMatrix3fvEXT; +extern PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC gles3wProgramUniformMatrix4fvEXT; +extern PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC gles3wProgramUniformMatrix2x3fvEXT; +extern PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC gles3wProgramUniformMatrix3x2fvEXT; +extern PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC gles3wProgramUniformMatrix2x4fvEXT; +extern PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC gles3wProgramUniformMatrix4x2fvEXT; +extern PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC gles3wProgramUniformMatrix3x4fvEXT; +extern PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC gles3wProgramUniformMatrix4x3fvEXT; +extern PFNGLVALIDATEPROGRAMPIPELINEEXTPROC gles3wValidateProgramPipelineEXT; +extern PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC gles3wGetProgramPipelineInfoLogEXT; + +extern PFNGLDEBUGMESSAGECONTROLKHRPROC gles3wDebugMessageControlKHR; +extern PFNGLDEBUGMESSAGECALLBACKKHRPROC gles3wDebugMessageCallbackKHR; +extern PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC gles3wFramebufferTexture2DMultisampleEXT; +extern PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC gles3wFramebufferTexture2DMultisampleIMG; + +#define glActiveTexture gles3wActiveTexture +#define glAttachShader gles3wAttachShader +#define glBindAttribLocation gles3wBindAttribLocation +#define glBindBuffer gles3wBindBuffer +#define glBindFramebuffer gles3wBindFramebuffer +#define glBindRenderbuffer gles3wBindRenderbuffer +#define glBindTexture gles3wBindTexture +#define glBlendColor gles3wBlendColor +#define glBlendEquation gles3wBlendEquation +#define glBlendEquationSeparate gles3wBlendEquationSeparate +#define glBlendFunc gles3wBlendFunc +#define glBlendFuncSeparate gles3wBlendFuncSeparate +#define glBufferData gles3wBufferData +#define glBufferSubData gles3wBufferSubData +#define glCheckFramebufferStatus gles3wCheckFramebufferStatus +#define glClear gles3wClear +#define glClearColor gles3wClearColor +#define glClearDepthf gles3wClearDepthf +#define glClearStencil gles3wClearStencil +#define glColorMask gles3wColorMask +#define glCompileShader gles3wCompileShader +#define glCompressedTexImage2D gles3wCompressedTexImage2D +#define glCompressedTexSubImage2D gles3wCompressedTexSubImage2D +#define glCopyTexImage2D gles3wCopyTexImage2D +#define glCopyTexSubImage2D gles3wCopyTexSubImage2D +#define glCreateProgram gles3wCreateProgram +#define glCreateShader gles3wCreateShader +#define glCullFace gles3wCullFace +#define glDeleteBuffers gles3wDeleteBuffers +#define glDeleteFramebuffers gles3wDeleteFramebuffers +#define glDeleteProgram gles3wDeleteProgram +#define glDeleteRenderbuffers gles3wDeleteRenderbuffers +#define glDeleteShader gles3wDeleteShader +#define glDeleteTextures gles3wDeleteTextures +#define glDepthFunc gles3wDepthFunc +#define glDepthMask gles3wDepthMask +#define glDepthRangef gles3wDepthRangef +#define glDetachShader gles3wDetachShader +#define glDisable gles3wDisable +#define glDisableVertexAttribArray gles3wDisableVertexAttribArray +#define glDrawArrays gles3wDrawArrays +#define glDrawElements gles3wDrawElements +#define glEnable gles3wEnable +#define glEnableVertexAttribArray gles3wEnableVertexAttribArray +#define glFinish gles3wFinish +#define glFlush gles3wFlush +#define glFramebufferRenderbuffer gles3wFramebufferRenderbuffer +#define glFramebufferTexture2D gles3wFramebufferTexture2D +#define glFrontFace gles3wFrontFace +#define glGenBuffers gles3wGenBuffers +#define glGenerateMipmap gles3wGenerateMipmap +#define glGenFramebuffers gles3wGenFramebuffers +#define glGenRenderbuffers gles3wGenRenderbuffers +#define glGenTextures gles3wGenTextures +#define glGetActiveAttrib gles3wGetActiveAttrib +#define glGetActiveUniform gles3wGetActiveUniform +#define glGetAttachedShaders gles3wGetAttachedShaders +#define glGetAttribLocation gles3wGetAttribLocation +#define glGetBooleanv gles3wGetBooleanv +#define glGetBufferParameteriv gles3wGetBufferParameteriv +#define glGetError gles3wGetError +#define glGetFloatv gles3wGetFloatv +#define glGetFramebufferAttachmentParameteriv gles3wGetFramebufferAttachmentParameteriv +#define glGetIntegerv gles3wGetIntegerv +#define glGetProgramiv gles3wGetProgramiv +#define glGetProgramInfoLog gles3wGetProgramInfoLog +#define glGetRenderbufferParameteriv gles3wGetRenderbufferParameteriv +#define glGetShaderiv gles3wGetShaderiv +#define glGetShaderInfoLog gles3wGetShaderInfoLog +#define glGetShaderPrecisionFormat gles3wGetShaderPrecisionFormat +#define glGetShaderSource gles3wGetShaderSource +#define glGetString gles3wGetString +#define glGetTexParameterfv gles3wGetTexParameterfv +#define glGetTexParameteriv gles3wGetTexParameteriv +#define glGetUniformfv gles3wGetUniformfv +#define glGetUniformiv gles3wGetUniformiv +#define glGetUniformLocation gles3wGetUniformLocation +#define glGetVertexAttribfv gles3wGetVertexAttribfv +#define glGetVertexAttribiv gles3wGetVertexAttribiv +#define glGetVertexAttribPointerv gles3wGetVertexAttribPointerv +#define glHint gles3wHint +#define glIsBuffer gles3wIsBuffer +#define glIsEnabled gles3wIsEnabled +#define glIsFramebuffer gles3wIsFramebuffer +#define glIsProgram gles3wIsProgram +#define glIsRenderbuffer gles3wIsRenderbuffer +#define glIsShader gles3wIsShader +#define glIsTexture gles3wIsTexture +#define glLineWidth gles3wLineWidth +#define glLinkProgram gles3wLinkProgram +#define glPixelStorei gles3wPixelStorei +#define glPolygonOffset gles3wPolygonOffset +#define glReadPixels gles3wReadPixels +#define glReleaseShaderCompiler gles3wReleaseShaderCompiler +#define glRenderbufferStorage gles3wRenderbufferStorage +#define glSampleCoverage gles3wSampleCoverage +#define glScissor gles3wScissor +#define glShaderBinary gles3wShaderBinary +#define glShaderSource gles3wShaderSource +#define glStencilFunc gles3wStencilFunc +#define glStencilFuncSeparate gles3wStencilFuncSeparate +#define glStencilMask gles3wStencilMask +#define glStencilMaskSeparate gles3wStencilMaskSeparate +#define glStencilOp gles3wStencilOp +#define glStencilOpSeparate gles3wStencilOpSeparate +#define glTexImage2D gles3wTexImage2D +#define glTexParameterf gles3wTexParameterf +#define glTexParameterfv gles3wTexParameterfv +#define glTexParameteri gles3wTexParameteri +#define glTexParameteriv gles3wTexParameteriv +#define glTexSubImage2D gles3wTexSubImage2D +#define glUniform1f gles3wUniform1f +#define glUniform1fv gles3wUniform1fv +#define glUniform1i gles3wUniform1i +#define glUniform1iv gles3wUniform1iv +#define glUniform2f gles3wUniform2f +#define glUniform2fv gles3wUniform2fv +#define glUniform2i gles3wUniform2i +#define glUniform2iv gles3wUniform2iv +#define glUniform3f gles3wUniform3f +#define glUniform3fv gles3wUniform3fv +#define glUniform3i gles3wUniform3i +#define glUniform3iv gles3wUniform3iv +#define glUniform4f gles3wUniform4f +#define glUniform4fv gles3wUniform4fv +#define glUniform4i gles3wUniform4i +#define glUniform4iv gles3wUniform4iv +#define glUniformMatrix2fv gles3wUniformMatrix2fv +#define glUniformMatrix3fv gles3wUniformMatrix3fv +#define glUniformMatrix4fv gles3wUniformMatrix4fv +#define glUseProgram gles3wUseProgram +#define glValidateProgram gles3wValidateProgram +#define glVertexAttrib1f gles3wVertexAttrib1f +#define glVertexAttrib1fv gles3wVertexAttrib1fv +#define glVertexAttrib2f gles3wVertexAttrib2f +#define glVertexAttrib2fv gles3wVertexAttrib2fv +#define glVertexAttrib3f gles3wVertexAttrib3f +#define glVertexAttrib3fv gles3wVertexAttrib3fv +#define glVertexAttrib4f gles3wVertexAttrib4f +#define glVertexAttrib4fv gles3wVertexAttrib4fv +#define glVertexAttribPointer gles3wVertexAttribPointer +#define glViewport gles3wViewport +#define glReadBuffer gles3wReadBuffer +#define glDrawRangeElements gles3wDrawRangeElements +#define glTexImage3D gles3wTexImage3D +#define glTexSubImage3D gles3wTexSubImage3D +#define glCopyTexSubImage3D gles3wCopyTexSubImage3D +#define glCompressedTexImage3D gles3wCompressedTexImage3D +#define glCompressedTexSubImage3D gles3wCompressedTexSubImage3D +#define glGenQueries gles3wGenQueries +#define glDeleteQueries gles3wDeleteQueries +#define glIsQuery gles3wIsQuery +#define glBeginQuery gles3wBeginQuery +#define glEndQuery gles3wEndQuery +#define glGetQueryiv gles3wGetQueryiv +#define glGetQueryObjectuiv gles3wGetQueryObjectuiv +#define glUnmapBuffer gles3wUnmapBuffer +#define glGetBufferPointerv gles3wGetBufferPointerv +#define glDrawBuffers gles3wDrawBuffers +#define glUniformMatrix2x3fv gles3wUniformMatrix2x3fv +#define glUniformMatrix3x2fv gles3wUniformMatrix3x2fv +#define glUniformMatrix2x4fv gles3wUniformMatrix2x4fv +#define glUniformMatrix4x2fv gles3wUniformMatrix4x2fv +#define glUniformMatrix3x4fv gles3wUniformMatrix3x4fv +#define glUniformMatrix4x3fv gles3wUniformMatrix4x3fv +#define glBlitFramebuffer gles3wBlitFramebuffer +#define glRenderbufferStorageMultisample gles3wRenderbufferStorageMultisample +#define glFramebufferTextureLayer gles3wFramebufferTextureLayer +#define glMapBufferRange gles3wMapBufferRange +#define glFlushMappedBufferRange gles3wFlushMappedBufferRange +#define glBindVertexArray gles3wBindVertexArray +#define glDeleteVertexArrays gles3wDeleteVertexArrays +#define glGenVertexArrays gles3wGenVertexArrays +#define glIsVertexArray gles3wIsVertexArray +#define glGetIntegeri_v gles3wGetIntegeri_v +#define glBeginTransformFeedback gles3wBeginTransformFeedback +#define glEndTransformFeedback gles3wEndTransformFeedback +#define glBindBufferRange gles3wBindBufferRange +#define glBindBufferBase gles3wBindBufferBase +#define glTransformFeedbackVaryings gles3wTransformFeedbackVaryings +#define glGetTransformFeedbackVarying gles3wGetTransformFeedbackVarying +#define glVertexAttribIPointer gles3wVertexAttribIPointer +#define glGetVertexAttribIiv gles3wGetVertexAttribIiv +#define glGetVertexAttribIuiv gles3wGetVertexAttribIuiv +#define glVertexAttribI4i gles3wVertexAttribI4i +#define glVertexAttribI4ui gles3wVertexAttribI4ui +#define glVertexAttribI4iv gles3wVertexAttribI4iv +#define glVertexAttribI4uiv gles3wVertexAttribI4uiv +#define glGetUniformuiv gles3wGetUniformuiv +#define glGetFragDataLocation gles3wGetFragDataLocation +#define glUniform1ui gles3wUniform1ui +#define glUniform2ui gles3wUniform2ui +#define glUniform3ui gles3wUniform3ui +#define glUniform4ui gles3wUniform4ui +#define glUniform1uiv gles3wUniform1uiv +#define glUniform2uiv gles3wUniform2uiv +#define glUniform3uiv gles3wUniform3uiv +#define glUniform4uiv gles3wUniform4uiv +#define glClearBufferiv gles3wClearBufferiv +#define glClearBufferuiv gles3wClearBufferuiv +#define glClearBufferfv gles3wClearBufferfv +#define glClearBufferfi gles3wClearBufferfi +#define glGetStringi gles3wGetStringi +#define glCopyBufferSubData gles3wCopyBufferSubData +#define glGetUniformIndices gles3wGetUniformIndices +#define glGetActiveUniformsiv gles3wGetActiveUniformsiv +#define glGetUniformBlockIndex gles3wGetUniformBlockIndex +#define glGetActiveUniformBlockiv gles3wGetActiveUniformBlockiv +#define glGetActiveUniformBlockName gles3wGetActiveUniformBlockName +#define glUniformBlockBinding gles3wUniformBlockBinding +#define glDrawArraysInstanced gles3wDrawArraysInstanced +#define glDrawElementsInstanced gles3wDrawElementsInstanced +#define glFenceSync gles3wFenceSync +#define glIsSync gles3wIsSync +#define glDeleteSync gles3wDeleteSync +#define glClientWaitSync gles3wClientWaitSync +#define glWaitSync gles3wWaitSync +#define glGetInteger64v gles3wGetInteger64v +#define glGetSynciv gles3wGetSynciv +#define glGetInteger64i_v gles3wGetInteger64i_v +#define glGetBufferParameteri64v gles3wGetBufferParameteri64v +#define glGenSamplers gles3wGenSamplers +#define glDeleteSamplers gles3wDeleteSamplers +#define glIsSampler gles3wIsSampler +#define glBindSampler gles3wBindSampler +#define glSamplerParameteri gles3wSamplerParameteri +#define glSamplerParameteriv gles3wSamplerParameteriv +#define glSamplerParameterf gles3wSamplerParameterf +#define glSamplerParameterfv gles3wSamplerParameterfv +#define glGetSamplerParameteriv gles3wGetSamplerParameteriv +#define glGetSamplerParameterfv gles3wGetSamplerParameterfv +#define glVertexAttribDivisor gles3wVertexAttribDivisor +#define glBindTransformFeedback gles3wBindTransformFeedback +#define glDeleteTransformFeedbacks gles3wDeleteTransformFeedbacks +#define glGenTransformFeedbacks gles3wGenTransformFeedbacks +#define glIsTransformFeedback gles3wIsTransformFeedback +#define glPauseTransformFeedback gles3wPauseTransformFeedback +#define glResumeTransformFeedback gles3wResumeTransformFeedback +#define glGetProgramBinary gles3wGetProgramBinary +#define glProgramBinary gles3wProgramBinary +#define glProgramParameteri gles3wProgramParameteri +#define glInvalidateFramebuffer gles3wInvalidateFramebuffer +#define glInvalidateSubFramebuffer gles3wInvalidateSubFramebuffer +#define glTexStorage2D gles3wTexStorage2D +#define glTexStorage3D gles3wTexStorage3D +#define glGetInternalformativ gles3wGetInternalformativ +#define glLabelObjectEXT gles3wLabelObjectEXT +#define glGetObjectLabelEXT gles3wGetObjectLabelEXT +#define glInsertEventMarkerEXT gles3wInsertEventMarkerEXT +#define glPushGroupMarkerEXT gles3wPushGroupMarkerEXT +#define glPopGroupMarkerEXT gles3wPopGroupMarkerEXT +#define glUseProgramStagesEXT gles3wUseProgramStagesEXT +#define glActiveShaderProgramEXT gles3wActiveShaderProgramEXT +#define glCreateShaderProgramvEXT gles3wCreateShaderProgramvEXT +#define glBindProgramPipelineEXT gles3wBindProgramPipelineEXT +#define glDeleteProgramPipelinesEXT gles3wDeleteProgramPipelinesEXT +#define glGenProgramPipelinesEXT gles3wGenProgramPipelinesEXT +#define glIsProgramPipelineEXT gles3wIsProgramPipelineEXT +#define glProgramParameteriEXT gles3wProgramParameteriEXT +#define glGetProgramPipelineivEXT gles3wGetProgramPipelineivEXT +#define glProgramUniform1iEXT gles3wProgramUniform1iEXT +#define glProgramUniform2iEXT gles3wProgramUniform2iEXT +#define glProgramUniform3iEXT gles3wProgramUniform3iEXT +#define glProgramUniform4iEXT gles3wProgramUniform4iEXT +#define glProgramUniform1fEXT gles3wProgramUniform1fEXT +#define glProgramUniform2fEXT gles3wProgramUniform2fEXT +#define glProgramUniform3fEXT gles3wProgramUniform3fEXT +#define glProgramUniform4fEXT gles3wProgramUniform4fEXT +#define glProgramUniform1ivEXT gles3wProgramUniform1ivEXT +#define glProgramUniform2ivEXT gles3wProgramUniform2ivEXT +#define glProgramUniform3ivEXT gles3wProgramUniform3ivEXT +#define glProgramUniform4ivEXT gles3wProgramUniform4ivEXT +#define glProgramUniform1fvEXT gles3wProgramUniform1fvEXT +#define glProgramUniform2fvEXT gles3wProgramUniform2fvEXT +#define glProgramUniform3fvEXT gles3wProgramUniform3fvEXT +#define glProgramUniform4fvEXT gles3wProgramUniform4fvEXT +#define glProgramUniformMatrix2fvEXT gles3wProgramUniformMatrix2fvEXT +#define glProgramUniformMatrix3fvEXT gles3wProgramUniformMatrix3fvEXT +#define glProgramUniformMatrix4fvEXT gles3wProgramUniformMatrix4fvEXT +#define glProgramUniformMatrix2x3fvEXT gles3wProgramUniformMatrix2x3fvEXT +#define glProgramUniformMatrix3x2fvEXT gles3wProgramUniformMatrix3x2fvEXT +#define glProgramUniformMatrix2x4fvEXT gles3wProgramUniformMatrix2x4fvEXT +#define glProgramUniformMatrix4x2fvEXT gles3wProgramUniformMatrix4x2fvEXT +#define glProgramUniformMatrix3x4fvEXT gles3wProgramUniformMatrix3x4fvEXT +#define glProgramUniformMatrix4x3fvEXT gles3wProgramUniformMatrix4x3fvEXT +#define glValidateProgramPipelineEXT gles3wValidateProgramPipelineEXT +#define glGetProgramPipelineInfoLogEXT gles3wGetProgramPipelineInfoLogEXT + +#define glDebugMessageControlKHR gles3wDebugMessageControlKHR +#define glDebugMessageCallbackKHR gles3wDebugMessageCallbackKHR +#define glFramebufferTexture2DMultisampleEXT gles3wFramebufferTexture2DMultisampleEXT +#define glFramebufferTexture2DMultisampleIMG gles3wFramebufferTexture2DMultisampleIMG + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/native/cocos/renderer/gfx-gles3/gles3w.mm b/native/cocos/renderer/gfx-gles3/gles3w.mm new file mode 100755 index 0000000000..9a46a8a8da --- /dev/null +++ b/native/cocos/renderer/gfx-gles3/gles3w.mm @@ -0,0 +1,772 @@ +#include "gles3w.h" + +#if defined(_WIN32) && !defined(ANDROID) +#define WIN32_LEAN_AND_MEAN 1 +#include +#include + +static HMODULE libgl; + +static int open_libgl(void) +{ + libgl = LoadLibraryA("libGLESv2.dll"); + return (libgl != NULL); +} + +static void close_libgl(void) +{ + FreeLibrary(libgl); +} + +static void *get_proc(const char *proc) +{ + void *res; + + res = (void*)eglGetProcAddress(proc); + if (!res) + res = (void*)GetProcAddress(libgl, proc); + return res; +} +#elif defined(__APPLE__) || defined(__APPLE_CC__) +#import +#import +#import +#import +#import +#import + +// Routine to run a system command and retrieve the output. +// From http://stackoverflow.com/questions/478898/how-to-execute-a-command-and-get-output-of-command-within-c +std::string ES3_EXEC(const char* cmd) { + FILE* pipe = popen(cmd, "r"); + if (!pipe) return "ERROR"; + char buffer[128]; + std::string result = ""; + while(!feof(pipe)) { + if(fgets(buffer, 128, pipe) != NULL) + result += buffer; + } + pclose(pipe); + return result; +} + +static CFBundleRef g_es3Bundle; +static CFURLRef g_es3BundleURL; + +static int open_libgl(void) +{ + CFStringRef frameworkPath = CFSTR("/System/Library/Frameworks/OpenGLES.framework"); + NSString *sysVersion = [UIDevice currentDevice].systemVersion; + NSArray *sysVersionComponents = [sysVersion componentsSeparatedByString:@"."]; + //BOOL isSimulator = ([[UIDevice currentDevice].model rangeOfString:@"Simulator"].location != NSNotFound); + +#if TARGET_IPHONE_SIMULATOR + bool isSimulator = true; +#else + bool isSimulator = false; +#endif + if(isSimulator) + { + // Ask where Xcode is installed + std::string xcodePath = "/Applications/Xcode.app/Contents/Developer\n"; + + // The result contains an end line character. Remove it. + size_t pos = xcodePath.find("\n"); + xcodePath.erase(pos); + + char tempPath[PATH_MAX]; + sprintf(tempPath, + "%s/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator%s.%s.sdk/System/Library/Frameworks/OpenGLES.framework", + xcodePath.c_str(), + [[sysVersionComponents objectAtIndex:0] cStringUsingEncoding:NSUTF8StringEncoding], + [[sysVersionComponents objectAtIndex:1] cStringUsingEncoding:NSUTF8StringEncoding]); + frameworkPath = CFStringCreateWithCString(kCFAllocatorDefault, tempPath, kCFStringEncodingUTF8); + } + + g_es3BundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, + frameworkPath, + kCFURLPOSIXPathStyle, true); + + CFRelease(frameworkPath); + + g_es3Bundle = CFBundleCreate(kCFAllocatorDefault, g_es3BundleURL); + + return (g_es3Bundle != NULL); +} + +static void close_libgl(void) +{ + CFRelease(g_es3Bundle); + CFRelease(g_es3BundleURL); +} + +static void *get_proc(const char *proc) +{ + void *res; + + CFStringRef procname = CFStringCreateWithCString(kCFAllocatorDefault, proc, + kCFStringEncodingASCII); + res = CFBundleGetFunctionPointerForName(g_es3Bundle, procname); + CFRelease(procname); + return res; +} +#else +#include +#include + +static void *libgl; + +static int open_libgl(void) +{ + libgl = dlopen("libGLESv2.so", RTLD_LAZY | RTLD_GLOBAL); + return (libgl != NULL); +} + +static void close_libgl(void) +{ + dlclose(libgl); +} + +static void *get_proc(const char *proc) +{ + void *res; + res = dlsym(libgl, proc); + return res; +} +#endif + +static struct { + int major, minor; +} version; + +static int parse_version(void) +{ + if (!glGetIntegerv) + return -1; + + glGetIntegerv(GL_MAJOR_VERSION, &version.major); + glGetIntegerv(GL_MINOR_VERSION, &version.minor); + + if (version.major < 3) + return -1; + return 0; +} + +static void load_procs(void); + +int gles3wInit(void) +{ + if (!open_libgl()) + { + return 0; + } + + load_procs(); + close_libgl(); + parse_version(); + + return 1; +} + +int gles3wIsSupported(int major, int minor) +{ + if (major <= 3) + return 0; + if (version.major == major) + return version.minor >= minor; + return version.major >= major; +} + +void *gles3wGetProcAddress(const char *proc) +{ + return get_proc(proc); +} + +PFNGLACTIVETEXTUREPROC gles3wActiveTexture; +PFNGLATTACHSHADERPROC gles3wAttachShader; +PFNGLBINDATTRIBLOCATIONPROC gles3wBindAttribLocation; +PFNGLBINDBUFFERPROC gles3wBindBuffer; +PFNGLBINDFRAMEBUFFERPROC gles3wBindFramebuffer; +PFNGLBINDRENDERBUFFERPROC gles3wBindRenderbuffer; +PFNGLBINDTEXTUREPROC gles3wBindTexture; +PFNGLBLENDCOLORPROC gles3wBlendColor; +PFNGLBLENDEQUATIONPROC gles3wBlendEquation; +PFNGLBLENDEQUATIONSEPARATEPROC gles3wBlendEquationSeparate; +PFNGLBLENDFUNCPROC gles3wBlendFunc; +PFNGLBLENDFUNCSEPARATEPROC gles3wBlendFuncSeparate; +PFNGLBUFFERDATAPROC gles3wBufferData; +PFNGLBUFFERSUBDATAPROC gles3wBufferSubData; +PFNGLCHECKFRAMEBUFFERSTATUSPROC gles3wCheckFramebufferStatus; +PFNGLCLEARPROC gles3wClear; +PFNGLCLEARCOLORPROC gles3wClearColor; +PFNGLCLEARDEPTHFPROC gles3wClearDepthf; +PFNGLCLEARSTENCILPROC gles3wClearStencil; +PFNGLCOLORMASKPROC gles3wColorMask; +PFNGLCOMPILESHADERPROC gles3wCompileShader; +PFNGLCOMPRESSEDTEXIMAGE2DPROC gles3wCompressedTexImage2D; +PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC gles3wCompressedTexSubImage2D; +PFNGLCOPYTEXIMAGE2DPROC gles3wCopyTexImage2D; +PFNGLCOPYTEXSUBIMAGE2DPROC gles3wCopyTexSubImage2D; +PFNGLCREATEPROGRAMPROC gles3wCreateProgram; +PFNGLCREATESHADERPROC gles3wCreateShader; +PFNGLCULLFACEPROC gles3wCullFace; +PFNGLDELETEBUFFERSPROC gles3wDeleteBuffers; +PFNGLDELETEFRAMEBUFFERSPROC gles3wDeleteFramebuffers; +PFNGLDELETEPROGRAMPROC gles3wDeleteProgram; +PFNGLDELETERENDERBUFFERSPROC gles3wDeleteRenderbuffers; +PFNGLDELETESHADERPROC gles3wDeleteShader; +PFNGLDELETETEXTURESPROC gles3wDeleteTextures; +PFNGLDEPTHFUNCPROC gles3wDepthFunc; +PFNGLDEPTHMASKPROC gles3wDepthMask; +PFNGLDEPTHRANGEFPROC gles3wDepthRangef; +PFNGLDETACHSHADERPROC gles3wDetachShader; +PFNGLDISABLEPROC gles3wDisable; +PFNGLDISABLEVERTEXATTRIBARRAYPROC gles3wDisableVertexAttribArray; +PFNGLDRAWARRAYSPROC gles3wDrawArrays; +PFNGLDRAWELEMENTSPROC gles3wDrawElements; +PFNGLENABLEPROC gles3wEnable; +PFNGLENABLEVERTEXATTRIBARRAYPROC gles3wEnableVertexAttribArray; +PFNGLFINISHPROC gles3wFinish; +PFNGLFLUSHPROC gles3wFlush; +PFNGLFRAMEBUFFERRENDERBUFFERPROC gles3wFramebufferRenderbuffer; +PFNGLFRAMEBUFFERTEXTURE2DPROC gles3wFramebufferTexture2D; +PFNGLFRONTFACEPROC gles3wFrontFace; +PFNGLGENBUFFERSPROC gles3wGenBuffers; +PFNGLGENERATEMIPMAPPROC gles3wGenerateMipmap; +PFNGLGENFRAMEBUFFERSPROC gles3wGenFramebuffers; +PFNGLGENRENDERBUFFERSPROC gles3wGenRenderbuffers; +PFNGLGENTEXTURESPROC gles3wGenTextures; +PFNGLGETACTIVEATTRIBPROC gles3wGetActiveAttrib; +PFNGLGETACTIVEUNIFORMPROC gles3wGetActiveUniform; +PFNGLGETATTACHEDSHADERSPROC gles3wGetAttachedShaders; +PFNGLGETATTRIBLOCATIONPROC gles3wGetAttribLocation; +PFNGLGETBOOLEANVPROC gles3wGetBooleanv; +PFNGLGETBUFFERPARAMETERIVPROC gles3wGetBufferParameteriv; +PFNGLGETERRORPROC gles3wGetError; +PFNGLGETFLOATVPROC gles3wGetFloatv; +PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC gles3wGetFramebufferAttachmentParameteriv; +PFNGLGETINTEGERVPROC gles3wGetIntegerv; +PFNGLGETPROGRAMIVPROC gles3wGetProgramiv; +PFNGLGETPROGRAMINFOLOGPROC gles3wGetProgramInfoLog; +PFNGLGETRENDERBUFFERPARAMETERIVPROC gles3wGetRenderbufferParameteriv; +PFNGLGETSHADERIVPROC gles3wGetShaderiv; +PFNGLGETSHADERINFOLOGPROC gles3wGetShaderInfoLog; +PFNGLGETSHADERPRECISIONFORMATPROC gles3wGetShaderPrecisionFormat; +PFNGLGETSHADERSOURCEPROC gles3wGetShaderSource; +PFNGLGETSTRINGPROC gles3wGetString; +PFNGLGETTEXPARAMETERFVPROC gles3wGetTexParameterfv; +PFNGLGETTEXPARAMETERIVPROC gles3wGetTexParameteriv; +PFNGLGETUNIFORMFVPROC gles3wGetUniformfv; +PFNGLGETUNIFORMIVPROC gles3wGetUniformiv; +PFNGLGETUNIFORMLOCATIONPROC gles3wGetUniformLocation; +PFNGLGETVERTEXATTRIBFVPROC gles3wGetVertexAttribfv; +PFNGLGETVERTEXATTRIBIVPROC gles3wGetVertexAttribiv; +PFNGLGETVERTEXATTRIBPOINTERVPROC gles3wGetVertexAttribPointerv; +PFNGLHINTPROC gles3wHint; +PFNGLISBUFFERPROC gles3wIsBuffer; +PFNGLISENABLEDPROC gles3wIsEnabled; +PFNGLISFRAMEBUFFERPROC gles3wIsFramebuffer; +PFNGLISPROGRAMPROC gles3wIsProgram; +PFNGLISRENDERBUFFERPROC gles3wIsRenderbuffer; +PFNGLISSHADERPROC gles3wIsShader; +PFNGLISTEXTUREPROC gles3wIsTexture; +PFNGLLINEWIDTHPROC gles3wLineWidth; +PFNGLLINKPROGRAMPROC gles3wLinkProgram; +PFNGLPIXELSTOREIPROC gles3wPixelStorei; +PFNGLPOLYGONOFFSETPROC gles3wPolygonOffset; +PFNGLREADPIXELSPROC gles3wReadPixels; +PFNGLRELEASESHADERCOMPILERPROC gles3wReleaseShaderCompiler; +PFNGLRENDERBUFFERSTORAGEPROC gles3wRenderbufferStorage; +PFNGLSAMPLECOVERAGEPROC gles3wSampleCoverage; +PFNGLSCISSORPROC gles3wScissor; +PFNGLSHADERBINARYPROC gles3wShaderBinary; +PFNGLSHADERSOURCEPROC gles3wShaderSource; +PFNGLSTENCILFUNCPROC gles3wStencilFunc; +PFNGLSTENCILFUNCSEPARATEPROC gles3wStencilFuncSeparate; +PFNGLSTENCILMASKPROC gles3wStencilMask; +PFNGLSTENCILMASKSEPARATEPROC gles3wStencilMaskSeparate; +PFNGLSTENCILOPPROC gles3wStencilOp; +PFNGLSTENCILOPSEPARATEPROC gles3wStencilOpSeparate; +PFNGLTEXIMAGE2DPROC gles3wTexImage2D; +PFNGLTEXPARAMETERFPROC gles3wTexParameterf; +PFNGLTEXPARAMETERFVPROC gles3wTexParameterfv; +PFNGLTEXPARAMETERIPROC gles3wTexParameteri; +PFNGLTEXPARAMETERIVPROC gles3wTexParameteriv; +PFNGLTEXSUBIMAGE2DPROC gles3wTexSubImage2D; +PFNGLUNIFORM1FPROC gles3wUniform1f; +PFNGLUNIFORM1FVPROC gles3wUniform1fv; +PFNGLUNIFORM1IPROC gles3wUniform1i; +PFNGLUNIFORM1IVPROC gles3wUniform1iv; +PFNGLUNIFORM2FPROC gles3wUniform2f; +PFNGLUNIFORM2FVPROC gles3wUniform2fv; +PFNGLUNIFORM2IPROC gles3wUniform2i; +PFNGLUNIFORM2IVPROC gles3wUniform2iv; +PFNGLUNIFORM3FPROC gles3wUniform3f; +PFNGLUNIFORM3FVPROC gles3wUniform3fv; +PFNGLUNIFORM3IPROC gles3wUniform3i; +PFNGLUNIFORM3IVPROC gles3wUniform3iv; +PFNGLUNIFORM4FPROC gles3wUniform4f; +PFNGLUNIFORM4FVPROC gles3wUniform4fv; +PFNGLUNIFORM4IPROC gles3wUniform4i; +PFNGLUNIFORM4IVPROC gles3wUniform4iv; +PFNGLUNIFORMMATRIX2FVPROC gles3wUniformMatrix2fv; +PFNGLUNIFORMMATRIX3FVPROC gles3wUniformMatrix3fv; +PFNGLUNIFORMMATRIX4FVPROC gles3wUniformMatrix4fv; +PFNGLUSEPROGRAMPROC gles3wUseProgram; +PFNGLVALIDATEPROGRAMPROC gles3wValidateProgram; +PFNGLVERTEXATTRIB1FPROC gles3wVertexAttrib1f; +PFNGLVERTEXATTRIB1FVPROC gles3wVertexAttrib1fv; +PFNGLVERTEXATTRIB2FPROC gles3wVertexAttrib2f; +PFNGLVERTEXATTRIB2FVPROC gles3wVertexAttrib2fv; +PFNGLVERTEXATTRIB3FPROC gles3wVertexAttrib3f; +PFNGLVERTEXATTRIB3FVPROC gles3wVertexAttrib3fv; +PFNGLVERTEXATTRIB4FPROC gles3wVertexAttrib4f; +PFNGLVERTEXATTRIB4FVPROC gles3wVertexAttrib4fv; +PFNGLVERTEXATTRIBPOINTERPROC gles3wVertexAttribPointer; +PFNGLVIEWPORTPROC gles3wViewport; +PFNGLREADBUFFERPROC gles3wReadBuffer; +PFNGLDRAWRANGEELEMENTSPROC gles3wDrawRangeElements; +PFNGLTEXIMAGE3DPROC gles3wTexImage3D; +PFNGLTEXSUBIMAGE3DPROC gles3wTexSubImage3D; +PFNGLCOPYTEXSUBIMAGE3DPROC gles3wCopyTexSubImage3D; +PFNGLCOMPRESSEDTEXIMAGE3DPROC gles3wCompressedTexImage3D; +PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC gles3wCompressedTexSubImage3D; +PFNGLGENQUERIESPROC gles3wGenQueries; +PFNGLDELETEQUERIESPROC gles3wDeleteQueries; +PFNGLISQUERYPROC gles3wIsQuery; +PFNGLBEGINQUERYPROC gles3wBeginQuery; +PFNGLENDQUERYPROC gles3wEndQuery; +PFNGLGETQUERYIVPROC gles3wGetQueryiv; +PFNGLGETQUERYOBJECTUIVPROC gles3wGetQueryObjectuiv; +PFNGLUNMAPBUFFERPROC gles3wUnmapBuffer; +PFNGLGETBUFFERPOINTERVPROC gles3wGetBufferPointerv; +PFNGLDRAWBUFFERSPROC gles3wDrawBuffers; +PFNGLUNIFORMMATRIX2X3FVPROC gles3wUniformMatrix2x3fv; +PFNGLUNIFORMMATRIX3X2FVPROC gles3wUniformMatrix3x2fv; +PFNGLUNIFORMMATRIX2X4FVPROC gles3wUniformMatrix2x4fv; +PFNGLUNIFORMMATRIX4X2FVPROC gles3wUniformMatrix4x2fv; +PFNGLUNIFORMMATRIX3X4FVPROC gles3wUniformMatrix3x4fv; +PFNGLUNIFORMMATRIX4X3FVPROC gles3wUniformMatrix4x3fv; +PFNGLBLITFRAMEBUFFERPROC gles3wBlitFramebuffer; +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC gles3wRenderbufferStorageMultisample; +PFNGLFRAMEBUFFERTEXTURELAYERPROC gles3wFramebufferTextureLayer; +PFNGLMAPBUFFERRANGEPROC gles3wMapBufferRange; +PFNGLFLUSHMAPPEDBUFFERRANGEPROC gles3wFlushMappedBufferRange; +PFNGLBINDVERTEXARRAYPROC gles3wBindVertexArray; +PFNGLDELETEVERTEXARRAYSPROC gles3wDeleteVertexArrays; +PFNGLGENVERTEXARRAYSPROC gles3wGenVertexArrays; +PFNGLISVERTEXARRAYPROC gles3wIsVertexArray; +PFNGLGETINTEGERI_VPROC gles3wGetIntegeri_v; +PFNGLBEGINTRANSFORMFEEDBACKPROC gles3wBeginTransformFeedback; +PFNGLENDTRANSFORMFEEDBACKPROC gles3wEndTransformFeedback; +PFNGLBINDBUFFERRANGEPROC gles3wBindBufferRange; +PFNGLBINDBUFFERBASEPROC gles3wBindBufferBase; +PFNGLTRANSFORMFEEDBACKVARYINGSPROC gles3wTransformFeedbackVaryings; +PFNGLGETTRANSFORMFEEDBACKVARYINGPROC gles3wGetTransformFeedbackVarying; +PFNGLVERTEXATTRIBIPOINTERPROC gles3wVertexAttribIPointer; +PFNGLGETVERTEXATTRIBIIVPROC gles3wGetVertexAttribIiv; +PFNGLGETVERTEXATTRIBIUIVPROC gles3wGetVertexAttribIuiv; +PFNGLVERTEXATTRIBI4IPROC gles3wVertexAttribI4i; +PFNGLVERTEXATTRIBI4UIPROC gles3wVertexAttribI4ui; +PFNGLVERTEXATTRIBI4IVPROC gles3wVertexAttribI4iv; +PFNGLVERTEXATTRIBI4UIVPROC gles3wVertexAttribI4uiv; +PFNGLGETUNIFORMUIVPROC gles3wGetUniformuiv; +PFNGLGETFRAGDATALOCATIONPROC gles3wGetFragDataLocation; +PFNGLUNIFORM1UIPROC gles3wUniform1ui; +PFNGLUNIFORM2UIPROC gles3wUniform2ui; +PFNGLUNIFORM3UIPROC gles3wUniform3ui; +PFNGLUNIFORM4UIPROC gles3wUniform4ui; +PFNGLUNIFORM1UIVPROC gles3wUniform1uiv; +PFNGLUNIFORM2UIVPROC gles3wUniform2uiv; +PFNGLUNIFORM3UIVPROC gles3wUniform3uiv; +PFNGLUNIFORM4UIVPROC gles3wUniform4uiv; +PFNGLCLEARBUFFERIVPROC gles3wClearBufferiv; +PFNGLCLEARBUFFERUIVPROC gles3wClearBufferuiv; +PFNGLCLEARBUFFERFVPROC gles3wClearBufferfv; +PFNGLCLEARBUFFERFIPROC gles3wClearBufferfi; +PFNGLGETSTRINGIPROC gles3wGetStringi; +PFNGLCOPYBUFFERSUBDATAPROC gles3wCopyBufferSubData; +PFNGLGETUNIFORMINDICESPROC gles3wGetUniformIndices; +PFNGLGETACTIVEUNIFORMSIVPROC gles3wGetActiveUniformsiv; +PFNGLGETUNIFORMBLOCKINDEXPROC gles3wGetUniformBlockIndex; +PFNGLGETACTIVEUNIFORMBLOCKIVPROC gles3wGetActiveUniformBlockiv; +PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC gles3wGetActiveUniformBlockName; +PFNGLUNIFORMBLOCKBINDINGPROC gles3wUniformBlockBinding; +PFNGLDRAWARRAYSINSTANCEDPROC gles3wDrawArraysInstanced; +PFNGLDRAWELEMENTSINSTANCEDPROC gles3wDrawElementsInstanced; +PFNGLFENCESYNCPROC gles3wFenceSync; +PFNGLISSYNCPROC gles3wIsSync; +PFNGLDELETESYNCPROC gles3wDeleteSync; +PFNGLCLIENTWAITSYNCPROC gles3wClientWaitSync; +PFNGLWAITSYNCPROC gles3wWaitSync; +PFNGLGETINTEGER64VPROC gles3wGetInteger64v; +PFNGLGETSYNCIVPROC gles3wGetSynciv; +PFNGLGETINTEGER64I_VPROC gles3wGetInteger64i_v; +PFNGLGETBUFFERPARAMETERI64VPROC gles3wGetBufferParameteri64v; +PFNGLGENSAMPLERSPROC gles3wGenSamplers; +PFNGLDELETESAMPLERSPROC gles3wDeleteSamplers; +PFNGLISSAMPLERPROC gles3wIsSampler; +PFNGLBINDSAMPLERPROC gles3wBindSampler; +PFNGLSAMPLERPARAMETERIPROC gles3wSamplerParameteri; +PFNGLSAMPLERPARAMETERIVPROC gles3wSamplerParameteriv; +PFNGLSAMPLERPARAMETERFPROC gles3wSamplerParameterf; +PFNGLSAMPLERPARAMETERFVPROC gles3wSamplerParameterfv; +PFNGLGETSAMPLERPARAMETERIVPROC gles3wGetSamplerParameteriv; +PFNGLGETSAMPLERPARAMETERFVPROC gles3wGetSamplerParameterfv; +PFNGLVERTEXATTRIBDIVISORPROC gles3wVertexAttribDivisor; +PFNGLBINDTRANSFORMFEEDBACKPROC gles3wBindTransformFeedback; +PFNGLDELETETRANSFORMFEEDBACKSPROC gles3wDeleteTransformFeedbacks; +PFNGLGENTRANSFORMFEEDBACKSPROC gles3wGenTransformFeedbacks; +PFNGLISTRANSFORMFEEDBACKPROC gles3wIsTransformFeedback; +PFNGLPAUSETRANSFORMFEEDBACKPROC gles3wPauseTransformFeedback; +PFNGLRESUMETRANSFORMFEEDBACKPROC gles3wResumeTransformFeedback; +PFNGLGETPROGRAMBINARYPROC gles3wGetProgramBinary; +PFNGLPROGRAMBINARYPROC gles3wProgramBinary; +PFNGLPROGRAMPARAMETERIPROC gles3wProgramParameteri; +PFNGLINVALIDATEFRAMEBUFFERPROC gles3wInvalidateFramebuffer; +PFNGLINVALIDATESUBFRAMEBUFFERPROC gles3wInvalidateSubFramebuffer; +PFNGLTEXSTORAGE2DPROC gles3wTexStorage2D; +PFNGLTEXSTORAGE3DPROC gles3wTexStorage3D; +PFNGLGETINTERNALFORMATIVPROC gles3wGetInternalformativ; +PFNGLUSEPROGRAMSTAGESEXTPROC gles3wUseProgramStagesEXT; +PFNGLACTIVESHADERPROGRAMEXTPROC gles3wActiveShaderProgramEXT; +PFNGLCREATESHADERPROGRAMVEXTPROC gles3wCreateShaderProgramvEXT; +PFNGLBINDPROGRAMPIPELINEEXTPROC gles3wBindProgramPipelineEXT; +PFNGLDELETEPROGRAMPIPELINESEXTPROC gles3wDeleteProgramPipelinesEXT; +PFNGLGENPROGRAMPIPELINESEXTPROC gles3wGenProgramPipelinesEXT; +PFNGLISPROGRAMPIPELINEEXTPROC gles3wIsProgramPipelineEXT; +PFNGLPROGRAMPARAMETERIEXTPROC gles3wProgramParameteriEXT; +PFNGLGETPROGRAMPIPELINEIVEXTPROC gles3wGetProgramPipelineivEXT; +PFNGLPROGRAMUNIFORM1IEXTPROC gles3wProgramUniform1iEXT; +PFNGLPROGRAMUNIFORM2IEXTPROC gles3wProgramUniform2iEXT; +PFNGLPROGRAMUNIFORM3IEXTPROC gles3wProgramUniform3iEXT; +PFNGLPROGRAMUNIFORM4IEXTPROC gles3wProgramUniform4iEXT; +PFNGLPROGRAMUNIFORM1FEXTPROC gles3wProgramUniform1fEXT; +PFNGLPROGRAMUNIFORM2FEXTPROC gles3wProgramUniform2fEXT; +PFNGLPROGRAMUNIFORM3FEXTPROC gles3wProgramUniform3fEXT; +PFNGLPROGRAMUNIFORM4FEXTPROC gles3wProgramUniform4fEXT; +PFNGLPROGRAMUNIFORM1IVEXTPROC gles3wProgramUniform1ivEXT; +PFNGLPROGRAMUNIFORM2IVEXTPROC gles3wProgramUniform2ivEXT; +PFNGLPROGRAMUNIFORM3IVEXTPROC gles3wProgramUniform3ivEXT; +PFNGLPROGRAMUNIFORM4IVEXTPROC gles3wProgramUniform4ivEXT; +PFNGLPROGRAMUNIFORM1FVEXTPROC gles3wProgramUniform1fvEXT; +PFNGLPROGRAMUNIFORM2FVEXTPROC gles3wProgramUniform2fvEXT; +PFNGLPROGRAMUNIFORM3FVEXTPROC gles3wProgramUniform3fvEXT; +PFNGLPROGRAMUNIFORM4FVEXTPROC gles3wProgramUniform4fvEXT; +PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC gles3wProgramUniformMatrix2fvEXT; +PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC gles3wProgramUniformMatrix3fvEXT; +PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC gles3wProgramUniformMatrix4fvEXT; +PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC gles3wProgramUniformMatrix2x3fvEXT; +PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC gles3wProgramUniformMatrix3x2fvEXT; +PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC gles3wProgramUniformMatrix2x4fvEXT; +PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC gles3wProgramUniformMatrix4x2fvEXT; +PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC gles3wProgramUniformMatrix3x4fvEXT; +PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC gles3wProgramUniformMatrix4x3fvEXT; +PFNGLVALIDATEPROGRAMPIPELINEEXTPROC gles3wValidateProgramPipelineEXT; +PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC gles3wGetProgramPipelineInfoLogEXT; +PFNGLLABELOBJECTEXTPROC gles3wLabelObjectEXT; +PFNGLGETOBJECTLABELEXTPROC gles3wGetObjectLabelEXT; +PFNGLINSERTEVENTMARKEREXTPROC gles3wInsertEventMarkerEXT; +PFNGLPUSHGROUPMARKEREXTPROC gles3wPushGroupMarkerEXT; +PFNGLPOPGROUPMARKEREXTPROC gles3wPopGroupMarkerEXT; + +PFNGLDEBUGMESSAGECONTROLKHRPROC gles3wDebugMessageControlKHR; +PFNGLDEBUGMESSAGECALLBACKKHRPROC gles3wDebugMessageCallbackKHR; +PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC gles3wFramebufferTexture2DMultisampleEXT; +PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC gles3wFramebufferTexture2DMultisampleIMG; + +static void load_procs(void) +{ + gles3wActiveTexture = (PFNGLACTIVETEXTUREPROC) get_proc("glActiveTexture"); + gles3wAttachShader = (PFNGLATTACHSHADERPROC) get_proc("glAttachShader"); + gles3wBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC) get_proc("glBindAttribLocation"); + gles3wBindBuffer = (PFNGLBINDBUFFERPROC) get_proc("glBindBuffer"); + gles3wBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC) get_proc("glBindFramebuffer"); + gles3wBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC) get_proc("glBindRenderbuffer"); + gles3wBindTexture = (PFNGLBINDTEXTUREPROC) get_proc("glBindTexture"); + gles3wBlendColor = (PFNGLBLENDCOLORPROC) get_proc("glBlendColor"); + gles3wBlendEquation = (PFNGLBLENDEQUATIONPROC) get_proc("glBlendEquation"); + gles3wBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC) get_proc("glBlendEquationSeparate"); + gles3wBlendFunc = (PFNGLBLENDFUNCPROC) get_proc("glBlendFunc"); + gles3wBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC) get_proc("glBlendFuncSeparate"); + gles3wBufferData = (PFNGLBUFFERDATAPROC) get_proc("glBufferData"); + gles3wBufferSubData = (PFNGLBUFFERSUBDATAPROC) get_proc("glBufferSubData"); + gles3wCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC) get_proc("glCheckFramebufferStatus"); + gles3wClear = (PFNGLCLEARPROC) get_proc("glClear"); + gles3wClearColor = (PFNGLCLEARCOLORPROC) get_proc("glClearColor"); + gles3wClearDepthf = (PFNGLCLEARDEPTHFPROC) get_proc("glClearDepthf"); + gles3wClearStencil = (PFNGLCLEARSTENCILPROC) get_proc("glClearStencil"); + gles3wColorMask = (PFNGLCOLORMASKPROC) get_proc("glColorMask"); + gles3wCompileShader = (PFNGLCOMPILESHADERPROC) get_proc("glCompileShader"); + gles3wCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC) get_proc("glCompressedTexImage2D"); + gles3wCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) get_proc("glCompressedTexSubImage2D"); + gles3wCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC) get_proc("glCopyTexImage2D"); + gles3wCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC) get_proc("glCopyTexSubImage2D"); + gles3wCreateProgram = (PFNGLCREATEPROGRAMPROC) get_proc("glCreateProgram"); + gles3wCreateShader = (PFNGLCREATESHADERPROC) get_proc("glCreateShader"); + gles3wCullFace = (PFNGLCULLFACEPROC) get_proc("glCullFace"); + gles3wDeleteBuffers = (PFNGLDELETEBUFFERSPROC) get_proc("glDeleteBuffers"); + gles3wDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC) get_proc("glDeleteFramebuffers"); + gles3wDeleteProgram = (PFNGLDELETEPROGRAMPROC) get_proc("glDeleteProgram"); + gles3wDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC) get_proc("glDeleteRenderbuffers"); + gles3wDeleteShader = (PFNGLDELETESHADERPROC) get_proc("glDeleteShader"); + gles3wDeleteTextures = (PFNGLDELETETEXTURESPROC) get_proc("glDeleteTextures"); + gles3wDepthFunc = (PFNGLDEPTHFUNCPROC) get_proc("glDepthFunc"); + gles3wDepthMask = (PFNGLDEPTHMASKPROC) get_proc("glDepthMask"); + gles3wDepthRangef = (PFNGLDEPTHRANGEFPROC) get_proc("glDepthRangef"); + gles3wDetachShader = (PFNGLDETACHSHADERPROC) get_proc("glDetachShader"); + gles3wDisable = (PFNGLDISABLEPROC) get_proc("glDisable"); + gles3wDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC) get_proc("glDisableVertexAttribArray"); + gles3wDrawArrays = (PFNGLDRAWARRAYSPROC) get_proc("glDrawArrays"); + gles3wDrawElements = (PFNGLDRAWELEMENTSPROC) get_proc("glDrawElements"); + gles3wEnable = (PFNGLENABLEPROC) get_proc("glEnable"); + gles3wEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC) get_proc("glEnableVertexAttribArray"); + gles3wFinish = (PFNGLFINISHPROC) get_proc("glFinish"); + gles3wFlush = (PFNGLFLUSHPROC) get_proc("glFlush"); + gles3wFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC) get_proc("glFramebufferRenderbuffer"); + gles3wFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC) get_proc("glFramebufferTexture2D"); + gles3wFrontFace = (PFNGLFRONTFACEPROC) get_proc("glFrontFace"); + gles3wGenBuffers = (PFNGLGENBUFFERSPROC) get_proc("glGenBuffers"); + gles3wGenerateMipmap = (PFNGLGENERATEMIPMAPPROC) get_proc("glGenerateMipmap"); + gles3wGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC) get_proc("glGenFramebuffers"); + gles3wGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC) get_proc("glGenRenderbuffers"); + gles3wGenTextures = (PFNGLGENTEXTURESPROC) get_proc("glGenTextures"); + gles3wGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC) get_proc("glGetActiveAttrib"); + gles3wGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC) get_proc("glGetActiveUniform"); + gles3wGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC) get_proc("glGetAttachedShaders"); + gles3wGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC) get_proc("glGetAttribLocation"); + gles3wGetBooleanv = (PFNGLGETBOOLEANVPROC) get_proc("glGetBooleanv"); + gles3wGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC) get_proc("glGetBufferParameteriv"); + gles3wGetError = (PFNGLGETERRORPROC) get_proc("glGetError"); + gles3wGetFloatv = (PFNGLGETFLOATVPROC) get_proc("glGetFloatv"); + gles3wGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) get_proc("glGetFramebufferAttachmentParameteriv"); + gles3wGetIntegerv = (PFNGLGETINTEGERVPROC) get_proc("glGetIntegerv"); + gles3wGetProgramiv = (PFNGLGETPROGRAMIVPROC) get_proc("glGetProgramiv"); + gles3wGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC) get_proc("glGetProgramInfoLog"); + gles3wGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC) get_proc("glGetRenderbufferParameteriv"); + gles3wGetShaderiv = (PFNGLGETSHADERIVPROC) get_proc("glGetShaderiv"); + gles3wGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC) get_proc("glGetShaderInfoLog"); + gles3wGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC) get_proc("glGetShaderPrecisionFormat"); + gles3wGetShaderSource = (PFNGLGETSHADERSOURCEPROC) get_proc("glGetShaderSource"); + gles3wGetString = (PFNGLGETSTRINGPROC) get_proc("glGetString"); + gles3wGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC) get_proc("glGetTexParameterfv"); + gles3wGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC) get_proc("glGetTexParameteriv"); + gles3wGetUniformfv = (PFNGLGETUNIFORMFVPROC) get_proc("glGetUniformfv"); + gles3wGetUniformiv = (PFNGLGETUNIFORMIVPROC) get_proc("glGetUniformiv"); + gles3wGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC) get_proc("glGetUniformLocation"); + gles3wGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC) get_proc("glGetVertexAttribfv"); + gles3wGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC) get_proc("glGetVertexAttribiv"); + gles3wGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC) get_proc("glGetVertexAttribPointerv"); + gles3wHint = (PFNGLHINTPROC) get_proc("glHint"); + gles3wIsBuffer = (PFNGLISBUFFERPROC) get_proc("glIsBuffer"); + gles3wIsEnabled = (PFNGLISENABLEDPROC) get_proc("glIsEnabled"); + gles3wIsFramebuffer = (PFNGLISFRAMEBUFFERPROC) get_proc("glIsFramebuffer"); + gles3wIsProgram = (PFNGLISPROGRAMPROC) get_proc("glIsProgram"); + gles3wIsRenderbuffer = (PFNGLISRENDERBUFFERPROC) get_proc("glIsRenderbuffer"); + gles3wIsShader = (PFNGLISSHADERPROC) get_proc("glIsShader"); + gles3wIsTexture = (PFNGLISTEXTUREPROC) get_proc("glIsTexture"); + gles3wLineWidth = (PFNGLLINEWIDTHPROC) get_proc("glLineWidth"); + gles3wLinkProgram = (PFNGLLINKPROGRAMPROC) get_proc("glLinkProgram"); + gles3wPixelStorei = (PFNGLPIXELSTOREIPROC) get_proc("glPixelStorei"); + gles3wPolygonOffset = (PFNGLPOLYGONOFFSETPROC) get_proc("glPolygonOffset"); + gles3wReadPixels = (PFNGLREADPIXELSPROC) get_proc("glReadPixels"); + gles3wReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC) get_proc("glReleaseShaderCompiler"); + gles3wRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC) get_proc("glRenderbufferStorage"); + gles3wSampleCoverage = (PFNGLSAMPLECOVERAGEPROC) get_proc("glSampleCoverage"); + gles3wScissor = (PFNGLSCISSORPROC) get_proc("glScissor"); + gles3wShaderBinary = (PFNGLSHADERBINARYPROC) get_proc("glShaderBinary"); + gles3wShaderSource = (PFNGLSHADERSOURCEPROC) get_proc("glShaderSource"); + gles3wStencilFunc = (PFNGLSTENCILFUNCPROC) get_proc("glStencilFunc"); + gles3wStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC) get_proc("glStencilFuncSeparate"); + gles3wStencilMask = (PFNGLSTENCILMASKPROC) get_proc("glStencilMask"); + gles3wStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC) get_proc("glStencilMaskSeparate"); + gles3wStencilOp = (PFNGLSTENCILOPPROC) get_proc("glStencilOp"); + gles3wStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC) get_proc("glStencilOpSeparate"); + gles3wTexImage2D = (PFNGLTEXIMAGE2DPROC) get_proc("glTexImage2D"); + gles3wTexParameterf = (PFNGLTEXPARAMETERFPROC) get_proc("glTexParameterf"); + gles3wTexParameterfv = (PFNGLTEXPARAMETERFVPROC) get_proc("glTexParameterfv"); + gles3wTexParameteri = (PFNGLTEXPARAMETERIPROC) get_proc("glTexParameteri"); + gles3wTexParameteriv = (PFNGLTEXPARAMETERIVPROC) get_proc("glTexParameteriv"); + gles3wTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC) get_proc("glTexSubImage2D"); + gles3wUniform1f = (PFNGLUNIFORM1FPROC) get_proc("glUniform1f"); + gles3wUniform1fv = (PFNGLUNIFORM1FVPROC) get_proc("glUniform1fv"); + gles3wUniform1i = (PFNGLUNIFORM1IPROC) get_proc("glUniform1i"); + gles3wUniform1iv = (PFNGLUNIFORM1IVPROC) get_proc("glUniform1iv"); + gles3wUniform2f = (PFNGLUNIFORM2FPROC) get_proc("glUniform2f"); + gles3wUniform2fv = (PFNGLUNIFORM2FVPROC) get_proc("glUniform2fv"); + gles3wUniform2i = (PFNGLUNIFORM2IPROC) get_proc("glUniform2i"); + gles3wUniform2iv = (PFNGLUNIFORM2IVPROC) get_proc("glUniform2iv"); + gles3wUniform3f = (PFNGLUNIFORM3FPROC) get_proc("glUniform3f"); + gles3wUniform3fv = (PFNGLUNIFORM3FVPROC) get_proc("glUniform3fv"); + gles3wUniform3i = (PFNGLUNIFORM3IPROC) get_proc("glUniform3i"); + gles3wUniform3iv = (PFNGLUNIFORM3IVPROC) get_proc("glUniform3iv"); + gles3wUniform4f = (PFNGLUNIFORM4FPROC) get_proc("glUniform4f"); + gles3wUniform4fv = (PFNGLUNIFORM4FVPROC) get_proc("glUniform4fv"); + gles3wUniform4i = (PFNGLUNIFORM4IPROC) get_proc("glUniform4i"); + gles3wUniform4iv = (PFNGLUNIFORM4IVPROC) get_proc("glUniform4iv"); + gles3wUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC) get_proc("glUniformMatrix2fv"); + gles3wUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC) get_proc("glUniformMatrix3fv"); + gles3wUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC) get_proc("glUniformMatrix4fv"); + gles3wUseProgram = (PFNGLUSEPROGRAMPROC) get_proc("glUseProgram"); + gles3wValidateProgram = (PFNGLVALIDATEPROGRAMPROC) get_proc("glValidateProgram"); + gles3wVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC) get_proc("glVertexAttrib1f"); + gles3wVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC) get_proc("glVertexAttrib1fv"); + gles3wVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC) get_proc("glVertexAttrib2f"); + gles3wVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC) get_proc("glVertexAttrib2fv"); + gles3wVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC) get_proc("glVertexAttrib3f"); + gles3wVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC) get_proc("glVertexAttrib3fv"); + gles3wVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC) get_proc("glVertexAttrib4f"); + gles3wVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC) get_proc("glVertexAttrib4fv"); + gles3wVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC) get_proc("glVertexAttribPointer"); + gles3wViewport = (PFNGLVIEWPORTPROC) get_proc("glViewport"); + gles3wReadBuffer = (PFNGLREADBUFFERPROC) get_proc("glReadBuffer"); + gles3wDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC) get_proc("glDrawRangeElements"); + gles3wTexImage3D = (PFNGLTEXIMAGE3DPROC) get_proc("glTexImage3D"); + gles3wTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC) get_proc("glTexSubImage3D"); + gles3wCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC) get_proc("glCopyTexSubImage3D"); + gles3wCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC) get_proc("glCompressedTexImage3D"); + gles3wCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) get_proc("glCompressedTexSubImage3D"); + gles3wGenQueries = (PFNGLGENQUERIESPROC) get_proc("glGenQueries"); + gles3wDeleteQueries = (PFNGLDELETEQUERIESPROC) get_proc("glDeleteQueries"); + gles3wIsQuery = (PFNGLISQUERYPROC) get_proc("glIsQuery"); + gles3wBeginQuery = (PFNGLBEGINQUERYPROC) get_proc("glBeginQuery"); + gles3wEndQuery = (PFNGLENDQUERYPROC) get_proc("glEndQuery"); + gles3wGetQueryiv = (PFNGLGETQUERYIVPROC) get_proc("glGetQueryiv"); + gles3wGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC) get_proc("glGetQueryObjectuiv"); + gles3wUnmapBuffer = (PFNGLUNMAPBUFFERPROC) get_proc("glUnmapBuffer"); + gles3wGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC) get_proc("glGetBufferPointerv"); + gles3wDrawBuffers = (PFNGLDRAWBUFFERSPROC) get_proc("glDrawBuffers"); + gles3wUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC) get_proc("glUniformMatrix2x3fv"); + gles3wUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC) get_proc("glUniformMatrix3x2fv"); + gles3wUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC) get_proc("glUniformMatrix2x4fv"); + gles3wUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC) get_proc("glUniformMatrix4x2fv"); + gles3wUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC) get_proc("glUniformMatrix3x4fv"); + gles3wUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC) get_proc("glUniformMatrix4x3fv"); + gles3wBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC) get_proc("glBlitFramebuffer"); + gles3wRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) get_proc("glRenderbufferStorageMultisample"); + gles3wFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC) get_proc("glFramebufferTextureLayer"); + gles3wMapBufferRange = (PFNGLMAPBUFFERRANGEPROC) get_proc("glMapBufferRange"); + gles3wFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC) get_proc("glFlushMappedBufferRange"); + gles3wBindVertexArray = (PFNGLBINDVERTEXARRAYPROC) get_proc("glBindVertexArray"); + gles3wDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC) get_proc("glDeleteVertexArrays"); + gles3wGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC) get_proc("glGenVertexArrays"); + gles3wIsVertexArray = (PFNGLISVERTEXARRAYPROC) get_proc("glIsVertexArray"); + gles3wGetIntegeri_v = (PFNGLGETINTEGERI_VPROC) get_proc("glGetIntegeri_v"); + gles3wBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC) get_proc("glBeginTransformFeedback"); + gles3wEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC) get_proc("glEndTransformFeedback"); + gles3wBindBufferRange = (PFNGLBINDBUFFERRANGEPROC) get_proc("glBindBufferRange"); + gles3wBindBufferBase = (PFNGLBINDBUFFERBASEPROC) get_proc("glBindBufferBase"); + gles3wTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC) get_proc("glTransformFeedbackVaryings"); + gles3wGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) get_proc("glGetTransformFeedbackVarying"); + gles3wVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC) get_proc("glVertexAttribIPointer"); + gles3wGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC) get_proc("glGetVertexAttribIiv"); + gles3wGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC) get_proc("glGetVertexAttribIuiv"); + gles3wVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC) get_proc("glVertexAttribI4i"); + gles3wVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC) get_proc("glVertexAttribI4ui"); + gles3wVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC) get_proc("glVertexAttribI4iv"); + gles3wVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC) get_proc("glVertexAttribI4uiv"); + gles3wGetUniformuiv = (PFNGLGETUNIFORMUIVPROC) get_proc("glGetUniformuiv"); + gles3wGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC) get_proc("glGetFragDataLocation"); + gles3wUniform1ui = (PFNGLUNIFORM1UIPROC) get_proc("glUniform1ui"); + gles3wUniform2ui = (PFNGLUNIFORM2UIPROC) get_proc("glUniform2ui"); + gles3wUniform3ui = (PFNGLUNIFORM3UIPROC) get_proc("glUniform3ui"); + gles3wUniform4ui = (PFNGLUNIFORM4UIPROC) get_proc("glUniform4ui"); + gles3wUniform1uiv = (PFNGLUNIFORM1UIVPROC) get_proc("glUniform1uiv"); + gles3wUniform2uiv = (PFNGLUNIFORM2UIVPROC) get_proc("glUniform2uiv"); + gles3wUniform3uiv = (PFNGLUNIFORM3UIVPROC) get_proc("glUniform3uiv"); + gles3wUniform4uiv = (PFNGLUNIFORM4UIVPROC) get_proc("glUniform4uiv"); + gles3wClearBufferiv = (PFNGLCLEARBUFFERIVPROC) get_proc("glClearBufferiv"); + gles3wClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC) get_proc("glClearBufferuiv"); + gles3wClearBufferfv = (PFNGLCLEARBUFFERFVPROC) get_proc("glClearBufferfv"); + gles3wClearBufferfi = (PFNGLCLEARBUFFERFIPROC) get_proc("glClearBufferfi"); + gles3wGetStringi = (PFNGLGETSTRINGIPROC) get_proc("glGetStringi"); + gles3wCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC) get_proc("glCopyBufferSubData"); + gles3wGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC) get_proc("glGetUniformIndices"); + gles3wGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC) get_proc("glGetActiveUniformsiv"); + gles3wGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC) get_proc("glGetUniformBlockIndex"); + gles3wGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC) get_proc("glGetActiveUniformBlockiv"); + gles3wGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) get_proc("glGetActiveUniformBlockName"); + gles3wUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC) get_proc("glUniformBlockBinding"); + gles3wDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC) get_proc("glDrawArraysInstanced"); + gles3wDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC) get_proc("glDrawElementsInstanced"); + gles3wFenceSync = (PFNGLFENCESYNCPROC) get_proc("glFenceSync"); + gles3wIsSync = (PFNGLISSYNCPROC) get_proc("glIsSync"); + gles3wDeleteSync = (PFNGLDELETESYNCPROC) get_proc("glDeleteSync"); + gles3wClientWaitSync = (PFNGLCLIENTWAITSYNCPROC) get_proc("glClientWaitSync"); + gles3wWaitSync = (PFNGLWAITSYNCPROC) get_proc("glWaitSync"); + gles3wGetInteger64v = (PFNGLGETINTEGER64VPROC) get_proc("glGetInteger64v"); + gles3wGetSynciv = (PFNGLGETSYNCIVPROC) get_proc("glGetSynciv"); + gles3wGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC) get_proc("glGetInteger64i_v"); + gles3wGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC) get_proc("glGetBufferParameteri64v"); + gles3wGenSamplers = (PFNGLGENSAMPLERSPROC) get_proc("glGenSamplers"); + gles3wDeleteSamplers = (PFNGLDELETESAMPLERSPROC) get_proc("glDeleteSamplers"); + gles3wIsSampler = (PFNGLISSAMPLERPROC) get_proc("glIsSampler"); + gles3wBindSampler = (PFNGLBINDSAMPLERPROC) get_proc("glBindSampler"); + gles3wSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC) get_proc("glSamplerParameteri"); + gles3wSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC) get_proc("glSamplerParameteriv"); + gles3wSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC) get_proc("glSamplerParameterf"); + gles3wSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC) get_proc("glSamplerParameterfv"); + gles3wGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC) get_proc("glGetSamplerParameteriv"); + gles3wGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC) get_proc("glGetSamplerParameterfv"); + gles3wVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC) get_proc("glVertexAttribDivisor"); + gles3wBindTransformFeedback = (PFNGLBINDTRANSFORMFEEDBACKPROC) get_proc("glBindTransformFeedback"); + gles3wDeleteTransformFeedbacks = (PFNGLDELETETRANSFORMFEEDBACKSPROC) get_proc("glDeleteTransformFeedbacks"); + gles3wGenTransformFeedbacks = (PFNGLGENTRANSFORMFEEDBACKSPROC) get_proc("glGenTransformFeedbacks"); + gles3wIsTransformFeedback = (PFNGLISTRANSFORMFEEDBACKPROC) get_proc("glIsTransformFeedback"); + gles3wPauseTransformFeedback = (PFNGLPAUSETRANSFORMFEEDBACKPROC) get_proc("glPauseTransformFeedback"); + gles3wResumeTransformFeedback = (PFNGLRESUMETRANSFORMFEEDBACKPROC) get_proc("glResumeTransformFeedback"); + gles3wGetProgramBinary = (PFNGLGETPROGRAMBINARYPROC) get_proc("glGetProgramBinary"); + gles3wProgramBinary = (PFNGLPROGRAMBINARYPROC) get_proc("glProgramBinary"); + gles3wProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC) get_proc("glProgramParameteri"); + gles3wInvalidateFramebuffer = (PFNGLINVALIDATEFRAMEBUFFERPROC) get_proc("glInvalidateFramebuffer"); + gles3wInvalidateSubFramebuffer = (PFNGLINVALIDATESUBFRAMEBUFFERPROC) get_proc("glInvalidateSubFramebuffer"); + gles3wTexStorage2D = (PFNGLTEXSTORAGE2DPROC) get_proc("glTexStorage2D"); + gles3wTexStorage3D = (PFNGLTEXSTORAGE3DPROC) get_proc("glTexStorage3D"); + gles3wGetInternalformativ = (PFNGLGETINTERNALFORMATIVPROC) get_proc("glGetInternalformativ"); + gles3wLabelObjectEXT = (PFNGLLABELOBJECTEXTPROC) get_proc("glLabelObjectEXT"); + gles3wGetObjectLabelEXT = (PFNGLGETOBJECTLABELEXTPROC) get_proc("glGetObjectLabelEXT"); + gles3wInsertEventMarkerEXT = (PFNGLINSERTEVENTMARKEREXTPROC) get_proc("glInsertEventMarkerEXT"); + gles3wPushGroupMarkerEXT = (PFNGLPUSHGROUPMARKEREXTPROC) get_proc("glPushGroupMarkerEXT"); + gles3wPopGroupMarkerEXT = (PFNGLPOPGROUPMARKEREXTPROC) get_proc("glPopGroupMarkerEXT"); + gles3wUseProgramStagesEXT = (PFNGLUSEPROGRAMSTAGESEXTPROC) get_proc("glUseProgramStagesEXT"); + gles3wActiveShaderProgramEXT = (PFNGLACTIVESHADERPROGRAMEXTPROC) get_proc("glActiveShaderProgramEXT"); + gles3wCreateShaderProgramvEXT = (PFNGLCREATESHADERPROGRAMVEXTPROC) get_proc("glCreateShaderProgramvEXT"); + gles3wBindProgramPipelineEXT = (PFNGLBINDPROGRAMPIPELINEEXTPROC) get_proc("glBindProgramPipelineEXT"); + gles3wDeleteProgramPipelinesEXT = (PFNGLDELETEPROGRAMPIPELINESEXTPROC) get_proc("glDeleteProgramPipelinesEXT"); + gles3wGenProgramPipelinesEXT = (PFNGLGENPROGRAMPIPELINESEXTPROC) get_proc("glGenProgramPipelinesEXT"); + gles3wIsProgramPipelineEXT = (PFNGLISPROGRAMPIPELINEEXTPROC) get_proc("glIsProgramPipelineEXT"); + gles3wProgramParameteriEXT = (PFNGLPROGRAMPARAMETERIEXTPROC) get_proc("glProgramParameteriEXT"); + gles3wGetProgramPipelineivEXT = (PFNGLGETPROGRAMPIPELINEIVEXTPROC) get_proc("glGetProgramPipelineivEXT"); + gles3wProgramUniform1iEXT = (PFNGLPROGRAMUNIFORM1IEXTPROC) get_proc("glProgramUniform1iEXT"); + gles3wProgramUniform2iEXT = (PFNGLPROGRAMUNIFORM2IEXTPROC) get_proc("glProgramUniform2iEXT"); + gles3wProgramUniform3iEXT = (PFNGLPROGRAMUNIFORM3IEXTPROC) get_proc("glProgramUniform3iEXT"); + gles3wProgramUniform4iEXT = (PFNGLPROGRAMUNIFORM4IEXTPROC) get_proc("glProgramUniform4iEXT"); + gles3wProgramUniform1fEXT = (PFNGLPROGRAMUNIFORM1FEXTPROC) get_proc("glProgramUniform1fEXT"); + gles3wProgramUniform2fEXT = (PFNGLPROGRAMUNIFORM2FEXTPROC) get_proc("glProgramUniform2fEXT"); + gles3wProgramUniform3fEXT = (PFNGLPROGRAMUNIFORM3FEXTPROC) get_proc("glProgramUniform3fEXT"); + gles3wProgramUniform4fEXT = (PFNGLPROGRAMUNIFORM4FEXTPROC) get_proc("glProgramUniform4fEXT"); + gles3wProgramUniform1ivEXT = (PFNGLPROGRAMUNIFORM1IVEXTPROC) get_proc("glProgramUniform1ivEXT"); + gles3wProgramUniform2ivEXT = (PFNGLPROGRAMUNIFORM2IVEXTPROC) get_proc("glProgramUniform2ivEXT"); + gles3wProgramUniform3ivEXT = (PFNGLPROGRAMUNIFORM3IVEXTPROC) get_proc("glProgramUniform3ivEXT"); + gles3wProgramUniform4ivEXT = (PFNGLPROGRAMUNIFORM4IVEXTPROC) get_proc("glProgramUniform4ivEXT"); + gles3wProgramUniform1fvEXT = (PFNGLPROGRAMUNIFORM1FVEXTPROC) get_proc("glProgramUniform1fvEXT"); + gles3wProgramUniform2fvEXT = (PFNGLPROGRAMUNIFORM2FVEXTPROC) get_proc("glProgramUniform2fvEXT"); + gles3wProgramUniform3fvEXT = (PFNGLPROGRAMUNIFORM3FVEXTPROC) get_proc("glProgramUniform3fvEXT"); + gles3wProgramUniform4fvEXT = (PFNGLPROGRAMUNIFORM4FVEXTPROC) get_proc("glProgramUniform4fvEXT"); + gles3wProgramUniformMatrix2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) get_proc("glProgramUniformMatrix2fvEXT"); + gles3wProgramUniformMatrix3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) get_proc("glProgramUniformMatrix3fvEXT"); + gles3wProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) get_proc("glProgramUniformMatrix4fvEXT"); + gles3wProgramUniformMatrix2x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) get_proc("glProgramUniformMatrix2x3fvEXT"); + gles3wProgramUniformMatrix4x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) get_proc("glProgramUniformMatrix3x2fvEXT"); + gles3wProgramUniformMatrix2x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) get_proc("glProgramUniformMatrix2x4fvEXT"); + gles3wProgramUniformMatrix4x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) get_proc("glProgramUniformMatrix4x2fvEXT"); + gles3wProgramUniformMatrix3x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) get_proc("glProgramUniformMatrix3x4fvEXT"); + gles3wProgramUniformMatrix4x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) get_proc("glProgramUniformMatrix4x3fvEXT"); + gles3wValidateProgramPipelineEXT = (PFNGLVALIDATEPROGRAMPIPELINEEXTPROC) get_proc("glValidateProgramPipelineEXT"); + gles3wGetProgramPipelineInfoLogEXT = (PFNGLGETPROGRAMPIPELINEINFOLOGEXTPROC) get_proc("glGetProgramPipelineInfoLogEXT"); + + gles3wDebugMessageControlKHR = (PFNGLDEBUGMESSAGECONTROLKHRPROC)get_proc("glDebugMessageControlKHR"); + gles3wDebugMessageCallbackKHR = (PFNGLDEBUGMESSAGECALLBACKKHRPROC)get_proc("glDebugMessageCallbackKHR"); + gles3wFramebufferTexture2DMultisampleEXT = (PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC)get_proc("glFramebufferTexture2DMultisampleEXT"); + gles3wFramebufferTexture2DMultisampleIMG = (PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC)get_proc("glFramebufferTexture2DMultisampleIMG"); +} diff --git a/native/cocos/renderer/gfx-metal/MTLbuffer.h b/native/cocos/renderer/gfx-metal/MTLbuffer.h new file mode 100644 index 0000000000..5507c1eafc --- /dev/null +++ b/native/cocos/renderer/gfx-metal/MTLbuffer.h @@ -0,0 +1,10 @@ +#pragma once + +CC_NAMESPACE_BEGIN + +class CC_MTL_API MTLBuffer: public Object +{ + +}; + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-metal/MTLbuffer.mm b/native/cocos/renderer/gfx-metal/MTLbuffer.mm new file mode 100644 index 0000000000..fe7af6bd84 --- /dev/null +++ b/native/cocos/renderer/gfx-metal/MTLbuffer.mm @@ -0,0 +1,7 @@ +#import "MetalStd.h" +#import "MTLBuffer.h" +#import + +CC_NAMESPACE_BEGIN + +CC_NAMESPACE_END diff --git a/native/cocos/renderer/gfx-metal/MetalStd.h b/native/cocos/renderer/gfx-metal/MetalStd.h new file mode 100644 index 0000000000..e41b01c384 --- /dev/null +++ b/native/cocos/renderer/gfx-metal/MetalStd.h @@ -0,0 +1,13 @@ +#pragma once + +#include + +#if (CC_PLATFORM == CC_PLATFORM_WINDOWS) +# ifdef CC_METAL_EXPORTS +# define CC_MTL_API __declspec(dllexport) +# else +# define CC_MTL_API __declspec(dllimport) +# endif +#else +# define CC_MTL_API +#endif diff --git a/native/cocos/renderer/gfx-metal/MetalStd.mm b/native/cocos/renderer/gfx-metal/MetalStd.mm new file mode 100644 index 0000000000..f0250c09bd --- /dev/null +++ b/native/cocos/renderer/gfx-metal/MetalStd.mm @@ -0,0 +1 @@ +#import "MetalStd.h" diff --git a/native/cocos/renderer/gfx/DeviceGraphics.cpp b/native/cocos/renderer/gfx/DeviceGraphics.cpp deleted file mode 100644 index 62c69fac68..0000000000 --- a/native/cocos/renderer/gfx/DeviceGraphics.cpp +++ /dev/null @@ -1,1168 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "DeviceGraphics.h" -#include "VertexBuffer.h" -#include "IndexBuffer.h" -#include "FrameBuffer.h" -#include "GraphicsHandle.h" -#include "Texture2D.h" -#include "RenderTarget.h" -#include "Program.h" -#include "GFXUtils.h" - -#include "platform/CCPlatformConfig.h" -#include "base/CCGLUtils.h" - -RENDERER_BEGIN - -static_assert(sizeof(int) == sizeof(GLint), "ERROR: GLint isn't equal to int!"); -static_assert(sizeof(float) == sizeof(GLfloat), "ERROR: GLfloat isn't equal to float!"); - -namespace -{ - void attach(GLenum location, const RenderTarget* target) - { - if (nullptr != dynamic_cast(target)) - { - GL_CHECK(glFramebufferTexture2D(GL_FRAMEBUFFER, location, GL_TEXTURE_2D, target->getHandle(), 0)); - } - else - { - GL_CHECK(glFramebufferRenderbuffer(GL_FRAMEBUFFER, location, GL_RENDERBUFFER, target->getHandle())); - } - } -} // namespace { - -DeviceGraphics* DeviceGraphics::getInstance() -{ - static DeviceGraphics* __instance = nullptr; - if (__instance == nullptr) - __instance = new (std::nothrow) DeviceGraphics(); - - return __instance; -} - -void DeviceGraphics::setFrameBuffer(const FrameBuffer* fb) -{ - if (fb == _frameBuffer) - return; - - RENDERER_SAFE_RELEASE(_frameBuffer); - _frameBuffer = const_cast(fb); - RENDERER_SAFE_RETAIN(_frameBuffer); - - if (nullptr == fb) - { - GL_CHECK(glBindFramebuffer(GL_FRAMEBUFFER, _defaultFbo)); - return; - } - - GL_CHECK(glBindFramebuffer(GL_FRAMEBUFFER, fb->getHandle())); - - int i = 0; - const auto& colorBuffers = fb->getColorBuffers(); - for (const auto& colorBuffer : colorBuffers) - attach(GL_COLOR_ATTACHMENT0 + i, colorBuffer); - for (i = static_cast(colorBuffers.size()); i < _caps.maxColorAttatchments; ++i) - { - GL_CHECK(glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + i, GL_TEXTURE_2D, 0, 0)); - } - if (0 == colorBuffers.size()) - { - // If not draw buffer is needed, should invoke this line explicitly, or it will cause - // GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER and GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER error. - // https://stackoverflow.com/questions/28313782/porting-opengl-es-framebuffer-to-opengl -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) - glDrawBuffer(GL_NONE); - glReadBuffer(GL_NONE); -#endif - } - - if (_frameBuffer->getDepthBuffer()) - attach(GL_DEPTH_ATTACHMENT, _frameBuffer->getDepthBuffer()); - - if (_frameBuffer->getStencilBuffer()) - attach(GL_STENCIL_ATTACHMENT, _frameBuffer->getStencilBuffer()); - - // if (_frameBuffer->getDepthStencilBuffer()) - // attach(GL_DEPTH_STENCIL_ATTACHMENT, _frameBuffer->getDepthStencilBuffer()); - - auto result = glCheckFramebufferStatus(GL_FRAMEBUFFER); - if (GL_FRAMEBUFFER_COMPLETE != result) - RENDERER_LOGE("Framebuffer status error: 0x%x", result); -} - -void DeviceGraphics::setViewport(int x, int y, int w, int h) -{ - if (_vx != x || - _vy != y || - _vw != w || - _vh != h) - { - _vx = x; - _vy = y; - _vw = w; - _vh = h; - GL_CHECK(ccViewport(_vx, _vy, _vw, _vh)); - } -} - -void DeviceGraphics::setScissor(int x, int y, int w, int h) -{ - if (_sx != x || - _sy != y || - _sw != w || - _sh != h) - { - _sx = x; - _sy = y; - _sw = w; - _sh = h; - ccScissor(_sx, _sy, _sw, _sh); - } -} - -void DeviceGraphics::clear(uint8_t flags, Color4F *color, double depth, int32_t stencil) -{ - GLbitfield mask = 0; - if (flags & ClearFlag::COLOR) - { - mask |= GL_COLOR_BUFFER_BIT; - GL_CHECK(glClearColor(color->r, color->g, color->b, color->a)); - } - - if (flags & ClearFlag::DEPTH) - { - mask |= GL_DEPTH_BUFFER_BIT; - GL_CHECK(glClearDepth(depth)); - - GL_CHECK(glEnable(GL_DEPTH_TEST)); - GL_CHECK(glDepthMask(GL_TRUE)); - GL_CHECK(glDepthFunc(GL_ALWAYS)); - } - - if (flags & ClearFlag::STENCIL) - { - mask |= GL_STENCIL_BUFFER_BIT; - GL_CHECK(glClearStencil(stencil)); - } - - GL_CHECK(glClear(mask)); - - // Restore depth related state. - if (flags & ClearFlag::DEPTH) - { - if (!_currentState->depthTest) - { - GL_CHECK(glDisable(GL_DEPTH_TEST)); - } - else - { - if (!_currentState->depthWrite) - { - GL_CHECK(glDepthMask(GL_FALSE)); - } - if (_currentState->depthFunc != DepthFunc::ALWAYS) - { - GL_CHECK(glDepthFunc(static_cast(_currentState->depthFunc))); - } - } - } -} - -void DeviceGraphics::enableBlend() -{ - _nextState->blend = true; -} - -void DeviceGraphics::enableDepthTest() -{ - _nextState->depthTest = true; -} - -void DeviceGraphics::enableDepthWrite() -{ - _nextState->depthWrite = true; -} - -void DeviceGraphics::enableStencilTest() -{ - _nextState->stencilTest = true; -} - -void DeviceGraphics::setStencilFunc(StencilFunc func, int ref, unsigned int mask) -{ - _nextState->stencilSeparation = false; - _nextState->stencilFuncFront = _nextState->stencilFuncBack = func; - _nextState->stencilRefFront = _nextState->stencilRefBack = ref; - _nextState->stencilMaskFront = _nextState->stencilMaskBack = mask; -} - -void DeviceGraphics::setStencilFuncFront(StencilFunc func, int ref, unsigned int mask) -{ - _nextState->stencilSeparation = true; - _nextState->stencilFuncFront = func; - _nextState->stencilRefFront = ref; - _nextState->stencilMaskFront = mask; -} - -void DeviceGraphics::setStencilFuncBack(StencilFunc func, int ref, unsigned int mask) -{ - _nextState->stencilSeparation = true; - _nextState->stencilFuncBack = func; - _nextState->stencilRefBack = ref; - _nextState->stencilMaskBack = mask; -} - -void DeviceGraphics::setStencilOp(StencilOp failOp, StencilOp zFailOp, StencilOp zPassOp, unsigned int writeMask) -{ - _nextState->stencilFailOpFront = _nextState->stencilFailOpBack = failOp; - _nextState->stencilZFailOpFront = _nextState->stencilZFailOpBack = zFailOp; - _nextState->stencilZPassOpFront = _nextState->stencilZPassOpBack = zPassOp; - _nextState->stencilWriteMaskFront = _nextState->stencilWriteMaskBack = writeMask; -} - -void DeviceGraphics::setStencilOpFront(StencilOp failOp, StencilOp zFailOp, StencilOp zPassOp, unsigned int writeMask) -{ - _nextState->stencilSeparation = true; - _nextState->stencilFailOpFront = failOp; - _nextState->stencilZFailOpFront = zFailOp; - _nextState->stencilZPassOpFront = zPassOp; - _nextState->stencilWriteMaskFront = writeMask; -} - -void DeviceGraphics::setStencilOpBack(StencilOp failOp, StencilOp zFailOp, StencilOp zPassOp, unsigned int writeMask) -{ - _nextState->stencilSeparation = true; - _nextState->stencilFailOpBack = failOp; - _nextState->stencilZFailOpBack = zFailOp; - _nextState->stencilZPassOpBack = zPassOp; - _nextState->stencilWriteMaskBack = writeMask; -} - -void DeviceGraphics::setDepthFunc(DepthFunc func) -{ - _nextState->depthFunc = func; -} - -void DeviceGraphics::setBlendColor(uint32_t rgba) -{ - _nextState->blendColor = rgba; -} - -void DeviceGraphics::setBlendColor(uint8_t r, uint8_t g, uint8_t b, uint8_t a) -{ - _nextState->blendColor = (r << 24) | (g << 16) | (b << 8) | a; -} - -void DeviceGraphics::setBlendFunc(BlendFactor src, BlendFactor dst) -{ - _nextState->blendSeparation = false; - _nextState->blendSrc = src; - _nextState->blendDst = dst; -} - -void DeviceGraphics::setBlendFuncSeparate(BlendFactor srcRGB, BlendFactor dstRGB, BlendFactor srcAlpha, BlendFactor dstAlpha) -{ - _nextState->blendSeparation = true; - _nextState->blendSrc = srcRGB; - _nextState->blendDst = dstRGB; - _nextState->blendSrcAlpha = srcAlpha; - _nextState->blendDstAlpha = dstAlpha; -} - -void DeviceGraphics::setBlendEquation(BlendOp mode) -{ - _nextState->blendSeparation = false; - _nextState->blendEq = mode; -} - -void DeviceGraphics::setBlendEquationSeparate(BlendOp modeRGB, BlendOp modeAlpha) -{ - _nextState->blendSeparation = true; - _nextState->blendEq = modeRGB; - _nextState->blendAlphaEq = modeAlpha; -} - -void DeviceGraphics::setCullMode(CullMode mode) -{ - _nextState->cullMode = mode; -} - -void DeviceGraphics::setVertexBuffer(int stream, VertexBuffer* buffer, int start /*= 0*/) -{ - _nextState->setVertexBuffer(stream, buffer); - _nextState->setVertexBufferOffset(stream, start); - - if (_nextState->maxStream < stream) { - _nextState->maxStream = stream; - } -} - -void DeviceGraphics::setIndexBuffer(IndexBuffer *buffer) -{ - _nextState->setIndexBuffer(buffer); -} - -void DeviceGraphics::setProgram(Program *program) -{ - _nextState->setProgram(program); -} - -void DeviceGraphics::setTexture(size_t hashName, Texture* texture, int slot) -{ - if (slot >= _caps.maxTextureUnits) - { - RENDERER_LOGW("Can not set texture %zu at stage %d, max texture exceed: %d", - hashName, slot, _caps.maxTextureUnits); - return; - } - - _nextState->setTexture(slot, texture); - setUniformi(hashName, slot); -} - -void DeviceGraphics::setTextureArray(size_t hashName, const std::vector& textures, const std::vector& slots) -{ - auto len = textures.size(); - if (len >= _caps.maxTextureUnits) - { - RENDERER_LOGW("Can not set %d textures for %zu, max texture exceed: %d", - (int)len, hashName, _caps.maxTextureUnits); - return; - } - for (size_t i = 0; i < len; ++i) - { - auto slot = slots[i]; - _nextState->setTexture(slot, textures[i]); - } - - setUniformiv(hashName, slots.size(), slots.data()); -} - -void DeviceGraphics::setPrimitiveType(PrimitiveType type) -{ - _nextState->primitiveType = type; -} - -void DeviceGraphics::draw(size_t base, GLsizei count) -{ - commitBlendStates(); - commitDepthStates(); - commitStencilStates(); - commitCullMode(); - commitVertexBuffer(); - - auto nextIndexBuffer = _nextState->getIndexBuffer(); - if (_currentState->getIndexBuffer() != nextIndexBuffer) - { - GL_CHECK(ccBindBuffer(GL_ELEMENT_ARRAY_BUFFER, nextIndexBuffer ? nextIndexBuffer->getHandle() : 0)); - } - - //commit program - bool programDirty = false; - if (_currentState->getProgram() != _nextState->getProgram()) - { - if (_nextState->getProgram()->isLinked()) - { - GL_CHECK(glUseProgram(_nextState->getProgram()->getHandle())); - } - else - RENDERER_LOGW("Failed to use program: has not linked yet."); - - programDirty = true; - } - - commitTextures(); - - //commit uniforms - const auto& uniformsInfo = _nextState->getProgram()->getUniforms(); - for (const auto& uniformInfo : uniformsInfo) - { - auto iter = _uniforms.find(uniformInfo.hashName); - if (_uniforms.end() == iter) - continue; - - auto& uniform = iter->second; - if (!programDirty && !uniform.dirty) - continue; - - uniform.dirty = false; - uniformInfo.setUniform(uniform.value, uniform.elementType); - } - - // draw primitives - if (nextIndexBuffer) - { - GL_CHECK(glDrawElements(ENUM_CLASS_TO_GLENUM(_nextState->primitiveType), - count, - ENUM_CLASS_TO_GLENUM(nextIndexBuffer->getFormat()), - (GLvoid *)(base * nextIndexBuffer->getBytesPerIndex()))); - } - else - { - GL_CHECK(glDrawArrays(ENUM_CLASS_TO_GLENUM(_nextState->primitiveType), (GLint)base, count)); - } - - _drawCalls++; - - auto temp = _nextState; - _nextState = _currentState; - _currentState = temp; - - _nextState->reset(); -} - -void DeviceGraphics::setUniform(size_t hashName, const void* v, size_t bytes, UniformElementType elementType) -{ - auto iter = _uniforms.find(hashName); - if (iter == _uniforms.end()) - { - _uniforms[hashName] = Uniform(v, bytes, elementType); - } - else - { - auto& uniform = iter->second; - uniform.dirty = true; - uniform.setValue(v, bytes); - } -} - -void DeviceGraphics::setUniformi(size_t hashName, int i1) -{ - setUniform(hashName, &i1, sizeof(int), UniformElementType::INT); -} - -void DeviceGraphics::setUniformi(size_t hashName, int i1, int i2) -{ - int tempValue[] = {i1, i2}; - setUniform(hashName, tempValue, 2 * sizeof(int), UniformElementType::INT); -} - -void DeviceGraphics::setUniformi(size_t hashName, int i1, int i2, int i3) -{ - int tempValue[] = {i1, i2, i3}; - setUniform(hashName, tempValue, 3 * sizeof(int), UniformElementType::INT); -} - -void DeviceGraphics::setUniformi(size_t hashName, int i1, int i2, int i3, int i4) -{ - int tempValue[] = {i1, i2, i3, i4}; - setUniform(hashName, tempValue, 4 * sizeof(int), UniformElementType::INT); -} - -void DeviceGraphics::setUniformiv(size_t hashName, size_t count, const int* value) -{ - setUniform(hashName, value, count * sizeof(int), UniformElementType::INT); -} - -void DeviceGraphics::setUniformf(size_t hashName, float f1) -{ - setUniform(hashName, &f1, sizeof(float), UniformElementType::FLOAT); -} - -void DeviceGraphics::setUniformf(size_t hashName, float f1, float f2) -{ - float tempValue[] = {f1, f2}; - setUniform(hashName, tempValue, 2 * sizeof(float), UniformElementType::FLOAT); -} - -void DeviceGraphics::setUniformf(size_t hashName, float f1, float f2, float f3) -{ - float tempValue[] = {f1, f2, f3}; - setUniform(hashName, tempValue, 3 * sizeof(float), UniformElementType::FLOAT); -} - -void DeviceGraphics::setUniformf(size_t hashName, float f1, float f2, float f3, float f4) -{ - float tempValue[] = {f1, f2, f3, f4}; - setUniform(hashName, tempValue, 4 * sizeof(float), UniformElementType::FLOAT); -} - -void DeviceGraphics::setUniformfv(size_t hashName, size_t count, const float* value) -{ - setUniform(hashName, value, count * sizeof(float), UniformElementType::FLOAT); -} - -void DeviceGraphics::setUniformVec2(size_t hashName, const cocos2d::Vec2& value) -{ - setUniform(hashName, &value, sizeof(Vec2), UniformElementType::FLOAT); -} - -void DeviceGraphics::setUniformVec3(size_t hashName, const cocos2d::Vec3& value) -{ - setUniform(hashName, &value, sizeof(Vec3), UniformElementType::FLOAT); -} - -void DeviceGraphics::setUniformVec4(size_t hashName, const cocos2d::Vec4& value) -{ - setUniform(hashName, &value, sizeof(Vec4), UniformElementType::FLOAT); -} - -void DeviceGraphics::setUniformMat2(size_t hashName, float* value) -{ - setUniform(hashName, value, 4 * sizeof(float), UniformElementType::FLOAT); -} - -void DeviceGraphics::setUniformMat3(size_t hashName, float* value) -{ - setUniform(hashName, value, 9 * sizeof(float), UniformElementType::FLOAT); -} - -void DeviceGraphics::setUniformMat4(size_t hashName, float* value) -{ - setUniform(hashName, value, 16 * sizeof(float), UniformElementType::FLOAT); -} - -void DeviceGraphics::setUniformMat4(size_t hashName, const cocos2d::Mat4& value) -{ - setUniform(hashName, value.m, 16 * sizeof(float), UniformElementType::FLOAT); -} - -// -// Priviate funcitons. -// - -DeviceGraphics::DeviceGraphics() -: _vx(0) -, _vy(0) -, _vw(0) -, _vh(0) -, _sx(0) -, _sy(0) -, _sw(0) -, _sh(0) -, _frameBuffer(nullptr) -{ - initCaps(); - initStates(); - - _newAttributes.resize(_caps.maxVertexAttributes); - _enabledAtrributes.resize(_caps.maxVertexAttributes); - - - _currentState = new State(); - _nextState = new State(); - - // Make sure _currentState and _nextState have enough sapce for textures. - _currentState->setTexture(_caps.maxTextureUnits, nullptr); - _nextState->setTexture(_caps.maxTextureUnits, nullptr); - - glGetIntegerv(GL_FRAMEBUFFER_BINDING, &_defaultFbo); -} - -DeviceGraphics::~DeviceGraphics() -{ - RENDERER_SAFE_RELEASE(_frameBuffer); - - delete _currentState; - delete _nextState; - - _currentState = _nextState = nullptr; -} - -void DeviceGraphics::initCaps() -{ - GL_CHECK(glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &_caps.maxVextexTextures)); - GL_CHECK(glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &_caps.maxVertexAttributes)); - // Need to emulate MAX_FRAGMENT/VERTEX_UNIFORM_VECTORS and MAX_VARYING_VECTORS - // because desktop GL's corresponding queries return the number of components - // whereas GLES2 return the number of vectors (each vector has 4 components). - // Therefore, the value returned by desktop GL needs to be divided by 4. -#if (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) - GL_CHECK(glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, &_caps.maxFragUniforms)); - _caps.maxFragUniforms /= 4; -#else - GL_CHECK(glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_VECTORS, &_caps.maxFragUniforms)); -#endif - - GL_CHECK(glGetIntegerv(GL_MAX_TEXTURE_UNITS, &_caps.maxTextureUnits)); - -#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS) - // IDEA: how to get these infomations - _caps.maxColorAttatchments = 1; - _caps.maxDrawBuffers = 1; -#else - GL_CHECK(glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS, &_caps.maxColorAttatchments)); - GL_CHECK(glGetIntegerv(GL_MAX_DRAW_BUFFERS, &_caps.maxDrawBuffers)); -#endif - - RENDERER_LOGD("Device caps: maxVextexTextures: %d, maxFragUniforms: %d, maxTextureUints: %d, maxVertexAttributes: %d, maxDrawBuffers: %d, maxColorAttatchments: %d", - _caps.maxVextexTextures, _caps.maxFragUniforms, _caps.maxTextureUnits, _caps.maxVertexAttributes, _caps.maxDrawBuffers, _caps.maxColorAttatchments); -} - -void DeviceGraphics::initStates() -{ - GL_CHECK(glDisable(GL_BLEND)); - GL_CHECK(glBlendFunc(GL_ONE, GL_ZERO)); - GL_CHECK(glBlendEquation(GL_FUNC_ADD)); - GL_CHECK(glBlendColor(1, 1, 1, 1)); - - GL_CHECK(glColorMask(true, true, true, true)); - - GL_CHECK(glEnable(GL_CULL_FACE)); - GL_CHECK(glCullFace(GL_BACK)); - - GL_CHECK(glDisable(GL_DEPTH_TEST)); - GL_CHECK(glDepthFunc(GL_LESS)); - GL_CHECK(glDepthMask(GL_FALSE)); - GL_CHECK(glDisable(GL_POLYGON_OFFSET_FILL)); - GL_CHECK(glDepthRange(0, 1)); - - GL_CHECK(glDisable(GL_STENCIL_TEST)); - GL_CHECK(glStencilFunc(GL_ALWAYS, 0, 0xff)); - GL_CHECK(glStencilMask(0xff)); - GL_CHECK(glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP)); - - GL_CHECK(glClearDepth(1)); - GL_CHECK(glClearColor(0, 0, 0, 0)); - GL_CHECK(glClearStencil(0)); - - GL_CHECK(glDisable(GL_SCISSOR_TEST)); -} - -void DeviceGraphics::restoreTexture(uint32_t index) -{ - auto texture = _currentState->getTexture(index); - if (texture) - { - GL_CHECK(glBindTexture(texture->getTarget(), texture->getHandle())); - } - else - { - GL_CHECK(glBindTexture(GL_TEXTURE_2D, 0)); - } -} - -void DeviceGraphics::restoreIndexBuffer() -{ - auto ib = _currentState->getIndexBuffer(); - GL_CHECK(ccBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ib ? ib->getHandle(): 0)); -} - -void DeviceGraphics::commitBlendStates() -{ - if (_currentState->blend != _nextState->blend) - { - if (!_nextState->blend) - { - glDisable(GL_BLEND); - return; - } - - glEnable(GL_BLEND); - - if (_nextState->blendSrc == BlendFactor::CONSTANT_COLOR || - _nextState->blendSrc == BlendFactor::ONE_MINUS_CONSTANT_COLOR || - _nextState->blendDst == BlendFactor::CONSTANT_COLOR || - _nextState->blendDst == BlendFactor::ONE_MINUS_CONSTANT_COLOR) - { - GL_CHECK(glBlendColor((_nextState->blendColor >> 24) / 255.f, - (_nextState->blendColor >> 16 & 0xff) / 255.f, - (_nextState->blendColor >> 8 & 0xff) / 255.f, - (_nextState->blendColor & 0xff) / 255.f)); - - } - - if (_nextState->blendSeparation) - { - GL_CHECK(glBlendFuncSeparate(ENUM_CLASS_TO_GLENUM(_nextState->blendSrc), - ENUM_CLASS_TO_GLENUM(_nextState->blendDst), - ENUM_CLASS_TO_GLENUM(_nextState->blendSrcAlpha), - ENUM_CLASS_TO_GLENUM(_nextState->blendDstAlpha))); - GL_CHECK(glBlendEquationSeparate(ENUM_CLASS_TO_GLENUM(_nextState->blendEq), - ENUM_CLASS_TO_GLENUM(_nextState->blendAlphaEq))); - } - else - { - GL_CHECK(glBlendFunc(ENUM_CLASS_TO_GLENUM(_nextState->blendSrc), - ENUM_CLASS_TO_GLENUM(_nextState->blendDst))); - GL_CHECK(glBlendEquation(ENUM_CLASS_TO_GLENUM(_nextState->blendEq))); - } - - return; - } - - if (_nextState->blend == false) - return; - - if (_currentState->blendColor != _nextState->blendColor) - glBlendColor((_nextState->blendColor >> 24) / 255.f, - (_nextState->blendColor >> 16 & 0xff) / 255.f, - (_nextState->blendColor >> 8 & 0xff) / 255.f, - (_nextState->blendColor & 0xff) / 255.f); - - if (_currentState->blendSeparation != _nextState->blendSeparation) - { - if (_nextState->blendSeparation) - { - GL_CHECK(glBlendFuncSeparate(ENUM_CLASS_TO_GLENUM(_nextState->blendSrc), - ENUM_CLASS_TO_GLENUM(_nextState->blendDst), - ENUM_CLASS_TO_GLENUM(_nextState->blendSrcAlpha), - ENUM_CLASS_TO_GLENUM(_nextState->blendDstAlpha))); - GL_CHECK(glBlendEquationSeparate(ENUM_CLASS_TO_GLENUM(_nextState->blendEq), - ENUM_CLASS_TO_GLENUM(_nextState->blendAlphaEq))); - } - else - { - GL_CHECK(glBlendFunc(ENUM_CLASS_TO_GLENUM(_nextState->blendSrc), - ENUM_CLASS_TO_GLENUM(_nextState->blendDst))); - GL_CHECK(glBlendEquation(ENUM_CLASS_TO_GLENUM(_nextState->blendEq))); - } - - return; - } - - if (_nextState->blendSeparation) - { - if (_currentState->blendSrc != _nextState->blendSrc || - _currentState->blendDst != _nextState->blendDst || - _currentState->blendSrcAlpha != _nextState->blendSrcAlpha || - _currentState->blendDstAlpha != _nextState->blendDstAlpha) - { - GL_CHECK(glBlendFuncSeparate(ENUM_CLASS_TO_GLENUM(_nextState->blendSrc), - ENUM_CLASS_TO_GLENUM(_nextState->blendDst), - ENUM_CLASS_TO_GLENUM(_nextState->blendSrcAlpha), - ENUM_CLASS_TO_GLENUM(_nextState->blendDstAlpha))); - } - } - - if (_currentState->blendEq != _nextState->blendEq || - _currentState->blendAlphaEq != _nextState->blendAlphaEq) - { - GL_CHECK(glBlendEquationSeparate(ENUM_CLASS_TO_GLENUM(_nextState->blendEq), - ENUM_CLASS_TO_GLENUM(_nextState->blendAlphaEq))); - } - else - { - if (_currentState->blendSrc != _nextState->blendSrc || - _currentState->blendDst != _nextState->blendDst) - { - GL_CHECK(glBlendFunc(ENUM_CLASS_TO_GLENUM(_nextState->blendSrc), - ENUM_CLASS_TO_GLENUM(_nextState->blendDst))); - } - - if (_currentState->blendEq != _nextState->blendEq) - { - GL_CHECK(glBlendEquation(ENUM_CLASS_TO_GLENUM(_nextState->blendEq))); - } - } -} - -void DeviceGraphics::commitDepthStates() -{ - if (_currentState->depthTest != _nextState->depthTest) - { - if (!_nextState->depthTest) - { - glDisable(GL_DEPTH_TEST); - return; - } - - GL_CHECK(glEnable(GL_DEPTH_TEST)); - GL_CHECK(glDepthFunc(ENUM_CLASS_TO_GLENUM(_nextState->depthFunc))); - GL_CHECK(glDepthMask(_nextState->depthWrite ? GL_TRUE : GL_FALSE)); - - return; - } - - if (_currentState->depthWrite != _nextState->depthWrite) - { - GL_CHECK(glDepthMask(_nextState->depthWrite ? GL_TRUE : GL_FALSE)); - } - - if (!_nextState->depthTest) - { - if (_nextState->depthWrite) - { - _nextState->depthTest = true; - _nextState->depthFunc = DepthFunc::ALWAYS; - - GL_CHECK(glEnable(GL_DEPTH_TEST)); - GL_CHECK(glDepthFunc(ENUM_CLASS_TO_GLENUM(_nextState->depthFunc))); - } - - return; - } - - if (_currentState->depthFunc != _nextState->depthFunc) - { - GL_CHECK(glDepthFunc(ENUM_CLASS_TO_GLENUM(_nextState->depthFunc))); - } -} - -void DeviceGraphics::commitStencilStates() -{ - if (_currentState->stencilTest != _nextState->stencilTest) - { - if (!_nextState->stencilTest) - { - glDisable(GL_STENCIL_TEST); - return; - } - - glEnable(GL_STENCIL_TEST); - - if (_nextState->stencilSeparation) - { - GL_CHECK(glStencilFuncSeparate(GL_FRONT, - ENUM_CLASS_TO_GLENUM(_nextState->stencilFuncFront), - ENUM_CLASS_TO_GLENUM(_nextState->stencilRefFront), - ENUM_CLASS_TO_GLENUM(_nextState->stencilMaskFront))); - GL_CHECK(glStencilMaskSeparate(GL_FRONT, ENUM_CLASS_TO_GLENUM(_nextState->stencilWriteMaskFront))); - GL_CHECK(glStencilOpSeparate(GL_FRONT, - ENUM_CLASS_TO_GLENUM(_nextState->stencilFailOpFront), - ENUM_CLASS_TO_GLENUM(_nextState->stencilZFailOpFront), - ENUM_CLASS_TO_GLENUM(_nextState->stencilZPassOpFront))); - GL_CHECK(glStencilFuncSeparate(GL_BACK, - ENUM_CLASS_TO_GLENUM(_nextState->stencilFuncBack), - ENUM_CLASS_TO_GLENUM(_nextState->stencilRefBack), - ENUM_CLASS_TO_GLENUM(_nextState->stencilMaskBack))); - GL_CHECK(glStencilMaskSeparate(GL_BACK, ENUM_CLASS_TO_GLENUM(_nextState->stencilWriteMaskBack))); - GL_CHECK(glStencilOpSeparate(GL_BACK, - ENUM_CLASS_TO_GLENUM(_nextState->stencilFailOpBack), - ENUM_CLASS_TO_GLENUM(_nextState->stencilZFailOpBack), - ENUM_CLASS_TO_GLENUM(_nextState->stencilZPassOpBack))); - } - else - { - GL_CHECK(glStencilFunc(ENUM_CLASS_TO_GLENUM(_nextState->stencilFuncFront), - ENUM_CLASS_TO_GLENUM(_nextState->stencilRefFront), - ENUM_CLASS_TO_GLENUM(_nextState->stencilMaskFront))); - GL_CHECK(glStencilMask(ENUM_CLASS_TO_GLENUM(_nextState->stencilWriteMaskFront))); - GL_CHECK(glStencilOp(ENUM_CLASS_TO_GLENUM(_nextState->stencilFailOpFront), - ENUM_CLASS_TO_GLENUM(_nextState->stencilZFailOpFront), - ENUM_CLASS_TO_GLENUM(_nextState->stencilZPassOpFront))); - } - - return; - } - - if (!_nextState->stencilTest) - return; - - if (_currentState->stencilSeparation != _nextState->stencilSeparation) - { - if (_nextState->stencilSeparation) - { - // front - GL_CHECK(glStencilFuncSeparate(GL_FRONT, - ENUM_CLASS_TO_GLENUM(_nextState->stencilFuncFront), - ENUM_CLASS_TO_GLENUM(_nextState->stencilRefFront), - ENUM_CLASS_TO_GLENUM(_nextState->stencilMaskFront))); - GL_CHECK(glStencilMaskSeparate(GL_FRONT, ENUM_CLASS_TO_GLENUM(_nextState->stencilWriteMaskFront))); - GL_CHECK(glStencilOpSeparate(GL_FRONT, - ENUM_CLASS_TO_GLENUM(_nextState->stencilFailOpFront), - ENUM_CLASS_TO_GLENUM(_nextState->stencilZFailOpFront), - ENUM_CLASS_TO_GLENUM(_nextState->stencilZPassOpFront))); - - // back - GL_CHECK(glStencilFuncSeparate(GL_BACK, - ENUM_CLASS_TO_GLENUM(_nextState->stencilFuncBack), - ENUM_CLASS_TO_GLENUM(_nextState->stencilRefBack), - ENUM_CLASS_TO_GLENUM(_nextState->stencilMaskBack))); - GL_CHECK(glStencilMaskSeparate(GL_BACK, ENUM_CLASS_TO_GLENUM(_nextState->stencilWriteMaskBack))); - GL_CHECK(glStencilOpSeparate(GL_BACK, - ENUM_CLASS_TO_GLENUM(_nextState->stencilFailOpBack), - ENUM_CLASS_TO_GLENUM(_nextState->stencilZFailOpBack), - ENUM_CLASS_TO_GLENUM(_nextState->stencilZPassOpBack))); - } - else - { - GL_CHECK(glStencilFunc(ENUM_CLASS_TO_GLENUM(_nextState->stencilFuncFront), - ENUM_CLASS_TO_GLENUM(_nextState->stencilRefFront), - ENUM_CLASS_TO_GLENUM(_nextState->stencilMaskFront))); - GL_CHECK(glStencilMask(ENUM_CLASS_TO_GLENUM(_nextState->stencilWriteMaskFront))); - GL_CHECK(glStencilOp(ENUM_CLASS_TO_GLENUM(_nextState->stencilFailOpFront), - ENUM_CLASS_TO_GLENUM(_nextState->stencilZFailOpFront), - ENUM_CLASS_TO_GLENUM(_nextState->stencilZPassOpFront))); - } - - return; - } - - if (_nextState->stencilSeparation) - { - // font - if (_currentState->stencilFuncFront != _nextState->stencilFuncFront || - _currentState->stencilRefFront != _nextState->stencilRefFront || - _currentState->stencilMaskFront != _nextState->stencilMaskFront) - { - GL_CHECK(glStencilFuncSeparate(GL_FRONT, - ENUM_CLASS_TO_GLENUM(_nextState->stencilFuncFront), - ENUM_CLASS_TO_GLENUM(_nextState->stencilRefFront), - ENUM_CLASS_TO_GLENUM(_nextState->stencilMaskFront))); - } - if (_currentState->stencilWriteMaskFront != _nextState->stencilWriteMaskFront) - { - GL_CHECK(glStencilMaskSeparate(GL_FRONT, ENUM_CLASS_TO_GLENUM(_nextState->stencilWriteMaskFront))); - } - if (_currentState->stencilFailOpFront != _nextState->stencilFailOpFront || - _currentState->stencilZFailOpFront != _nextState->stencilZFailOpFront || - _currentState->stencilZPassOpFront != _nextState->stencilZPassOpFront) - { - GL_CHECK(glStencilOpSeparate(GL_FRONT, - ENUM_CLASS_TO_GLENUM(_nextState->stencilFailOpFront), - ENUM_CLASS_TO_GLENUM(_nextState->stencilZFailOpFront), - ENUM_CLASS_TO_GLENUM(_nextState->stencilZPassOpFront))); - } - - // back - if (_currentState->stencilFuncBack != _nextState->stencilFuncBack || - _currentState->stencilRefBack != _nextState->stencilRefBack || - _currentState->stencilMaskBack != _nextState->stencilMaskBack) - { - GL_CHECK(glStencilFuncSeparate(GL_BACK, - ENUM_CLASS_TO_GLENUM(_nextState->stencilFuncBack), - ENUM_CLASS_TO_GLENUM(_nextState->stencilRefBack), - ENUM_CLASS_TO_GLENUM(_nextState->stencilMaskBack))); - } - if (_currentState->stencilWriteMaskBack != _nextState->stencilWriteMaskBack) - GL_CHECK(glStencilMaskSeparate(GL_BACK, ENUM_CLASS_TO_GLENUM(_nextState->stencilWriteMaskBack))); - if (_currentState->stencilFailOpBack != _nextState->stencilFailOpBack || - _currentState->stencilZFailOpBack != _nextState->stencilZFailOpBack || - _currentState->stencilZPassOpBack != _nextState->stencilZPassOpBack) - { - GL_CHECK(glStencilOpSeparate(GL_BACK, - ENUM_CLASS_TO_GLENUM(_nextState->stencilFailOpBack), - ENUM_CLASS_TO_GLENUM(_nextState->stencilZFailOpBack), - ENUM_CLASS_TO_GLENUM(_nextState->stencilZPassOpBack))); - } - } - else - { - if (_currentState->stencilFuncFront != _nextState->stencilFuncFront || - _currentState->stencilRefFront != _nextState->stencilRefFront || - _currentState->stencilMaskFront != _nextState->stencilMaskFront) - { - GL_CHECK(glStencilFunc(ENUM_CLASS_TO_GLENUM(_nextState->stencilFuncFront), - ENUM_CLASS_TO_GLENUM(_nextState->stencilRefFront), - ENUM_CLASS_TO_GLENUM(_nextState->stencilMaskFront))); - } - - if (_currentState->stencilWriteMaskFront != _nextState->stencilWriteMaskFront) - { - GL_CHECK(glStencilMask(ENUM_CLASS_TO_GLENUM(_nextState->stencilWriteMaskFront))); - } - - if (_currentState->stencilFailOpFront != _nextState->stencilFailOpFront || - _currentState->stencilZFailOpFront != _nextState->stencilZFailOpFront || - _currentState->stencilZPassOpFront != _nextState->stencilZPassOpFront) - { - GL_CHECK(glStencilOp(ENUM_CLASS_TO_GLENUM(_nextState->stencilFailOpFront), - ENUM_CLASS_TO_GLENUM(_nextState->stencilZFailOpFront), - ENUM_CLASS_TO_GLENUM(_nextState->stencilZPassOpFront))); - } - } -} - -void DeviceGraphics::commitCullMode() -{ - if (_currentState->cullMode == _nextState->cullMode) - return; - - if (_nextState->cullMode == CullMode::NONE) - { - GL_CHECK(glDisable(GL_CULL_FACE)); - return; - } - - GL_CHECK(glEnable(GL_CULL_FACE)); - GL_CHECK(glCullFace(ENUM_CLASS_TO_GLENUM(_nextState->cullMode))); -} -void DeviceGraphics::commitVertexBuffer() -{ - if (-1 == _nextState->maxStream) - { - RENDERER_LOGW("VertexBuffer not assigned, please call setVertexBuffer before every draw."); - return; - } - - bool attrsDirty = false; - if (_currentState->maxStream != _nextState->maxStream) - attrsDirty = true; - else if (_currentState->getProgram() != _nextState->getProgram()) - attrsDirty = true; - else - { - for (int i = 0; i < _nextState->maxStream + 1; ++i) - { - if (_currentState->getVertexBuffer(i) != _nextState->getVertexBuffer(i) || - _currentState->getVertexBufferOffset(i) != _nextState->getVertexBufferOffset(i)) - { - attrsDirty = true; - break; - } - } - } - - if (attrsDirty) - { - for (int i = 0; i < _caps.maxVertexAttributes; ++i) - _newAttributes[i] = 0; - - for (int i = 0; i < _nextState->maxStream + 1; ++i) - { - auto vb = _nextState->getVertexBuffer(i); - if (!vb) - continue; - - GL_CHECK(ccBindBuffer(GL_ARRAY_BUFFER, vb->getHandle())); - - auto vboffset = _nextState->getVertexBufferOffset(i); - const auto& attributes = _nextState->getProgram()->getAttributes(); - auto usedAttriLen = attributes.size(); - for (int j = 0; j < usedAttriLen; ++j) - { - const auto& attr = attributes[j]; - const auto* el = vb->getFormat().getElement(attr.name); - if (!el || !el->isValid()) - { - RENDERER_LOGW("Can not find vertex attribute: %s", attr.name.c_str()); - continue; - } - - if (0 == _enabledAtrributes[attr.location]) - { - GL_CHECK(ccEnableVertexAttribArray(attr.location)); - _enabledAtrributes[attr.location] = 1; - } - _newAttributes[attr.location] = 1; - - // glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); - GL_CHECK(ccVertexAttribPointer(attr.location, - el->num, - ENUM_CLASS_TO_GLENUM(el->type), - el->normalize, - el->stride, - (GLvoid*)(el->offset + vboffset * el->stride))); - } - } - - // Disable unused attributes. - for (int i = 0; i < _caps.maxVertexAttributes; ++i) - { - if (_enabledAtrributes[i] != _newAttributes[i]) - { - GL_CHECK(ccDisableVertexAttribArray(i)); - _enabledAtrributes[i] = 0; - } - } - } -} - -void DeviceGraphics::commitTextures() -{ - const auto& curTextureUnits = _currentState->getTextureUnits(); - int curTextureSize = static_cast(curTextureUnits.size()); - const auto& nextTextureUnits = _nextState->getTextureUnits(); - int capacity = static_cast(nextTextureUnits.size()); - for (int i = 0; i < capacity; ++i) - { - if (i >= curTextureSize || curTextureUnits[i] != nextTextureUnits[i]) - { - auto texture = nextTextureUnits[i]; - if (texture) - { - GL_CHECK(glActiveTexture(GL_TEXTURE0 + i)); - GL_CHECK(glBindTexture(texture->getTarget(), - texture->getHandle())); - } - } - } -} - -// -// Uniform -// -DeviceGraphics::Uniform::Uniform() -: dirty(true) -, elementType(UniformElementType::FLOAT) -{} - -DeviceGraphics::Uniform::Uniform(const void* v, size_t bytes, UniformElementType elementType_) -: dirty(true) -, elementType(elementType_) -{ - setValue(v, bytes); -} - -DeviceGraphics::Uniform::Uniform(Uniform&& h) -{ - if (this == &h) - return; - - if (value != nullptr) - { - free(value); - } - value = h.value; - h.value = nullptr; - - dirty = h.dirty; - elementType = h.elementType; -} - -DeviceGraphics::Uniform::~Uniform() -{ - if (value) - { - free(value); - value = nullptr; - } -} - -DeviceGraphics::Uniform& DeviceGraphics::Uniform::operator=(Uniform&& h) -{ - if (this == &h) - return *this; - - dirty = h.dirty; - - if (value != nullptr) - { - free(value); - } - value = h.value; - h.value = nullptr; - elementType = h.elementType; - - return *this; -} - -void DeviceGraphics::Uniform::setValue(const void* v, size_t valueBytes) -{ - if (bytes != valueBytes || !value) { - if (value) - free(value); - value = malloc(valueBytes); - - bytes = valueBytes; - } - - memcpy(value, v, valueBytes); -} - -RENDERER_END diff --git a/native/cocos/renderer/gfx/DeviceGraphics.h b/native/cocos/renderer/gfx/DeviceGraphics.h deleted file mode 100644 index 65c4a8c824..0000000000 --- a/native/cocos/renderer/gfx/DeviceGraphics.h +++ /dev/null @@ -1,359 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#pragma once - -#include -#include -#include -#include -#include "base/ccTypes.h" -#include "base/CCRef.h" -#include "math/Vec2.h" -#include "math/Vec3.h" -#include "math/Vec4.h" -#include "math/Mat4.h" -#include "../Macro.h" -#include "../Types.h" -#include "State.h" - -RENDERER_BEGIN - -class FrameBuffer; -class VertexBuffer; -class IndexBuffer; -class Program; -class Texture; - -/** - * @addtogroup gfx - * @{ - */ - -/** - * DeviceGraphics is a direct abstraction for OpenGL APIs. - * This fundamental class takes responsibility for all GL states management and GL call invocations. - */ -class DeviceGraphics final : public Ref -{ -public: - struct Capacity - { - int maxVextexTextures; - int maxFragUniforms; - int maxTextureUnits; - int maxVertexAttributes; - int maxDrawBuffers; - int maxColorAttatchments; - }; - - struct Uniform - { - Uniform(const void* v, size_t bytes, UniformElementType elementType_); - Uniform(Uniform&& h); - Uniform(); - ~Uniform(); - - Uniform& operator=(Uniform&& h); - - void setValue(const void* v, size_t bytes); - - void* value = nullptr; - size_t bytes = 0; - - bool dirty; - UniformElementType elementType; - - private: - // Disable copy operator - Uniform& operator=(const Uniform& o); - }; - - /** - * Returns a shared instance of the director. - */ - static DeviceGraphics* getInstance(); - - /** - * Sets the target FrameBuffer - */ - void setFrameBuffer(const FrameBuffer* fb); - /** - * Sets viewport with x, y, width and height - */ - void setViewport(int x, int y, int w, int h); - /** - * Sets scissor clipping area - */ - void setScissor(int x, int y, int w, int h); - - /** - * Clear with flags, including color, depth and stencil, - * you should also specify the color, depth and stencil value to use. - */ - void clear(uint8_t flags, Color4F *color, double depth, int32_t stencil); - - /** - * Enables blend in GL state - */ - void enableBlend(); - /** - * Enables depth test in GL state - */ - void enableDepthTest(); - /** - * Enables depth write in GL state - */ - void enableDepthWrite(); - /** - * Enables stencil test in GL state - */ - void enableStencilTest(); - - /** - * Sets both the front and back function and reference value for stencil testing - */ - void setStencilFunc(StencilFunc func, int ref, unsigned int mask); - /** - * Sets the front function and reference value for stencil testing - */ - void setStencilFuncFront(StencilFunc func, int ref, unsigned int mask); - /** - * Sets the back function and reference value for stencil testing - */ - void setStencilFuncBack(StencilFunc func, int ref, unsigned int mask); - - /** - * Sets both the front and back-facing stencil test actions - */ - void setStencilOp(StencilOp failOp, StencilOp zFailOp, StencilOp zPassOp, unsigned int writeMask); - /** - * Sets the front stencil test actions - */ - void setStencilOpFront(StencilOp failOp, StencilOp zFailOp, StencilOp zPassOp, unsigned int writeMask); - /** - * Sets the back stencil test actions - */ - void setStencilOpBack(StencilOp failOp, StencilOp zFailOp, StencilOp zPassOp, unsigned int writeMask); - - /** - * Specifies the depth comparison function, which sets the conditions under which the pixel will be drawn. - */ - void setDepthFunc(DepthFunc func); - - /** - * Sets the source and destination blending factors with all channel packed into a 32bit unsigned int - */ - void setBlendColor(uint32_t rgba); - /** - * Sets the source and destination blending factors with separate color channel values - */ - void setBlendColor(uint8_t r, uint8_t g, uint8_t b, uint8_t a); - /** - * Sets which function is used for blending pixel arithmetic - */ - void setBlendFunc(BlendFactor src, BlendFactor dst); - /** - * Sets which function is used for blending pixel arithmetic for RGB and alpha components separately - */ - void setBlendFuncSeparate(BlendFactor srcRGB, BlendFactor dstRGB, BlendFactor srcAlpha, BlendFactor dstAlpha); - /** - * Sets both the RGB blend equation and alpha blend equation to a single equation. - */ - void setBlendEquation(BlendOp mode); - /** - * Sets the RGB blend equation and alpha blend equation separately. - */ - void setBlendEquationSeparate(BlendOp modeRGB, BlendOp modeAlpha); - - /** - * Specifies whether or not front and/or back-facing polygons can be culled. - */ - void setCullMode(CullMode mode); - - /** - * Sets the vertex buffer - */ - void setVertexBuffer(int stream, VertexBuffer* buffer, int start = 0); - /** - * Sets the index buffer - */ - void setIndexBuffer(IndexBuffer *buffer); - /** - * Sets a linked program - */ - void setProgram(Program *program); - /** - * Sets a texture into a GL texture slot then set to the specified uniform - */ - void setTexture(size_t hashName, Texture* texture, int slot); - /** - * Sets textures array into GL texture slots then set to the specified uniform - */ - void setTextureArray(size_t hashName, const std::vector& textures, const std::vector& slots); - - /** - * Sets a integer to the specified uniform - */ - void setUniformi(size_t hashName, int i1); - /** - * Sets two integers to the specified uniform - */ - void setUniformi(size_t hashName, int i1, int i2); - /** - * Sets three integers to the specified uniform - */ - void setUniformi(size_t hashName, int i1, int i2, int i3); - /** - * Sets four integers to the specified uniform - */ - void setUniformi(size_t hashName, int i1, int i2, int i3, int i4); - /** - * Sets a vector of integers to the specified uniform - */ - void setUniformiv(size_t hashName, size_t count, const int* value); - /** - * Sets a float to the specified uniform - */ - void setUniformf(size_t hashName, float f1); - /** - * Sets two floats to the specified uniform - */ - void setUniformf(size_t hashName, float f1, float f2); - /** - * Sets three floats to the specified uniform - */ - void setUniformf(size_t hashName, float f1, float f2, float f3); - /** - * Sets four floats to the specified uniform - */ - void setUniformf(size_t hashName, float f1, float f2, float f3, float f4); - /** - * Sets a vector of floats to the specified uniform - */ - void setUniformfv(size_t hashName, size_t count, const float* value); - /** - * Sets a Vec2 to the specified uniform - */ - void setUniformVec2(size_t hashName, const cocos2d::Vec2& value); - /** - * Sets a Vec3 to the specified uniform - */ - void setUniformVec3(size_t hashName, const cocos2d::Vec3& value); - /** - * Sets a Vec4 to the specified uniform - */ - void setUniformVec4(size_t hashName, const cocos2d::Vec4& value); - /** - * Sets a 2x2 matrix to the specified uniform - */ - void setUniformMat2(size_t hashName, float* value); - /** - * Sets a 3x3 matrix to the specified uniform - */ - void setUniformMat3(size_t hashName, float* value); - /** - * Sets a 4x4 matrix specified by float pointer to the given uniform - */ - void setUniformMat4(size_t hashName, float* value); - /** - * Sets a Mat4 object to the given uniform - */ - void setUniformMat4(size_t hashName, const cocos2d::Mat4& value); - /** - * Sets data specified by data pointer, type and bytes to the given uniform - */ - void setUniform(size_t hashName, const void* v, size_t bytes, UniformElementType elementType); - - /** - * Sets the primitive type for draw calls - */ - void setPrimitiveType(PrimitiveType type); - - /** - * Draw elements using the current gl states - */ - void draw(size_t base, GLsizei count); - - /** - * Resets the draw call counter to 0 - */ - void resetDrawCalls() { _drawCalls = 0; }; - /** - * Gets current draw call counts - */ - uint32_t getDrawCalls() const { return _drawCalls; }; - - inline const Capacity& getCapacity() const { return _caps; } - -private: - DeviceGraphics(); - ~DeviceGraphics(); - CC_DISALLOW_COPY_ASSIGN_AND_MOVE(DeviceGraphics); - - inline void initStates(); - inline void initCaps(); - void restoreTexture(uint32_t index); - void restoreIndexBuffer(); - - inline void commitBlendStates(); - inline void commitDepthStates(); - inline void commitStencilStates(); - inline void commitCullMode(); - inline void commitVertexBuffer(); - inline void commitTextures(); - - int _vx; - int _vy; - int _vw; - int _vh; - - int _sx; - int _sy; - int _sw; - int _sh; - - uint32_t _drawCalls = 0; - - int _defaultFbo; - - Capacity _caps; - char* _glExtensions; - - FrameBuffer *_frameBuffer; - std::vector _enabledAtrributes; - std::vector _newAttributes; - std::unordered_map _uniforms; - - State* _nextState; - State* _currentState; - - friend class IndexBuffer; - friend class Texture2D; -}; - -// end of gfx group -/// @} - -RENDERER_END diff --git a/native/cocos/renderer/gfx/FrameBuffer.cpp b/native/cocos/renderer/gfx/FrameBuffer.cpp deleted file mode 100644 index e29958f140..0000000000 --- a/native/cocos/renderer/gfx/FrameBuffer.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "FrameBuffer.h" -#include "RenderTarget.h" -#include "base/CCGLUtils.h" - -RENDERER_BEGIN - -FrameBuffer::FrameBuffer() -: _device(nullptr) -, _depthBuffer(nullptr) -, _stencilBuffer(nullptr) -, _depthStencilBuffer(nullptr) -{ - -} - -FrameBuffer::~FrameBuffer() -{ - destroy(); -} - -void FrameBuffer::destroy() -{ - for (auto colorBufffer : _colorBuffers) - RENDERER_SAFE_RELEASE(colorBufffer); - _colorBuffers.clear(); - - RENDERER_SAFE_RELEASE(_depthBuffer); - _depthBuffer = nullptr; - - RENDERER_SAFE_RELEASE(_stencilBuffer); - _stencilBuffer = nullptr; - - RENDERER_SAFE_RELEASE(_depthStencilBuffer); - _depthStencilBuffer = nullptr; - - if (_glID != 0) - { - glDeleteFramebuffers(1, &_glID); - _glID = 0; - } -} - -bool FrameBuffer::init(DeviceGraphics* device, uint16_t width, uint16_t height) -{ - _device = device; - _width = width; - _height = height; - - glGenFramebuffers(1, &_glID); - - return true; -} - -void FrameBuffer::setColorBuffer(RenderTarget* rt, int index) -{ - if (index >= _colorBuffers.size()) - _colorBuffers.resize(index + 1); - - RENDERER_SAFE_RETAIN(rt); - RENDERER_SAFE_RELEASE(_colorBuffers[index]); - _colorBuffers[index] = rt; -} - -void FrameBuffer::setColorBuffers(const std::vector& renderTargets) -{ - for (auto& colorBufffer : renderTargets) - RENDERER_SAFE_RETAIN(colorBufffer); - for (auto& colorBufffer : _colorBuffers) - RENDERER_SAFE_RELEASE(colorBufffer); - _colorBuffers = renderTargets; -} - -void FrameBuffer::setDepthBuffer(RenderTarget* rt) -{ - RENDERER_SAFE_RETAIN(rt); - RENDERER_SAFE_RELEASE(_depthBuffer); - _depthBuffer = rt; -} - -void FrameBuffer::setStencilBuffer(RenderTarget* rt) -{ - RENDERER_SAFE_RETAIN(rt); - RENDERER_SAFE_RELEASE(_stencilBuffer); - _stencilBuffer = rt; -} - -void FrameBuffer::setDepthStencilBuffer(RenderTarget* rt) -{ - RENDERER_SAFE_RETAIN(rt); - RENDERER_SAFE_RELEASE(_depthStencilBuffer); - _depthStencilBuffer = rt; -} - -const std::vector& FrameBuffer::getColorBuffers() const -{ - return _colorBuffers; -} - -const RenderTarget* FrameBuffer::getDepthBuffer() const -{ - return _depthBuffer; -} - -const RenderTarget* FrameBuffer::getStencilBuffer() const -{ - return _stencilBuffer; -} - -const RenderTarget* FrameBuffer::getDepthStencilBuffer() const -{ - return _depthStencilBuffer; -} - -RENDERER_END - - diff --git a/native/cocos/renderer/gfx/FrameBuffer.h b/native/cocos/renderer/gfx/FrameBuffer.h deleted file mode 100644 index 4dd771cdfa..0000000000 --- a/native/cocos/renderer/gfx/FrameBuffer.h +++ /dev/null @@ -1,128 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#pragma once - -#include -#include "../Macro.h" -#include "../Types.h" -#include "GraphicsHandle.h" - -RENDERER_BEGIN - -class DeviceGraphics; -class RenderTarget; - -/** - * @addtogroup gfx - * @{ - */ - -/** - * The FrameBuffer class can store the render results of DeviceGraphics. - * It contains color buffers, depth buffers and stencil buffers, - * they are destinations for drawing, clearing and writing operations during the render process. - */ -class FrameBuffer final : public GraphicsHandle -{ -public: - /** - * Create a FrameBuffer object with device and size - */ - RENDERER_DEFINE_CREATE_METHOD_3(FrameBuffer, init, DeviceGraphics*, uint16_t, uint16_t) - - FrameBuffer(); - /** - * Inits the frame buffer with device and size - */ - bool init(DeviceGraphics* device, uint16_t width, uint16_t height); - /** - * Destroys the GL buffers created by this frame buffer object - */ - void destroy(); - - /** - * Sets the color buffers as drawing and clearing destinations - */ - void setColorBuffers(const std::vector& renderTargets); - /** - * Sets a color buffer at specific index - */ - void setColorBuffer(RenderTarget* rt, int index); - /** - * Sets the depth buffer as depth writing destination - */ - void setDepthBuffer(RenderTarget* rt); - /** - * Sets the stencil buffer as stencil writing destination - */ - void setStencilBuffer(RenderTarget* rt); - /** - * Sets the depth and stencil buffer at the same time. - * If you want to set both with the same RenderTarget, you should use this instead of setting them separatly. - */ - void setDepthStencilBuffer(RenderTarget* rt); - - /** - * Sets the width of frame buffer - */ - inline int getWidth() const { return _width; } - /** - * Sets the width of frame buffer - */ - inline int getHeight() const { return _height; } - - /** - * Gets the color buffers - */ - const std::vector& getColorBuffers() const; - /** - * Gets the depth buffer - */ - const RenderTarget* getDepthBuffer() const; - /** - * Gets the stencil buffer - */ - const RenderTarget* getStencilBuffer() const; - /** - * Gets the depth and stencil buffer if they share the same one. - */ - const RenderTarget* getDepthStencilBuffer() const; - -private: - virtual ~FrameBuffer(); - - DeviceGraphics* _device; - std::vector _colorBuffers; - RenderTarget* _depthBuffer; - RenderTarget* _stencilBuffer; - RenderTarget* _depthStencilBuffer; - uint16_t _width; - uint16_t _height; -}; - -// end of gfx group -/// @} - -RENDERER_END diff --git a/native/cocos/renderer/gfx/GFX.cpp b/native/cocos/renderer/gfx/GFX.cpp deleted file mode 100644 index 2a3d8119e3..0000000000 --- a/native/cocos/renderer/gfx/GFX.cpp +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "GFX.h" diff --git a/native/cocos/renderer/gfx/GFX.h b/native/cocos/renderer/gfx/GFX.h deleted file mode 100644 index 8caae6cf37..0000000000 --- a/native/cocos/renderer/gfx/GFX.h +++ /dev/null @@ -1,35 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#pragma once - -#include "IndexBuffer.h" -#include "VertexBuffer.h" -#include "DeviceGraphics.h" -#include "FrameBuffer.h" -#include "State.h" -#include "RenderBuffer.h" -#include "RenderTarget.h" -#include "Texture2D.h" -#include "Program.h" diff --git a/native/cocos/renderer/gfx/GFXUtils.cpp b/native/cocos/renderer/gfx/GFXUtils.cpp deleted file mode 100644 index f511092226..0000000000 --- a/native/cocos/renderer/gfx/GFXUtils.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "GFXUtils.h" -#include "Macro.h" - -#include - -const char* glEnumName(GLenum _enum) -{ -#define GLENUM(_ty) case _ty: return #_ty - - switch (_enum) - { - GLENUM(GL_TEXTURE); - GLENUM(GL_RENDERBUFFER); - - GLENUM(GL_INVALID_ENUM); - GLENUM(GL_INVALID_FRAMEBUFFER_OPERATION); - GLENUM(GL_INVALID_VALUE); - GLENUM(GL_INVALID_OPERATION); - GLENUM(GL_OUT_OF_MEMORY); - - GLENUM(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT); - GLENUM(GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT); - // GLENUM(GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER); - // GLENUM(GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER); - GLENUM(GL_FRAMEBUFFER_UNSUPPORTED); - } - -#undef GLENUM - - RENDERER_LOGW("Unknown enum? %x", _enum); - return ""; -} - diff --git a/native/cocos/renderer/gfx/GFXUtils.h b/native/cocos/renderer/gfx/GFXUtils.h deleted file mode 100644 index c3ba547008..0000000000 --- a/native/cocos/renderer/gfx/GFXUtils.h +++ /dev/null @@ -1,30 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#pragma once - -#include "platform/CCGL.h" - -const char* glEnumName(GLenum _enum); - diff --git a/native/cocos/renderer/gfx/GraphicsHandle.cpp b/native/cocos/renderer/gfx/GraphicsHandle.cpp deleted file mode 100644 index bd4db097b3..0000000000 --- a/native/cocos/renderer/gfx/GraphicsHandle.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "GraphicsHandle.h" - -RENDERER_BEGIN - -GraphicsHandle::GraphicsHandle() -: _glID(0) -{ - -} - -GraphicsHandle::~GraphicsHandle() -{ - -} - -RENDERER_END diff --git a/native/cocos/renderer/gfx/GraphicsHandle.h b/native/cocos/renderer/gfx/GraphicsHandle.h deleted file mode 100644 index 3a9e5c43d0..0000000000 --- a/native/cocos/renderer/gfx/GraphicsHandle.h +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#pragma once - -#include "../Macro.h" -#include "../Types.h" - -#include "base/CCRef.h" - -RENDERER_BEGIN - -/** - * @addtogroup gfx - * @{ - */ - -/** - * Abstract class for GL graphic classes that uses a GL handle id. - * Such as Texture, FrameBuffer, IndexBuffer, VertexBuffer, Program. - */ -class GraphicsHandle : public Ref -{ -public: - GraphicsHandle(); - virtual ~GraphicsHandle(); - /** - * Gets the GL handle - */ - inline GLuint getHandle() const { return _glID; } - -protected: - GLuint _glID = 0; -}; - -// end of gfx group -/// @} - -RENDERER_END diff --git a/native/cocos/renderer/gfx/IndexBuffer.cpp b/native/cocos/renderer/gfx/IndexBuffer.cpp deleted file mode 100644 index 6e43109329..0000000000 --- a/native/cocos/renderer/gfx/IndexBuffer.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "IndexBuffer.h" -#include "DeviceGraphics.h" -#include "base/CCGLUtils.h" - -RENDERER_BEGIN - -IndexBuffer::IndexBuffer() -: _device(nullptr) -, _format(IndexFormat::UINT16) -, _usage(Usage::STATIC) -, _numIndices(0) -, _bytesPerIndex(0) -{ -} - -IndexBuffer::~IndexBuffer() -{ - destroy(); -} - -bool IndexBuffer::init(DeviceGraphics* device, IndexFormat format, Usage usage, const void* data, size_t dataByteLength, uint32_t numIndices) -{ - _device = device; - _format = format; - _usage = usage; - _numIndices = numIndices; - _bytesPerIndex = 0; - - // calculate bytes - if (format == IndexFormat::UINT8) - { - _bytesPerIndex = 1; - } - else if (format == IndexFormat::UINT16) - { - _bytesPerIndex = 2; - } - else if (format == IndexFormat::UINT32) - { - _bytesPerIndex = 4; - } - - _bytes = _bytesPerIndex * numIndices; - - // update - glGenBuffers(1, &_glID); - update(0, data, dataByteLength); - - // stats - //REFINE: device._stats.ib += _bytes; - - return true; -} - -void IndexBuffer::update(uint32_t offset, const void* data, size_t dataByteLength) -{ - if (_glID == 0) - { - RENDERER_LOGE("The buffer is destroyed"); - return; - } - - if (data && dataByteLength + offset > _bytes) - { - RENDERER_LOGE("Failed to update index buffer data, bytes exceed."); - return; - } - - GLenum glUsage = (GLenum)_usage; - ccBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _glID); - if (!data) - { - glBufferData(GL_ELEMENT_ARRAY_BUFFER, _bytes, nullptr, glUsage); - } - else - { - if (offset > 0) - { - glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, (GLintptr)offset, (GLsizeiptr)dataByteLength, (const GLvoid*)data); - } - else - { - glBufferData(GL_ELEMENT_ARRAY_BUFFER, (GLsizeiptr)dataByteLength, data, glUsage); - } - } - _device->restoreIndexBuffer(); -} - -void IndexBuffer::destroy() -{ - if (_glID == 0) - return; - - ccDeleteBuffers(1, &_glID); - //REFINE: _device._stats.ib -= _bytes; - _glID = 0; -} - -RENDERER_END diff --git a/native/cocos/renderer/gfx/IndexBuffer.h b/native/cocos/renderer/gfx/IndexBuffer.h deleted file mode 100644 index 78f3f96425..0000000000 --- a/native/cocos/renderer/gfx/IndexBuffer.h +++ /dev/null @@ -1,157 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#pragma once - -#include -#include "../Macro.h" -#include "../Types.h" -#include "GraphicsHandle.h" - -RENDERER_BEGIN - -/** - * @addtogroup gfx - * @{ - */ - -class DeviceGraphics; - -/** - * IndexBuffer manages the GL buffer for element indices. - * It creates, updates and destoies the GL buffer. - */ -class IndexBuffer final : public GraphicsHandle -{ -public: - /** - * Creates an IndexBuffer object - * @param[in] device DeviceGraphics pointer. - * @param[in] format Index element format. - * @param[in] usage The usage pattern of the index buffer. - * @param[in] data Data pointer, could be nullptr, then nothing is updated to the buffer. - * @param[in] dataByteLength Data's byte length. - * @param[in] numIndices Count of indices. - */ - RENDERER_DEFINE_CREATE_METHOD_6(IndexBuffer, init, DeviceGraphics*, IndexFormat, Usage, const void*, size_t, uint32_t) - - IndexBuffer(); - virtual ~IndexBuffer(); - - /** - * Initializes the index buffer with necessary options. - * @param[in] device DeviceGraphics pointer. - * @param[in] format Index element format. - * @param[in] usage The usage pattern of the index buffer. - * @param[in] data Data pointer, could be nullptr, then nothing is updated to the buffer. - * @param[in] dataByteLength Data's byte length. - * @param[in] numIndices Count of indices. - */ - bool init(DeviceGraphics* device, IndexFormat format, Usage usage, const void* data, size_t dataByteLength, uint32_t numIndices); - /** - * Update data to the GL index buffer - * @param[in] offset Destination offset for filling buffer data. - * @param[in] data Data to be updated. - * @param[in] dataByteLength Data byte length to be updated. - */ - void update(uint32_t offset, const void* data, size_t dataByteLength); - - /** - * Gets the count of indices. - */ - inline uint32_t getCount() const { return _numIndices; } - /** - * Sets the count of indices. - */ - inline void setCount(uint32_t numIndices) { _numIndices = numIndices; } - - /** - * Gets the format of indices. - */ - inline IndexFormat getFormat() const { return _format; } - /** - * Sets the format of indices. - */ - inline void setFormat(IndexFormat format) { _format = format; } - - /** - * Gets bytes occupied by each index. - */ - inline uint32_t getBytesPerIndex() const { return _bytesPerIndex; } - /** - * Sets bytes occupied by each index. - */ - inline void setBytesPerIndex(uint32_t bytesPerIndex) {_bytesPerIndex = bytesPerIndex; } - - /** - * Gets usage pattern of the index buffer - */ - inline Usage getUsage() const { return _usage; } - /** - * Sets usage pattern of the index buffer - */ - inline void setUsage(Usage usage) { _usage = usage; } - - /** - * Gets byte size of the index buffer - */ - inline uint32_t getBytes() const { return _bytes; } - /** - * Sets byte size of the index buffer - */ - inline void setBytes(uint32_t bytes) { _bytes = bytes; } - - using FetchDataCallback = std::function; - void setFetchDataCallback(const FetchDataCallback& cb) { _fetchDataCallback = cb; } - uint8_t* invokeFetchDataCallback(size_t* bytes) { - if (_fetchDataCallback == nullptr) - { - *bytes = 0; - return nullptr; - } - return _fetchDataCallback(bytes); - } - - /** - * Destroies the index buffer - */ - void destroy(); - -private: - DeviceGraphics* _device; - IndexFormat _format; - Usage _usage; - uint32_t _numIndices; - uint32_t _bytesPerIndex; - uint32_t _bytes; - - FetchDataCallback _fetchDataCallback; - - CC_DISALLOW_COPY_ASSIGN_AND_MOVE(IndexBuffer) -}; - -// end of gfx group -/// @} - -RENDERER_END diff --git a/native/cocos/renderer/gfx/Program.cpp b/native/cocos/renderer/gfx/Program.cpp deleted file mode 100644 index 19f469c63e..0000000000 --- a/native/cocos/renderer/gfx/Program.cpp +++ /dev/null @@ -1,395 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "Program.h" -#include "GFXUtils.h" - -#include -#include -#include - -namespace { - - uint32_t _genID = 0; - - std::string logForOpenGLShader(GLuint shader) - { - GLint logLength = 0; - - GL_CHECK(glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &logLength)); - if (logLength < 1) - return ""; - - char *logBytes = (char*)malloc(sizeof(char) * logLength); - GL_CHECK(glGetShaderInfoLog(shader, logLength, nullptr, logBytes)); - std::string ret(logBytes); - - free(logBytes); - return ret; - } - - std::string logForOpenGLProgram(GLuint program) - { - GLint logLength = 0; - - GL_CHECK(glGetProgramiv(program, GL_INFO_LOG_LENGTH, &logLength)); - if (logLength < 1) - return ""; - - char *logBytes = (char*)malloc(sizeof(char) * logLength); - GL_CHECK(glGetProgramInfoLog(program, logLength, nullptr, logBytes)); - std::string ret(logBytes); - - free(logBytes); - return ret; - } - - bool _createShader(GLenum type, const std::string& src, GLuint* outShader) - { - assert(outShader != nullptr); - GLuint shader = glCreateShader(type); - const GLchar* sources[] = { src.c_str() }; - GL_CHECK(glShaderSource(shader, 1, sources, nullptr)); - GL_CHECK(glCompileShader(shader)); - - GLint status; - GL_CHECK(glGetShaderiv(shader, GL_COMPILE_STATUS, &status)); - - if (!status) - { - GLsizei length; - GL_CHECK(glGetShaderiv(shader, GL_SHADER_SOURCE_LENGTH, &length)); - GLchar* src = (GLchar *)malloc(sizeof(GLchar) * length); - - GL_CHECK(glGetShaderSource(shader, length, nullptr, src)); - RENDERER_LOGE("ERROR: Failed to compile shader:\n%s", src); - - std::string shaderLog = logForOpenGLShader(shader); - RENDERER_LOGE("%s", shaderLog.c_str()); - - free(src); - - *outShader = 0; - return false; - } - - *outShader = shader; - return true; - } - -#define DEF_TO_INT(pointer) (*(int*)(pointer)) -#define DEF_TO_FLOAT(pointer) (*(float*)(pointer)) - - void setUniform1i(GLint location, GLsizei count , const void* value, cocos2d::renderer::UniformElementType elementType) - { - assert(count == 1); - if (elementType == cocos2d::renderer::UniformElementType::INT) - { - glUniform1i(location, DEF_TO_INT(value)); - } - else - { - float floatVal = *((float*)value); - GLint intVal = (GLint)floatVal; - glUniform1i(location, intVal); - } - } - - void setUniform1iv(GLint location, GLsizei count , const void* value, cocos2d::renderer::UniformElementType elementType) - { - glUniform1iv(location, count, (const GLint*)value); - } - - void setUniform2iv(GLint location, GLsizei count , const void* value, cocos2d::renderer::UniformElementType elementType) - { - glUniform2iv(location, count, (const GLint*)value); - } - - void setUniform3iv(GLint location, GLsizei count , const void* value, cocos2d::renderer::UniformElementType elementType) - { - glUniform3iv(location, count, (const GLint*)value); - } - - void setUniform4iv(GLint location, GLsizei count , const void* value, cocos2d::renderer::UniformElementType elementType) - { - glUniform4iv(location, count, (const GLint*)value); - } - - void setUniform1f(GLint location, GLsizei count , const void* value, cocos2d::renderer::UniformElementType elementType) - { - assert(count == 1); - glUniform1f(location, DEF_TO_FLOAT(value)); - } - - void setUniform1fv(GLint location, GLsizei count , const void* value, cocos2d::renderer::UniformElementType elementType) - { - glUniform1fv(location, count, (const GLfloat*)value); - } - - void setUniform2fv(GLint location, GLsizei count , const void* value, cocos2d::renderer::UniformElementType elementType) - { - glUniform2fv(location, count, (const GLfloat*)value); - } - - void setUniform3fv(GLint location, GLsizei count , const void* value, cocos2d::renderer::UniformElementType elementType) - { - glUniform3fv(location, count, (const GLfloat*)value); - } - - void setUniform4fv(GLint location, GLsizei count , const void* value, cocos2d::renderer::UniformElementType elementType) - { - glUniform4fv(location, count, (const GLfloat*)value); - } - - void setUniformMatrix2fv(GLint location, GLsizei count, const void *value, cocos2d::renderer::UniformElementType elementType) - { - glUniformMatrix2fv(location, count, GL_FALSE, (const GLfloat*)value); - } - - void setUniformMatrix3fv(GLint location, GLsizei count, const void *value, cocos2d::renderer::UniformElementType elementType) - { - glUniformMatrix3fv(location, count, GL_FALSE, (const GLfloat*)value); - } - - void setUniformMatrix4fv(GLint location, GLsizei count, const void *value, cocos2d::renderer::UniformElementType elementType) - { - glUniformMatrix4fv(location, count, GL_FALSE, (const GLfloat*)value); - } - - /** - * _type2uniformCommit - */ - std::unordered_map _type2uniformCommit = { - { GL_INT, setUniform1i }, - { GL_FLOAT, setUniform1f }, - { GL_FLOAT_VEC2, setUniform2fv }, - { GL_FLOAT_VEC3, setUniform3fv }, - { GL_FLOAT_VEC4, setUniform4fv }, - { GL_INT_VEC2, setUniform2iv }, - { GL_INT_VEC3, setUniform3iv }, - { GL_INT_VEC4, setUniform4iv }, - { GL_BOOL, setUniform1i }, - { GL_BOOL_VEC2, setUniform2iv }, - { GL_BOOL_VEC3, setUniform3iv }, - { GL_BOOL_VEC4, setUniform4iv }, - { GL_FLOAT_MAT2, setUniformMatrix2fv }, - { GL_FLOAT_MAT3, setUniformMatrix3fv }, - { GL_FLOAT_MAT4, setUniformMatrix4fv }, - { GL_SAMPLER_2D, setUniform1i }, - { GL_SAMPLER_CUBE, setUniform1i } - }; - - /** - * _type2uniformArrayCommit - */ - std::unordered_map _type2uniformArrayCommit = { - { GL_INT, setUniform1iv }, - { GL_FLOAT, setUniform1fv }, - { GL_FLOAT_VEC2, setUniform2fv }, - { GL_FLOAT_VEC3, setUniform3fv }, - { GL_FLOAT_VEC4, setUniform4fv }, - { GL_INT_VEC2, setUniform2iv }, - { GL_INT_VEC3, setUniform3iv }, - { GL_INT_VEC4, setUniform4iv }, - { GL_BOOL, setUniform1iv }, - { GL_BOOL_VEC2, setUniform2iv }, - { GL_BOOL_VEC3, setUniform3iv }, - { GL_BOOL_VEC4, setUniform4iv }, - { GL_FLOAT_MAT2, setUniformMatrix2fv }, - { GL_FLOAT_MAT3, setUniformMatrix3fv }, - { GL_FLOAT_MAT4, setUniformMatrix4fv }, - { GL_SAMPLER_2D, setUniform1iv }, - { GL_SAMPLER_CUBE, setUniform1iv } - }; -} // namespace { - -RENDERER_BEGIN - -void Program::Uniform::setUniform(const void* value, UniformElementType elementType) const -{ - GLsizei count = size == -1 ? 1 : size; - _callback(location, count, value, elementType); -} - -Program::Program() -: _device(nullptr) -, _id(0) -, _linked(false) -{ - -} - -Program::~Program() -{ - GL_CHECK(glDeleteProgram(_glID)); -} - -bool Program::init(DeviceGraphics* device, const char* vertSource, const char* fragSource) -{ - assert(device); - assert(vertSource); - assert(fragSource); - - _device = device; - _vertSource = vertSource; - _fragSource = fragSource; - _id = _genID++; - _linked = false; - return true; -} - -void Program::link() -{ - if (_linked) { - return; - } - - GLuint vertShader; - bool ok = _createShader(GL_VERTEX_SHADER, _vertSource, &vertShader); - if (!ok) - return; - - GLuint fragShader; - ok = _createShader(GL_FRAGMENT_SHADER, _fragSource, &fragShader); - if (!ok) - { - glDeleteShader(vertShader); - return; - } - - GLuint program = glCreateProgram(); - GL_CHECK(glAttachShader(program, vertShader)); - GL_CHECK(glAttachShader(program, fragShader)); - GL_CHECK(glLinkProgram(program)); - - GLint status = GL_TRUE; - GL_CHECK(glGetProgramiv(program, GL_LINK_STATUS, &status)); - - if (status == GL_FALSE) - { - RENDERER_LOGE("ERROR: Failed to link program: %u", program); - std::string programLog = logForOpenGLProgram(program); - RENDERER_LOGE("%s", programLog.c_str()); - glDeleteShader(vertShader); - glDeleteShader(fragShader); - glDeleteProgram(program); - return; - } - - glDeleteShader(vertShader); - glDeleteShader(fragShader); - - _glID = program; - - // parse attribute - GLint numAttributes; - glGetProgramiv(program, GL_ACTIVE_ATTRIBUTES, &numAttributes); - - if (numAttributes > 0) - { - GLint length; - glGetProgramiv(program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &length); - - if (length > 0) - { - GLchar* attribName = (GLchar*) malloc(length + 1); - Attribute attribute; - for (GLint i = 0; i < numAttributes; ++i) { - // Query attribute info. - glGetActiveAttrib(program, i, length, nullptr, &attribute.size, &attribute.type, attribName); - attribName[length] = '\0'; - attribute.name = attribName; - // Query the pre-assigned attribute location - attribute.location = glGetAttribLocation(program, attribName); - - _attributes.push_back(std::move(attribute)); - } - free(attribName); - } - } - - // Query and store uniforms from the program. - GLint activeUniforms; - glGetProgramiv(program, GL_ACTIVE_UNIFORMS, &activeUniforms); - if (activeUniforms > 0) - { - GLint length; - glGetProgramiv(program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &length); - if (length > 0) - { - GLchar* uniformName = (GLchar*) malloc(length + 1); - - Uniform uniform; - for (int i = 0; i < activeUniforms; ++i) - { - // Query uniform info. - GL_CHECK(glGetActiveUniform(program, i, length, nullptr, &uniform.size, &uniform.type, uniformName)); - uniformName[length] = '\0'; - bool isArray = false; - // remove possible array '[]' from uniform name - if (length > 3) - { - char* c = strrchr(uniformName, '['); - if (c) - { - *c = '\0'; - isArray = true; - } - } - - uniform.name = uniformName; - uniform.hashName = std::hash{}(uniformName); - GL_CHECK(uniform.location = glGetUniformLocation(program, uniformName)); - - GLenum err = glGetError(); - if (err != GL_NO_ERROR) - { - RENDERER_LOGE("error: 0x%x uniformName: %s", (int)err, uniformName); - } - assert(err == GL_NO_ERROR); - - if (!isArray) - { - uniform.size = -1; - auto iter = _type2uniformCommit.find(uniform.type); - assert(iter != _type2uniformCommit.end()); - uniform._callback = iter->second; - } - else - { - auto iter = _type2uniformArrayCommit.find(uniform.type); - assert(iter != _type2uniformArrayCommit.end()); - uniform._callback = iter->second; - } - _uniforms.push_back(std::move(uniform)); - } - - free(uniformName); - } - } - - _linked = true; -} - -RENDERER_END diff --git a/native/cocos/renderer/gfx/Program.h b/native/cocos/renderer/gfx/Program.h deleted file mode 100644 index 6dedf3fcc3..0000000000 --- a/native/cocos/renderer/gfx/Program.h +++ /dev/null @@ -1,165 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#pragma once - -#include "../Macro.h" -#include "../Types.h" - -#include "GraphicsHandle.h" - -#include -#include - -RENDERER_BEGIN - -/** - * @addtogroup gfx - * @{ - */ - -class DeviceGraphics; - -/** - * Program class manages the internal GL shader program. - */ -class Program final: public GraphicsHandle -{ -public: - /** - * Describes vertex attribute informations used in the program - * @struct Attribute - */ - struct Attribute - { - /** - * Attribute name - */ - std::string name; - /** - * Number of components per attribute - */ - GLsizei size; - /** - * Attribute location - */ - GLuint location; - /** - * Attribute type - */ - GLenum type; - }; - - /** - * Describes uniform informations used in the program - * @struct Uniform - */ - struct Uniform - { - /** - * Uniform name - */ - std::string name; - - /** - * Uniform hash name - */ - size_t hashName; - /** - * The length of the array for uniforms declared as arrays, default value is 1 - */ - GLsizei size; - /** - * Uniform location - */ - GLint location; - /** - * Uniform type - */ - GLenum type; - /** - * Sets the uniform value - */ - void setUniform(const void* value, UniformElementType elementType) const; - /** - * Sets the callback which will be called when uniform updated - */ - using SetUniformCallback = void (*)(GLint, GLsizei, const void*, UniformElementType); // location, count, value, elementType - private: - SetUniformCallback _callback; - friend class Program; - }; - - /** - * Creates a Program with device and shader sources - */ - RENDERER_DEFINE_CREATE_METHOD_3(Program, init, DeviceGraphics*, const char*, const char*) - Program(); - virtual ~Program(); - - /** - * Initializes a Program with device and program sources - * @param[in] device DeviceGraphics pointer - * @param[in] vertSource Vertex shader program - * @param[in] fragSource Fragment shader program - */ - bool init(DeviceGraphics* device, const char* vertSource, const char* fragSource); - /** - * Gets the id of program - */ - inline uint32_t getID() const { return _id; } - /** - * Gets the attibutes used in the program - */ - inline const std::vector& getAttributes() const { return _attributes; } - /** - * Gets the uniforms used in the program - */ - inline const std::vector& getUniforms() const { return _uniforms; } - /** - * Indicates whether the program is successfully linked - */ - inline bool isLinked() const { return _linked; } - /** - * Link the program with its shader sources - */ - void link(); - - inline size_t getHash() const { return _hash; } - inline void setHash(size_t hash) { _hash = hash; } -private: - DeviceGraphics* _device; - std::vector _attributes; - std::vector _uniforms; - std::string _vertSource; - std::string _fragSource; - uint32_t _id; - bool _linked; - size_t _hash = 0; -}; - -// end of gfx group -/// @} - -RENDERER_END diff --git a/native/cocos/renderer/gfx/RenderBuffer.cpp b/native/cocos/renderer/gfx/RenderBuffer.cpp deleted file mode 100644 index 717ecdcb27..0000000000 --- a/native/cocos/renderer/gfx/RenderBuffer.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "RenderBuffer.h" -#include "GFXUtils.h" - -RENDERER_BEGIN - -RenderBuffer::RenderBuffer() -: _device(nullptr) -, _format(Format::RGBA4) -, _width(0) -, _height(0) -{ - -} - -RenderBuffer::~RenderBuffer() -{ - if (_glID == 0) - { - RENDERER_LOGE("The render-buffer (%p) is invalid!", this); - return; - } - - GL_CHECK(glDeleteRenderbuffers(1, &_glID)); -} - -bool RenderBuffer::init(DeviceGraphics* device, Format format, uint16_t width, uint16_t height) -{ - _device = device; - _format = format; - _width = width; - _height = height; - - GLint oldRenderBuffer; - glGetIntegerv(GL_RENDERBUFFER_BINDING, &oldRenderBuffer); - GL_CHECK(glGenRenderbuffers(1, &_glID)); - GL_CHECK(glBindRenderbuffer(GL_RENDERBUFFER, _glID)); - GL_CHECK(glRenderbufferStorage(GL_RENDERBUFFER, (GLenum)format, width, height)); - GL_CHECK(glBindRenderbuffer(GL_RENDERBUFFER, oldRenderBuffer)); - return true; -} - -RENDERER_END diff --git a/native/cocos/renderer/gfx/RenderBuffer.h b/native/cocos/renderer/gfx/RenderBuffer.h deleted file mode 100644 index 147397a4a4..0000000000 --- a/native/cocos/renderer/gfx/RenderBuffer.h +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#pragma once - -#include "../Macro.h" -#include "renderer/Types.h" - -#include "RenderTarget.h" - -RENDERER_BEGIN - -/** - * @addtogroup gfx - * @{ - */ - -class DeviceGraphics; - -/** - * RenderBuffer manages the GL render buffer. - * A render buffer stores data such as an image, or can be source or target of a rendering operation. - */ -class RenderBuffer final : public RenderTarget -{ -public: - /** - * RenderBuffer's pixel format - */ - enum class Format : uint32_t - { - RGBA4 = GL_RGBA4, - RGB5_A1 = GL_RGB5_A1, - D16 = GL_DEPTH_COMPONENT16, - S8 = GL_STENCIL_INDEX8, -// D24S8 = GL_DEPTH_STENCIL - }; - - /** - * Creates a RenderBuffer with device, pixel format and size - */ - RENDERER_DEFINE_CREATE_METHOD_4(RenderBuffer, init, DeviceGraphics*, Format, uint16_t, uint16_t) - - RenderBuffer(); - virtual ~RenderBuffer(); - - /** - * Initializes a RenderBuffer with device, pixel format and size - */ - bool init(DeviceGraphics* device, Format format, uint16_t width, uint16_t height); - -private: - DeviceGraphics* _device; - Format _format; - uint16_t _width; - uint16_t _height; -}; - -// end of gfx group -/// @} - -RENDERER_END diff --git a/native/cocos/renderer/gfx/RenderTarget.cpp b/native/cocos/renderer/gfx/RenderTarget.cpp deleted file mode 100644 index 027d8b8ecd..0000000000 --- a/native/cocos/renderer/gfx/RenderTarget.cpp +++ /dev/null @@ -1,25 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "RenderTarget.h" diff --git a/native/cocos/renderer/gfx/RenderTarget.h b/native/cocos/renderer/gfx/RenderTarget.h deleted file mode 100644 index 204529e67c..0000000000 --- a/native/cocos/renderer/gfx/RenderTarget.h +++ /dev/null @@ -1,53 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#pragma once - -#include "../Macro.h" -#include "../Types.h" - -#include "base/CCRef.h" - -#include "GraphicsHandle.h" - -RENDERER_BEGIN - -/** - * @addtogroup gfx - * @{ - */ - -/** - * Abstract class for all classes that could act as a render target - */ -class RenderTarget : public GraphicsHandle -{ -public: - virtual ~RenderTarget() {} -}; - -// end of gfx group -/// @} - -RENDERER_END diff --git a/native/cocos/renderer/gfx/State.cpp b/native/cocos/renderer/gfx/State.cpp deleted file mode 100644 index 8d59aba6c2..0000000000 --- a/native/cocos/renderer/gfx/State.cpp +++ /dev/null @@ -1,224 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "State.h" - -#include "VertexBuffer.h" -#include "IndexBuffer.h" -#include "Texture2D.h" -#include "Program.h" - -RENDERER_BEGIN - -State::State() -{ - _textureUnits.resize(10); - _vertexBuffers.resize(10); - _vertexBufferOffsets.resize(10); - - reset(); -} - -State::~State() -{ - for (auto vertexBuf : _vertexBuffers) - { - RENDERER_SAFE_RELEASE(vertexBuf); - } - - RENDERER_SAFE_RELEASE(_indexBuffer); - - for (auto texture : _textureUnits) - { - RENDERER_SAFE_RELEASE(texture); - } - - RENDERER_SAFE_RELEASE(_program); -} - -void State::reset() -{ - blend = false; - blendSeparation = false; - blendColor = 0xFFFFFFFF; - blendEq = BlendOp::ADD; - blendAlphaEq = BlendOp::ADD; - blendSrc = BlendFactor::ONE; - blendDst = BlendFactor::ZERO; - blendSrcAlpha = BlendFactor::ONE; - blendDstAlpha = BlendFactor::ZERO; - // depth - depthTest = false; - depthWrite = false; - depthFunc = DepthFunc::LESS; - // stencil - stencilTest = false; - stencilSeparation = false; - stencilFuncFront = StencilFunc::ALWAYS; - stencilRefFront = 0; - stencilMaskFront = 0xFF; - stencilFailOpFront = StencilOp::KEEP; - stencilZFailOpFront = StencilOp::KEEP; - stencilZPassOpFront = StencilOp::KEEP; - stencilWriteMaskFront = 0xFF; - stencilFuncBack = StencilFunc::ALWAYS; - stencilRefBack = 0; - stencilMaskBack = 0xFF; - stencilFailOpBack = StencilOp::KEEP; - stencilZFailOpBack = StencilOp::KEEP; - stencilZPassOpBack = StencilOp::KEEP; - stencilWriteMaskBack = 0xFF; - // cull-mode - cullMode = CullMode::BACK; - - // primitive-type - primitiveType = PrimitiveType::TRIANGLES; - - // bindings - maxStream = -1; - - - for (auto i = 0; i < _textureUnits.size(); i++) { - if (_textureUnits[i]) { - RENDERER_SAFE_RELEASE(_textureUnits[i]); - } - _textureUnits[i] = nullptr; - } - - for (auto i = 0; i < _vertexBuffers.size(); i++) { - if (_vertexBuffers[i]) { - RENDERER_SAFE_RELEASE(_vertexBuffers[i]); - } - _vertexBuffers[i] = nullptr; - } - - if (_indexBuffer) - { - RENDERER_SAFE_RELEASE(_indexBuffer); - } - _indexBuffer = nullptr; - - if (_program) - { - RENDERER_SAFE_RELEASE(_program); - } - _program = nullptr; -} - -void State::setVertexBuffer(size_t index, VertexBuffer* vertBuf) -{ - if (index >= _vertexBuffers.size()) - { - _vertexBuffers.resize(index + 1); - } - - VertexBuffer* oldBuf = _vertexBuffers[index]; - if (oldBuf != vertBuf) - { - RENDERER_SAFE_RELEASE(oldBuf); - _vertexBuffers[index] = vertBuf; - RENDERER_SAFE_RETAIN(vertBuf); - } -} - -VertexBuffer* State::getVertexBuffer(size_t index) const -{ - if (_vertexBuffers.empty()) - return nullptr; - assert(index < _vertexBuffers.size()); - return _vertexBuffers[index]; -} - -void State::setVertexBufferOffset(size_t index, int32_t offset) -{ - if (index >= _vertexBufferOffsets.size()) - { - _vertexBufferOffsets.resize(index + 1); - } - - _vertexBufferOffsets[index] = offset; -} - -int32_t State::getVertexBufferOffset(size_t index) const -{ - assert(index < _vertexBufferOffsets.size()); - return _vertexBufferOffsets[index]; -} - -void State::setIndexBuffer(IndexBuffer* indexBuf) -{ - if (_indexBuffer != indexBuf) - { - RENDERER_SAFE_RELEASE(_indexBuffer); - _indexBuffer = indexBuf; - RENDERER_SAFE_RETAIN(_indexBuffer); - } -} - -IndexBuffer* State::getIndexBuffer() const -{ - return _indexBuffer; -} - -void State::setTexture(size_t index, Texture* texture) -{ - if (index >= _textureUnits.size()) - { - _textureUnits.resize(index + 1); - } - - Texture* oldTexture = _textureUnits[index]; - if (oldTexture != texture) - { - RENDERER_SAFE_RELEASE(oldTexture); - _textureUnits[index] = texture; - RENDERER_SAFE_RETAIN(texture); - } -} - -Texture* State::getTexture(size_t index) const -{ - if (_textureUnits.empty()) - return nullptr; - assert(index < _textureUnits.size()); - return _textureUnits[index]; -} - -void State::setProgram(Program* program) -{ - assert(program != nullptr); - if (_program != program) - { - RENDERER_SAFE_RELEASE(_program); - _program = program; - RENDERER_SAFE_RETAIN(_program); - } -} - -Program* State::getProgram() const -{ - return _program; -} - -RENDERER_END diff --git a/native/cocos/renderer/gfx/State.h b/native/cocos/renderer/gfx/State.h deleted file mode 100644 index 75d8be3817..0000000000 --- a/native/cocos/renderer/gfx/State.h +++ /dev/null @@ -1,277 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#pragma once - -#include -#include -#include "../Macro.h" -#include "../Types.h" - -RENDERER_BEGIN - -class VertexBuffer; -class IndexBuffer; -class Program; -class Texture; - -/** - * @addtogroup gfx - * @{ - */ - -/** - * State class save the GL states used in one draw call. - * It will be used to compare between the previous states and the current states, so that we know which GL states should be updated. - * User shouldn't be using this Class directly. Instead, they should set the states in Pass of material system. - * @see `Pass` - */ -struct State final -{ - /** - * Constructor - */ - State(); - ~State(); - - /** - * Reset all states to default values - */ - void reset(); - - /** - @name Blend - @{ - */ - /** - * Indicates blending enabled or not - */ - bool blend; - /** - * Indicates the RGB blend equation and alpha blend equation settings are separate or not - */ - bool blendSeparation; - /** - * The blending color - */ - uint32_t blendColor; - /** - * The blending equation - */ - BlendOp blendEq; - /** - * The blending equation for alpha channel - */ - BlendOp blendAlphaEq; - /** - * The blending source factor - */ - BlendFactor blendSrc; - /** - * The blending destination factor - */ - BlendFactor blendDst; - /** - * The blending source factor for alpha - */ - BlendFactor blendSrcAlpha; - /** - * The blending destination factor for alpha - */ - BlendFactor blendDstAlpha; - /** - end of Blend - @} - */ - - /** - @name Depth - @{ - */ - /** - * Indicates depth test enabled or not - */ - bool depthTest; - /** - * Indicates depth writing enabled or not - */ - bool depthWrite; - /** - * The depth comparison function - */ - DepthFunc depthFunc; - /** - end of Depth - @} - */ - - /** - @name Stencil - @{ - */ - /** - * Indicates stencil test enabled or not - */ - bool stencilTest; - /** - * Indicates stencil test function for front and back is set separatly or not - */ - bool stencilSeparation; - /** - * The front face function for stencil test - */ - StencilFunc stencilFuncFront; - /** - * The front reference value for stencil test - */ - int32_t stencilRefFront; - /** - * The front mask value to AND with the reference value and store the result into stencil buffer when test is done - */ - uint32_t stencilMaskFront; - /** - * The function to use when the stencil test fails for front face - */ - StencilOp stencilFailOpFront; - /** - * The function to use when the stencil test passes but the depth test fails for front face - */ - StencilOp stencilZFailOpFront; - /** - * The function to use when both the stencil and the depth test pass for front face. - * Or when the stencil test passes and there is no depth buffer or depth testing is disabled. - */ - StencilOp stencilZPassOpFront; - /** - * The bit mask to enable or disable writing of individual bits in the front stencil planes - */ - uint32_t stencilWriteMaskFront; - /** - * The back face function for stencil test - */ - StencilFunc stencilFuncBack; - /** - * The back reference value for stencil test - */ - int32_t stencilRefBack; - /** - * The back mask value to AND with the reference value and store the result into stencil buffer when test is done - */ - uint32_t stencilMaskBack; - /** - * The function to use when the stencil test fails for back face - */ - StencilOp stencilFailOpBack; - /** - * The function to use when the stencil test passes but the depth test fails for back face - */ - StencilOp stencilZFailOpBack; - /** - * The function to use when both the stencil and the depth test pass for back face. - * Or when the stencil test passes and there is no depth buffer or depth testing is disabled. - */ - StencilOp stencilZPassOpBack; - /** - * The bit mask to enable or disable writing of individual bits in the back stencil planes - */ - uint32_t stencilWriteMaskBack; - /** - end of Stencil - @} - */ - - /** - * Specifies whether front-facing or back-facing polygons are candidates for culling. - */ - CullMode cullMode; - - /** - * Specifies the primitive type for rendering - */ - PrimitiveType primitiveType; - - int32_t maxStream; - - /** - * Specifies the vertex buffer - */ - void setVertexBuffer(size_t index, VertexBuffer* vertBuf); - /** - * Gets the vertex buffer - */ - VertexBuffer* getVertexBuffer(size_t index) const; - - /** - * Specifies the vertex buffer offset - */ - void setVertexBufferOffset(size_t index, int32_t offset); - /** - * Gets the vertex buffer offset - */ - int32_t getVertexBufferOffset(size_t index) const; - - /** - * Specifies the index buffer - */ - void setIndexBuffer(IndexBuffer* indexBuf); - /** - * Gets the index buffer - */ - IndexBuffer* getIndexBuffer() const; - - /** - * Sets the texture for specific texture unit - */ - void setTexture(size_t index, Texture* texture); - /** - * Gets the specific texture unit - */ - Texture* getTexture(size_t index) const; - - /** - * Gets all texture units - */ - const std::vector& getTextureUnits() const { return _textureUnits; } - - /** - * Sets the program used for rendering - */ - void setProgram(Program* program); - /** - * Gets the program used for rendering - */ - Program* getProgram() const; - -private: - std::vector _vertexBuffers; - std::vector _vertexBufferOffsets; - IndexBuffer *_indexBuffer = nullptr; - std::vector _textureUnits; - Program *_program = nullptr; -}; - -// end of gfx group -/// @} - -RENDERER_END diff --git a/native/cocos/renderer/gfx/Texture.cpp b/native/cocos/renderer/gfx/Texture.cpp deleted file mode 100644 index daf193f9fe..0000000000 --- a/native/cocos/renderer/gfx/Texture.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "Texture.h" -#include "platform/CCPlatformConfig.h" -#include "base/CCGLUtils.h" - -namespace { - - struct GLFilter - { - GLuint min; - GLuint mag; - GLuint mip; - }; - - GLFilter _filterGL[] = { - { GL_NEAREST, GL_NEAREST_MIPMAP_NEAREST, GL_NEAREST_MIPMAP_LINEAR }, - { GL_LINEAR, GL_LINEAR_MIPMAP_NEAREST, GL_LINEAR_MIPMAP_LINEAR }, - }; - -} // namespace { - -RENDERER_BEGIN - -Texture::Texture() -: _device(nullptr) -, _anisotropy(1) -, _target(0) -, _wrapS(WrapMode::REPEAT) -, _wrapT(WrapMode::REPEAT) -, _width(4) -, _height(4) -, _minFilter(Filter::LINEAR) -, _magFilter(Filter::LINEAR) -, _mipFilter(Filter::LINEAR) -, _hasMipmap(false) -, _compressed(false) -{ - -} - -Texture::~Texture() -{ - if (_glID == 0) - { - RENDERER_LOGE("Invalid texture: %p", this); - return; - } - - glDeleteTextures(1, &_glID); - - //REFINE: this._device._stats.tex -= this.bytes; -} - -bool Texture::init(DeviceGraphics* device) -{ - if (device == nullptr) - { - return false; - } - _device = device; - _width = 4; - _height = 4; - _hasMipmap = false; - _compressed = false; - - _anisotropy = 1; - _minFilter = Filter::LINEAR; - _magFilter = Filter::LINEAR; - _mipFilter = Filter::LINEAR; - _wrapS = WrapMode::REPEAT; - _wrapT = WrapMode::REPEAT; - // wrapR available in webgl2 - // _wrapR = WrapMode::REPEAT; - - _target = -1; - return true; -} - -GLenum Texture::glFilter(Filter filter, Filter mipFilter/* = TextureFilter::NONE*/) -{ - if (filter < Filter::NEAREST || filter > Filter::LINEAR) - { - RENDERER_LOGW("Unknown filter: %u", (uint32_t)filter); - return mipFilter == Filter::NONE ? GL_LINEAR : GL_LINEAR_MIPMAP_LINEAR; - } - - if (mipFilter < Filter::NONE || mipFilter > Filter::LINEAR) - { - RENDERER_LOGW("Unknown mipFilter: %u", (uint32_t)filter); - return mipFilter == Filter::NONE ? GL_LINEAR : GL_LINEAR_MIPMAP_LINEAR; - } - - const GLFilter& p = _filterGL[(uint8_t)filter]; - GLenum ret = p.min; - if (mipFilter == Filter::NEAREST) - ret = p.mag; - else if (mipFilter == Filter::LINEAR) - ret = p.mip; - return ret; -} - -RENDERER_END diff --git a/native/cocos/renderer/gfx/Texture.h b/native/cocos/renderer/gfx/Texture.h deleted file mode 100644 index 542d8bccc1..0000000000 --- a/native/cocos/renderer/gfx/Texture.h +++ /dev/null @@ -1,294 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#pragma once - -#include "../Macro.h" -#include "../Types.h" - -#include "GraphicsHandle.h" -#include "RenderTarget.h" -#include "base/CCData.h" - -#include - -RENDERER_BEGIN - -class DeviceGraphics; - -/** - * @addtogroup gfx - * @{ - */ - -/** - * The base texture class - */ -class Texture : public RenderTarget -{ -public: - /** - * @enum Filter - * Texture filter modes - */ - enum class Filter : int8_t - { - NONE = -1, - NEAREST = 0, - LINEAR = 1 - }; - - /** - * @enum Filter - * Texture wrap modes - */ - enum class WrapMode : uint16_t - { - REPEAT = GL_REPEAT, - CLAMP = GL_CLAMP_TO_EDGE, - MIRROR = GL_MIRRORED_REPEAT - }; - - /** - * @enum Format - * Texture formats - */ - enum class Format : uint8_t - { - BEGIN = 0, - // compress formats - RGB_DXT1 = 0, - RGBA_DXT1 = 1, - RGBA_DXT3 = 2, - RGBA_DXT5 = 3, - RGB_ETC1 = 4, - RGB_PVRTC_2BPPV1 = 5, - RGBA_PVRTC_2BPPV1 = 6, - RGB_PVRTC_4BPPV1 = 7, - RGBA_PVRTC_4BPPV1 = 8, - // - // normal formats - A8 = 9, - L8 = 10, - L8_A8 = 11, - R5_G6_B5 = 12, - R5_G5_B5_A1 = 13, - R4_G4_B4_A4 = 14, - RGB8 = 15, // each channel has 8 bits - RGBA8 = 16, // each channel has 8 bits - RGB16F = 17, // each channel has 16 bits - RGBA16F = 18, // each channel has 16 bits - RGB32F = 19, // each channel has 32 bits - RGBA32F = 20, // each channel has 32 bits - R32F = 21, - _111110F = 22, - SRGB = 23, - SRGBA = 24, - // - // depth formats - D16 = 25, - END = 25 - // - }; - - /** - * @struct Image - * Raw image data - */ - struct Image - { - uint8_t* data = nullptr; - size_t length = 0; - }; - - /** - * @struct Options - * Texture setting options including format, width, height, wrap mode, filter etc. - */ - struct Options - { - /** - * Image mipmaps - */ - std::vector images; - /** - * The maximum anisotropy for the texture - */ - int32_t anisotropy = 1; - /** - * The internal format specifying the color components in the texture - */ - GLenum glInternalFormat = GL_RGBA; - /** - * The pixel format of the texel data - */ - GLenum glFormat = GL_RGB; - /** - * The data type of the texel data - */ - GLenum glType = GL_UNSIGNED_BYTE; - /** - * The width of the texture - */ - uint16_t width = 4; - /** - * The height of the texture - */ - uint16_t height = 4; - uint8_t bpp = 0; - - /** - * The wrapping function for texture coordinate s - */ - WrapMode wrapS = WrapMode::CLAMP; - /** - * The wrapping function for texture coordinate t - */ - WrapMode wrapT = WrapMode::CLAMP; - /** - * The texture minification filter - */ - Filter minFilter = Filter::LINEAR; - /** - * The texture magnification filter - */ - Filter magFilter = Filter::LINEAR; - /** - * The texture filter for mipmaps - */ - Filter mipFilter = Filter::LINEAR; - - /** - * Specifies whether the texture have mipmaps - */ - bool hasMipmap = false; - /** - * Specifies whether the texture if flipped vertically - */ - bool flipY = false; - /** - * Specifies whether the texture have alpha premultiplied - */ - bool premultiplyAlpha = false; - /** - * Specifies whether the texture is compressed - */ - bool compressed = false; - }; - - /** - * @struct ImageOption - * The informations of Image which indicates the mipmap level, width, height, filpY and premultiplyAlpha - */ - struct ImageOption - { - Image image; - int32_t level = 0; - uint16_t width = 4; - uint16_t height = 4; - - bool flipY = false; - bool premultiplyAlpha = false; - }; - - /** - * @struct SubImageOption - * The informations of sub image which indicates the area to update, mipmap level, filpY and premultiplyAlpha - */ - struct SubImageOption - { - SubImageOption(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint8_t level, bool flipY, bool premultiplyAlpha) - : x(x) - , y(y) - , width(width) - , height(height) - , level(level) - , flipY(flipY) - , premultiplyAlpha(premultiplyAlpha) - {} - - SubImageOption() {} - - uint32_t imageDataLength = 0; - uint16_t x = 0; - uint16_t y = 0; - uint16_t width = 0; - uint16_t height = 0; - uint8_t* imageData = nullptr; - uint8_t level = 0; - bool flipY = false; - bool premultiplyAlpha = false; - }; - - /** - * Gets the target gl location - */ - inline GLuint getTarget() const { return _target; } - /** - * Gets the width of texture - */ - inline uint16_t getWidth() const { return _width; } - /** - * Gets the height of texture - */ - inline uint16_t getHeight() const { return _height; } - -protected: - - static GLenum glFilter(Filter filter, Filter mipFilter = Filter::NONE); - - static bool isPow2(int32_t v) { - return !(v & (v - 1)) && (!!v); - } - - Texture(); - virtual ~Texture(); - - bool init(DeviceGraphics* device); - - DeviceGraphics* _device; - GLint _anisotropy; - GLuint _target; - - WrapMode _wrapS; - WrapMode _wrapT; - uint16_t _width; - uint16_t _height; - uint8_t _bpp = 0; - - Filter _minFilter; - Filter _magFilter; - Filter _mipFilter; - GLenum _glInternalFormat; - GLenum _glFormat; - GLenum _glType; - - bool _hasMipmap; - bool _compressed; -}; - -// end of gfx group -/// @} - -RENDERER_END diff --git a/native/cocos/renderer/gfx/Texture2D.cpp b/native/cocos/renderer/gfx/Texture2D.cpp deleted file mode 100644 index 4baea32301..0000000000 --- a/native/cocos/renderer/gfx/Texture2D.cpp +++ /dev/null @@ -1,293 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "Texture2D.h" -#include "DeviceGraphics.h" -#include "GFXUtils.h" - -#include "base/CCGLUtils.h" - -RENDERER_BEGIN - -Texture2D::Texture2D() -{ -// RENDERER_LOGD("Construct Texture2D: %p", this); -} - -Texture2D::~Texture2D() -{ -// RENDERER_LOGD("Destruct Texture2D: %p", this); -} - -bool Texture2D::init(DeviceGraphics* device, Options& options) -{ - bool ok = Texture::init(device); - if (ok) - { - _target = GL_TEXTURE_2D; - GL_CHECK(glGenTextures(1, &_glID)); - - if (options.images.empty()) - options.images.push_back(Image()); - - update(options); - } - return ok; -} - -void Texture2D::update(const Options& options) -{ - bool genMipmap = _hasMipmap; - - _width = options.width; - _height = options.height; - _anisotropy = options.anisotropy; - _minFilter = options.minFilter; - _magFilter = options.magFilter; - _mipFilter = options.mipFilter; - _wrapS = options.wrapS; - _wrapT = options.wrapT; - _glFormat = options.glFormat; - _glInternalFormat = options.glInternalFormat; - _glType = options.glType; - _compressed = options.compressed; - _bpp = options.bpp; - - // check if generate mipmap - _hasMipmap = options.hasMipmap; - genMipmap = options.hasMipmap; - - if (options.images.size() > 1) - { - genMipmap = false; //REFINE: is it true here? - uint16_t maxLength = options.width > options.height ? options.width : options.height; - if (maxLength >> (options.images.size() - 1) != 1) - RENDERER_LOGE("texture-2d mipmap is invalid, should have a 1x1 mipmap."); - } - - // NOTE: get pot after _width, _height has been assigned. - bool pot = isPow2(_width) && isPow2(_height); - if (!pot) - genMipmap = false; - - GL_CHECK(glActiveTexture(GL_TEXTURE0)); - GL_CHECK(glBindTexture(GL_TEXTURE_2D, _glID)); - if (!options.images.empty()) - setMipmap(options.images, options.flipY, options.premultiplyAlpha); - - setTexInfo(); - - if (genMipmap) - { - GL_CHECK(glHint(GL_GENERATE_MIPMAP_HINT, GL_NICEST)); - GL_CHECK(glGenerateMipmap(GL_TEXTURE_2D)); - } - _device->restoreTexture(0); -} - -void Texture2D::updateSubImage(const SubImageOption& option) -{ - GL_CHECK(glActiveTexture(GL_TEXTURE0)); - GL_CHECK(glBindTexture(GL_TEXTURE_2D, _glID)); - setSubImage(option); - _device->restoreTexture(0); -} - -void Texture2D::updateImage(const ImageOption& option) -{ - GL_CHECK(glActiveTexture(GL_TEXTURE0)); - GL_CHECK(glBindTexture(GL_TEXTURE_2D, _glID)); - setImage(option); - _device->restoreTexture(0); -} - -// Private methods: - -void Texture2D::setSubImage(const SubImageOption& option) -{ - bool flipY = option.flipY; - bool premultiplyAlpha = option.premultiplyAlpha; - - //Set the row align only when mipmapsNum == 1 and the data is uncompressed - GLint aligment = 1; - if (!_hasMipmap && !_compressed && _bpp > 0) - { - unsigned int bytesPerRow = option.width * _bpp / 8; - - if (bytesPerRow % 8 == 0) - aligment = 8; - else if (bytesPerRow % 4 == 0) - aligment = 4; - else if (bytesPerRow % 2 == 0) - aligment = 2; - else - aligment = 1; - } - - GL_CHECK(ccPixelStorei(GL_UNPACK_ALIGNMENT, aligment)); - - GL_CHECK(ccPixelStorei(GL_UNPACK_FLIP_Y_WEBGL, flipY)); - GL_CHECK(ccPixelStorei(GL_UNPACK_PREMULTIPLY_ALPHA_WEBGL, premultiplyAlpha)); - - ccFlipYOrPremultiptyAlphaIfNeeded(_glFormat, option.width, option.height, (uint32_t)option.imageDataLength, option.imageData); - - if (_compressed) - { - glCompressedTexSubImage2D(GL_TEXTURE_2D, - option.level, - option.x, - option.y, - option.width, - option.height, - _glFormat, - option.imageDataLength, - option.imageData); - } - else - { - GL_CHECK(glTexSubImage2D(GL_TEXTURE_2D, - option.level, - option.x, - option.y, - option.width, - option.height, - _glFormat, - _glType, option.imageData)); - } -} - -void Texture2D::setImage(const ImageOption& option) -{ - const auto& img = option.image; - - bool flipY = option.flipY; - bool premultiplyAlpha = option.premultiplyAlpha; - - //Set the row align only when mipmapsNum == 1 and the data is uncompressed - GLint aligment = 1; - unsigned int bytesPerRow = option.width * _bpp / 8; - if (_hasMipmap && !_compressed && _bpp > 0) - { - if (bytesPerRow % 8 == 0) - aligment = 8; - else if (bytesPerRow % 4 == 0) - aligment = 4; - else if (bytesPerRow % 2 == 0) - aligment = 2; - else - aligment = 1; - } - - GL_CHECK(ccPixelStorei(GL_UNPACK_ALIGNMENT, aligment)); - GL_CHECK(ccPixelStorei(GL_UNPACK_FLIP_Y_WEBGL, flipY)); - GL_CHECK(ccPixelStorei(GL_UNPACK_PREMULTIPLY_ALPHA_WEBGL, premultiplyAlpha)); - - uint32_t pixelBytes = (uint32_t)img.length; - - switch(_glType) - { - case GL_FLOAT: - { - pixelBytes /= sizeof(float); - break; - } - } - - ccFlipYOrPremultiptyAlphaIfNeeded(_glFormat, option.width, option.height, pixelBytes, img.data); - - if (_compressed) - { - glCompressedTexImage2D(GL_TEXTURE_2D, - option.level, - _glInternalFormat, - option.width, - option.height, - 0, - (GLsizei)img.length, - img.data); - } - else - { - GL_CHECK(glTexImage2D(GL_TEXTURE_2D, - option.level, - _glInternalFormat, - option.width, - option.height, - 0, - _glFormat, - _glType, - img.data)); - } -} - -void Texture2D::setMipmap(const std::vector& images, bool isFlipY, bool isPremultiplyAlpha) -{ - ImageOption options; - options.width = _width; - options.height = _height; - options.flipY = isFlipY; - options.premultiplyAlpha = isPremultiplyAlpha; - options.level = 0; - - for (size_t i = 0, len = images.size(); i < len; ++i) - { - options.level = (GLint)i; - options.width = _width >> i; - options.height = _height >> i; - options.image = images[i]; - setImage(options); - } -} - -void Texture2D::setTexInfo() -{ - bool pot = isPow2(_width) && isPow2(_height); - - // WebGL1 doesn't support all wrap modes with NPOT textures - if (!pot && (_wrapS != WrapMode::CLAMP || _wrapT != WrapMode::CLAMP)) - { - RENDERER_LOGW("WebGL1 doesn\'t support all wrap modes with NPOT textures"); - _wrapS = WrapMode::CLAMP; - _wrapT = WrapMode::CLAMP; - } - - Filter mipFilter = _hasMipmap ? _mipFilter : Filter::NONE; - if (!pot && mipFilter != Filter::NONE) - { - RENDERER_LOGW("NPOT textures do not support mipmap filter"); - mipFilter = Filter::NONE; - } - - GL_CHECK(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, glFilter(_minFilter, mipFilter))); - GL_CHECK(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, glFilter(_magFilter, Filter::NONE))); - GL_CHECK(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, (GLint)_wrapS)); - GL_CHECK(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, (GLint)_wrapT)); - - //REFINE: let ext = this._device.ext('EXT_texture_filter_anisotropic'); -// if (ext) { -// GL_CHECK(glTexParameteri(GL_TEXTURE_2D, ext.TEXTURE_MAX_ANISOTROPY_EXT, this._anisotropy)); -// } -} - -RENDERER_END diff --git a/native/cocos/renderer/gfx/Texture2D.h b/native/cocos/renderer/gfx/Texture2D.h deleted file mode 100644 index de7084c636..0000000000 --- a/native/cocos/renderer/gfx/Texture2D.h +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#pragma once - -#include "../Macro.h" -#include "../Types.h" - -#include "Texture.h" - -RENDERER_BEGIN - -/** - * @addtogroup gfx - * @{ - */ - -/** - * The 2d texture class\n - * JS API: gfx.Texture2D - @code - let texture = new gfx.Texture2D(cc.renderer.device, { - images: [], - width: 128, - height: 128, - wrapS: renderEngine.gfx.WRAP_REPEAT, - wrapT: renderEngine.gfx.WRAP_REPEAT, - format: renderEngine.gfx.TEXTURE_FMT_RGB8, - mipmap: false, - }); - @endcode - */ -class Texture2D : public Texture -{ -public: - Texture2D(); - ~Texture2D(); - - /* - * Init the texture with device and options - * @see Texture::Options - */ - bool init(DeviceGraphics* device, Options& options); - /** - * Update the texture with new options - * @see Texture::Options - */ - void update(const Options& options); - /** - * Update a sub area of the texture with sub image option - * @see Texture::SubImageOption - */ - void updateSubImage(const SubImageOption& option); - /** - * Update the image of a given level mipmap specified in image option - * @see Texture::ImageOption - */ - void updateImage(const ImageOption& option); - -private: - void setSubImage(const SubImageOption& options); - void setImage(const ImageOption& options); - void setMipmap(const std::vector& images, bool isFlipY, bool isPremultiplyAlpha); - void setTexInfo(); - -}; - -// end of gfx group -/// @} - -RENDERER_END diff --git a/native/cocos/renderer/gfx/VertexBuffer.cpp b/native/cocos/renderer/gfx/VertexBuffer.cpp deleted file mode 100644 index e7f7055050..0000000000 --- a/native/cocos/renderer/gfx/VertexBuffer.cpp +++ /dev/null @@ -1,141 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "VertexBuffer.h" -#include "DeviceGraphics.h" -#include "base/CCGLUtils.h" - -RENDERER_BEGIN - -VertexBuffer::VertexBuffer() -: _device(nullptr) -, _usage(Usage::STATIC) -, _numVertices(0) -, _bytes(0) -{ - -} - -VertexBuffer::~VertexBuffer() -{ - destroy(); -} - -bool VertexBuffer::init(DeviceGraphics* device, VertexFormat* format, Usage usage, const void* data, size_t dataByteLength, uint32_t numVertices) -{ - _device = device; - setFormat(format); - _usage = usage; - _numVertices = numVertices; - - // calculate bytes - _bytes = _format->_bytes * numVertices; - - // update - glGenBuffers(1, &_glID); - update(0, data, dataByteLength); - - // stats - //REFINE: device._stats.ib += _bytes; - - return true; -} - -void VertexBuffer::setFormat(VertexFormat* format) -{ - if (_format == format) - return; - - CC_SAFE_RELEASE(_format); - _format = format; - CC_SAFE_RETAIN(_format); - -} - -void VertexBuffer::update(uint32_t offset, const void* data, size_t dataByteLength) -{ - if (_glID == 0) - { - RENDERER_LOGE("The buffer is destroyed"); - return; - } - - if (data && dataByteLength + offset > _bytes) { - RENDERER_LOGE("Failed to update vertex buffer data, bytes exceed."); - return; - } - - GLenum glUsage = (GLenum)_usage; - ccBindBuffer(GL_ARRAY_BUFFER, _glID); - if (!data) - { - glBufferData(GL_ARRAY_BUFFER, _bytes, nullptr, glUsage); - } - else - { - if (offset > 0) - { - glBufferSubData(GL_ARRAY_BUFFER, (GLintptr)offset, (GLsizeiptr)dataByteLength, (const GLvoid*)data); - } - else - { - glBufferData(GL_ARRAY_BUFFER, (GLsizeiptr)dataByteLength, data, glUsage); - } - } - ccBindBuffer(GL_ARRAY_BUFFER, 0); -} - -void VertexBuffer::destroy() -{ - if (_glID == 0) - return; - - CC_SAFE_RELEASE_NULL(_format); - - ccDeleteBuffers(1, &_glID); - //REFINE: _device._stats.ib -= _bytes; - - _glID = 0; -} - -#if GFX_DEBUG > 0 -static void testVertexBuffer() -{ - VertexFormat vertexFmt({ - { ATTRIB_NAME_POSITION, AttribType::FLOAT32, 2 } - }); - - DeviceGraphics* device = nullptr; - float vertex[] = { - -1, 0, 0 - -1, 1, 1 - }; - VertexBuffer* buffer = new VertexBuffer(); - buffer->init(device, vertexFmt, Usage::STATIC, vertex, sizeof(vertex), 3); - - buffer->release(); -} -#endif - -RENDERER_END diff --git a/native/cocos/renderer/gfx/VertexBuffer.h b/native/cocos/renderer/gfx/VertexBuffer.h deleted file mode 100644 index 77a50a4923..0000000000 --- a/native/cocos/renderer/gfx/VertexBuffer.h +++ /dev/null @@ -1,149 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#pragma once - -#include -#include "../Macro.h" -#include "../Types.h" -#include "VertexFormat.h" -#include "GraphicsHandle.h" - -RENDERER_BEGIN - -/** - * @addtogroup gfx - * @{ - */ - -class DeviceGraphics; - -/** - * VertexBuffer manages the GL vertex attributes buffer. - * It creates, updates and destoies the GL vertex buffer. - */ -class VertexBuffer final : public GraphicsHandle -{ -public: - /** - * Creates a vertex buffer object - * @param[in] device DeviceGraphics pointer - * @param[in] format Specifies the vertex attributes layout - * @param[in] usage The usage pattern - * @param[in] data Data pointer, could be nullptr, then nothing is updated to the buffer. - * @param[in] dataByteLength Data's byte length. - * @param[in] numVertices Count of vertices. - */ - RENDERER_DEFINE_CREATE_METHOD_6(VertexBuffer, init, DeviceGraphics*, VertexFormat*, Usage, const void*, size_t, uint32_t) - - VertexBuffer(); - virtual ~VertexBuffer(); - - /** - * Initializes a vertex buffer object - * @param[in] device DeviceGraphics pointer - * @param[in] format Specifies the vertex attributes layout - * @param[in] usage The usage pattern - * @param[in] data Data pointer, could be nullptr, then nothing is updated to the buffer. - * @param[in] dataByteLength Data's byte length. - * @param[in] numVertices Count of vertices. - */ - bool init(DeviceGraphics* device, VertexFormat* format, Usage usage, const void* data, size_t dataByteLength, uint32_t numVertices); - /** - * Update data to the GL vertex buffer - * @param[in] offset Destination offset for filling buffer data. - * @param[in] data Data to be updated. - * @param[in] dataByteLength Data byte length to be updated. - */ - void update(uint32_t offset, const void* data, size_t dataByteLength); - - /** - * Gets the count of vertices - */ - inline uint32_t getCount() const { return _numVertices; } - /** - * Sets the count of vertices - */ - inline void setCount(uint32_t numVertices) { _numVertices = numVertices; } - - /** - * Gets the attributes layout and format of vertices. - */ - inline const VertexFormat& getFormat() const { return *_format; } -// inline void setFormat(VertexFormat&& format) { _format = std::move(format); } - /** - * Sets the attributes layout and format of vertices. - */ - void setFormat(VertexFormat* format); - - /** - * Gets usage pattern of the vertex buffer - */ - inline Usage getUsage() const { return _usage; } - /** - * Sets usage pattern of the vertex buffer - */ - inline void setUsage(Usage usage) { _usage = usage; } - - /** - * Gets byte size of the vertex buffer - */ - inline uint32_t getBytes() const { return _bytes; } - /** - * Sets byte size of the vertex buffer - */ - inline void setBytes(uint32_t bytes) { _bytes = bytes; } - - using FetchDataCallback = std::function; - void setFetchDataCallback(const FetchDataCallback& cb) { _fetchDataCallback = cb; } - uint8_t* invokeFetchDataCallback(size_t* bytes) { - if (_fetchDataCallback == nullptr) - { - *bytes = 0; - return nullptr; - } - return _fetchDataCallback(bytes); - } - - /** - * Destroies the vertex buffer - */ - void destroy(); - -private: - DeviceGraphics* _device = nullptr; - VertexFormat* _format = nullptr; - Usage _usage; - uint32_t _numVertices; - uint32_t _bytes; - - FetchDataCallback _fetchDataCallback; - - CC_DISALLOW_COPY_ASSIGN_AND_MOVE(VertexBuffer) -}; - -// end of gfx group -/// @} - -RENDERER_END diff --git a/native/cocos/renderer/gfx/VertexFormat.cpp b/native/cocos/renderer/gfx/VertexFormat.cpp deleted file mode 100644 index a4c9d612f9..0000000000 --- a/native/cocos/renderer/gfx/VertexFormat.cpp +++ /dev/null @@ -1,164 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "VertexFormat.h" - -RENDERER_BEGIN - -static uint32_t attrTypeBytes(AttribType attrType) -{ - if (attrType == AttribType::INT8) { - return 1; - } else if (attrType == AttribType::UINT8) { - return 1; - } else if (attrType == AttribType::INT16) { - return 2; - } else if (attrType == AttribType::UINT16) { - return 2; - } else if (attrType == AttribType::INT32) { - return 4; - } else if (attrType == AttribType::UINT32) { - return 4; - } else if (attrType == AttribType::FLOAT32) { - return 4; - } - - RENDERER_LOGW("Unknown ATTR_TYPE: %u", (uint32_t)attrType); - return 0; -} - -VertexFormat* VertexFormat::XY_UV_Two_Color = new VertexFormat(std::vector({ - Info(ATTRIB_NAME_POSITION, AttribType::FLOAT32, 2), - Info(ATTRIB_NAME_UV0, AttribType::FLOAT32, 2), - Info(ATTRIB_NAME_COLOR, AttribType::UINT8, 4, true), - Info(ATTRIB_NAME_COLOR0, AttribType::UINT8, 4, true) -})); - -VertexFormat* VertexFormat::XY_UV_Color = new VertexFormat(std::vector({ - Info(ATTRIB_NAME_POSITION, AttribType::FLOAT32, 2), - Info(ATTRIB_NAME_UV0, AttribType::FLOAT32, 2), - Info(ATTRIB_NAME_COLOR, AttribType::UINT8, 4, true) -})); - -VertexFormat* VertexFormat::XY_Color = new VertexFormat(std::vector({ - Info(ATTRIB_NAME_POSITION, AttribType::FLOAT32, 2), - Info(ATTRIB_NAME_COLOR, AttribType::UINT8, 4, true) -})); - -VertexFormat::VertexFormat() -{ -} - -VertexFormat::VertexFormat(const std::vector& infos) -{ - _bytes = 0; -#if GFX_DEBUG > 0 - std::vector _elements; - std::vector& elements = _elements; -#else - std::vector elements; -#endif - - uint32_t offset = 0; - for (size_t i = 0, len = infos.size(); i < len; ++i) - { - const auto& info = infos[i]; - Element el; - el.name = info._name; - el.offset = offset; - el.stride = 0; - el.stream = -1; - el.type = info._type; - el.num = info._num; - el.normalize = info._normalize; - el.bytes = info._num * attrTypeBytes(info._type); - - _names.push_back(el.name); - _attr2el[el.name] = el; - elements.push_back(&_attr2el[el.name]); - - _bytes += el.bytes; - offset += el.bytes; - } - - for (size_t i = 0, len = elements.size(); i < len; ++i) - { - auto& el = elements[i]; - el->stride = _bytes; - } -} - -VertexFormat::VertexFormat(const VertexFormat& o) -{ - if (this != &o) - *this = o; -} - -VertexFormat::VertexFormat(VertexFormat&& o) -{ - if (this != &o) - *this = std::move(o); -} - -VertexFormat& VertexFormat::operator=(const VertexFormat& o) -{ - if (this != &o) - { - _names = o._names; - _attr2el = o._attr2el; -#if GFX_DEBUG > 0 - _elements = o._elements; - _bytes = o._bytes; -#endif - } - return *this; -} - -VertexFormat& VertexFormat::operator=(VertexFormat&& o) -{ - if (this != &o) - { - _names = std::move(o._names); - _attr2el = std::move(o._attr2el); -#if GFX_DEBUG > 0 - _elements = std::move(o._elements); - _bytes = o._bytes; - o._bytes = 0; -#endif - } - return *this; -} - -const VertexFormat::Element* VertexFormat::getElement(const std::string& attrName) const -{ - static const Element* INVALID_ELEMENT_VALUE = nullptr; - const auto& iter = _attr2el.find(attrName); - if (iter != _attr2el.end()) - { - return &iter->second; - } - return INVALID_ELEMENT_VALUE; -} - -RENDERER_END diff --git a/native/cocos/renderer/gfx/VertexFormat.h b/native/cocos/renderer/gfx/VertexFormat.h deleted file mode 100644 index e7a5754db7..0000000000 --- a/native/cocos/renderer/gfx/VertexFormat.h +++ /dev/null @@ -1,197 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#pragma once - -#include -#include -#include - -#include "base/CCRef.h" -#include "../Types.h" - -RENDERER_BEGIN - -/** - * @addtogroup gfx - * @{ - */ - -/** - * The vertex format defines the attributes and their data layout in the VertexBuffer\n - * JS API: gfx.VertexFormat - @code - let vertexFmt = new gfx.VertexFormat([ - { name: gfx.ATTR_POSITION, type: gfx.ATTR_TYPE_FLOAT32, num: 3 }, - { name: gfx.ATTR_UV0, type: gfx.ATTR_TYPE_FLOAT32, num: 2 }, - { name: gfx.ATTR_COLOR, type: gfx.ATTR_TYPE_FLOAT32, num: 4, normalize: true }, - ]); - @endcode - */ -class VertexFormat : public Ref -{ -public: - /* - * Informations used to define an attribute in vertex data layout. - * @struct Info - */ - struct Info - { - /* - * Constructor - * @param[in] name Attribute name - * @param[in] type Data type of each component - * @param[in] num Number of components per attribute - * @param[in] normalized Whether integer data values should be normalized into a certain range when being casted to a float - */ - Info(const std::string& name, AttribType type, uint32_t num, bool normalize = false) - : _name(name) - , _num(num) - , _type(type) - , _normalize(normalize) - { - } - std::string _name; - uint32_t _num; - AttribType _type; - bool _normalize; - }; - - static Info INFO_END; - - /* - * Element describes informations of an attribute - * @struct Info - */ - struct Element - { - Element() - : offset(0) - , stride(0) - , stream(-1) - , num(0) - , bytes(0) - , type(AttribType::INVALID) - , normalize(false) - {} - - inline bool isValid() const - { - return type != AttribType::INVALID; - } - - /* - * Name of the attribute - */ - std::string name; - /* - * Byte offset in each vertex data - */ - size_t offset; - /* - * Specifies the offset in bytes between the beginning of consecutive vertex attributes - */ - uint32_t stride; - int32_t stream; - /* - * Number of components per attribute unit - */ - uint32_t num; - /* - * Total bytes per attribute unit - */ - uint32_t bytes; - /* - * Data type of each component - */ - AttribType type; - /* - * Specifies whether integer data values should be normalized into a certain range when being casted to a float - */ - bool normalize; - }; - - /* - * Default constructor - */ - VertexFormat(); - /** - * Constructor with specific attribute informations - * @param[in] infos Array of all elements informations - */ - VertexFormat(const std::vector& infos); - /* - * Copy constructor - */ - VertexFormat(const VertexFormat& o); - /* - * Move constructor - */ - VertexFormat(VertexFormat&& o); - - VertexFormat& operator=(const VertexFormat& o); - VertexFormat& operator=(VertexFormat&& o); - - /** - * Gets all attribute names - */ - const std::vector& getAttributeNames() const { return _names; }; - /** - * Getes an attribute element by name - */ - const Element* getElement(const std::string& attrName) const; - - /** - * Gets total byte size of a vertex - */ - uint32_t getBytes() const { return _bytes; }; - - /* - * Builtin VertexFormat with 2d position, uv, color, color0 attributes - */ - static VertexFormat* XY_UV_Two_Color; - /* - * Builtin VertexFormat with 2d position, uv, color attributes - */ - static VertexFormat* XY_UV_Color; - /* - * Builtin VertexFormat with 2d position, color attributes - */ - static VertexFormat* XY_Color; - -private: - std::vector _names; - std::unordered_map _attr2el; -#if GFX_DEBUG > 0 - std::vector _elements; -#endif - uint32_t _bytes; - - friend class VertexBuffer; -}; - -// end of gfx group -/// @} - -RENDERER_END diff --git a/native/cocos/renderer/memop/RecyclePool.hpp b/native/cocos/renderer/memop/RecyclePool.hpp deleted file mode 100644 index 1e5e3130de..0000000000 --- a/native/cocos/renderer/memop/RecyclePool.hpp +++ /dev/null @@ -1,128 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#ifndef RecyclePool_hpp -#define RecyclePool_hpp - -#include -#include "../Macro.h" -#include "../base/CCVector.h" - -RENDERER_BEGIN -template -class RecyclePool -{ -public: - typedef std::function RecycleFunc; - - RecyclePool(RecycleFunc func, int size) - : _data() - { - _count = 0; - _func = func; - _data.resize(size); - - for (int i = 0; i < size; i++) - { - _data[i] = func(); - } - } - - ~RecyclePool() - { - for (size_t i = 0, len = _data.size(); i < len; i++) - { - delete _data[i]; - } - - _data.clear(); - } - - const T* getData(size_t index) const - { - if (index >= _count) - { - RENDERER_LOGW("Failed to get data %zu, index not found.", index); - return nullptr; - } - - return _data[index]; - } - - const size_t getLength() const - { - return _count; - } - - void reset() - { - _count = 0; - } - - T* add() - { - int size = (int)_data.size(); - if (_count >= size) - { - resize(size * 2); - } - - return _data[_count++]; - } - - void resize(int size) - { - if (size > _data.size()) - { - for (int i = (int)_data.size(); i < size; i++) - { - T* data = _func(); - _data.push_back(data); - } - } - } - - void remove(int index) - { - if (index >= _count) - { - return; - } - - int last = _count - 1; - T tmp = _data[index]; - _data[index] = _data[last]; - _data[last] = tmp; - _count -= 1; - } -private: - size_t _count = 0; - RecycleFunc _func; - std::vector _data; - - -}; -RENDERER_END - -#endif /* RecyclePool_hpp */ diff --git a/native/cocos/renderer/renderer/BaseRenderer.cpp b/native/cocos/renderer/renderer/BaseRenderer.cpp deleted file mode 100644 index 9691425219..0000000000 --- a/native/cocos/renderer/renderer/BaseRenderer.cpp +++ /dev/null @@ -1,387 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "BaseRenderer.h" -#include -#include "gfx/DeviceGraphics.h" -#include "gfx/Texture2D.h" -#include "ProgramLib.h" -#include "View.h" -#include "Scene.h" -#include "Effect.h" -#include "Light.h" -#include "InputAssembler.h" -#include "Pass.h" -#include "Camera.h" -#include "Model.h" -#include "math/MathUtil.h" -#include "Program.h" - -RENDERER_BEGIN - -const size_t BaseRenderer::cc_dirLightDirection = std::hash{}("cc_dirLightDirection"); -const size_t BaseRenderer::cc_dirLightColor = std::hash{}("cc_dirLightColor"); -const size_t BaseRenderer::cc_pointLightPositionAndRange = std::hash{}("cc_pointLightPositionAndRange"); -const size_t BaseRenderer::cc_pointLightColor = std::hash{}("cc_pointLightColor"); -const size_t BaseRenderer::cc_spotLightDirection = std::hash{}("cc_spotLightDirection"); -const size_t BaseRenderer::cc_spotLightPositionAndRange = std::hash{}("cc_spotLightPositionAndRange"); -const size_t BaseRenderer::cc_spotLightColor = std::hash{}("cc_spotLightColor"); -const size_t BaseRenderer::cc_shadow_map = std::hash{}("cc_shadow_map"); -const size_t BaseRenderer::cc_shadow_map_lightViewProjMatrix = std::hash{}("cc_shadow_map_lightViewProjMatrix"); -const size_t BaseRenderer::cc_shadow_map_info = std::hash{}("cc_shadow_map_info"); -const size_t BaseRenderer::cc_shadow_map_bias = std::hash{}("cc_shadow_map_bias"); -const size_t BaseRenderer::cc_shadow_lightViewProjMatrix = std::hash{}("cc_shadow_lightViewProjMatrix"); -const size_t BaseRenderer::cc_shadow_info = std::hash{}("cc_shadow_info"); -const size_t BaseRenderer::cc_matView = std::hash{}("cc_matView"); -const size_t BaseRenderer::cc_matWorld = std::hash{}("cc_matWorld"); -const size_t BaseRenderer::cc_matWorldIT = std::hash{}("cc_matWorldIT"); -const size_t BaseRenderer::cc_matpProj = std::hash{}("cc_matpProj"); -const size_t BaseRenderer::cc_matViewProj = std::hash{}("cc_matViewProj"); -const size_t BaseRenderer::cc_cameraPos = std::hash{}("cc_cameraPos"); - -BaseRenderer::BaseRenderer() -{ - _drawItems = new RecyclePool([]()mutable->DrawItem*{return new DrawItem();},100); - _stageInfos = new RecyclePool([]()mutable->StageInfo*{return new StageInfo();}, 10); - _views = new RecyclePool([]()mutable->View*{return new View();}, 8); - - _tmpMat4 = new cocos2d::Mat4(); -} - -BaseRenderer::~BaseRenderer() -{ - _device->release(); - _device = nullptr; - - delete _programLib; - _programLib = nullptr; - - RENDERER_SAFE_RELEASE(_defaultTexture); - _defaultTexture = nullptr; - - delete _drawItems; - _drawItems = nullptr; - - delete _stageInfos; - _stageInfos = nullptr; - - delete _views; - _views = nullptr; - - delete _tmpMat4; - _tmpMat4 = nullptr; -} - -bool BaseRenderer::init(DeviceGraphics* device, std::vector& programTemplates) -{ - _device = device; - _device->retain(); - _programLib = new (std::nothrow) ProgramLib(_device, programTemplates); - return true; -} - -bool BaseRenderer::init(DeviceGraphics* device, std::vector& programTemplates, Texture2D* defaultTexture) -{ - _device = device; - _device->retain(); - _defaultTexture = defaultTexture; - RENDERER_SAFE_RETAIN(_defaultTexture); - _programLib = new (std::nothrow) ProgramLib(_device, programTemplates); - return true; -} - -void BaseRenderer::registerStage(const std::string& name, const StageCallback& callback) -{ - _stage2fn.emplace(std::make_pair(name, callback)); -} - -// protected functions - -void BaseRenderer::render(const View& view, const Scene* scene) -{ - // setup framebuffer - _device->setFrameBuffer(view.frameBuffer); - - // setup viewport - _device->setViewport(view.rect.x, - view.rect.y, - view.rect.w, - view.rect.h); - - // setup clear - Color4F clearColor; - if (ClearFlag::COLOR & view.clearFlags) - clearColor = view.color; - _device->clear(view.clearFlags, &clearColor, view.depth, view.stencil); - - // get all draw items - _drawItems->reset(); - int modelMask = -1; - for (const auto& model : scene->getModels()) - { - modelMask = model->getCullingMask(); - if (view.cullingByID) - { - if ((modelMask & view.cullingMask) == 0) - continue; - } - else - { - if (-1 != modelMask) - continue; - } - - DrawItem* drawItem = _drawItems->add(); - model->extractDrawItem(*drawItem); - } - - // dispatch draw items to different stage - _stageInfos->reset(); - StageItem stageItem; - std::vector stageItems; - for (const auto& stage : view.stages) - { - for (size_t i = 0, len = _drawItems->getLength(); i < len; i++) - { - const DrawItem* item = _drawItems->getData(i); - auto tech = item->effect->getTechnique(stage); - if (tech) - { - stageItem.model = item->model; - stageItem.ia = item->ia; - stageItem.effect = item->effect; - stageItem.defines = item->defines; - stageItem.technique = tech; - stageItem.sortKey = -1; - stageItem.uniforms = item->uniforms; - stageItem.definesKeyHash = item->definesKeyHash; - - stageItems.push_back(stageItem); - } - } - StageInfo* stageInfo = _stageInfos->add(); - stageInfo->stage = stage; - stageInfo->items = &stageItems; - } - - // render stages - std::unordered_map::iterator foundIter; - for (size_t i = 0, len = _stageInfos->getLength(); i < len; i++) - { - const StageInfo* stageInfo = _stageInfos->getData(i); - foundIter = _stage2fn.find(stageInfo->stage); - if (_stage2fn.end() != foundIter) - { - auto& fn = foundIter->second; - fn(view, *stageInfo->items); - } - } -} - -void BaseRenderer::setProperty (Effect::Property& prop) -{ - Technique::Parameter::Type propType = prop.getType(); - auto& propName = prop.getName(); - auto propHashName = prop.getHashName(); - if (Effect::Property::Type::UNKNOWN == propType) - { - RENDERER_LOGW("Failed to set technique property, type unknown"); - return; - } - - if (nullptr == prop.getValue()) - { - prop = Effect::Property(propName, propType); - - if (Effect::Property::Type::TEXTURE_2D == propType) - { - prop.setTexture(_defaultTexture); - } - } - - if (nullptr == prop.getValue()) - { - RENDERER_LOGW("Failed to set technique property %s, value not found", propName.c_str()); - return; - } - - if (Effect::Property::Type::TEXTURE_2D == propType || - Effect::Property::Type::TEXTURE_CUBE == propType) - { - if (1 == prop.getCount()) - { - _device->setTexture(propHashName, - (renderer::Texture *)(prop.getValue()), - allocTextureUnit()); - } - else if (0 < prop.getCount()) - { - std::vector slots; - slots.reserve(10); - for (int i = 0; i < prop.getCount(); ++i) - { - slots.push_back(allocTextureUnit()); - } - - _device->setTextureArray(propHashName, - prop.getTextureArray(), - slots); - } - } - else - { - uint16_t bytes = prop.getBytes(); - if (Effect::Property::Type::INT == propType || - Effect::Property::Type::INT2 == propType || - Effect::Property::Type::INT4 == propType) - { - _device->setUniformiv(propHashName, bytes / sizeof(int), (const int*)prop.getValue()); - } - else - { - _device->setUniformfv(propHashName, bytes / sizeof(float), (const float*)prop.getValue()); - } - } -} - -void BaseRenderer::draw(const StageItem& item) -{ - const Mat4& worldMatrix = item.model->getWorldMatrix(); - _device->setUniformMat4(cc_matWorld, worldMatrix.m); - - _tmpMat4->set(worldMatrix); - _tmpMat4->inverse(); - _tmpMat4->transpose(); - _device->setUniformMat4(cc_matWorldIT, _tmpMat4->m); - - // set technique uniforms - for (int i = 0, len = (int)item.uniforms->size(); i < len; i++) - { - std::unordered_map* properties = (*item.uniforms)[i]; - for (auto& prop : *properties) { - setProperty(prop.second); - } - } - - auto ia = item.ia; - // for each pass - for (const auto& pass : item.technique->getPasses()) - { - // set vertex buffer - _device->setVertexBuffer(0, ia->getVertexBuffer()); - - // set index buffer - if (ia->_indexBuffer) - _device->setIndexBuffer(ia->_indexBuffer); - - // set primitive type - _device->setPrimitiveType(ia->_primitiveType); - - // get program - _program = _programLib->switchProgram(pass->getHashName(), item.definesKeyHash, *(item.defines)); - _device->setProgram(_program); - - // cull mode - _device->setCullMode(pass->_cullMode); - - // blend - if (pass->_blend) - { - _device->enableBlend(); - _device->setBlendFuncSeparate(pass->_blendSrc, - pass->_blendDst, - pass->_blendSrcAlpha, - pass->_blendDstAlpha); - _device->setBlendEquationSeparate(pass->_blendEq, pass->_blendAlphaEq); - _device->setBlendColor(pass->_blendColor); - } - - // depth test & write - if (pass->_depthTest) - { - _device->enableDepthTest(); - _device->setDepthFunc(pass->_depthFunc); - } - if (pass->_depthWrite) - _device->enableDepthWrite(); - - // setencil - if (pass->_stencilTest) - { - _device->enableStencilTest(); - - // front - _device->setStencilFuncFront(pass->_stencilFuncFront, - pass->_stencilRefFront, - pass->_stencilMaskFront); - _device->setStencilOpFront(pass->_stencilFailOpFront, - pass->_stencilZFailOpFront, - pass->_stencilZPassOpFront, - pass->_stencilWriteMaskFront); - - // back - _device->setStencilFuncBack(pass->_stencilFuncBack, - pass->_stencilRefBack, - pass->_stencilMaskBack); - _device->setStencilOpBack(pass->_stencilFailOpBack, - pass->_stencilZFailOpBack, - pass->_stencilZPassOpBack, - pass->_stencilWriteMaskBack); - } - - // draw pass - _device->draw(ia->_start, ia->getPrimitiveCount()); - - resetTextureUint(); - } -} - -// private functions - -void BaseRenderer::resetTextureUint() -{ - _usedTextureUnits = 0; -} - -int BaseRenderer::allocTextureUnit() -{ - int maxTexureUnits = _device->getCapacity().maxTextureUnits; - if (_usedTextureUnits >= maxTexureUnits) - RENDERER_LOGW("Trying to use %d texture uints while this GPU only supports %d", _usedTextureUnits, maxTexureUnits); - - return _usedTextureUnits++; -} - -void BaseRenderer::reset() -{ - _views->reset(); - _stageInfos->reset(); -} - -View* BaseRenderer::requestView() -{ - return _views->add(); -} - -RENDERER_END diff --git a/native/cocos/renderer/renderer/BaseRenderer.h b/native/cocos/renderer/renderer/BaseRenderer.h deleted file mode 100644 index 14fc851a8e..0000000000 --- a/native/cocos/renderer/renderer/BaseRenderer.h +++ /dev/null @@ -1,163 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#pragma once - -#include -#include -#include -#include -#include "../Macro.h" -#include "ProgramLib.h" -#include "Model.h" -#include "Effect.h" -#include "../memop/RecyclePool.hpp" - -RENDERER_BEGIN - -class DeviceGraphics; -class View; -class Scene; -class ProgramLib; -class Model; -class InputAssembler; -class Effect; -class Technique; -class Texture2D; - -/** - * @addtogroup renderer - * @{ - */ - -/** - * @brief Base renderer implements the basic render process. - */ -class BaseRenderer : public Ref -{ -public: - struct StageItem - { - Model* model = nullptr; - InputAssembler *ia = nullptr; - Effect* effect = nullptr; - Technique* technique = nullptr; - std::vector* defines = nullptr; - size_t definesKeyHash = 0; - std::vector*>* uniforms = nullptr; - int sortKey = -1; - }; - typedef std::function&)> StageCallback; - /** - * @brief The default constructor. - */ - BaseRenderer(); - - /** - * @brief Initializes the base renderer. - * @param[in] device DeviceGraphics pointer. - * @param[in] programTemplates All linked programs. - */ - bool init(DeviceGraphics* device, std::vector& programTemplates); - /** - * @brief Initializes the base renderer. - * @param[in] device DeviceGraphics pointer. - * @param[in] programTemplates All programs. - * @param[in] defaultTexture Default texture pointer. - */ - bool init(DeviceGraphics* device, std::vector& programTemplates, Texture2D* defaultTexture); - /** - * @brief The default destructor. - */ - virtual ~BaseRenderer(); - /** - * @brief Register a new render stage. - * @param[in] name Stage name. - * @param[in] call Stage handle callback. - */ - void registerStage(const std::string& name, const StageCallback& callback); - /** - * @brief Gets the program library pointer. - * @return Program library pointer. - */ - ProgramLib* getProgramLib() const { return _programLib; }; - -protected: - void render(const View&, const Scene* scene); - void draw(const StageItem& item); - void setProperty (Effect::Property& prop); - - struct StageInfo - { - std::vector* items; - std::string stage = ""; - }; - - void resetTextureUint(); - int allocTextureUnit(); - void reset(); - View* requestView(); - - int _usedTextureUnits = 0; - DeviceGraphics* _device = nullptr; - ProgramLib* _programLib = nullptr; - Program* _program = nullptr; - Texture2D* _defaultTexture = nullptr; - std::unordered_map _stage2fn; - RecyclePool* _drawItems = nullptr; - RecyclePool* _stageInfos = nullptr; - RecyclePool* _views = nullptr; - - cocos2d::Mat4* _tmpMat4 = nullptr; - - CC_DISALLOW_COPY_ASSIGN_AND_MOVE(BaseRenderer); - - ValueMap _defines; - size_t _definesHash = 0; - std::string _definesKey = ""; - - static const size_t cc_dirLightDirection; - static const size_t cc_dirLightColor; - static const size_t cc_pointLightPositionAndRange; - static const size_t cc_pointLightColor; - static const size_t cc_spotLightDirection; - static const size_t cc_spotLightPositionAndRange; - static const size_t cc_spotLightColor; - static const size_t cc_shadow_map; - static const size_t cc_shadow_map_lightViewProjMatrix; - static const size_t cc_shadow_map_info; - static const size_t cc_shadow_map_bias; - static const size_t cc_shadow_lightViewProjMatrix; - static const size_t cc_shadow_info; - static const size_t cc_matView; - static const size_t cc_matWorld; - static const size_t cc_matWorldIT; - static const size_t cc_matpProj; - static const size_t cc_matViewProj; - static const size_t cc_cameraPos; -}; - -// end of renderer group -/// @} -RENDERER_END diff --git a/native/cocos/renderer/renderer/Camera.cpp b/native/cocos/renderer/renderer/Camera.cpp deleted file mode 100644 index ef2d9d3c6a..0000000000 --- a/native/cocos/renderer/renderer/Camera.cpp +++ /dev/null @@ -1,230 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "Camera.h" -#include "gfx/FrameBuffer.h" -#include "math/MathUtil.h" - -RENDERER_BEGIN - -Camera::Camera() -{ -} - -Camera::~Camera() -{ - RENDERER_SAFE_RELEASE(_framebuffer); - RENDERER_SAFE_RELEASE(_node); -} - -void Camera::setFrameBuffer(FrameBuffer* framebuffer) -{ - RENDERER_SAFE_RELEASE(_framebuffer); - _framebuffer = framebuffer; - RENDERER_SAFE_RETAIN(_framebuffer); -} - -void Camera::setWorldMatrix(const Mat4& worldMatrix) -{ - Quaternion rotation; - worldMatrix.decompose(nullptr, &rotation, &_worldPos); - - Mat4::createTranslation(_worldPos, &_worldRTInv); - _worldRTInv.rotate(rotation); - _worldRTInv.inverse(); -} - -void Camera::setColor(float r, float g, float b, float a) -{ - _color.set(r, g, b, a); -} - -void Camera::setDepth(float depth) -{ - _depth = depth; -} - -void Camera::setStencil(int stencil) -{ - _stencil = stencil; -} - -void Camera::setClearFlags(uint8_t flags ) -{ - _clearFlags = flags; -} - -void Camera::setRect(float x, float y, float w, float h) -{ - _rect.set(x, y, w, h); -} - -void Camera::setStages(const std::vector& stages) -{ - _stages = stages; -} - - -void Camera::setNode(NodeProxy* node) -{ - if (_node != nullptr) - { - _node->release(); - } - _node = node; - if (_node != nullptr) - { - _node->retain(); - } -} - -void Camera::calcMatrices(const int width, const int height) -{ - // view matrix - //REFINE: - _node->getWorldRT(&_worldRTInv); - _matView.set(_worldRTInv.getInversed()); - - // projecton matrix - float aspect = (float)width / height; - if (ProjectionType::PERSPECTIVE == _projection) - Mat4::createPerspective(_fov / 3.1415926 * 180, aspect, _near, _far, &_matProj); - else - { - float x = _orthoHeight * aspect; - float y = _orthoHeight; - Mat4::createOrthographicOffCenter(-x, x, -y, y, _near, _far, &_matProj); - } - - // view projection - Mat4::multiply(_matProj, _matView, &_matViewProj); - _matInvViewProj.set(_matViewProj.getInversed()); -} - -void Camera::extractView(View& out, int width, int height) -{ - if (_framebuffer != nullptr) { - width = _framebuffer->getWidth(); - height = _framebuffer->getHeight(); - } - - // rect - out.rect.set(_rect.x * width, - _rect.y * height, - _rect.w * width, - _rect.h * height); - - // clear opts - out.color.set(_color.r, _color.g, _color.b, _color.a); - out.depth = _depth; - out.stencil = _stencil; - out.clearFlags = _clearFlags; - - calcMatrices(width, height); - out.matView.set(_matView); - out.matProj.set(_matProj); - out.matViewProj.set(_matViewProj); - out.matInvViewProj.set(_matInvViewProj); - - // stages & framebuffer - out.stages = _stages; - out.frameBuffer = _framebuffer; - - // culling mask - out.cullingMask = _cullingMask; - out.cullingByID = true; -} - -Vec3& Camera::screenToWorld(Vec3& out, const Vec3& screenPos, int width, int height) -{ - calcMatrices(width, height); - - float cx = _rect.x * width; - float cy = _rect.y * height; - float cw = _rect.w * width; - float ch = _rect.h * height; - - if (ProjectionType::PERSPECTIVE == _projection) - { - // Caculate screen pos in far clip plane. - out.set((screenPos.x - cx) * 2.0f / cw - 1.0f, - (screenPos.y - cy) * 2.0f / ch - 1.0f, - 1.0f); - - // Transform to world position. - out.transformMat4(out, _matInvViewProj); - - _node->getWorldPosition(&_worldPos); - _temp_v3.set(_worldPos); - out = _temp_v3.lerp(out, MathUtil::lerp(_near / _far, 1, screenPos.z)); - } - else - { - out.set((screenPos.x - cx) * 2.0f / cw - 1.0f, - (screenPos.y - cy) * 2.0f / ch - 1.0f, - screenPos.z * 2.0f - 1.0f); - - // Transform to world position. - out.transformMat4(out, _matInvViewProj); - } - - return out; -} - -Vec3& Camera::worldToScreen(Vec3& out, const Vec3& worldPos, int width, int height) -{ - calcMatrices(width, height); - - float cx = _rect.x * width; - float cy = _rect.y * height; - float cw = _rect.w * width; - float ch = _rect.h * height; - - out.transformMat4(worldPos, _matViewProj); - out.x = cx + (out.x + 1) * 0.5f * cw; - out.y = cy + (out.y + 1) * 0.5f * ch; - out.z = out.z * 0.5 + 0.5; - - return out; -} - -Mat4& Camera::worldMatrixToScreen(Mat4& out, const Mat4& worldMatrix, int width, int height) -{ - calcMatrices(width, height); - - Mat4::multiply(_matViewProj, worldMatrix, &out); - - float halfWidth = width / 2; - float halfHeight = height / 2; - - _temp_mat4.set(Mat4::IDENTITY); - _temp_mat4.translate(halfWidth, halfHeight, 0, &_temp_mat4); - _temp_mat4.scale(halfWidth, halfHeight, 1, &_temp_mat4); - - out.multiply(_temp_mat4); - - return out; -} - -RENDERER_END diff --git a/native/cocos/renderer/renderer/Camera.h b/native/cocos/renderer/renderer/Camera.h deleted file mode 100644 index 5a9d30461e..0000000000 --- a/native/cocos/renderer/renderer/Camera.h +++ /dev/null @@ -1,252 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#pragma once - -#include -#include -#include "base/ccTypes.h" -#include "math/Vec3.h" -#include "math/Mat4.h" -#include "../Macro.h" -#include "../Types.h" -#include "View.h" -#include "../scene/NodeProxy.hpp" - -#ifdef near -#undef near -#endif - -#ifdef far -#undef far -#endif - -RENDERER_BEGIN - -class FrameBuffer; - -/** - * @addtogroup renderer - * @{ - */ - -/** - * @brief Manage scene camera. - */ -class Camera : public Ref -{ -public: - /** - * @brief The default constructor. - */ - Camera(); - /** - * @brief The default destructor. - */ - ~Camera(); - - /** - * @brief Gets the camera type. - */ - ProjectionType getType() const { return _projection; } - /** - * @brief Sets the camera type. - */ - inline void setType(ProjectionType value) { _projection = value; } - /** - * @brief Gets the view height for orthographic camera. - */ - inline float getOrthoHeight() const { return _orthoHeight; } - /** - * @brief Sets the view height for orthographic camera. - */ - inline void setOrthoHeight(float value) { _orthoHeight = value; } - /** - * @brief Gets the field of view for the camera. - */ - inline float getFov() const { return _fov; } - /** - * @brief Sets the field of view for the camera. - */ - inline void setFov(float fov) { _fov = fov; } - /** - * @brief Gets the near clip plane. - */ - inline float getNear() const { return _near; } - /** - * @brief Sets the near clip plane. - */ - inline void setNear(float near) { _near = near; } - /** - * @brief Gets the far clip plane. - */ - inline float getFar() const { return _far; } - /** - * @brief Sets the far clip plane. - */ - inline void setFar(float far) { _far = far; } - /** - * @brief Gets the clear color. - */ - inline void getColor(Color4F& out) const { out = _color; } - /** - * @brief Sets the clear color. - */ - void setColor(float r, float g, float b, float a); - /** - * @brief Gets the depth of the camera, camera of smaller depth gets rendered earlier. - */ - inline float getDepth() const { return _depth; } - /** - * @brief Sets the depth of the camera, camera of smaller depth gets rendered earlier - */ - void setDepth(float depth); - /** - * @brief Gets the culling mask. - */ - inline int getCullingMask() const { return _cullingMask; } - /** - * @brief Sets the culling mask. - */ - inline void setCullingMask(int mask) { _cullingMask = mask; } - /** - * @brief Gets the stencil value to clear - */ - inline int getStencil() const { return _stencil; } - /** - * @brief Sets the stencil value to clear - */ - void setStencil(int stencil); - /** - * @brief Gets the clear flags including color, stencil and depth. - */ - inline uint8_t getClearFlags() const { return _clearFlags; } - /** - * @brief Sets the clear flags including color, stencil and depth. - */ - void setClearFlags(uint8_t flags ); - /** - * @brief Gets rect. - */ - inline Rect* getRect(Rect& out) const { out = _rect; return &out; } - /** - * @brief Sets rect. - */ - void setRect(float x, float y, float w, float h); - /** - * @brief Gets stages. - */ - inline const std::vector& getStages() const { return _stages; } - /** - * @brief Sets stages. - */ - void setStages(const std::vector& stages); - /** - * @brief Gets the frame buffer as render target. - */ - inline FrameBuffer* getFrameBuffer() const { return _framebuffer; } - /** - * @brief Sets the frame buffer as render target. - */ - void setFrameBuffer(FrameBuffer* framebuffer); - /** - * @brief Sets the world matrix. - */ - void setWorldMatrix(const Mat4& worldMatrix); - /** - * @brief Extracts the camera info to view. - */ - void extractView(View& view, int width, int height); - /** - * @brief Transform a screen position to world in the current camera projection. - */ - Vec3& screenToWorld(Vec3& out, const Vec3& screenPos, int width, int height); - /** - * @brief Transform a world position to screen in the current camera projection. - */ - Vec3& worldToScreen(Vec3& out, const Vec3& worldPos, int width, int height); - /** - * @brief Transform a screen position to world space - */ - Mat4& worldMatrixToScreen(Mat4& out, const Mat4& worldMatrix, int width, int height); - /** - * @brief Sets the related node proxy which provids model matrix for camera. - */ - void setNode(NodeProxy* node); - /** - * @brief Gets the related node proxy which provids model matrix for camera. - */ - inline NodeProxy* getNode() const { return _node; } - /** - * @brief Sets the camera render priority. - */ - void setPriority(int priority) { _priority = priority; } - /** - * @brief Gets the camera render priority. - */ - int getPriority() const { return _priority; } -private: - void calcMatrices(const int width, const int height); -private: - NodeProxy* _node = nullptr; - ProjectionType _projection = ProjectionType::PERSPECTIVE; - - // clear options - Color4F _color = {0.2f, 0.3f, 0.47f, 1.f}; - float _depth = 1.f; - int _stencil = 1; - int _cullingMask = 1; - uint8_t _clearFlags = ClearFlag::COLOR | ClearFlag::DEPTH; - - // stage & framebuffer - std::vector _stages; - FrameBuffer* _framebuffer = nullptr; - - // projection properties - float _near = 0.01f; - float _far = 1000.0f; - float _fov = RENDERER_PI / 4.0f; - Rect _rect = {0, 0, 1, 1}; - - // ortho properties - float _orthoHeight = 10.f; - - Mat4 _worldRTInv; - Vec3 _worldPos; - - Mat4 _matView; - Mat4 _matProj; - Mat4 _matViewProj; - Mat4 _matInvViewProj; - - Vec3 _temp_v3; - Mat4 _temp_mat4; - - int _priority = 0; -}; - -// end of renderer group -/// @} - -RENDERER_END diff --git a/native/cocos/renderer/renderer/Config.cpp b/native/cocos/renderer/renderer/Config.cpp deleted file mode 100644 index 8a1a49266d..0000000000 --- a/native/cocos/renderer/renderer/Config.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "Config.h" - -RENDERER_BEGIN - -unsigned int Config::_stageOffset = 0; -std::unordered_map Config::_name2stageID; - -void Config::addStage(const std::string& name) -{ - if (Config::_name2stageID.end() != Config::_name2stageID.find(name)) - return; - - unsigned int stageID = 1 << Config::_stageOffset; - Config::_name2stageID[name] = stageID; - - ++Config::_stageOffset; -} - -int Config::getStageID(const std::string &name) -{ - auto foundIter = Config::_name2stageID.find(name); - if (Config::_name2stageID.end() == foundIter) - return -1; - - return (int)foundIter->second; -} - -unsigned int Config::getStageIDs(const std::vector& nameList) -{ - unsigned int ret = 0; - - std::unordered_map::iterator foundIter; - std::unordered_map::iterator endIter = Config::_name2stageID.end(); - for (const auto& name : nameList) - { - foundIter = Config::_name2stageID.find(name); - if (endIter != foundIter) - ret |= foundIter->second; - } - - return ret; -} - -RENDERER_END diff --git a/native/cocos/renderer/renderer/Config.h b/native/cocos/renderer/renderer/Config.h deleted file mode 100644 index c545db1933..0000000000 --- a/native/cocos/renderer/renderer/Config.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#pragma once - -#include -#include -#include -#include "../Macro.h" - -RENDERER_BEGIN - -/** - * @addtogroup renderer - * @{ - */ - -/** - * @brief Stage config which use to store stageID. - */ -class Config -{ -public: - /** - * @brief Adds stage id by name. - * @param[in] name Stage name. - */ - static void addStage(const std::string& name); - /** - * @brief Gets stage id by name. - * @param[in] name Stage name. - * @return Stage id. - */ - static int getStageID(const std::string& name); - /** - * @brief Gets all stage id by a list of names and store in uint32 value by AND operation. - * @param[in] nameList Stage name list. - * @return A uint32 represents all stages. - */ - static unsigned int getStageIDs(const std::vector& nameList); - -private: - static unsigned int _stageOffset; - static std::unordered_map _name2stageID; -}; - -// end of renderer group -/// @} - -RENDERER_END diff --git a/native/cocos/renderer/renderer/CustomProperties.cpp b/native/cocos/renderer/renderer/CustomProperties.cpp deleted file mode 100644 index d649df277f..0000000000 --- a/native/cocos/renderer/renderer/CustomProperties.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "CustomProperties.hpp" - -RENDERER_BEGIN -CustomProperties::CustomProperties() -{ -} - -CustomProperties::~CustomProperties() -{ - _properties.clear(); - _defines.clear(); -} - -void CustomProperties::setProperty(const std::string name, const Property& property) -{ - auto iter = _properties.find(name); - if (iter != _properties.end() && iter->second == property) - { - return; - } - _properties[name] = property; - _dirty = true; -} - -const CustomProperties::Property& CustomProperties::getProperty(std::string name) const -{ - static Property EMPTY_PROPERTY; - if (_properties.end() == _properties.find(name)) - return EMPTY_PROPERTY; - else - return _properties.at(name); -} - -void CustomProperties::define(const std::string& name, const Value& value) -{ - if (_defines[name] == value) - { - return; - }; - - _dirty = true; - _defines[name] = value; - - generateDefinesKey(); -} - -Value CustomProperties::getDefine(const std::string& name) const -{ - auto iter = _defines.find(name); - if (iter != _defines.end()) - { - return iter->second; - } - - RENDERER_LOGW("Failed to get CustomProperties define %s, define not found.", name.c_str()); - return Value::Null; -} - -std::unordered_map* CustomProperties::extractProperties() -{ - return &_properties; -} - -ValueMap* CustomProperties::extractDefines() -{ - return &_defines; -} - -void CustomProperties::generateDefinesKey() -{ - _definesKey = ""; - for (auto& def : _defines) { - _definesKey += def.first + def.second.asString(); - } -} - -RENDERER_END diff --git a/native/cocos/renderer/renderer/CustomProperties.hpp b/native/cocos/renderer/renderer/CustomProperties.hpp deleted file mode 100644 index 437800e7c0..0000000000 --- a/native/cocos/renderer/renderer/CustomProperties.hpp +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#pragma once - -#include -#include "../Macro.h" -#include "Technique.h" -#include "base/CCValue.h" - -RENDERER_BEGIN - -class CustomProperties -{ -public: - using Property = Technique::Parameter; - - CustomProperties(); - ~CustomProperties(); - - void setProperty(const std::string name, const Property& property); - const Property& getProperty(std::string name) const; - void define(const std::string& name, const Value& value); - Value getDefine(const std::string& name) const; - std::unordered_map* extractProperties(); - ValueMap* extractDefines(); - const double getHash() const {return _hash; }; - - const std::string& getDefinesKey() { return _definesKey; }; -private: - - std::unordered_map _properties; - ValueMap _defines; - double _hash = 0; - bool _dirty = false; - - void generateDefinesKey(); - std::string _definesKey; -}; - -RENDERER_END diff --git a/native/cocos/renderer/renderer/Effect.cpp b/native/cocos/renderer/renderer/Effect.cpp deleted file mode 100644 index 855183a937..0000000000 --- a/native/cocos/renderer/renderer/Effect.cpp +++ /dev/null @@ -1,176 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "Effect.h" -#include "Config.h" - -RENDERER_BEGIN - -Effect::Effect() -: _hash(0) -{} - -void Effect::init(const Vector& techniques, - const std::unordered_map& properties, - const std::vector& defineTemplates) -{ - _techniques = techniques; - _properties = properties; - - for (const auto& defineTemplate: defineTemplates) - _defines.emplace(defineTemplate.at("name").asString(), - defineTemplate.at("value")); - generateDefinesKey(); -} - -Effect::~Effect() -{ -// RENDERER_LOGD("Effect destruction: %p", this); - clear(); -} - -void Effect::clear() -{ - _techniques.clear(); -} - -Technique* Effect::getTechnique(const std::string& stage) const -{ - int stageID = Config::getStageID(stage); - if (-1 == stageID) - return nullptr; - - for (const auto& tech : _techniques) - { - if (tech->getStageIDs() & stageID) - return tech; - } - - return nullptr; -} - -Value Effect::getDefine(const std::string& name) const -{ - return _defines.at(name); -} - -void Effect::define(const std::string& name, const Value& value) -{ - if (_defines[name] != value) - { - _defines[name] = value; - generateDefinesKey(); - } -} - -ValueMap* Effect::extractDefines() -{ - return &_defines; -} - -std::unordered_map* Effect::extractProperties() -{ - return &_properties; -} - -const Effect::Property& Effect::getProperty(const std::string& name) const -{ - static Property EMPTY_PROPERTY; - if (_properties.end() == _properties.find(name)) - return EMPTY_PROPERTY; - else - return _properties.at(name); -} - -void Effect::setProperty(const std::string& name, const Property& property) -{ - _properties[name] = property; -} - -void Effect::generateDefinesKey() -{ - _definesKey = ""; - for (auto& def : _defines) { - _definesKey += def.first + std::to_string(def.second.asUnsignedInt()); - } -} - -void Effect::copy(const Effect* effect) -{ - _hash = effect->_hash; - auto& otherTech = effect->_techniques; - for (auto it = otherTech.begin(); it != otherTech.end(); it ++) - { - auto tech = new Technique(); - tech->autorelease(); - tech->copy(**it); - _techniques.pushBack(tech); - } - _defines = effect->_defines; - _properties = effect->_properties; - _definesKey = effect->_definesKey; -} - -void Effect::setCullMode(CullMode cullMode) -{ - Technique* tech = _techniques.front(); - const Vector& passes = tech->getPasses(); - for (const auto& pass : passes) - { - pass->setCullMode(cullMode); - } -} - -void Effect::setBlend(BlendOp blendEq, BlendFactor blendSrc, BlendFactor blendDst, BlendOp blendAlphaEq, BlendFactor blendSrcAlpha, BlendFactor blendDstAlpha, uint32_t blendColor) -{ - Technique* tech = _techniques.front(); - const Vector& passes = tech->getPasses(); - for (const auto& pass : passes) - { - pass->setBlend(blendEq, blendSrc, blendDst, blendAlphaEq, blendSrcAlpha, blendDstAlpha, blendColor); - } -} - -void Effect::setStencilTest(bool value) -{ - Technique* tech = _techniques.front(); - const Vector& passes = tech->getPasses(); - for (const auto& pass : passes) - { - pass->setStencilTest(value); - } -} - -void Effect::setStencil(StencilFunc stencilFunc, uint32_t stencilRef, uint8_t stencilMask, StencilOp stencilFailOp, StencilOp stencilZFailOp, StencilOp stencilZPassOp, uint8_t stencilWriteMask) -{ - Technique* tech = _techniques.front(); - const Vector& passes = tech->getPasses(); - for (const auto& pass : passes) - { - pass->setStencilFront(stencilFunc, stencilRef, stencilMask, stencilFailOp, stencilZFailOp, stencilZPassOp, stencilWriteMask); - pass->setStencilBack(stencilFunc, stencilRef, stencilMask, stencilFailOp, stencilZFailOp, stencilZPassOp, stencilWriteMask); - } -} - -RENDERER_END diff --git a/native/cocos/renderer/renderer/Effect.h b/native/cocos/renderer/renderer/Effect.h deleted file mode 100644 index a8bee4efbc..0000000000 --- a/native/cocos/renderer/renderer/Effect.h +++ /dev/null @@ -1,209 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#pragma once - -#include -#include -#include -#include "base/CCRef.h" -#include "base/CCValue.h" -#include "../Macro.h" -#include "Technique.h" -#include "Pass.h" - -RENDERER_BEGIN - -/** - * @addtogroup renderer - * @{ - */ - -/** - * @brief Fundamental class of material system, contains techniques, shader template define settings and uniform properties.\n - * JS API: renderer.Effect - * @code - * let pass = new renderer.Pass('sprite'); - * pass.setDepth(false, false); - * pass.setCullMode(gfx.CULL_NONE); - * let mainTech = new renderer.Technique( - * ['transparent'], - * [ - * { name: 'texture', type: renderer.PARAM_TEXTURE_2D }, - * { name: 'color', type: renderer.PARAM_COLOR4 } - * ], - * [ - * pass - * ] - * ); - * let effect = new renderer.Effect( - * [ - * mainTech - * ], - * { - * 'color': {r: 1, g: 1, b: 1, a: 1} - * }, - * [ - * { name: 'useTexture', value: true }, - * { name: 'useModel', value: false }, - * { name: 'alphaTest', value: false }, - * { name: 'useColor', value: true } - * ] - * ); - * @endcode - */ -class Effect : public Ref -{ -public: - using Property = Technique::Parameter; - - /* - * @brief The default constructor. - */ - Effect(); - /* - * @brief The default destructor. - */ - ~Effect(); - - /* - * @brief Initialize with techniques, properties and define settings. - * @param[in] techniques All techniques in an array - * @param[in] properties All properties in a map - * @param[in] defineTemplates All defines and their value in a map - */ - void init(const Vector& techniques, - const std::unordered_map& properties, - const std::vector& defineTemplates); - /** - * @brief Clears techniques and define list. - */ - void clear(); - - /** - * @brief Gets technique by stage. - */ - Technique* getTechnique(const std::string& stage) const; - /* - * @brief Gets all techniques. - */ - const Vector& getTechniques() const { return _techniques; } - /** - * @brief Gets define property value by name. - */ - Value getDefine(const std::string& name) const; - /** - * @brief Sets a define's value. - */ - void define(const std::string& name, const Value& value); - - /* - * @brief Extracts all defines. - */ - ValueMap* extractDefines(); - /* - * @brief Extracts all propertyps. - */ - std::unordered_map* extractProperties(); - /** - * @brief Gets uniform property value by name. - */ - const Property& getProperty(const std::string& name) const; - /** - * @brief Sets uniform property value by name. - */ - void setProperty(const std::string& name, const Property& property); - /* - * @brief Gets all uniform properties. - */ - const std::unordered_map& getProperties() const { return _properties; } - /** - * @brief Updates hash. - */ - void updateHash(double hash) { _hash = hash; }; - /** - * @brief Gets hash. - */ - double getHash() const { return _hash; }; - - /** - * @brief Sets cull mode. - * @param[in] cullMode Cull front or back or both. - */ - void setCullMode(CullMode cullMode); - /** - * @brief Sets blend mode. - * @param[in] blendEq RGB blend equation. - * @param[in] blendSrc Src RGB blend factor. - * @param[in] blendDst Dst RGB blend factor. - * @param[in] blendAlphaEq Alpha blend equation. - * @param[in] blendSrcAlpha Src Alpha blend equation. - * @param[in] blendDstAlpha Dst Alpha blend equation. - * @param[in] blendColor Blend constant color value. - */ - void setBlend(BlendOp blendEq = BlendOp::ADD, - BlendFactor blendSrc = BlendFactor::ONE, - BlendFactor blendDst = BlendFactor::ZERO, - BlendOp blendAlphaEq = BlendOp::ADD, - BlendFactor blendSrcAlpha = BlendFactor::ONE, - BlendFactor blendDstAlpha = BlendFactor::ZERO, - uint32_t blendColor = 0xffffffff); - /** - * @brief Sets stencil front-facing function, reference, mask, fail operation, write mask. - */ - void setStencil(StencilFunc stencilFunc = StencilFunc::ALWAYS, - uint32_t stencilRef = 0, - uint8_t stencilMask = 0xff, - StencilOp stencilFailOp = StencilOp::KEEP, - StencilOp stencilZFailOp = StencilOp::KEEP, - StencilOp stencilZPassOp = StencilOp::KEEP, - uint8_t stencilWriteMask = 0xff); - /* - * @brief Sets stencil test enabled or not. - */ - void setStencilTest(bool value); - - /* - * @brief Gets the define key for the current define settings. - */ - const std::string& getDefinesKey() { return _definesKey; }; - /** - * @brief Deep copy from other effect. - */ - void copy(const Effect* effect); -private: - double _hash; - std::string _definesKey; - Vector _techniques; - ValueMap _defines; - std::unordered_map _properties; - - void generateDefinesKey(); - -}; - -// end of renderer group -/// @} - -RENDERER_END diff --git a/native/cocos/renderer/renderer/ForwardRenderer.cpp b/native/cocos/renderer/renderer/ForwardRenderer.cpp deleted file mode 100644 index 5bee83b78f..0000000000 --- a/native/cocos/renderer/renderer/ForwardRenderer.cpp +++ /dev/null @@ -1,480 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "ForwardRenderer.h" - -#include "gfx/DeviceGraphics.h" -#include "gfx/Texture2D.h" -#include "gfx/VertexBuffer.h" -#include "gfx/IndexBuffer.h" -#include "gfx/FrameBuffer.h" -#include "ProgramLib.h" -#include "View.h" -#include "Scene.h" -#include "Effect.h" -#include "InputAssembler.h" -#include "Pass.h" -#include "Camera.h" -#include "Light.h" -#include - -#include "math/MathUtil.h" - -RENDERER_BEGIN - -ForwardRenderer::ForwardRenderer() -{ - _arrayPool = new RecyclePool([]()mutable->float*{return new float[16];}, 8); - - _defines["CC_NUM_DIR_LIGHTS"] = Value(0); - _defines["CC_NUM_POINT_LIGHTS"] = Value(0); - _defines["CC_NUM_SPOT_LIGHTS"] = Value(0); - _defines["CC_NUM_AMBIENT_LIGHTS"] = Value(0); - _defines["CC_NUM_SHADOW_LIGHTS"] = Value(0); - - _definesHash = 0; -} - -ForwardRenderer::~ForwardRenderer() -{ - _directionalLights.clear(); - _pointLights.clear(); - _spotLights.clear(); - _shadowLights.clear(); - _ambientLights.clear(); - _defines.clear(); - - delete _arrayPool; - _arrayPool = nullptr; -} - -bool ForwardRenderer::init(DeviceGraphics* device, std::vector& programTemplates, Texture2D* defaultTexture, int width, int height) -{ - BaseRenderer::init(device, programTemplates, defaultTexture); - _width = width; - _height = height; - registerStage("opaque", std::bind(&ForwardRenderer::opaqueStage, this, std::placeholders::_1, std::placeholders::_2)); - registerStage("shadowcast", std::bind(&ForwardRenderer::shadowStage, this, std::placeholders::_1, std::placeholders::_2)); - registerStage("transparent", std::bind(&ForwardRenderer::transparentStage, this, std::placeholders::_1, std::placeholders::_2)); - return true; -} - -void ForwardRenderer::resetData() -{ - _arrayPool->reset(); - reset(); -} - -void ForwardRenderer::render(Scene* scene) -{ - resetData(); - updateLights(scene); - scene->sortCameras(); - auto& cameras = scene->getCameras(); - for (auto& camera : cameras) - { - View* view = requestView(); - camera->extractView(*view, _width, _height); - } - - for (size_t i = 0, len = _views->getLength(); i < len; ++i) { - const View* view = _views->getData(i); - BaseRenderer::render(*view, scene); - } - - scene->removeModels(); -} - -void ForwardRenderer::renderCamera(Camera* camera, Scene* scene) -{ - reset(); - int width = _width; - int height = _height; - FrameBuffer* fb = camera->getFrameBuffer(); - if (nullptr != fb) { - width = fb->getWidth(); - height = fb->getHeight(); - } - View* view = requestView(); - camera->extractView(*view, width, height); - BaseRenderer::render(*view, scene); - - scene->removeModels(); -} - -void ForwardRenderer::updateLights(Scene* scene) -{ - _directionalLights.clear(); - _pointLights.clear(); - _spotLights.clear(); - _shadowLights.clear(); - _ambientLights.clear(); - - const Vector lights = scene->getLights(); - for (const auto& light : lights) - { - light->update(_device); - if (light->getShadowType() != Light::ShadowType::NONE) - { - _shadowLights.pushBack(light); - View* view = requestView(); - std::vector stages; - stages.push_back("shadowcast"); - light->extractView(*view, stages); - } - - switch(light->getType()) - { - case Light::LightType::DIRECTIONAL: - { - _directionalLights.pushBack(light); - break; - } - case Light::LightType::POINT: - { - _pointLights.pushBack(light); - break; - } - case Light::LightType::SPOT: - { - _spotLights.pushBack(light); - break; - } - case Light::LightType::AMBIENT: - { - _ambientLights.pushBack(light); - break; - } - } - } - - if (lights.size() > 0) - { - updateDefines(); - } - - _numLights = lights.size(); -} - -void ForwardRenderer::updateDefines() -{ - _defines["CC_NUM_DIR_LIGHTS"] = std::min(4, (int)_directionalLights.size()); - _defines["CC_NUM_POINT_LIGHTS"] = std::min(4, (int)_pointLights.size()); - _defines["CC_NUM_SPOT_LIGHTS"] = std::min(4, (int)_spotLights.size()); - _defines["CC_NUM_AMBIENT_LIGHTS"] = std::min(4, (int)_ambientLights.size()); - _defines["CC_NUM_SHADOW_LIGHTS"] = std::min(4, (int)_shadowLights.size()); - - _definesKey = - std::to_string(_directionalLights.size()) + - std::to_string(_pointLights.size()) + - std::to_string(_spotLights.size()) + - std::to_string(_ambientLights.size()) + - std::to_string(_shadowLights.size()) - ; - - _definesHash = std::hash{}(_definesKey); -} - -void ForwardRenderer::submitLightsUniforms() -{ - if (_directionalLights.size() > 0) - { - size_t count = _directionalLights.size(); - float* directions = _arrayPool->add(); - float* colors = _arrayPool->add(); - Vec3 lightVec3; - Vec3 colorVec3; - for (int i = 0; i < count; ++i) - { - int index = i * 4; - auto* light = _directionalLights.at(i); - lightVec3.set(light->getDirectionUniform()); - *(directions + index) = lightVec3.x; - *(directions + index + 1) = lightVec3.y; - *(directions + index + 2) = lightVec3.z; - *(directions + index + 3) = 0; - - colorVec3.set(light->getColorUniform()); - *(colors + index) = colorVec3.x; - *(colors + index + 1) = colorVec3.y; - *(colors + index + 2) = colorVec3.z; - *(colors + index + 3) = 0; - } - _device->setUniformfv(cc_dirLightDirection, count * 4, directions); - _device->setUniformfv(cc_dirLightColor, count * 4, colors); - } - - if (_pointLights.size() > 0) - { - size_t count = _pointLights.size(); - float* positionAndRanges = _arrayPool->add(); - float* colors = _arrayPool->add(); - Vec3 posVec3; - Vec3 colorVec3; - for (int i = 0; i < count; ++i) - { - int index = i * 4; - auto* light = _pointLights.at(i); - posVec3.set(light->getPositionUniform()); - *(positionAndRanges + index) = posVec3.x; - *(positionAndRanges + index + 1) = posVec3.y; - *(positionAndRanges + index + 2) = posVec3.z; - *(positionAndRanges + index + 3) = light->getRange(); - - colorVec3.set(light->getColorUniform()); - *(colors + index) = colorVec3.x; - *(colors + index + 1) = colorVec3.y; - *(colors + index + 2) = colorVec3.z; - *(colors + index + 3) = 0; - } - _device->setUniformfv(cc_pointLightPositionAndRange, count * 4, positionAndRanges); - _device->setUniformfv(cc_pointLightColor, count * 4, colors); - } - - if (_spotLights.size() > 0) - { - size_t count = _spotLights.size(); - float* directions = _arrayPool->add(); - float* positionAndRanges = _arrayPool->add(); - float* colors = _arrayPool->add(); - Vec3 lightVec3; - Vec3 posVec3; - Vec3 colorVec3; - for (int i = 0; i < count; ++i) - { - int index = i * 4; - auto* light = _spotLights.at(i); - lightVec3.set(light->getDirectionUniform()); - *(directions + index) = lightVec3.x; - *(directions + index + 1) = lightVec3.y; - *(directions + index + 2) = lightVec3.z; - *(directions + index + 3) = 0; - - posVec3.set(light->getPositionUniform()); - *(positionAndRanges + index) = posVec3.x; - *(positionAndRanges + index + 1) = posVec3.y; - *(positionAndRanges + index + 2) = posVec3.z; - *(positionAndRanges + index + 3) = light->getRange(); - - colorVec3.set(light->getColorUniform()); - *(colors + index) = colorVec3.x; - *(colors + index + 1) = colorVec3.y; - *(colors + index + 2) = colorVec3.z; - *(colors + index + 3) = 0; - } - _device->setUniformfv(cc_spotLightDirection, count * 4, directions); - _device->setUniformfv(cc_spotLightPositionAndRange, count * 4, positionAndRanges); - _device->setUniformfv(cc_spotLightColor, count * 4, colors); - } - - if (_ambientLights.size() > 0) { - size_t count = _ambientLights.size(); - float* colors = _arrayPool->add(); - Vec3 colorVec3; - for (int i = 0; i < count; ++i) - { - int index = i * 4; - auto* light = _ambientLights.at(i); - colorVec3.set(light->getColorUniform()); - *(colors + index) = colorVec3.x; - *(colors + index + 1) = colorVec3.y; - *(colors + index + 2) = colorVec3.z; - *(colors + index + 3) = 0; - } - _device->setUniformfv(cc_pointLightColor, count * 4, colors); - } -} - -void ForwardRenderer::submitShadowStageUniforms(const View& view) -{ - static float* shadowInfo = new float[4]; - shadowInfo[0] = view.shadowLight->getShadowMinDepth(); - shadowInfo[1] = view.shadowLight->getShadowMaxDepth(); - shadowInfo[2] = view.shadowLight->getShadowDepthScale(); - shadowInfo[3] = view.shadowLight->getShadowDarkness(); - - _device->setUniformMat4(cc_shadow_map_lightViewProjMatrix, view.matViewProj); - _device->setUniformfv(cc_shadow_map_info, 4, shadowInfo); - _device->setUniformf(cc_shadow_map_bias, view.shadowLight->getShadowBias()); -} - -void ForwardRenderer::submitOtherStagesUniforms() -{ - size_t count = _shadowLights.size(); - float* shadowLightInfo = _arrayPool->add(); - static float* shadowLightProjs = new float[4 * 16]; - - for (int i = 0; i < count; ++i) - { - Light* light = _shadowLights.at(i); - const Mat4 view = light->getViewProjMatrix(); - memcpy(shadowLightProjs + i * 16, view.m, sizeof(float) * 16); - - int index = i * 4; - *(shadowLightInfo + index) = light->getShadowMinDepth(); - *(shadowLightInfo + index + 1) = light->getShadowMaxDepth(); - *(shadowLightInfo + index + 2) = light->getShadowDepthScale(); - *(shadowLightInfo + index + 3) = light->getShadowDarkness(); - } - - _device->setUniformfv(cc_shadow_lightViewProjMatrix, count * 16, shadowLightProjs); - _device->setUniformfv(cc_shadow_info, count * 4, shadowLightInfo); -} - -void ForwardRenderer::updateShaderDefines(StageItem& item) -{ - item.defines->push_back(&_defines); - MathUtil::combineHash(item.definesKeyHash, _definesHash); -} - -bool ForwardRenderer::compareItems(const StageItem &a, const StageItem &b) -{ - const Technique* techA = a.technique; - const Technique* techB = b.technique; - - if (techA->getLayer() != techB->getLayer()) { - return techA->getLayer() > techB->getLayer(); - } - - size_t pa = techA->getPasses().size(); - size_t pb = techB->getPasses().size(); - - if (pa != pb) { - return pa > pb; - } - - return a.sortKey > b.sortKey; -} - -void ForwardRenderer::sortItems(std::vector& items) -{ - std::sort(items.begin(), items.end(), compareItems); -} - -void ForwardRenderer::drawItems(const std::vector& items) -{ - size_t count = _shadowLights.size(); - if (count == 0 && _numLights == 0) - { - for (const auto& item : items) - { - draw(item); - } - } - else - { - std::vector shadowMaps; - shadowMaps.reserve(count); - std::vector slots; - slots.reserve(count); - for (const auto& item : items) - { - shadowMaps.clear(); - for(int i = 0; i < count; i++) - { - Light* light = _shadowLights.at(i); - shadowMaps.push_back(light->getShadowMap()); - slots.push_back(allocTextureUnit()); - } - _device->setTextureArray(cc_shadow_map, shadowMaps, slots); - updateShaderDefines(const_cast(item)); - draw(item); - } - } -} - -void ForwardRenderer::opaqueStage(const View& view, std::vector& items) -{ - // update uniforms - _device->setUniformMat4(cc_matView, view.matView); - _device->setUniformMat4(cc_matpProj, view.matProj); - _device->setUniformMat4(cc_matViewProj, view.matViewProj); - static Vec3 cameraPos3; - static Vec4 cameraPos4; - view.getPosition(cameraPos3); - cameraPos4.set(cameraPos3.x, cameraPos3.y, cameraPos3.z, 0); - _device->setUniformVec4(cc_cameraPos, cameraPos4); - submitLightsUniforms(); - submitOtherStagesUniforms(); - drawItems(items); -} - -void ForwardRenderer::shadowStage(const View& view, std::vector& items) -{ - // update rendering - submitShadowStageUniforms(view); - - for (auto& item : items) - { - const Value* def = _programLib->getValueFromDefineList("CC_SHADOW_CASTING", *item.defines); - if (def && def->asBool()) { - updateShaderDefines(item); - draw(item); - } - } -} - -void ForwardRenderer::transparentStage(const View& view, const std::vector& items) -{ - // update uniforms - _device->setUniformMat4(cc_matView, view.matView); - _device->setUniformMat4(cc_matpProj, view.matProj); - _device->setUniformMat4(cc_matViewProj, view.matViewProj); - static Vec3 cameraPos3; - static Vec4 cameraPos4; - view.getPosition(cameraPos3); - cameraPos4.set(cameraPos3.x, cameraPos3.y, cameraPos3.z, 0); - _device->setUniformVec4(cc_cameraPos, cameraPos4); - - static Vec3 camFwd; - static Vec3 tmpVec3; - view.getForward(camFwd); - - submitLightsUniforms(); - submitOtherStagesUniforms(); - - NodeProxy* node; - // calculate zdist - for (auto& item : const_cast&>(items)) - { - // TODO: we should use mesh center instead! - node = const_cast(item.model->getNode()); - if (node != nullptr) - { - node->getWorldPosition(&tmpVec3); - } - else - { - tmpVec3.set(0, 0, 0); - } - - Vec3::subtract(tmpVec3, tmpVec3, &cameraPos3); - item.sortKey = -Vec3::dot(tmpVec3, camFwd); - } - - sortItems(const_cast&>(items)); - drawItems(items); -} - -RENDERER_END diff --git a/native/cocos/renderer/renderer/ForwardRenderer.h b/native/cocos/renderer/renderer/ForwardRenderer.h deleted file mode 100644 index 78aacc61dd..0000000000 --- a/native/cocos/renderer/renderer/ForwardRenderer.h +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#pragma once - -#include "BaseRenderer.h" -#include "Camera.h" -#include "../memop/RecyclePool.hpp" - -RENDERER_BEGIN - -/** - * @addtogroup renderer - * @{ - */ - -/** - * @brief A builtin forward renderer implementation - */ -class ForwardRenderer final : public BaseRenderer -{ -public: - /** - * @brief The default constructor. - */ - ForwardRenderer(); - ~ForwardRenderer(); - /** - * @brief Initializes the forward renderer. - * @param[in] device DeviceGraphics pointer. - * @param[in] programTemplates All linked programs. - * @param[in] defaultTexture Default texture pointer. - * @param[in] width. - * @param[in] height. - */ - bool init(DeviceGraphics* device, std::vector& programTemplates, Texture2D* defaultTexture, int width, int height); - /** - * @brief Renders the given render scene. - */ - void render(Scene* scene); - /** - * @brief Renders the given render scene with a given camera setting. - */ - void renderCamera(Camera* camera, Scene* scene); -private: - void updateLights(Scene* scene); - void updateDefines(); - void submitLightsUniforms(); - void submitShadowStageUniforms(const View& view); - void submitOtherStagesUniforms(); - void updateShaderDefines(StageItem& item); - void sortItems(std::vector& items); - void drawItems(const std::vector& items); - void opaqueStage(const View& view, std::vector& items); - void shadowStage(const View& view, std::vector& items); - void transparentStage(const View& view, const std::vector& items); - void resetData(); - static bool compareItems(const StageItem& a, const StageItem& b); - - Vector _directionalLights; - Vector _pointLights; - Vector _spotLights; - Vector _shadowLights; - Vector _ambientLights; - - RecyclePool* _arrayPool = nullptr; - - int _width = 0; - int _height = 0; - std::size_t _numLights = 0; -}; - -// end of renderer group -/// @} - -RENDERER_END diff --git a/native/cocos/renderer/renderer/INode.h b/native/cocos/renderer/renderer/INode.h deleted file mode 100644 index 756906ca0d..0000000000 --- a/native/cocos/renderer/renderer/INode.h +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#pragma once - -#include "../Macro.h" -#include "math/Mat4.h" -#include "math/Vec3.h" - -RENDERER_BEGIN - -class INode -{ -public: - virtual ~INode() {} - virtual Mat4 getWorldMatrix() const = 0; - virtual Mat4 getWorldRT() const = 0; - virtual Vec3 getWorldPos() const = 0; -}; - -RENDERER_END diff --git a/native/cocos/renderer/renderer/InputAssembler.cpp b/native/cocos/renderer/renderer/InputAssembler.cpp deleted file mode 100644 index 26a5ef93c9..0000000000 --- a/native/cocos/renderer/renderer/InputAssembler.cpp +++ /dev/null @@ -1,144 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "InputAssembler.h" -#include "gfx/VertexBuffer.h" -#include "gfx/IndexBuffer.h" - -RENDERER_BEGIN - -InputAssembler::InputAssembler() -{ -} - -InputAssembler::InputAssembler(const InputAssembler& o) -{ - *this = o; -} - -InputAssembler::InputAssembler(InputAssembler&& o) -{ - *this = std::move(o); -} - -InputAssembler::~InputAssembler() -{ - RENDERER_SAFE_RELEASE(_vertexBuffer); - RENDERER_SAFE_RELEASE(_indexBuffer); -} - -void InputAssembler::clear() -{ - CC_SAFE_RELEASE(_vertexBuffer); - CC_SAFE_RELEASE(_indexBuffer); - - _vertexBuffer = nullptr; - _indexBuffer = nullptr; - _primitiveType = PrimitiveType::TRIANGLES; - _start = 0; - _count = -1; -} - -InputAssembler& InputAssembler::operator=(const InputAssembler& o) -{ - CC_SAFE_RELEASE(_vertexBuffer); - CC_SAFE_RELEASE(_indexBuffer); - - _vertexBuffer = o._vertexBuffer; - _indexBuffer = o._indexBuffer; - _start = o._start; - _count = o._count; - _primitiveType = o._primitiveType; - - CC_SAFE_RETAIN(_vertexBuffer); - CC_SAFE_RETAIN(_indexBuffer); - - return *this; -} - -InputAssembler& InputAssembler::operator=(InputAssembler&& o) -{ - CC_SAFE_RELEASE(_vertexBuffer); - CC_SAFE_RELEASE(_indexBuffer); - - _vertexBuffer = o._vertexBuffer; - _indexBuffer = o._indexBuffer; - _start = o._start; - _count = o._count; - _primitiveType = o._primitiveType; - - o._indexBuffer = nullptr; - o._vertexBuffer = nullptr; - o._start = 0; - o._count = -1; - - return *this; -} - -bool InputAssembler::init(VertexBuffer* vb, - IndexBuffer* ib, - PrimitiveType pt/* = PrimitiveType::TRIANGLES*/) -{ - setVertexBuffer(vb); - setIndexBuffer(ib); - _primitiveType = pt; - return true; -} - -void InputAssembler::setVertexBuffer(VertexBuffer* vb) -{ - RENDERER_SAFE_RELEASE(_vertexBuffer); - _vertexBuffer = vb; - RENDERER_SAFE_RETAIN(_vertexBuffer); -} - -void InputAssembler::setIndexBuffer(IndexBuffer* ib) -{ - RENDERER_SAFE_RELEASE(_indexBuffer); - _indexBuffer = ib; - RENDERER_SAFE_RETAIN(_indexBuffer); -} - -uint32_t InputAssembler::getPrimitiveCount() const -{ - if (-1 != _count) - return _count; - - if (_indexBuffer) - return _indexBuffer->getCount(); - - assert(_vertexBuffer); - return _vertexBuffer->getCount(); -} - -bool InputAssembler::isMergeable(const InputAssembler& ia) const -{ - if (_indexBuffer != ia._indexBuffer || _vertexBuffer != ia._vertexBuffer) - { - return false; - } - return (_start + _count) == ia._start; -} - -RENDERER_END diff --git a/native/cocos/renderer/renderer/InputAssembler.h b/native/cocos/renderer/renderer/InputAssembler.h deleted file mode 100644 index 173fe18ceb..0000000000 --- a/native/cocos/renderer/renderer/InputAssembler.h +++ /dev/null @@ -1,126 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#pragma once - -#include "../Types.h" -#include "../Macro.h" - -RENDERER_BEGIN - -class VertexBuffer; -class IndexBuffer; - -/** - * @addtogroup renderer - * @{ - */ - -/** - * @brief InputAssembler is an fundamental data structure to store vertex buffer and index buffer. - */ -class InputAssembler -{ -public: - InputAssembler(); - InputAssembler(const InputAssembler& o); - InputAssembler(InputAssembler&& o); - ~InputAssembler(); - - InputAssembler& operator=(const InputAssembler& o); - InputAssembler& operator=(InputAssembler&& o); - - /** - * @brief Initializes with vertex buffer, index buffer and primitive type. - */ - bool init(VertexBuffer* vb, - IndexBuffer* ib, - PrimitiveType pt = PrimitiveType::TRIANGLES); - /** - * @brief Gets the primitive count. - */ - uint32_t getPrimitiveCount() const; - - /** - * @brief Sets the vertex buffer. - */ - void setVertexBuffer(VertexBuffer* vb); - /** - * @brief Gets the vertex buffer. - */ - inline VertexBuffer* getVertexBuffer() const { return _vertexBuffer; } - /** - * @brief Sets the index buffer. - */ - void setIndexBuffer(IndexBuffer* ib); - /** - * @brief Gets the index buffer. - */ - inline IndexBuffer* getIndexBuffer() const { return _indexBuffer; } - - /** - * @brief Sets the index offset in buffer. - */ - inline void setStart(int start) { _start = start; } - /** - * @brief Gets the index offset in buffer. - */ - inline int getStart() const { return _start; } - /** - * @brief Sets the count of indices. - */ - inline void setCount(int count) { _count = count; } - /** - * @brief Gets the count of indices. - */ - inline int getCount() const { return _count; } - /** - * @brief Gets the primitive type. - */ - inline PrimitiveType getPrimitiveType() const { return _primitiveType; } - /** - * @brief Sets the primitive type. - */ - inline void setPrimitiveType(PrimitiveType type) { _primitiveType = type; } - /** - * @brief Clears all field. - */ - void clear(); - /** - * @brief Can be merge. - */ - bool isMergeable(const InputAssembler& ia) const; -private: - friend class BaseRenderer; - - VertexBuffer* _vertexBuffer = nullptr; - IndexBuffer* _indexBuffer = nullptr; - PrimitiveType _primitiveType = PrimitiveType::TRIANGLES; - int _start = 0; - int _count = -1; -}; - -// end of renderer group -/// @} -RENDERER_END diff --git a/native/cocos/renderer/renderer/Light.cpp b/native/cocos/renderer/renderer/Light.cpp deleted file mode 100644 index 1ab5066db4..0000000000 --- a/native/cocos/renderer/renderer/Light.cpp +++ /dev/null @@ -1,287 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "Light.h" -#include -#include "gfx/DeviceGraphics.h" -#include "gfx/Texture2D.h" -#include "gfx/RenderBuffer.h" -#include "gfx/FrameBuffer.h" - -RENDERER_BEGIN - -Light::Light() -{ - _worldRT = Mat4(); -} - -Light::~Light() -{ - RENDERER_SAFE_RELEASE(_shadowFrameBuffer); - RENDERER_SAFE_RELEASE(_shadowDepthBuffer); - RENDERER_SAFE_RELEASE(_node); - RENDERER_SAFE_RELEASE(_shadowMap); -} - -void Light::setColor(float r, float g, float b) -{ - _color.set(r, g, b); - _colorUniform.set(r * _intensity, g * _intensity, b * _intensity); -} - -void Light::setIntensity(float val) -{ - _intensity = val; - _colorUniform.set(_color.r * _intensity, - _color.g * _intensity, - _color.b * _intensity); -} - -void Light::setSpotAngle(float val) -{ - _spotAngle = val; - _spotUniform[0] = std::cos(_spotAngle * 0.5f); -} - -void Light::setSpotExp(float val) -{ - _spotExp = val; - _spotUniform[1] = _spotExp; -} - -void Light::setShadowType(ShadowType val) -{ - if (ShadowType::NONE == _shadowType && - ShadowType::NONE != val) - { - _shadowMapDirty = true; - } - - _shadowType = val; -} - -void Light::setShadowResolution(uint32_t val) -{ - if (_shadowResolution != val) - { - _shadowMapDirty = true; - _shadowResolution = val; - } -} - -float Light::getShadowMinDepth() const -{ - if (LightType::DIRECTIONAL == _type) - return 1.0f; - else - return _shadowMinDepth; -} - -float Light::getShadowMaxDepth() const -{ - if (LightType::DIRECTIONAL == _type) - return 1.0f; - else - return _shadowMaxDepth; -} - -void Light::setWorldMatrix(const Mat4& worldMatrix) -{ - _worldMatrix = worldMatrix; - Quaternion rotation; - Vec3 translation; - _worldMatrix.decompose(nullptr, &rotation, &translation); - Mat4::createRotation(rotation, &_worldRT); - _worldRT.translate(translation); -} - -void Light::setNode(NodeProxy* node) -{ - if (_node == node) - { - return; - } - - if (_node != nullptr) - { - _node->release(); - } - _node = node; - if (_node != nullptr) - { - _node->retain(); - } -} - -void Light::extractView(View& out, const std::vector& stages) -{ - out.shadowLight = const_cast(this); - out.rect = { 0, 0, (float)_shadowResolution, (float)_shadowResolution }; - - // clear options - out.color.set(1.f, 1.f, 1.f, 1.f); - out.depth = 1; - out.stencil = 1; - out.clearFlags = ClearFlag::COLOR | ClearFlag::DEPTH; - - // stage & framebuffer - out.stages = stages; - out.frameBuffer = _shadowFrameBuffer; - - // view projection matrix - switch (_type) - { - case LightType::SPOT: - computeSpotLightViewProjMatrix(out.matView, out.matProj); - break; - case LightType::DIRECTIONAL: - computeDirectionalLightViewProjMatrix(out.matView, out.matProj); - break; - case LightType::POINT: - computePointLightViewProjMatrix(out.matView, out.matProj); - break; - default: - RENDERER_LOGW("Shadow of this light type is not supported"); - break; - } - - // view-porjection - Mat4::multiply(out.matProj, out.matView, &out.matViewProj); - out.matInvViewProj = out.matViewProj.getInversed(); - - _viewProjMatrix.set(out.matViewProj); - - out.cullingMask = 0xffffffff; -} - -void Light::update(DeviceGraphics* device) -{ - updateLightPositionAndDirection(); - - if (ShadowType::NONE == _shadowType) - destroyShadowMap(); - else - { - destroyShadowMap(); - generateShadowMap(device); - _shadowMapDirty = false; - } -} - -// private functions - -void Light::updateLightPositionAndDirection() -{ - _worldMatrix = _node->getWorldMatrix(); - _worldMatrix.transformVector(_forward, &_directionUniform); - _positionUniform.set(_worldMatrix.m[12], _worldMatrix.m[13], _worldMatrix.m[14]); -} - -void Light::generateShadowMap(DeviceGraphics* device) -{ - _shadowMap = new (std::nothrow) Texture2D(); - if (!_shadowMap) - return; - - _shadowDepthBuffer = new (std::nothrow) RenderBuffer(); - if (!_shadowDepthBuffer) - { - _shadowMap->release(); - _shadowMap = nullptr; - - return; - } - - _shadowFrameBuffer = new (std::nothrow) FrameBuffer(); - if (!_shadowFrameBuffer) - { - _shadowMap->release(); - _shadowDepthBuffer->release(); - _shadowMap = nullptr; - _shadowDepthBuffer = nullptr; - - return; - } - - Texture2D::Options options; - options.width = _shadowResolution; - options.height = _shadowResolution; - options.glFormat = GL_RGBA; - options.wrapS = Texture2D::WrapMode::CLAMP; - options.wrapT = Texture2D::WrapMode::CLAMP; - _shadowMap->init(device, options); - - _shadowDepthBuffer->init(device, RenderBuffer::Format::D16, _shadowResolution, _shadowResolution); - - _shadowFrameBuffer->init(device, _shadowResolution, _shadowResolution); - _shadowFrameBuffer->setColorBuffer(_shadowMap, 0); - _shadowFrameBuffer->setDepthBuffer(_shadowDepthBuffer); -} - -void Light::destroyShadowMap() -{ - if (_shadowMap) - { - _shadowMap->release(); - _shadowMap = nullptr; - - RENDERER_SAFE_RELEASE(_shadowDepthBuffer); - _shadowDepthBuffer = nullptr; - - RENDERER_SAFE_RELEASE(_shadowFrameBuffer); - _shadowFrameBuffer = nullptr; - } -} - -void Light::computeSpotLightViewProjMatrix(Mat4& matView, Mat4& matProj) const -{ - // view matrix - _node->getWorldRT(&(const_cast(this)->_worldRT)); - matView = _worldRT.getInversed(); - - // proj matrix - Mat4::createPerspective(_spotAngle * _spotAngleScale, - 1, - _shadowMinDepth, - _shadowMaxDepth, - &matProj); -} - -void Light::computeDirectionalLightViewProjMatrix(Mat4& matView, Mat4& matProj) const -{ - // view matrix - _node->getWorldRT(&(const_cast(this)->_worldRT)); - matView = _worldRT.getInversed(); - - // proj matrix - float halfSize = _shadowFustumSize / 2; - Mat4::createOrthographic(-halfSize, halfSize, -halfSize, halfSize, _shadowMinDepth, _shadowMaxDepth, &matProj); -} - -void Light::computePointLightViewProjMatrix(Mat4& matView, Mat4& matProj) const -{ - //REFINE -} - -RENDERER_END diff --git a/native/cocos/renderer/renderer/Light.h b/native/cocos/renderer/renderer/Light.h deleted file mode 100644 index da47f3d566..0000000000 --- a/native/cocos/renderer/renderer/Light.h +++ /dev/null @@ -1,316 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#pragma once - -#include -#include -#include "base/ccTypes.h" -#include "math/Mat4.h" -#include "../Macro.h" -#include "../Types.h" -#include "View.h" -#include "../scene/NodeProxy.hpp" - -RENDERER_BEGIN - -class FrameBuffer; -class Texture2D; -class RenderBuffer; -class DeviceGraphics; - -/** - * @addtogroup renderer - * @{ - */ - -/** - * @brief Manage scene light. - */ -class Light : public Ref -{ -public: - /** - * @brief Light type. - */ - enum class LightType - { - /** - * Directional light - */ - DIRECTIONAL, - /** - * Point light - */ - POINT, - /** - * Spot light - */ - SPOT, - /** - * Ambient light - */ - AMBIENT - }; - - /** - * @brief Shadow type. - */ - enum class ShadowType - { - /** - * No shadow - */ - NONE, - /** - * Hard shadow - */ - HARD, - /** - * Soft shadow - */ - SOFT - }; - - /** - * @brief The default constructor. - */ - Light(); - ~Light(); - - /** - * @brief Sets the light color. - */ - void setColor(float r, float g, float b); - /** - * @brief Gets the light color. - */ - inline Color3F getColor() const { return _color; } - /** - * @brief Sets the light intensity. - */ - void setIntensity(float val); - /** - * @brief Gets the light intensity. - */ - inline float getIntensity() const { return _intensity; } - /** - * @brief Sets the light type. - */ - inline void setType(LightType type) { _type = type; } - /** - * @brief Gets the light type. - */ - inline LightType getType() const { return _type; } - /** - * @brief Sets the spot light angle. - */ - void setSpotAngle(float val); - /** - * @brief Gets the spot light angle. - */ - inline float getSpotAngle() const { return _spotAngle; } - - /** - * @brief Sets the light attenuation exponent. - */ - void setSpotExp(float val); - /** - * @brief Gets the light attenuation exponent. - */ - inline float getSpotExp() const { return _spotExp; } - /** - * @brief Sets spot or point light range. - */ - inline void setRange(float val) { _range = val; } - /** - * @brief Gets spot or point light range. - */ - inline float getRange() const { return _range; } - /** - * @brief Gets the shadow type. - */ - void setShadowType(ShadowType val); - /** - * @brief Gets the shadow type. - */ - inline ShadowType getShadowType() const { return _shadowType; } - /** - * @brief Gets the shadow map texture. - */ - inline Texture2D* getShadowMap() const { return _shadowMap; } - /** - * @brief Gets the view projection matrix. - */ - inline Mat4 getViewPorjMatrix() const { return _viewProjMatrix; } - /** - * @brief Gets the view projection matrix. - */ - inline const Mat4& getViewProjMatrix() const { return _viewProjMatrix; } - /** - * @brief Gets the direction uniform. - */ - inline const Vec3& getDirectionUniform() const { return _directionUniform; } - /** - * @brief Gets the color uniform. - */ - inline const Vec3& getColorUniform() const { return _colorUniform; } - /** - * @brief Gets the position uniform. - */ - inline const Vec3& getPositionUniform() const { return _positionUniform; } - /** - * @brief Sets the resolution of shadow - */ - void setShadowResolution(uint32_t val); - /** - * @brief Gets the resolution of shadow - */ - inline uint32_t getShadowResolution() const { return _shadowResolution; } - - /** - * @brief Sets the shadow bias setting. - */ - inline void setShadowBias(float val) { _shadowBias = val; } - /** - * @brief Gets the shadow bias setting. - */ - inline float getShadowBias() const { return _shadowBias; } - /** - * @brief Sets the shadow darkness setting. - */ - inline void setShadowDarkness(float val) { _shadowDarkness = val; } - /** - * @brief Gets the shadow darkness setting. - */ - inline float getShadowDarkness() const { return _shadowDarkness; } - - /** - * @brief Sets the min depth of shadow. - */ - inline void setShadowMinDepth(float val) { _shadowMinDepth = val; } - /** - * @brief Gets the min depth of shadow. - */ - float getShadowMinDepth() const; - /** - * @brief Sets the max depth of shadow. - */ - inline void setShadowMaxDepth(float val) { _shadowMaxDepth = val; } - /** - * @brief Gets the max depth of shadow. - */ - float getShadowMaxDepth() const; - /** - * @brief Sets the shadow scale. - */ - inline void setShadowDepthScale(float val) { _shadowScale = val; } - /** - * @brief Gets the shadow scale. - */ - inline float getShadowDepthScale() const { return _shadowScale; } - /** - * @brief Sets the frustum edge fall off. - */ - inline void setFrustumEdgeFalloff(uint32_t val) { _frustumEdgeFalloff = val; } - /** - * @brief Gets the frustum edge fall off. - */ - inline uint32_t getFrustumEdgeFalloff() const { return _frustumEdgeFalloff; } - /** - * @brief Sets the world matrix. - */ - void setWorldMatrix(const Mat4& worldMatrix); - /** - * @brief Gets the world matrix. - */ - inline const Mat4& getWorldMatrix() const { return _node->getWorldMatrix(); } - /** - * @brief Extract light informations to view. - */ - void extractView(View& out, const std::vector& stages); - /** - * @brief Update light and generate new shadow map. - */ - void update(DeviceGraphics* device); - /** - * @brief Sets the shadow frustum size. - */ - inline void setShadowFrustumSize(float val) {_shadowFustumSize = val;}; - /** - * @brief Sets the related node proxy which provids model matrix for light. - */ - void setNode(NodeProxy* node); -private: - void updateLightPositionAndDirection(); - void generateShadowMap(DeviceGraphics* device); - void destroyShadowMap(); - void computeSpotLightViewProjMatrix(Mat4& matView, Mat4& matProj) const; - void computeDirectionalLightViewProjMatrix(Mat4& matView, Mat4& matProj) const; - void computePointLightViewProjMatrix(Mat4& matView, Mat4& matProj) const; - - LightType _type = LightType::DIRECTIONAL; - Color3F _color = {1.f, 1.f, 1.f}; - float _intensity = 1.f; - - // used for spot and point light - float _range = 1.f; - // used for spot light, default to 60 degrees - float _spotAngle = RENDERER_PI / 3; - float _spotExp = 1.f; - // cached for uniform - Vec3 _directionUniform; - Vec3 _positionUniform; - Vec3 _colorUniform = {_color.r * _intensity, _color.g * _intensity, _color.b * _intensity}; - float _spotUniform[2] = { std::cos(_spotAngle) * 0.5f, _spotExp}; - - // shadow params - ShadowType _shadowType = ShadowType::NONE; - FrameBuffer* _shadowFrameBuffer = nullptr; - Texture2D* _shadowMap = nullptr; - bool _shadowMapDirty = false; - RenderBuffer* _shadowDepthBuffer = nullptr; - uint32_t _shadowResolution = 1024; - float _shadowBias = 0.0005f; - float _shadowDarkness = 1.f; - float _shadowMinDepth = 1; - float _shadowMaxDepth = 1000; - float _shadowScale = 50; // maybe need to change it if the distance between shadowMaxDepth and shadowMinDepth is small. - uint32_t _frustumEdgeFalloff = 0; // used by directional and spot light. - Mat4 _viewProjMatrix; - float _spotAngleScale = 1; // used for spot light. - float _shadowFustumSize = 50; // used for directional light. - - Mat4 _worldMatrix; - Mat4 _worldRT; - - NodeProxy* _node = nullptr; - - Vec3 _forward = Vec3(0, 0, -1.f); -}; - -// end of renderer group -/// @} - -RENDERER_END diff --git a/native/cocos/renderer/renderer/Model.cpp b/native/cocos/renderer/renderer/Model.cpp deleted file mode 100644 index e7913f7f55..0000000000 --- a/native/cocos/renderer/renderer/Model.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "Model.h" -#include "Effect.h" -#include "InputAssembler.h" -#include "../scene/NodeProxy.hpp" -#include "../gfx/VertexBuffer.h" -#include "math/MathUtil.h" - -RENDERER_BEGIN - -// Implementation of Model pool. - -ccCArray* ModelPool::_pool = ccCArrayNew(500); - -Model* ModelPool::getOrCreateModel() -{ - Model* model = nullptr; - if (0 != _pool->num) - { - model = static_cast(ModelPool::_pool->arr[ModelPool::_pool->num - 1]); - ccCArrayRemoveValueAtIndex(ModelPool::_pool, ModelPool::_pool->num - 1); - } - else - model = new Model(); - - return model; -} - -void ModelPool::returnModel(Model *model) -{ - if (ModelPool::_pool->num < ModelPool::_pool->max) - { - model->reset(); - ccCArrayAppendValue(ModelPool::_pool, model); - } - else - delete model; -} - -// Implementation of Model - -Model::Model() -{ -} - -Model::~Model() -{ - reset(); -} - -void Model::setInputAssembler(const InputAssembler& ia) -{ - _inputAssembler = ia; -} - -void Model::setEffect(Effect* effect, CustomProperties* customProperties) -{ - if (_effect != effect) - { - CC_SAFE_RELEASE(_effect); - _effect = effect; - CC_SAFE_RETAIN(_effect); - } - - _uniforms.clear(); - _definesList.clear(); - - _definesKeyHash = 0; - - if (effect != nullptr) - { - _definesList.push_back(effect->extractDefines()); - _uniforms.push_back(effect->extractProperties()); - - MathUtil::combineHash(_definesKeyHash, std::hash{}(effect->getDefinesKey())); - } - - if (customProperties != nullptr) - { - _definesList.push_back(customProperties->extractDefines()); - _uniforms.push_back(customProperties->extractProperties()); - - MathUtil::combineHash(_definesKeyHash, std::hash{}(customProperties->getDefinesKey())); - } -} - -void Model::setNode(NodeProxy* node) -{ - if (_node != node) - { - CC_SAFE_RELEASE(_node); - _node = node; - CC_SAFE_RETAIN(_node); - } -} - -void Model::extractDrawItem(DrawItem& out) const -{ - if (_dynamicIA) - { - out.model = const_cast(this); - out.ia = nullptr; - out.effect = _effect; - out.defines = const_cast*>(&_definesList); - - return; - } - - out.model = const_cast(this); - out.ia = const_cast(&_inputAssembler); - out.effect = _effect; - out.defines = const_cast*>(&_definesList); - out.uniforms = const_cast*>*>(&_uniforms); - out.definesKeyHash = _definesKeyHash; -} - -void Model::reset() -{ - CC_SAFE_RELEASE_NULL(_effect); - CC_SAFE_RELEASE_NULL(_node); - _inputAssembler.clear(); - _uniforms.clear(); - _definesList.clear(); -} - -RENDERER_END diff --git a/native/cocos/renderer/renderer/Model.h b/native/cocos/renderer/renderer/Model.h deleted file mode 100644 index 258e6a721e..0000000000 --- a/native/cocos/renderer/renderer/Model.h +++ /dev/null @@ -1,150 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#pragma once - -#include -#include -#include "base/CCVector.h" -#include "base/CCValue.h" -#include "base/ccCArray.h" -#include "math/Mat4.h" -#include "../Macro.h" -#include "InputAssembler.h" -#include "../gfx/DeviceGraphics.h" -#include "CustomProperties.hpp" -#include "../scene/NodeProxy.hpp" - -RENDERER_BEGIN - -class Effect; -class InputAssembler; -class Model; - -/** - * @addtogroup renderer - * @{ - */ - -struct DrawItem -{ - Model* model = nullptr; - InputAssembler* ia = nullptr; - Effect* effect = nullptr; - std::vector* defines = nullptr; - size_t definesKeyHash = 0; - std::vector*>* uniforms = nullptr; -}; - -class Model; - -class ModelPool -{ -public: - static Model* getOrCreateModel(); - static void returnModel(Model*); - -private: - static ccCArray* _pool;; -}; - -/** - * @brief Model contains InputAssembler, effect, culling mask and model matrix. - */ -class Model -{ -public: - /** - * @brief The default constructor. - */ - Model(); - /** - * @brief The default destructor. - */ - ~Model(); - /** - * @brief Sets model matrix. - */ - inline void setWorldMatix(const Mat4& matrix) { _worldMatrix = matrix; } - /** - * @brief Gets mode matrix. - */ - inline const Mat4& getWorldMatrix() const { return _worldMatrix; } - /** - * @brief Sets culling mask. - */ - inline void setCullingMask(int val) { _cullingMask = val; } - /** - * @brief Gets culling mask. - */ - inline int getCullingMask() const { return _cullingMask; } - /** - * @brief Adds a input assembler. - */ - void setInputAssembler(const InputAssembler& ia); - /** - * @brief Adds an effect. - */ - void setEffect(Effect* effect, CustomProperties* customProperties); - /** - * @brief Set user key. - */ - inline void setUserKey(int key) { _userKey = key; }; - /** - * @brief Set node. - */ - void setNode(NodeProxy* node); - /** - * @brief Get node. - */ - inline const NodeProxy* getNode() const { return _node; }; - /** - * @brief Extract draw item for the given index during rendering process. - */ - void extractDrawItem(DrawItem& out) const; - /** - * @brief Resets models. - */ - void reset(); -private: - friend class ModelPool; - - NodeProxy* _node = nullptr; - Mat4 _worldMatrix; - Effect* _effect = nullptr; - - InputAssembler _inputAssembler; - std::vector _definesList; - std::vector*> _uniforms; - bool _dynamicIA = false; - int _cullingMask = -1; - int _userKey = -1; - - size_t _definesKeyHash = 0; -}; - -// end of renderer group -/// @} - -RENDERER_END diff --git a/native/cocos/renderer/renderer/Pass.cpp b/native/cocos/renderer/renderer/Pass.cpp deleted file mode 100644 index f383ef3199..0000000000 --- a/native/cocos/renderer/renderer/Pass.cpp +++ /dev/null @@ -1,151 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#include "Pass.h" - -RENDERER_BEGIN - -Pass::Pass(const std::string& programName) -: _programName(programName) -{ - _hashName = std::hash{}(programName); -// RENDERER_LOGD("Pass constructor: %p", this); -} - -Pass::~Pass() -{ -// RENDERER_LOGD("Pass destructor: %p", this); -} - -void Pass::setCullMode(CullMode cullMode) -{ - _cullMode = cullMode; -} - -void Pass::setBlend(BlendOp blendEq, - BlendFactor blendSrc, - BlendFactor blendDst, - BlendOp blendAlphaEq, - BlendFactor blendSrcAlpha, - BlendFactor blendDstAlpha, - uint32_t blendColor) -{ - _blend = true; - _blendEq = blendEq; - _blendSrc = blendSrc; - _blendDst = blendDst; - _blendAlphaEq = blendAlphaEq; - _blendSrcAlpha = blendSrcAlpha; - _blendDstAlpha = blendDstAlpha; - _blendColor = blendColor; -} - -void Pass::setDepth(bool depthTest, bool depthWrite, DepthFunc depthFunc) -{ - _depthTest = depthTest; - _depthWrite = depthWrite; - _depthFunc = depthFunc; -} - -void Pass::setStencilFront(StencilFunc stencilFunc, - uint32_t stencilRef, - uint8_t stencilMask, - StencilOp stencilFailOp, - StencilOp stencilZFailOp, - StencilOp stencilZPassOp, - uint8_t stencilWriteMask) -{ - _stencilTest = true; - _stencilFuncFront = stencilFunc; - _stencilRefFront = stencilRef; - _stencilMaskFront = stencilMask; - _stencilFailOpFront = stencilFailOp; - _stencilZFailOpFront = stencilZFailOp; - _stencilZPassOpFront = stencilZPassOp; - _stencilWriteMaskFront = stencilWriteMask; -} - -void Pass::setStencilBack(StencilFunc stencilFunc, - uint32_t stencilRef, - uint8_t stencilMask, - StencilOp stencilFailOp, - StencilOp stencilZFailOp, - StencilOp stencilZPassOp, - uint8_t stencilWriteMask) -{ - _stencilTest = true; - _stencilFuncBack = stencilFunc; - _stencilRefBack = stencilRef; - _stencilMaskBack = stencilMask; - _stencilFailOpBack = stencilFailOp; - _stencilZFailOpBack = stencilZFailOp; - _stencilZPassOpBack = stencilZPassOp; - _stencilWriteMaskBack = stencilWriteMask; -} - -void Pass::copy(const Pass& pass) -{ - // blending - _blend = pass._blend; - _blendEq = pass._blendEq; - _blendAlphaEq = pass._blendAlphaEq; - _blendSrc = pass._blendSrc; - _blendDst = pass._blendDst; - _blendSrcAlpha = pass._blendSrcAlpha; - _blendDstAlpha = pass._blendDstAlpha; - _blendColor = pass._blendColor; - - // depth - _depthTest = pass._depthTest; - _depthWrite = pass._depthWrite; - _depthFunc = pass._depthFunc; - - // stencil - - _stencilTest = pass._stencilTest; - // front - _stencilRefFront = pass._stencilRefFront; - _stencilFuncFront = pass._stencilFuncFront; - _stencilFailOpFront = pass._stencilFailOpFront; - _stencilZFailOpFront = pass._stencilZFailOpFront; - _stencilZPassOpFront = pass._stencilZPassOpFront; - _stencilWriteMaskFront = pass._stencilWriteMaskFront; - _stencilMaskFront = pass._stencilMaskFront; - // back - _stencilRefBack = pass._stencilRefBack; - _stencilFuncBack = pass._stencilFuncBack; - _stencilFailOpBack = pass._stencilFailOpBack; - _stencilZFailOpBack = pass._stencilZFailOpBack; - _stencilZPassOpBack = pass._stencilZPassOpBack; - _stencilWriteMaskBack = pass._stencilWriteMaskBack; - _stencilMaskBack = pass._stencilMaskBack; - - // cull mode - _cullMode = pass._cullMode; - - _programName = pass._programName; - _hashName = pass._hashName; -} - -RENDERER_END diff --git a/native/cocos/renderer/renderer/Pass.h b/native/cocos/renderer/renderer/Pass.h deleted file mode 100644 index 31c4d3a199..0000000000 --- a/native/cocos/renderer/renderer/Pass.h +++ /dev/null @@ -1,189 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -#pragma once - -#include -#include -#include "../Macro.h" -#include "../Types.h" - -RENDERER_BEGIN - -/** - * @addtogroup renderer - * @{ - */ - -/** - * @brief Pass describes base render pass configurations, including program, cull face, blending, depth testing and stencil testing configs.\n - * JS API: renderer.Pass - * @code - * let pass = new renderer.Pass('sprite'); - * pass.setDepth(false, false); - * pass.setCullMode(gfx.CULL_NONE); - * pass.setBlend( - * gfx.BLEND_FUNC_ADD, - * gfx.BLEND_SRC_ALPHA, gfx.BLEND_ONE_MINUS_SRC_ALPHA, - * gfx.BLEND_FUNC_ADD, - * gfx.BLEND_SRC_ALPHA, gfx.BLEND_ONE_MINUS_SRC_ALPHA - * ); - * @endcode - */ -class Pass : public Ref -{ -public: - /** - * @brief Constructor with linked program name. - * @param[in] programName Shader program name - */ - Pass(const std::string& programName); - Pass() {}; - ~Pass(); - - /** - * @brief Sets cull mode. - * @param[in] cullMode Cull front or back or both. - */ - void setCullMode(CullMode cullMode); - /** - * @brief Sets blend mode. - * @param[in] blendEq RGB blend equation. - * @param[in] blendSrc Src RGB blend factor. - * @param[in] blendDst Dst RGB blend factor. - * @param[in] blendAlphaEq Alpha blend equation. - * @param[in] blendSrcAlpha Src Alpha blend equation. - * @param[in] blendDstAlpha Dst Alpha blend equation. - * @param[in] blendColor Blend constant color value. - */ - void setBlend(BlendOp blendEq = BlendOp::ADD, - BlendFactor blendSrc = BlendFactor::ONE, - BlendFactor blendDst = BlendFactor::ZERO, - BlendOp blendAlphaEq = BlendOp::ADD, - BlendFactor blendSrcAlpha = BlendFactor::ONE, - BlendFactor blendDstAlpha = BlendFactor::ZERO, - uint32_t blendColor = 0xffffffff); - /** - * @brief Switch depth test or write, and sets depth test function. - * @param[in] depthTest Enable depth test or not. - * @param[in] depthWrite Enable depth write or not. - * @param[in] depthFunc Depth test function. - */ - void setDepth(bool depthTest = false, - bool depthWrite = false, - DepthFunc depthFunc = DepthFunc::LESS); - /** - * @brief Sets stencil front-facing function, reference, mask, fail operation, write mask. - */ - void setStencilFront(StencilFunc stencilFunc = StencilFunc::ALWAYS, - uint32_t stencilRef = 0, - uint8_t stencilMask = 0xff, - StencilOp stencilFailOp = StencilOp::KEEP, - StencilOp stencilZFailOp = StencilOp::KEEP, - StencilOp stencilZPassOp = StencilOp::KEEP, - uint8_t stencilWriteMask = 0xff); - /** - * @brief Sets stencil back-facing function, reference, mask, fail operation, write mask. - */ - void setStencilBack(StencilFunc stencilFunc = StencilFunc::ALWAYS, - uint32_t stencilRef = 0, - uint8_t stencilMask = 0xff, - StencilOp stencilFailOp = StencilOp::KEEP, - StencilOp stencilZFailOp = StencilOp::KEEP, - StencilOp stencilZPassOp = StencilOp::KEEP, - uint8_t stencilWriteMask = 0xff); - /* - * @brief Sets stencil test enabled or not. - */ - inline void setStencilTest(bool value) { _stencilTest = value; } - /** - * @brief Gets stencil test enabled or not. - */ - inline bool getStencilTest() const { return _stencilTest; } - /** - * @brief Sets linked program name. - */ - inline void setProgramName(const std::string& programName) { _programName = programName; } - /** - * @brief Gets linked program name. - */ - inline const std::string& getProgramName() const { return _programName; } - - inline size_t getHashName() const { return _hashName; } - /** - * @brief Disable stencil test. - */ - inline void disableStencilTest() { _stencilTest = false; } - /** - * @brief deep copy from other pass. - */ - void copy(const Pass& pass); - -private: - friend class BaseRenderer; - - // blending - bool _blend = false; - BlendOp _blendEq = BlendOp::ADD; - BlendOp _blendAlphaEq = BlendOp::ADD; - BlendFactor _blendSrc = BlendFactor::SRC_ALPHA; - BlendFactor _blendDst = BlendFactor::ONE_MINUS_SRC_ALPHA; - BlendFactor _blendSrcAlpha = BlendFactor::SRC_ALPHA; - BlendFactor _blendDstAlpha = BlendFactor::ONE_MINUS_SRC_ALPHA; - uint32_t _blendColor = 0xffffffff; - - // depth - bool _depthTest = false; - bool _depthWrite = false; - DepthFunc _depthFunc = DepthFunc::LESS; - - // stencil - bool _stencilTest = false; - // front - uint32_t _stencilRefFront = 0; - StencilFunc _stencilFuncFront = StencilFunc::ALWAYS; - StencilOp _stencilFailOpFront = StencilOp::KEEP; - StencilOp _stencilZFailOpFront = StencilOp::KEEP; - StencilOp _stencilZPassOpFront = StencilOp::KEEP; - uint8_t _stencilWriteMaskFront = 0xff; - uint8_t _stencilMaskFront = 0xff; - // back - uint32_t _stencilRefBack = 0; - StencilFunc _stencilFuncBack = StencilFunc::ALWAYS; - StencilOp _stencilFailOpBack = StencilOp::KEEP; - StencilOp _stencilZFailOpBack = StencilOp::KEEP; - StencilOp _stencilZPassOpBack = StencilOp::KEEP; - uint8_t _stencilWriteMaskBack = 0xff; - uint8_t _stencilMaskBack = 0xff; - - // cull mode - CullMode _cullMode = CullMode::BACK; - - std::string _programName = ""; - size_t _hashName = 0; -}; - -// end of renderer group -/// @} -RENDERER_END diff --git a/native/cocos/renderer/renderer/ProgramLib.cpp b/native/cocos/renderer/renderer/ProgramLib.cpp deleted file mode 100644 index 91d979fd00..0000000000 --- a/native/cocos/renderer/renderer/ProgramLib.cpp +++ /dev/null @@ -1,341 +0,0 @@ -/**************************************************************************** - Copyright (c) 2018 Xiamen Yaji Software Co., Ltd. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ -#include "ProgramLib.h" -#include "../gfx/Program.h" -#include "gfx/DeviceGraphics.h" - -#include "math/MathUtil.h" - -#include -#include -#include -#include - -namespace { - uint32_t _shdID = 0; - - std::string generateDefines(const std::vector& definesList) - { - std::string ret; - std::string v; - cocos2d::ValueMap cache; - for (int i = (int)definesList.size() - 1; i >= 0; i--) - { - cocos2d::ValueMap* defMap = definesList[i]; - for (const auto& def : *defMap) - { - if (cache.find(def.first) != cache.end()) - { - continue; - } - - if (def.second.getType() == cocos2d::Value::Type::BOOLEAN) - { - v = def.second.asBool() ? "1" : "0"; - } - else - { - v = std::to_string(def.second.asUnsignedInt()); - } - - ret += "#define " + def.first + " " + v + "\n"; - - cache.emplace(def.first, def.second); - } - } - - return ret; - } - - std::string replaceMacroNums(const std::string str, const std::vector& definesList) - { - cocos2d::ValueMap cache; - std::string tmp = str; - for (int i = (int)definesList.size() - 1; i >= 0; i--) - { - cocos2d::ValueMap* defMap = definesList[i]; - - for (const auto& def : *defMap) - { - if (cache.find(def.first) != cache.end()) - { - continue; - } - - if (def.second.getType() == cocos2d::Value::Type::INTEGER || def.second.getType() == cocos2d::Value::Type::UNSIGNED) - { - cache.emplace(def.first, def.second); - } - } - } - - for (const auto& def : cache) - { - std::regex pattern(def.first); - tmp = std::regex_replace(tmp, pattern, def.second.asString()); - } - - return tmp; - } - - using RegexReplaceCallback = std::function&)>; - - static std::string regexReplaceString(const std::string& text, const std::string& pattern, const RegexReplaceCallback& replaceCallback) - { - std::string ret = text; - std::regex re(pattern); - - std::string::const_iterator text_iter = text.cbegin(); - std::match_results results; - - size_t start = 0; - size_t offset = 0; - while (std::regex_search(text_iter, text.end(), results, re)) - { - offset = start + results.position(); - std::string replacement = replaceCallback(results); - ret = ret.replace(offset, results.length(), replacement); - start = offset + replacement.length(); - - text_iter = results[0].second; - } - - return ret; - } - - std::string unrollLoops(const std::string& text) - { - auto func = [](const std::match_results& results) -> std::string { - assert(results.size() == 5); - std::string snippet = results[4].str(); - std::string replacePatternStr = "\\{" + results[1].str() + "\\}"; - std::regex replacePattern(replacePatternStr); - - int32_t parsedBegin = atoi(results[2].str().c_str()); - int32_t parsedEnd = atoi(results[3].str().c_str()); - if (parsedBegin < 0 || parsedEnd < 0) - { - RENDERER_LOGE("Unroll For Loops Error: begin and end of range must be an int num."); - } - - std::string unroll; - char tmp[256] = {0}; - for (int32_t i = parsedBegin; i < parsedEnd; ++i) - { - snprintf(tmp, 256, "%d", i); - std::string replaceFormat(tmp); - unroll += std::regex_replace(snippet, replacePattern, replaceFormat); - } - return unroll; - }; - - return regexReplaceString(text, "#pragma for (\\w+) in range\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*\\)([\\s\\S]+?)#pragma endFor", func); - } -} - -std::string test_unrollLoops(const std::string& text) -{ - return unrollLoops(text); -} - -RENDERER_BEGIN - -ProgramLib::ProgramLib(DeviceGraphics* device, std::vector