safex-webgl 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.prettierrc +6 -0
- package/@types/index.d.ts +36 -0
- package/README.md +152 -0
- package/bun.lock +353 -0
- package/dist/actions/Action.d.ts +27 -0
- package/dist/actions/Action.d.ts.map +1 -0
- package/dist/actions/Action.js +62 -0
- package/dist/actions/Action.js.map +1 -0
- package/dist/actions/ActionBezier.d.ts +121 -0
- package/dist/actions/ActionBezier.d.ts.map +1 -0
- package/dist/actions/ActionBezier.js +221 -0
- package/dist/actions/ActionBezier.js.map +1 -0
- package/dist/actions/ActionBlink.d.ts +62 -0
- package/dist/actions/ActionBlink.d.ts.map +1 -0
- package/dist/actions/ActionBlink.js +96 -0
- package/dist/actions/ActionBlink.js.map +1 -0
- package/dist/actions/ActionCatmullRom.d.ts +242 -0
- package/dist/actions/ActionCatmullRom.d.ts.map +1 -0
- package/dist/actions/ActionCatmullRom.js +436 -0
- package/dist/actions/ActionCatmullRom.js.map +1 -0
- package/dist/actions/ActionFade.d.ts +126 -0
- package/dist/actions/ActionFade.d.ts.map +1 -0
- package/dist/actions/ActionFade.js +190 -0
- package/dist/actions/ActionFade.js.map +1 -0
- package/dist/actions/ActionInstant.d.ts +237 -0
- package/dist/actions/ActionInstant.d.ts.map +1 -0
- package/dist/actions/ActionInstant.js +386 -0
- package/dist/actions/ActionInstant.js.map +1 -0
- package/dist/actions/ActionInterval.d.ts +132 -0
- package/dist/actions/ActionInterval.d.ts.map +1 -0
- package/dist/actions/ActionInterval.js +254 -0
- package/dist/actions/ActionInterval.js.map +1 -0
- package/dist/actions/ActionJump.d.ts +146 -0
- package/dist/actions/ActionJump.d.ts.map +1 -0
- package/dist/actions/ActionJump.js +239 -0
- package/dist/actions/ActionJump.js.map +1 -0
- package/dist/actions/ActionMove.d.ts +73 -0
- package/dist/actions/ActionMove.d.ts.map +1 -0
- package/dist/actions/ActionMove.js +164 -0
- package/dist/actions/ActionMove.js.map +1 -0
- package/dist/actions/ActionRotate.d.ts +137 -0
- package/dist/actions/ActionRotate.d.ts.map +1 -0
- package/dist/actions/ActionRotate.js +214 -0
- package/dist/actions/ActionRotate.js.map +1 -0
- package/dist/actions/ActionScale.d.ts +110 -0
- package/dist/actions/ActionScale.d.ts.map +1 -0
- package/dist/actions/ActionScale.js +157 -0
- package/dist/actions/ActionScale.js.map +1 -0
- package/dist/actions/ActionSkew.d.ts +120 -0
- package/dist/actions/ActionSkew.d.ts.map +1 -0
- package/dist/actions/ActionSkew.js +185 -0
- package/dist/actions/ActionSkew.js.map +1 -0
- package/dist/actions/ActionTint.d.ts +132 -0
- package/dist/actions/ActionTint.d.ts.map +1 -0
- package/dist/actions/ActionTint.js +193 -0
- package/dist/actions/ActionTint.js.map +1 -0
- package/dist/actions/Animate.d.ts +77 -0
- package/dist/actions/Animate.d.ts.map +1 -0
- package/dist/actions/Animate.js +177 -0
- package/dist/actions/Animate.js.map +1 -0
- package/dist/actions/DelayTime.d.ts +95 -0
- package/dist/actions/DelayTime.d.ts.map +1 -0
- package/dist/actions/DelayTime.js +145 -0
- package/dist/actions/DelayTime.js.map +1 -0
- package/dist/actions/FiniteTimeAction.d.ts +11 -0
- package/dist/actions/FiniteTimeAction.d.ts.map +1 -0
- package/dist/actions/FiniteTimeAction.js +24 -0
- package/dist/actions/FiniteTimeAction.js.map +1 -0
- package/dist/actions/Follow.d.ts +23 -0
- package/dist/actions/Follow.d.ts.map +1 -0
- package/dist/actions/Follow.js +98 -0
- package/dist/actions/Follow.js.map +1 -0
- package/dist/actions/Repeat.d.ts +151 -0
- package/dist/actions/Repeat.d.ts.map +1 -0
- package/dist/actions/Repeat.js +276 -0
- package/dist/actions/Repeat.js.map +1 -0
- package/dist/actions/Sequence.d.ts +77 -0
- package/dist/actions/Sequence.d.ts.map +1 -0
- package/dist/actions/Sequence.js +190 -0
- package/dist/actions/Sequence.js.map +1 -0
- package/dist/actions/Spawn.d.ts +63 -0
- package/dist/actions/Spawn.d.ts.map +1 -0
- package/dist/actions/Spawn.js +146 -0
- package/dist/actions/Spawn.js.map +1 -0
- package/dist/actions/Speed.d.ts +19 -0
- package/dist/actions/Speed.d.ts.map +1 -0
- package/dist/actions/Speed.js +57 -0
- package/dist/actions/Speed.js.map +1 -0
- package/dist/actions/TargetedAction.d.ts +67 -0
- package/dist/actions/TargetedAction.d.ts.map +1 -0
- package/dist/actions/TargetedAction.js +99 -0
- package/dist/actions/TargetedAction.js.map +1 -0
- package/dist/actions/easing/ActionEase.d.ts +133 -0
- package/dist/actions/easing/ActionEase.d.ts.map +1 -0
- package/dist/actions/easing/ActionEase.js +184 -0
- package/dist/actions/easing/ActionEase.js.map +1 -0
- package/dist/actions/easing/Back.d.ts +174 -0
- package/dist/actions/easing/Back.d.ts.map +1 -0
- package/dist/actions/easing/Back.js +227 -0
- package/dist/actions/easing/Back.js.map +1 -0
- package/dist/actions/easing/Bezier.d.ts +94 -0
- package/dist/actions/easing/Bezier.d.ts.map +1 -0
- package/dist/actions/easing/Bezier.js +124 -0
- package/dist/actions/easing/Bezier.js.map +1 -0
- package/dist/actions/easing/Bounce.d.ts +203 -0
- package/dist/actions/easing/Bounce.d.ts.map +1 -0
- package/dist/actions/easing/Bounce.js +288 -0
- package/dist/actions/easing/Bounce.js.map +1 -0
- package/dist/actions/easing/Circle.d.ts +177 -0
- package/dist/actions/easing/Circle.d.ts.map +1 -0
- package/dist/actions/easing/Circle.js +220 -0
- package/dist/actions/easing/Circle.js.map +1 -0
- package/dist/actions/easing/Cubic.d.ts +165 -0
- package/dist/actions/easing/Cubic.d.ts.map +1 -0
- package/dist/actions/easing/Cubic.js +209 -0
- package/dist/actions/easing/Cubic.js.map +1 -0
- package/dist/actions/easing/Elastic.d.ts +269 -0
- package/dist/actions/easing/Elastic.d.ts.map +1 -0
- package/dist/actions/easing/Elastic.js +358 -0
- package/dist/actions/easing/Elastic.js.map +1 -0
- package/dist/actions/easing/Exponential.d.ts +181 -0
- package/dist/actions/easing/Exponential.d.ts.map +1 -0
- package/dist/actions/easing/Exponential.js +214 -0
- package/dist/actions/easing/Exponential.js.map +1 -0
- package/dist/actions/easing/InOut.d.ts +191 -0
- package/dist/actions/easing/InOut.d.ts.map +1 -0
- package/dist/actions/easing/InOut.js +254 -0
- package/dist/actions/easing/InOut.js.map +1 -0
- package/dist/actions/easing/Quartic.d.ts +232 -0
- package/dist/actions/easing/Quartic.d.ts.map +1 -0
- package/dist/actions/easing/Quartic.js +313 -0
- package/dist/actions/easing/Quartic.js.map +1 -0
- package/dist/actions/easing/Quintic.d.ts +168 -0
- package/dist/actions/easing/Quintic.d.ts.map +1 -0
- package/dist/actions/easing/Quintic.js +212 -0
- package/dist/actions/easing/Quintic.js.map +1 -0
- package/dist/actions/easing/Sine.d.ts +176 -0
- package/dist/actions/easing/Sine.d.ts.map +1 -0
- package/dist/actions/easing/Sine.js +206 -0
- package/dist/actions/easing/Sine.js.map +1 -0
- package/dist/actions/index.d.ts +16 -0
- package/dist/actions/index.d.ts.map +1 -0
- package/dist/actions/index.js +16 -0
- package/dist/actions/index.js.map +1 -0
- package/dist/audio/Audio.d.ts +47 -0
- package/dist/audio/Audio.d.ts.map +1 -0
- package/dist/audio/Audio.js +255 -0
- package/dist/audio/Audio.js.map +1 -0
- package/dist/audio/engine.d.ts +171 -0
- package/dist/audio/engine.d.ts.map +1 -0
- package/dist/audio/engine.js +556 -0
- package/dist/audio/engine.js.map +1 -0
- package/dist/audio/index.d.ts +3 -0
- package/dist/audio/index.d.ts.map +1 -0
- package/dist/audio/index.js +3 -0
- package/dist/audio/index.js.map +1 -0
- package/dist/boot.d.ts +80 -0
- package/dist/boot.d.ts.map +1 -0
- package/dist/boot.js +468 -0
- package/dist/boot.js.map +1 -0
- package/dist/clipping-nodes/ClippingNode.d.ts +114 -0
- package/dist/clipping-nodes/ClippingNode.d.ts.map +1 -0
- package/dist/clipping-nodes/ClippingNode.js +177 -0
- package/dist/clipping-nodes/ClippingNode.js.map +1 -0
- package/dist/clipping-nodes/ClippingNodeWebGLRenderCmd.d.ts +25 -0
- package/dist/clipping-nodes/ClippingNodeWebGLRenderCmd.d.ts.map +1 -0
- package/dist/clipping-nodes/ClippingNodeWebGLRenderCmd.js +157 -0
- package/dist/clipping-nodes/ClippingNodeWebGLRenderCmd.js.map +1 -0
- package/dist/core/ActionManager.d.ts +56 -0
- package/dist/core/ActionManager.d.ts.map +1 -0
- package/dist/core/ActionManager.js +253 -0
- package/dist/core/ActionManager.js.map +1 -0
- package/dist/core/Configuration.d.ts +108 -0
- package/dist/core/Configuration.d.ts.map +1 -0
- package/dist/core/Configuration.js +232 -0
- package/dist/core/Configuration.js.map +1 -0
- package/dist/core/Director.d.ts +130 -0
- package/dist/core/Director.d.ts.map +1 -0
- package/dist/core/Director.js +580 -0
- package/dist/core/Director.js.map +1 -0
- package/dist/core/DrawingPrimitivesWebGL.d.ts +32 -0
- package/dist/core/DrawingPrimitivesWebGL.d.ts.map +1 -0
- package/dist/core/DrawingPrimitivesWebGL.js +273 -0
- package/dist/core/DrawingPrimitivesWebGL.js.map +1 -0
- package/dist/core/Scheduler.d.ts +110 -0
- package/dist/core/Scheduler.d.ts.map +1 -0
- package/dist/core/Scheduler.js +687 -0
- package/dist/core/Scheduler.js.map +1 -0
- package/dist/core/base-nodes/BaseNodesPropertyDefine.d.ts +2 -0
- package/dist/core/base-nodes/BaseNodesPropertyDefine.d.ts.map +1 -0
- package/dist/core/base-nodes/BaseNodesPropertyDefine.js +37 -0
- package/dist/core/base-nodes/BaseNodesPropertyDefine.js.map +1 -0
- package/dist/core/base-nodes/CustomRenderCmd.d.ts +9 -0
- package/dist/core/base-nodes/CustomRenderCmd.d.ts.map +1 -0
- package/dist/core/base-nodes/CustomRenderCmd.js +16 -0
- package/dist/core/base-nodes/CustomRenderCmd.js.map +1 -0
- package/dist/core/base-nodes/Node.d.ts +285 -0
- package/dist/core/base-nodes/Node.d.ts.map +1 -0
- package/dist/core/base-nodes/Node.js +1112 -0
- package/dist/core/base-nodes/Node.js.map +1 -0
- package/dist/core/base-nodes/NodeRenderCmd.d.ts +65 -0
- package/dist/core/base-nodes/NodeRenderCmd.d.ts.map +1 -0
- package/dist/core/base-nodes/NodeRenderCmd.js +460 -0
- package/dist/core/base-nodes/NodeRenderCmd.js.map +1 -0
- package/dist/core/base-nodes/NodeWebGLRenderCmd.d.ts +17 -0
- package/dist/core/base-nodes/NodeWebGLRenderCmd.d.ts.map +1 -0
- package/dist/core/base-nodes/NodeWebGLRenderCmd.js +29 -0
- package/dist/core/base-nodes/NodeWebGLRenderCmd.js.map +1 -0
- package/dist/core/cocoa/AffineTransform.d.ts +201 -0
- package/dist/core/cocoa/AffineTransform.d.ts.map +1 -0
- package/dist/core/cocoa/AffineTransform.js +260 -0
- package/dist/core/cocoa/AffineTransform.js.map +1 -0
- package/dist/core/cocoa/Geometry.d.ts +176 -0
- package/dist/core/cocoa/Geometry.d.ts.map +1 -0
- package/dist/core/cocoa/Geometry.js +237 -0
- package/dist/core/cocoa/Geometry.js.map +1 -0
- package/dist/core/event-manager/Event.d.ts +57 -0
- package/dist/core/event-manager/Event.d.ts.map +1 -0
- package/dist/core/event-manager/Event.js +69 -0
- package/dist/core/event-manager/Event.js.map +1 -0
- package/dist/core/event-manager/EventCustom.d.ts +22 -0
- package/dist/core/event-manager/EventCustom.d.ts.map +1 -0
- package/dist/core/event-manager/EventCustom.js +31 -0
- package/dist/core/event-manager/EventCustom.js.map +1 -0
- package/dist/core/event-manager/EventExtension.d.ts +33 -0
- package/dist/core/event-manager/EventExtension.d.ts.map +1 -0
- package/dist/core/event-manager/EventExtension.js +80 -0
- package/dist/core/event-manager/EventExtension.js.map +1 -0
- package/dist/core/event-manager/EventFocus.d.ts +17 -0
- package/dist/core/event-manager/EventFocus.d.ts.map +1 -0
- package/dist/core/event-manager/EventFocus.js +21 -0
- package/dist/core/event-manager/EventFocus.js.map +1 -0
- package/dist/core/event-manager/EventHelper.d.ts +8 -0
- package/dist/core/event-manager/EventHelper.d.ts.map +1 -0
- package/dist/core/event-manager/EventHelper.js +92 -0
- package/dist/core/event-manager/EventHelper.js.map +1 -0
- package/dist/core/event-manager/EventListener.d.ts +53 -0
- package/dist/core/event-manager/EventListener.d.ts.map +1 -0
- package/dist/core/event-manager/EventListener.js +95 -0
- package/dist/core/event-manager/EventListener.js.map +1 -0
- package/dist/core/event-manager/EventListenerCustom.d.ts +11 -0
- package/dist/core/event-manager/EventListenerCustom.d.ts.map +1 -0
- package/dist/core/event-manager/EventListenerCustom.js +37 -0
- package/dist/core/event-manager/EventListenerCustom.js.map +1 -0
- package/dist/core/event-manager/EventListenerFocus.d.ts +10 -0
- package/dist/core/event-manager/EventListenerFocus.d.ts.map +1 -0
- package/dist/core/event-manager/EventListenerFocus.js +28 -0
- package/dist/core/event-manager/EventListenerFocus.js.map +1 -0
- package/dist/core/event-manager/EventListenerMouse.d.ts +13 -0
- package/dist/core/event-manager/EventListenerMouse.d.ts.map +1 -0
- package/dist/core/event-manager/EventListenerMouse.js +49 -0
- package/dist/core/event-manager/EventListenerMouse.js.map +1 -0
- package/dist/core/event-manager/EventListenerTouchAllAtOnce.d.ts +12 -0
- package/dist/core/event-manager/EventListenerTouchAllAtOnce.d.ts.map +1 -0
- package/dist/core/event-manager/EventListenerTouchAllAtOnce.js +28 -0
- package/dist/core/event-manager/EventListenerTouchAllAtOnce.js.map +1 -0
- package/dist/core/event-manager/EventListenerTouchOneByOne.d.ts +16 -0
- package/dist/core/event-manager/EventListenerTouchOneByOne.d.ts.map +1 -0
- package/dist/core/event-manager/EventListenerTouchOneByOne.js +38 -0
- package/dist/core/event-manager/EventListenerTouchOneByOne.js.map +1 -0
- package/dist/core/event-manager/EventListenerVector.d.ts +15 -0
- package/dist/core/event-manager/EventListenerVector.d.ts.map +1 -0
- package/dist/core/event-manager/EventListenerVector.js +38 -0
- package/dist/core/event-manager/EventListenerVector.js.map +1 -0
- package/dist/core/event-manager/EventManager.d.ts +140 -0
- package/dist/core/event-manager/EventManager.d.ts.map +1 -0
- package/dist/core/event-manager/EventManager.js +907 -0
- package/dist/core/event-manager/EventManager.js.map +1 -0
- package/dist/core/event-manager/EventMouse.d.ts +173 -0
- package/dist/core/event-manager/EventMouse.d.ts.map +1 -0
- package/dist/core/event-manager/EventMouse.js +200 -0
- package/dist/core/event-manager/EventMouse.js.map +1 -0
- package/dist/core/event-manager/EventTouch.d.ts +24 -0
- package/dist/core/event-manager/EventTouch.d.ts.map +1 -0
- package/dist/core/event-manager/EventTouch.js +33 -0
- package/dist/core/event-manager/EventTouch.js.map +1 -0
- package/dist/core/event-manager/Touch.d.ts +60 -0
- package/dist/core/event-manager/Touch.d.ts.map +1 -0
- package/dist/core/event-manager/Touch.js +94 -0
- package/dist/core/event-manager/Touch.js.map +1 -0
- package/dist/core/event-manager/index.d.ts +6 -0
- package/dist/core/event-manager/index.d.ts.map +1 -0
- package/dist/core/event-manager/index.js +6 -0
- package/dist/core/event-manager/index.js.map +1 -0
- package/dist/core/index.d.ts +16 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +16 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/kazmath/gl/mat4stack.d.ts +5 -0
- package/dist/core/kazmath/gl/mat4stack.d.ts.map +1 -0
- package/dist/core/kazmath/gl/mat4stack.js +53 -0
- package/dist/core/kazmath/gl/mat4stack.js.map +1 -0
- package/dist/core/kazmath/gl/matrix.d.ts +21 -0
- package/dist/core/kazmath/gl/matrix.d.ts.map +1 -0
- package/dist/core/kazmath/gl/matrix.js +121 -0
- package/dist/core/kazmath/gl/matrix.js.map +1 -0
- package/dist/core/kazmath/index.d.ts +7 -0
- package/dist/core/kazmath/index.d.ts.map +1 -0
- package/dist/core/kazmath/index.js +7 -0
- package/dist/core/kazmath/index.js.map +1 -0
- package/dist/core/kazmath/mat3.d.ts +45 -0
- package/dist/core/kazmath/mat3.d.ts.map +1 -0
- package/dist/core/kazmath/mat3.js +297 -0
- package/dist/core/kazmath/mat3.js.map +1 -0
- package/dist/core/kazmath/mat4.d.ts +175 -0
- package/dist/core/kazmath/mat4.d.ts.map +1 -0
- package/dist/core/kazmath/mat4.func.d.ts +44 -0
- package/dist/core/kazmath/mat4.func.d.ts.map +1 -0
- package/dist/core/kazmath/mat4.func.js +210 -0
- package/dist/core/kazmath/mat4.func.js.map +1 -0
- package/dist/core/kazmath/mat4.js +671 -0
- package/dist/core/kazmath/mat4.js.map +1 -0
- package/dist/core/kazmath/plane.d.ts +24 -0
- package/dist/core/kazmath/plane.d.ts.map +1 -0
- package/dist/core/kazmath/plane.js +96 -0
- package/dist/core/kazmath/plane.js.map +1 -0
- package/dist/core/kazmath/quaternion.d.ts +135 -0
- package/dist/core/kazmath/quaternion.d.ts.map +1 -0
- package/dist/core/kazmath/quaternion.js +407 -0
- package/dist/core/kazmath/quaternion.js.map +1 -0
- package/dist/core/kazmath/utility.d.ts +8 -0
- package/dist/core/kazmath/utility.d.ts.map +1 -0
- package/dist/core/kazmath/utility.js +14 -0
- package/dist/core/kazmath/utility.js.map +1 -0
- package/dist/core/kazmath/vec3.d.ts +26 -0
- package/dist/core/kazmath/vec3.d.ts.map +1 -0
- package/dist/core/kazmath/vec3.js +170 -0
- package/dist/core/kazmath/vec3.js.map +1 -0
- package/dist/core/kazmath/vec4.d.ts +22 -0
- package/dist/core/kazmath/vec4.d.ts.map +1 -0
- package/dist/core/kazmath/vec4.js +136 -0
- package/dist/core/kazmath/vec4.js.map +1 -0
- package/dist/core/labelttf/LabelTTF.d.ts +310 -0
- package/dist/core/labelttf/LabelTTF.d.ts.map +1 -0
- package/dist/core/labelttf/LabelTTF.js +818 -0
- package/dist/core/labelttf/LabelTTF.js.map +1 -0
- package/dist/core/labelttf/LabelTTFPropertyDefine.d.ts +2 -0
- package/dist/core/labelttf/LabelTTFPropertyDefine.d.ts.map +1 -0
- package/dist/core/labelttf/LabelTTFPropertyDefine.js +27 -0
- package/dist/core/labelttf/LabelTTFPropertyDefine.js.map +1 -0
- package/dist/core/labelttf/LabelTTFWebGLRenderCmd.d.ts +37 -0
- package/dist/core/labelttf/LabelTTFWebGLRenderCmd.d.ts.map +1 -0
- package/dist/core/labelttf/LabelTTFWebGLRenderCmd.js +367 -0
- package/dist/core/labelttf/LabelTTFWebGLRenderCmd.js.map +1 -0
- package/dist/core/layers/Layer.d.ts +35 -0
- package/dist/core/layers/Layer.d.ts.map +1 -0
- package/dist/core/layers/Layer.js +93 -0
- package/dist/core/layers/Layer.js.map +1 -0
- package/dist/core/layers/LayerColor.d.ts +61 -0
- package/dist/core/layers/LayerColor.d.ts.map +1 -0
- package/dist/core/layers/LayerColor.js +144 -0
- package/dist/core/layers/LayerColor.js.map +1 -0
- package/dist/core/layers/LayerGradient.d.ts +196 -0
- package/dist/core/layers/LayerGradient.d.ts.map +1 -0
- package/dist/core/layers/LayerGradient.js +482 -0
- package/dist/core/layers/LayerGradient.js.map +1 -0
- package/dist/core/layers/LayerMultiplex.d.ts +47 -0
- package/dist/core/layers/LayerMultiplex.d.ts.map +1 -0
- package/dist/core/layers/LayerMultiplex.js +87 -0
- package/dist/core/layers/LayerMultiplex.js.map +1 -0
- package/dist/core/layers/LayerWebGLRenderCmd.d.ts +26 -0
- package/dist/core/layers/LayerWebGLRenderCmd.d.ts.map +1 -0
- package/dist/core/layers/LayerWebGLRenderCmd.js +100 -0
- package/dist/core/layers/LayerWebGLRenderCmd.js.map +1 -0
- package/dist/core/layers/index.d.ts +5 -0
- package/dist/core/layers/index.d.ts.map +1 -0
- package/dist/core/layers/index.js +5 -0
- package/dist/core/layers/index.js.map +1 -0
- package/dist/core/platform/BlendFunc.d.ts +30 -0
- package/dist/core/platform/BlendFunc.d.ts.map +1 -0
- package/dist/core/platform/BlendFunc.js +50 -0
- package/dist/core/platform/BlendFunc.js.map +1 -0
- package/dist/core/platform/Color.d.ts +31 -0
- package/dist/core/platform/Color.d.ts.map +1 -0
- package/dist/core/platform/Color.js +71 -0
- package/dist/core/platform/Color.js.map +1 -0
- package/dist/core/platform/Common.d.ts +157 -0
- package/dist/core/platform/Common.d.ts.map +1 -0
- package/dist/core/platform/Common.js +180 -0
- package/dist/core/platform/Common.js.map +1 -0
- package/dist/core/platform/Config.d.ts +230 -0
- package/dist/core/platform/Config.d.ts.map +1 -0
- package/dist/core/platform/Config.js +231 -0
- package/dist/core/platform/Config.js.map +1 -0
- package/dist/core/platform/Dictionary.d.ts +16 -0
- package/dist/core/platform/Dictionary.d.ts.map +1 -0
- package/dist/core/platform/Dictionary.js +65 -0
- package/dist/core/platform/Dictionary.js.map +1 -0
- package/dist/core/platform/EGLView/ContainerStrategy.d.ts +30 -0
- package/dist/core/platform/EGLView/ContainerStrategy.d.ts.map +1 -0
- package/dist/core/platform/EGLView/ContainerStrategy.js +121 -0
- package/dist/core/platform/EGLView/ContainerStrategy.js.map +1 -0
- package/dist/core/platform/EGLView/ContentStrategy.d.ts +56 -0
- package/dist/core/platform/EGLView/ContentStrategy.d.ts.map +1 -0
- package/dist/core/platform/EGLView/ContentStrategy.js +117 -0
- package/dist/core/platform/EGLView/ContentStrategy.js.map +1 -0
- package/dist/core/platform/EGLView/EGLInstance.d.ts +8 -0
- package/dist/core/platform/EGLView/EGLInstance.d.ts.map +1 -0
- package/dist/core/platform/EGLView/EGLInstance.js +16 -0
- package/dist/core/platform/EGLView/EGLInstance.js.map +1 -0
- package/dist/core/platform/EGLView/ResolutionPolicy.d.ts +99 -0
- package/dist/core/platform/EGLView/ResolutionPolicy.d.ts.map +1 -0
- package/dist/core/platform/EGLView/ResolutionPolicy.js +116 -0
- package/dist/core/platform/EGLView/ResolutionPolicy.js.map +1 -0
- package/dist/core/platform/EGLView.d.ts +204 -0
- package/dist/core/platform/EGLView.d.ts.map +1 -0
- package/dist/core/platform/EGLView.js +669 -0
- package/dist/core/platform/EGLView.js.map +1 -0
- package/dist/core/platform/FontDefinition.d.ts +47 -0
- package/dist/core/platform/FontDefinition.d.ts.map +1 -0
- package/dist/core/platform/FontDefinition.js +59 -0
- package/dist/core/platform/FontDefinition.js.map +1 -0
- package/dist/core/platform/InputManager.d.ts +149 -0
- package/dist/core/platform/InputManager.d.ts.map +1 -0
- package/dist/core/platform/InputManager.js +558 -0
- package/dist/core/platform/InputManager.js.map +1 -0
- package/dist/core/platform/Loaders.d.ts +4 -0
- package/dist/core/platform/Loaders.d.ts.map +1 -0
- package/dist/core/platform/Loaders.js +141 -0
- package/dist/core/platform/Loaders.js.map +1 -0
- package/dist/core/platform/Macro.d.ts +634 -0
- package/dist/core/platform/Macro.d.ts.map +1 -0
- package/dist/core/platform/Macro.js +763 -0
- package/dist/core/platform/Macro.js.map +1 -0
- package/dist/core/platform/SAXParser.d.ts +44 -0
- package/dist/core/platform/SAXParser.d.ts.map +1 -0
- package/dist/core/platform/SAXParser.js +122 -0
- package/dist/core/platform/SAXParser.js.map +1 -0
- package/dist/core/platform/Types.d.ts +188 -0
- package/dist/core/platform/Types.d.ts.map +1 -0
- package/dist/core/platform/Types.js +425 -0
- package/dist/core/platform/Types.js.map +1 -0
- package/dist/core/platform/VisibleRect.d.ts +38 -0
- package/dist/core/platform/VisibleRect.d.ts.map +1 -0
- package/dist/core/platform/VisibleRect.js +66 -0
- package/dist/core/platform/VisibleRect.js.map +1 -0
- package/dist/core/platform/index.d.ts +7 -0
- package/dist/core/platform/index.d.ts.map +1 -0
- package/dist/core/platform/index.js +7 -0
- package/dist/core/platform/index.js.map +1 -0
- package/dist/core/platform/miniFramework.d.ts +28 -0
- package/dist/core/platform/miniFramework.d.ts.map +1 -0
- package/dist/core/platform/miniFramework.js +245 -0
- package/dist/core/platform/miniFramework.js.map +1 -0
- package/dist/core/platform/types/Quad2.d.ts +30 -0
- package/dist/core/platform/types/Quad2.d.ts.map +1 -0
- package/dist/core/platform/types/Quad2.js +62 -0
- package/dist/core/platform/types/Quad2.js.map +1 -0
- package/dist/core/platform/types/Quad3.d.ts +18 -0
- package/dist/core/platform/types/Quad3.d.ts.map +1 -0
- package/dist/core/platform/types/Quad3.js +30 -0
- package/dist/core/platform/types/Quad3.js.map +1 -0
- package/dist/core/platform/types/Tex2F.d.ts +20 -0
- package/dist/core/platform/types/Tex2F.d.ts.map +1 -0
- package/dist/core/platform/types/Tex2F.js +33 -0
- package/dist/core/platform/types/Tex2F.js.map +1 -0
- package/dist/core/platform/types/Vertex2F.d.ts +12 -0
- package/dist/core/platform/types/Vertex2F.d.ts.map +1 -0
- package/dist/core/platform/types/Vertex2F.js +25 -0
- package/dist/core/platform/types/Vertex2F.js.map +1 -0
- package/dist/core/platform/types/Vertex3F.d.ts +14 -0
- package/dist/core/platform/types/Vertex3F.d.ts.map +1 -0
- package/dist/core/platform/types/Vertex3F.js +31 -0
- package/dist/core/platform/types/Vertex3F.js.map +1 -0
- package/dist/core/platform/types/WebGLColor.d.ts +17 -0
- package/dist/core/platform/types/WebGLColor.d.ts.map +1 -0
- package/dist/core/platform/types/WebGLColor.js +40 -0
- package/dist/core/platform/types/WebGLColor.js.map +1 -0
- package/dist/core/renderer/GlobalVertexBuffer.d.ts +19 -0
- package/dist/core/renderer/GlobalVertexBuffer.d.ts.map +1 -0
- package/dist/core/renderer/GlobalVertexBuffer.js +99 -0
- package/dist/core/renderer/GlobalVertexBuffer.js.map +1 -0
- package/dist/core/renderer/RendererWebGL.d.ts +47 -0
- package/dist/core/renderer/RendererWebGL.d.ts.map +1 -0
- package/dist/core/renderer/RendererWebGL.js +389 -0
- package/dist/core/renderer/RendererWebGL.js.map +1 -0
- package/dist/core/scenes/Scene.d.ts +6 -0
- package/dist/core/scenes/Scene.d.ts.map +1 -0
- package/dist/core/scenes/Scene.js +12 -0
- package/dist/core/scenes/Scene.js.map +1 -0
- package/dist/core/sprites/Animation.d.ts +147 -0
- package/dist/core/sprites/Animation.d.ts.map +1 -0
- package/dist/core/sprites/Animation.js +277 -0
- package/dist/core/sprites/Animation.js.map +1 -0
- package/dist/core/sprites/AnimationCache.d.ts +37 -0
- package/dist/core/sprites/AnimationCache.d.ts.map +1 -0
- package/dist/core/sprites/AnimationCache.js +159 -0
- package/dist/core/sprites/AnimationCache.js.map +1 -0
- package/dist/core/sprites/Sprite.d.ts +104 -0
- package/dist/core/sprites/Sprite.d.ts.map +1 -0
- package/dist/core/sprites/Sprite.js +388 -0
- package/dist/core/sprites/Sprite.js.map +1 -0
- package/dist/core/sprites/SpriteBatchNode.d.ts +194 -0
- package/dist/core/sprites/SpriteBatchNode.d.ts.map +1 -0
- package/dist/core/sprites/SpriteBatchNode.js +332 -0
- package/dist/core/sprites/SpriteBatchNode.js.map +1 -0
- package/dist/core/sprites/SpriteFrame.d.ts +47 -0
- package/dist/core/sprites/SpriteFrame.d.ts.map +1 -0
- package/dist/core/sprites/SpriteFrame.js +223 -0
- package/dist/core/sprites/SpriteFrame.js.map +1 -0
- package/dist/core/sprites/SpriteFrameCache.d.ts +102 -0
- package/dist/core/sprites/SpriteFrameCache.d.ts.map +1 -0
- package/dist/core/sprites/SpriteFrameCache.js +333 -0
- package/dist/core/sprites/SpriteFrameCache.js.map +1 -0
- package/dist/core/sprites/SpriteLoadManager.d.ts +8 -0
- package/dist/core/sprites/SpriteLoadManager.d.ts.map +1 -0
- package/dist/core/sprites/SpriteLoadManager.js +37 -0
- package/dist/core/sprites/SpriteLoadManager.js.map +1 -0
- package/dist/core/sprites/SpriteWebGLRenderCmd.d.ts +35 -0
- package/dist/core/sprites/SpriteWebGLRenderCmd.d.ts.map +1 -0
- package/dist/core/sprites/SpriteWebGLRenderCmd.js +286 -0
- package/dist/core/sprites/SpriteWebGLRenderCmd.js.map +1 -0
- package/dist/core/sprites/SpritesPropertyDefine.d.ts +2 -0
- package/dist/core/sprites/SpritesPropertyDefine.d.ts.map +1 -0
- package/dist/core/sprites/SpritesPropertyDefine.js +19 -0
- package/dist/core/sprites/SpritesPropertyDefine.js.map +1 -0
- package/dist/core/support/PointExtension.d.ts +296 -0
- package/dist/core/support/PointExtension.d.ts.map +1 -0
- package/dist/core/support/PointExtension.js +443 -0
- package/dist/core/support/PointExtension.js.map +1 -0
- package/dist/core/support/Vertex.d.ts +24 -0
- package/dist/core/support/Vertex.d.ts.map +1 -0
- package/dist/core/support/Vertex.js +120 -0
- package/dist/core/support/Vertex.js.map +1 -0
- package/dist/core/utils/BinaryLoader.d.ts +9 -0
- package/dist/core/utils/BinaryLoader.d.ts.map +1 -0
- package/dist/core/utils/BinaryLoader.js +116 -0
- package/dist/core/utils/BinaryLoader.js.map +1 -0
- package/dist/core/utils/Profiler.d.ts +13 -0
- package/dist/core/utils/Profiler.d.ts.map +1 -0
- package/dist/core/utils/Profiler.js +140 -0
- package/dist/core/utils/Profiler.js.map +1 -0
- package/dist/helper/AsyncPool.d.ts +22 -0
- package/dist/helper/AsyncPool.d.ts.map +1 -0
- package/dist/helper/AsyncPool.js +101 -0
- package/dist/helper/AsyncPool.js.map +1 -0
- package/dist/helper/Base64.d.ts +29 -0
- package/dist/helper/Base64.d.ts.map +1 -0
- package/dist/helper/Base64.js +71 -0
- package/dist/helper/Base64.js.map +1 -0
- package/dist/helper/Debugger.d.ts +179 -0
- package/dist/helper/Debugger.d.ts.map +1 -0
- package/dist/helper/Debugger.js +250 -0
- package/dist/helper/Debugger.js.map +1 -0
- package/dist/helper/ZipUtils.d.ts +2 -0
- package/dist/helper/ZipUtils.d.ts.map +1 -0
- package/dist/helper/ZipUtils.js +20 -0
- package/dist/helper/ZipUtils.js.map +1 -0
- package/dist/helper/async.d.ts +49 -0
- package/dist/helper/async.d.ts.map +1 -0
- package/dist/helper/async.js +95 -0
- package/dist/helper/async.js.map +1 -0
- package/dist/helper/checkType.d.ts +8 -0
- package/dist/helper/checkType.d.ts.map +1 -0
- package/dist/helper/checkType.js +31 -0
- package/dist/helper/checkType.js.map +1 -0
- package/dist/helper/engine.d.ts +6 -0
- package/dist/helper/engine.d.ts.map +1 -0
- package/dist/helper/engine.js +115 -0
- package/dist/helper/engine.js.map +1 -0
- package/dist/helper/getset.d.ts +2 -0
- package/dist/helper/getset.d.ts.map +1 -0
- package/dist/helper/getset.js +51 -0
- package/dist/helper/getset.js.map +1 -0
- package/dist/helper/global.d.ts +6 -0
- package/dist/helper/global.d.ts.map +1 -0
- package/dist/helper/global.js +6 -0
- package/dist/helper/global.js.map +1 -0
- package/dist/helper/index.d.ts +3 -0
- package/dist/helper/index.d.ts.map +1 -0
- package/dist/helper/index.js +3 -0
- package/dist/helper/index.js.map +1 -0
- package/dist/helper/loader.d.ts +102 -0
- package/dist/helper/loader.d.ts.map +1 -0
- package/dist/helper/loader.js +447 -0
- package/dist/helper/loader.js.map +1 -0
- package/dist/helper/path.d.ts +12 -0
- package/dist/helper/path.d.ts.map +1 -0
- package/dist/helper/path.js +75 -0
- package/dist/helper/path.js.map +1 -0
- package/dist/helper/string.d.ts +2 -0
- package/dist/helper/string.d.ts.map +1 -0
- package/dist/helper/string.js +32 -0
- package/dist/helper/string.js.map +1 -0
- package/dist/helper/sys.d.ts +446 -0
- package/dist/helper/sys.d.ts.map +1 -0
- package/dist/helper/sys.js +691 -0
- package/dist/helper/sys.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/motion-streak/MotionStreak.d.ts +56 -0
- package/dist/motion-streak/MotionStreak.d.ts.map +1 -0
- package/dist/motion-streak/MotionStreak.js +301 -0
- package/dist/motion-streak/MotionStreak.js.map +1 -0
- package/dist/motion-streak/MotionStreakWebGLRenderCmd.d.ts +9 -0
- package/dist/motion-streak/MotionStreakWebGLRenderCmd.d.ts.map +1 -0
- package/dist/motion-streak/MotionStreakWebGLRenderCmd.js +52 -0
- package/dist/motion-streak/MotionStreakWebGLRenderCmd.js.map +1 -0
- package/dist/motion-streak/index.d.ts +2 -0
- package/dist/motion-streak/index.d.ts.map +1 -0
- package/dist/motion-streak/index.js +2 -0
- package/dist/motion-streak/index.js.map +1 -0
- package/dist/particle/PNGReader.d.ts +30 -0
- package/dist/particle/PNGReader.d.ts.map +1 -0
- package/dist/particle/PNGReader.js +304 -0
- package/dist/particle/PNGReader.js.map +1 -0
- package/dist/particle/Particle.d.ts +27 -0
- package/dist/particle/Particle.d.ts.map +1 -0
- package/dist/particle/Particle.js +50 -0
- package/dist/particle/Particle.js.map +1 -0
- package/dist/particle/ParticleBatchNode.d.ts +163 -0
- package/dist/particle/ParticleBatchNode.d.ts.map +1 -0
- package/dist/particle/ParticleBatchNode.js +447 -0
- package/dist/particle/ParticleBatchNode.js.map +1 -0
- package/dist/particle/ParticleBatchNodeWebGLRenderCmd.d.ts +8 -0
- package/dist/particle/ParticleBatchNodeWebGLRenderCmd.d.ts.map +1 -0
- package/dist/particle/ParticleBatchNodeWebGLRenderCmd.js +33 -0
- package/dist/particle/ParticleBatchNodeWebGLRenderCmd.js.map +1 -0
- package/dist/particle/ParticleSystem.d.ts +941 -0
- package/dist/particle/ParticleSystem.d.ts.map +1 -0
- package/dist/particle/ParticleSystem.js +2017 -0
- package/dist/particle/ParticleSystem.js.map +1 -0
- package/dist/particle/ParticleSystemWebGLRenderCmd.d.ts +29 -0
- package/dist/particle/ParticleSystemWebGLRenderCmd.d.ts.map +1 -0
- package/dist/particle/ParticleSystemWebGLRenderCmd.js +346 -0
- package/dist/particle/ParticleSystemWebGLRenderCmd.js.map +1 -0
- package/dist/particle/TIFFReader.d.ts +138 -0
- package/dist/particle/TIFFReader.d.ts.map +1 -0
- package/dist/particle/TIFFReader.js +596 -0
- package/dist/particle/TIFFReader.js.map +1 -0
- package/dist/particle/examples/ParticleFire.d.ts +60 -0
- package/dist/particle/examples/ParticleFire.d.ts.map +1 -0
- package/dist/particle/examples/ParticleFire.js +188 -0
- package/dist/particle/examples/ParticleFire.js.map +1 -0
- package/dist/particle/examples/ParticleGalaxy.d.ts +60 -0
- package/dist/particle/examples/ParticleGalaxy.d.ts.map +1 -0
- package/dist/particle/examples/ParticleGalaxy.js +199 -0
- package/dist/particle/examples/ParticleGalaxy.js.map +1 -0
- package/dist/particle/examples/ParticleSmoke.d.ts +60 -0
- package/dist/particle/examples/ParticleSmoke.d.ts.map +1 -0
- package/dist/particle/examples/ParticleSmoke.js +195 -0
- package/dist/particle/examples/ParticleSmoke.js.map +1 -0
- package/dist/particle/examples/ParticleSpiral.d.ts +38 -0
- package/dist/particle/examples/ParticleSpiral.d.ts.map +1 -0
- package/dist/particle/examples/ParticleSpiral.js +130 -0
- package/dist/particle/examples/ParticleSpiral.js.map +1 -0
- package/dist/particle/examples/index.d.ts +5 -0
- package/dist/particle/examples/index.d.ts.map +1 -0
- package/dist/particle/examples/index.js +5 -0
- package/dist/particle/examples/index.js.map +1 -0
- package/dist/particle/index.d.ts +2 -0
- package/dist/particle/index.d.ts.map +1 -0
- package/dist/particle/index.js +2 -0
- package/dist/particle/index.js.map +1 -0
- package/dist/polyfills.d.ts +34 -0
- package/dist/polyfills.d.ts.map +1 -0
- package/dist/polyfills.js +102 -0
- package/dist/polyfills.js.map +1 -0
- package/dist/progress-timer/ActionProgressTimer.d.ts +118 -0
- package/dist/progress-timer/ActionProgressTimer.d.ts.map +1 -0
- package/dist/progress-timer/ActionProgressTimer.js +173 -0
- package/dist/progress-timer/ActionProgressTimer.js.map +1 -0
- package/dist/progress-timer/ProgressTimer.d.ts +143 -0
- package/dist/progress-timer/ProgressTimer.d.ts.map +1 -0
- package/dist/progress-timer/ProgressTimer.js +228 -0
- package/dist/progress-timer/ProgressTimer.js.map +1 -0
- package/dist/progress-timer/ProgressTimerWebGLRenderCmd.d.ts +56 -0
- package/dist/progress-timer/ProgressTimerWebGLRenderCmd.d.ts.map +1 -0
- package/dist/progress-timer/ProgressTimerWebGLRenderCmd.js +445 -0
- package/dist/progress-timer/ProgressTimerWebGLRenderCmd.js.map +1 -0
- package/dist/progress-timer/index.d.ts +3 -0
- package/dist/progress-timer/index.d.ts.map +1 -0
- package/dist/progress-timer/index.js +3 -0
- package/dist/progress-timer/index.js.map +1 -0
- package/dist/render-texture/RenderTexture.d.ts +226 -0
- package/dist/render-texture/RenderTexture.d.ts.map +1 -0
- package/dist/render-texture/RenderTexture.js +332 -0
- package/dist/render-texture/RenderTexture.js.map +1 -0
- package/dist/render-texture/RenderTextureWebGLRenderCmd.d.ts +28 -0
- package/dist/render-texture/RenderTextureWebGLRenderCmd.d.ts.map +1 -0
- package/dist/render-texture/RenderTextureWebGLRenderCmd.js +276 -0
- package/dist/render-texture/RenderTextureWebGLRenderCmd.js.map +1 -0
- package/dist/render-texture/index.d.ts +2 -0
- package/dist/render-texture/index.d.ts.map +1 -0
- package/dist/render-texture/index.js +2 -0
- package/dist/render-texture/index.js.map +1 -0
- package/dist/shaders/GLProgram.d.ts +288 -0
- package/dist/shaders/GLProgram.d.ts.map +1 -0
- package/dist/shaders/GLProgram.js +794 -0
- package/dist/shaders/GLProgram.js.map +1 -0
- package/dist/shaders/GLProgramState.d.ts +58 -0
- package/dist/shaders/GLProgramState.d.ts.map +1 -0
- package/dist/shaders/GLProgramState.js +255 -0
- package/dist/shaders/GLProgramState.js.map +1 -0
- package/dist/shaders/GLStateCache.d.ts +97 -0
- package/dist/shaders/GLStateCache.d.ts.map +1 -0
- package/dist/shaders/GLStateCache.js +255 -0
- package/dist/shaders/GLStateCache.js.map +1 -0
- package/dist/shaders/ShaderCache.d.ts +111 -0
- package/dist/shaders/ShaderCache.d.ts.map +1 -0
- package/dist/shaders/ShaderCache.js +273 -0
- package/dist/shaders/ShaderCache.js.map +1 -0
- package/dist/shaders/Shaders.d.ts +84 -0
- package/dist/shaders/Shaders.d.ts.map +1 -0
- package/dist/shaders/Shaders.js +250 -0
- package/dist/shaders/Shaders.js.map +1 -0
- package/dist/shaders/index.d.ts +5 -0
- package/dist/shaders/index.d.ts.map +1 -0
- package/dist/shaders/index.js +5 -0
- package/dist/shaders/index.js.map +1 -0
- package/dist/shape-nodes/DrawNode.d.ts +61 -0
- package/dist/shape-nodes/DrawNode.d.ts.map +1 -0
- package/dist/shape-nodes/DrawNode.js +597 -0
- package/dist/shape-nodes/DrawNode.js.map +1 -0
- package/dist/shape-nodes/DrawNodeWebGLRenderCmd.d.ts +11 -0
- package/dist/shape-nodes/DrawNodeWebGLRenderCmd.d.ts.map +1 -0
- package/dist/shape-nodes/DrawNodeWebGLRenderCmd.js +27 -0
- package/dist/shape-nodes/DrawNodeWebGLRenderCmd.js.map +1 -0
- package/dist/text-input/IMEDispatcher.d.ts +180 -0
- package/dist/text-input/IMEDispatcher.d.ts.map +1 -0
- package/dist/text-input/IMEDispatcher.js +454 -0
- package/dist/text-input/IMEDispatcher.js.map +1 -0
- package/dist/text-input/TextFieldTTF.d.ts +219 -0
- package/dist/text-input/TextFieldTTF.d.ts.map +1 -0
- package/dist/text-input/TextFieldTTF.js +381 -0
- package/dist/text-input/TextFieldTTF.js.map +1 -0
- package/dist/textures/Texture2D.d.ts +10 -0
- package/dist/textures/Texture2D.d.ts.map +1 -0
- package/dist/textures/Texture2D.js +10 -0
- package/dist/textures/Texture2D.js.map +1 -0
- package/dist/textures/TextureAtlas.d.ts +204 -0
- package/dist/textures/TextureAtlas.d.ts.map +1 -0
- package/dist/textures/TextureAtlas.js +602 -0
- package/dist/textures/TextureAtlas.js.map +1 -0
- package/dist/textures/TextureCache.d.ts +147 -0
- package/dist/textures/TextureCache.d.ts.map +1 -0
- package/dist/textures/TextureCache.js +327 -0
- package/dist/textures/TextureCache.js.map +1 -0
- package/dist/textures/TexturesPropertyDefine.d.ts +2 -0
- package/dist/textures/TexturesPropertyDefine.d.ts.map +1 -0
- package/dist/textures/TexturesPropertyDefine.js +39 -0
- package/dist/textures/TexturesPropertyDefine.js.map +1 -0
- package/dist/textures/TexturesWebGL.d.ts +349 -0
- package/dist/textures/TexturesWebGL.d.ts.map +1 -0
- package/dist/textures/TexturesWebGL.js +765 -0
- package/dist/textures/TexturesWebGL.js.map +1 -0
- package/dist/textures/WebGLTextureCache.d.ts +2 -0
- package/dist/textures/WebGLTextureCache.d.ts.map +1 -0
- package/dist/textures/WebGLTextureCache.js +79 -0
- package/dist/textures/WebGLTextureCache.js.map +1 -0
- package/dist/textures/index.d.ts +3 -0
- package/dist/textures/index.d.ts.map +1 -0
- package/dist/textures/index.js +3 -0
- package/dist/textures/index.js.map +1 -0
- package/dist/tilemap/TGAlib.d.ts +103 -0
- package/dist/tilemap/TGAlib.d.ts.map +1 -0
- package/dist/tilemap/TGAlib.js +338 -0
- package/dist/tilemap/TGAlib.js.map +1 -0
- package/dist/tilemap/TMXLayer.d.ts +225 -0
- package/dist/tilemap/TMXLayer.d.ts.map +1 -0
- package/dist/tilemap/TMXLayer.js +694 -0
- package/dist/tilemap/TMXLayer.js.map +1 -0
- package/dist/tilemap/TMXLayerInfo.d.ts +42 -0
- package/dist/tilemap/TMXLayerInfo.d.ts.map +1 -0
- package/dist/tilemap/TMXLayerInfo.js +57 -0
- package/dist/tilemap/TMXLayerInfo.js.map +1 -0
- package/dist/tilemap/TMXLayerWebGLRenderCmd.d.ts +17 -0
- package/dist/tilemap/TMXLayerWebGLRenderCmd.d.ts.map +1 -0
- package/dist/tilemap/TMXLayerWebGLRenderCmd.js +209 -0
- package/dist/tilemap/TMXLayerWebGLRenderCmd.js.map +1 -0
- package/dist/tilemap/TMXMapInfo.d.ts +210 -0
- package/dist/tilemap/TMXMapInfo.d.ts.map +1 -0
- package/dist/tilemap/TMXMapInfo.js +614 -0
- package/dist/tilemap/TMXMapInfo.js.map +1 -0
- package/dist/tilemap/TMXObjectGroup.d.ts +70 -0
- package/dist/tilemap/TMXObjectGroup.d.ts.map +1 -0
- package/dist/tilemap/TMXObjectGroup.js +106 -0
- package/dist/tilemap/TMXObjectGroup.js.map +1 -0
- package/dist/tilemap/TMXTiledMap.d.ts +163 -0
- package/dist/tilemap/TMXTiledMap.d.ts.map +1 -0
- package/dist/tilemap/TMXTiledMap.js +347 -0
- package/dist/tilemap/TMXTiledMap.js.map +1 -0
- package/dist/tilemap/TMXTilesetInfo.d.ts +38 -0
- package/dist/tilemap/TMXTilesetInfo.d.ts.map +1 -0
- package/dist/tilemap/TMXTilesetInfo.js +59 -0
- package/dist/tilemap/TMXTilesetInfo.js.map +1 -0
- package/dist/tilemap/TMXXMLParser.d.ts +52 -0
- package/dist/tilemap/TMXXMLParser.d.ts.map +1 -0
- package/dist/tilemap/TMXXMLParser.js +52 -0
- package/dist/tilemap/TMXXMLParser.js.map +1 -0
- package/dist/tilemap/index.d.ts +4 -0
- package/dist/tilemap/index.d.ts.map +1 -0
- package/dist/tilemap/index.js +4 -0
- package/dist/tilemap/index.js.map +1 -0
- package/dist/ui/base/FocusNavigationController.d.ts +12 -0
- package/dist/ui/base/FocusNavigationController.d.ts.map +1 -0
- package/dist/ui/base/FocusNavigationController.js +54 -0
- package/dist/ui/base/FocusNavigationController.js.map +1 -0
- package/dist/ui/base/ProtectedNode.d.ts +66 -0
- package/dist/ui/base/ProtectedNode.d.ts.map +1 -0
- package/dist/ui/base/ProtectedNode.js +248 -0
- package/dist/ui/base/ProtectedNode.js.map +1 -0
- package/dist/ui/base/ProtectedNodeWebGLRenderCmd.d.ts +13 -0
- package/dist/ui/base/ProtectedNodeWebGLRenderCmd.d.ts.map +1 -0
- package/dist/ui/base/ProtectedNodeWebGLRenderCmd.js +136 -0
- package/dist/ui/base/ProtectedNodeWebGLRenderCmd.js.map +1 -0
- package/dist/ui/base/UIHelper.d.ts +48 -0
- package/dist/ui/base/UIHelper.d.ts.map +1 -0
- package/dist/ui/base/UIHelper.js +128 -0
- package/dist/ui/base/UIHelper.js.map +1 -0
- package/dist/ui/base/UIScale9Sprite.d.ts +224 -0
- package/dist/ui/base/UIScale9Sprite.d.ts.map +1 -0
- package/dist/ui/base/UIScale9Sprite.js +825 -0
- package/dist/ui/base/UIScale9Sprite.js.map +1 -0
- package/dist/ui/base/UIScale9SpriteWebGLRenderCmd.d.ts +15 -0
- package/dist/ui/base/UIScale9SpriteWebGLRenderCmd.d.ts.map +1 -0
- package/dist/ui/base/UIScale9SpriteWebGLRenderCmd.js +119 -0
- package/dist/ui/base/UIScale9SpriteWebGLRenderCmd.js.map +1 -0
- package/dist/ui/base/UIWidget.d.ts +794 -0
- package/dist/ui/base/UIWidget.d.ts.map +1 -0
- package/dist/ui/base/UIWidget.js +1634 -0
- package/dist/ui/base/UIWidget.js.map +1 -0
- package/dist/ui/base/UIWidgetRenderCmd.d.ts +9 -0
- package/dist/ui/base/UIWidgetRenderCmd.d.ts.map +1 -0
- package/dist/ui/base/UIWidgetRenderCmd.js +41 -0
- package/dist/ui/base/UIWidgetRenderCmd.js.map +1 -0
- package/dist/ui/index.d.ts +9 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +9 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/layout/UILayout.d.ts +486 -0
- package/dist/ui/layout/UILayout.d.ts.map +1 -0
- package/dist/ui/layout/UILayout.js +1430 -0
- package/dist/ui/layout/UILayout.js.map +1 -0
- package/dist/ui/layout/UILayoutParameter.d.ts +344 -0
- package/dist/ui/layout/UILayoutParameter.d.ts.map +1 -0
- package/dist/ui/layout/UILayoutParameter.js +444 -0
- package/dist/ui/layout/UILayoutParameter.js.map +1 -0
- package/dist/ui/layout/UILayoutWebGLRenderCmd.d.ts +30 -0
- package/dist/ui/layout/UILayoutWebGLRenderCmd.d.ts.map +1 -0
- package/dist/ui/layout/UILayoutWebGLRenderCmd.js +136 -0
- package/dist/ui/layout/UILayoutWebGLRenderCmd.js.map +1 -0
- package/dist/ui/layout/constant.d.ts +30 -0
- package/dist/ui/layout/constant.d.ts.map +1 -0
- package/dist/ui/layout/constant.js +31 -0
- package/dist/ui/layout/constant.js.map +1 -0
- package/dist/ui/widget/UIButton.d.ts +248 -0
- package/dist/ui/widget/UIButton.d.ts.map +1 -0
- package/dist/ui/widget/UIButton.js +727 -0
- package/dist/ui/widget/UIButton.js.map +1 -0
- package/dist/ui/widget/UIRichText.d.ts +216 -0
- package/dist/ui/widget/UIRichText.d.ts.map +1 -0
- package/dist/ui/widget/UIRichText.js +549 -0
- package/dist/ui/widget/UIRichText.js.map +1 -0
- package/dist/ui/widget/UIScrollView.d.ts +547 -0
- package/dist/ui/widget/UIScrollView.d.ts.map +1 -0
- package/dist/ui/widget/UIScrollView.js +1544 -0
- package/dist/ui/widget/UIScrollView.js.map +1 -0
- package/dist/ui/widget/UIScrollViewBar.d.ts +101 -0
- package/dist/ui/widget/UIScrollViewBar.d.ts.map +1 -0
- package/dist/ui/widget/UIScrollViewBar.js +277 -0
- package/dist/ui/widget/UIScrollViewBar.js.map +1 -0
- package/dist/ui/widget/UIScrollViewWebGLRenderCmd.d.ts +10 -0
- package/dist/ui/widget/UIScrollViewWebGLRenderCmd.d.ts.map +1 -0
- package/dist/ui/widget/UIScrollViewWebGLRenderCmd.js +42 -0
- package/dist/ui/widget/UIScrollViewWebGLRenderCmd.js.map +1 -0
- package/dist/ui/widget/UISlider.d.ts +229 -0
- package/dist/ui/widget/UISlider.d.ts.map +1 -0
- package/dist/ui/widget/UISlider.js +667 -0
- package/dist/ui/widget/UISlider.js.map +1 -0
- package/dist/ui/widget/UIText.d.ts +90 -0
- package/dist/ui/widget/UIText.d.ts.map +1 -0
- package/dist/ui/widget/UIText.js +325 -0
- package/dist/ui/widget/UIText.js.map +1 -0
- package/dist/ui/widget/UITextField.d.ts +282 -0
- package/dist/ui/widget/UITextField.d.ts.map +1 -0
- package/dist/ui/widget/UITextField.js +549 -0
- package/dist/ui/widget/UITextField.js.map +1 -0
- package/dist/ui/widget/UITextFieldRenderer.d.ts +41 -0
- package/dist/ui/widget/UITextFieldRenderer.d.ts.map +1 -0
- package/dist/ui/widget/UITextFieldRenderer.js +150 -0
- package/dist/ui/widget/UITextFieldRenderer.js.map +1 -0
- package/eslint.config.ts +59 -0
- package/index.html +22 -0
- package/package.json +38 -0
- package/res/Button.mp3 +0 -0
- package/res/SmallSun.plist +108 -0
- package/res/Spiral.plist +102 -0
- package/res/base.png +0 -0
- package/res/button.png +0 -0
- package/res/button_plus.png +0 -0
- package/res/ortho-test1.png +0 -0
- package/res/orthogonal-test1.tmx +9 -0
- package/res/orthogonal-test1.tsx +4 -0
- package/res/particle.png +0 -0
- package/res/sliderThumb.png +0 -0
- package/res/sliderTrack.png +0 -0
- package/res/streak.png +0 -0
- package/res/ui.plist +578 -0
- package/res/ui.png +0 -0
- package/res/vite.svg +1 -0
- package/test/ActionScene.ts +15 -0
- package/test/DemoScene.ts +108 -0
- package/test/GraphicsTest.ts +17 -0
- package/test/ParticleScene.ts +24 -0
- package/test/TiledMapScene.ts +14 -0
- package/test/index.ts +28 -0
- package/vite.config.ts +13 -0
|
@@ -0,0 +1,794 @@
|
|
|
1
|
+
import { _renderContext, director, Game, game, Node } from '..';
|
|
2
|
+
import { getMat4MultiplyValue, KM_GL_MODELVIEW, KM_GL_PROJECTION, kmGLGetMatrix, kmMat4Multiply, Matrix4, modelview_matrix_stack, projection_matrix_stack, } from '../core/kazmath';
|
|
3
|
+
import { checkGLErrorDebug, UNIFORM_COSTIME_S, UNIFORM_MVMATRIX_S, UNIFORM_MVPMATRIX_S, UNIFORM_PMATRIX_S, UNIFORM_RANDOM01_S, UNIFORM_SAMPLER_S, UNIFORM_SINTIME_S, UNIFORM_TIME_S, } from '../core/platform/Macro';
|
|
4
|
+
import { log } from '../helper/Debugger';
|
|
5
|
+
import { loader } from '../helper/loader';
|
|
6
|
+
import { glDeleteProgram, glUseProgram } from './GLStateCache';
|
|
7
|
+
export class GLProgram {
|
|
8
|
+
_usesTime = false;
|
|
9
|
+
_projectionUpdated = -1;
|
|
10
|
+
static _highpSupported = null;
|
|
11
|
+
constructor(vShaderFileName, fShaderFileName, glContext) {
|
|
12
|
+
this._uniforms = {};
|
|
13
|
+
this._hashForUniforms = {};
|
|
14
|
+
this._glContext = glContext || _renderContext;
|
|
15
|
+
vShaderFileName && fShaderFileName && this.init(vShaderFileName, fShaderFileName);
|
|
16
|
+
}
|
|
17
|
+
// Uniform cache
|
|
18
|
+
_updateUniform(name, matrix, ...rest) {
|
|
19
|
+
if (!name)
|
|
20
|
+
return false;
|
|
21
|
+
let updated = false;
|
|
22
|
+
const element = this._hashForUniforms[name];
|
|
23
|
+
let args;
|
|
24
|
+
if (Array.isArray(matrix)) {
|
|
25
|
+
args = matrix;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
args = [matrix, ...rest];
|
|
29
|
+
}
|
|
30
|
+
if (!element || element.length !== args.length) {
|
|
31
|
+
this._hashForUniforms[name] = [].concat(args);
|
|
32
|
+
updated = true;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
for (let i = 0; i < args.length; i += 1) {
|
|
36
|
+
// Array and Typed Array inner values could be changed, so we must update them
|
|
37
|
+
if (args[i] !== element[i] || typeof args[i] === 'object') {
|
|
38
|
+
element[i] = args[i];
|
|
39
|
+
updated = true;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return updated;
|
|
44
|
+
}
|
|
45
|
+
_description() {
|
|
46
|
+
return `<CCGLProgram = ${this.toString()} | Program = ${this._programObj.toString()}, VertexShader = ${this._vertShader.toString()}, FragmentShader = ${this._fragShader.toString()}>`;
|
|
47
|
+
}
|
|
48
|
+
_compileShader(shader, type, source) {
|
|
49
|
+
if (!source || !shader)
|
|
50
|
+
return false;
|
|
51
|
+
const preStr = GLProgram._isHighpSupported() ? 'precision highp float;\n' : 'precision mediump float;\n';
|
|
52
|
+
source =
|
|
53
|
+
`${preStr}uniform mat4 CC_PMatrix; \n` +
|
|
54
|
+
'uniform mat4 CC_MVMatrix; \n' +
|
|
55
|
+
'uniform mat4 CC_MVPMatrix; \n' +
|
|
56
|
+
'uniform vec4 CC_Time; \n' +
|
|
57
|
+
'uniform vec4 CC_SinTime; \n' +
|
|
58
|
+
'uniform vec4 CC_CosTime; \n' +
|
|
59
|
+
'uniform vec4 CC_Random01; \n' +
|
|
60
|
+
'uniform sampler2D CC_Texture0; \n' +
|
|
61
|
+
`//CC INCLUDES END \n${source}`;
|
|
62
|
+
this._glContext.shaderSource(shader, source);
|
|
63
|
+
this._glContext.compileShader(shader);
|
|
64
|
+
const status = this._glContext.getShaderParameter(shader, this._glContext.COMPILE_STATUS);
|
|
65
|
+
if (!status) {
|
|
66
|
+
log(`cocos2d: ERROR: Failed to compile shader:\n${this._glContext.getShaderSource(shader)}`);
|
|
67
|
+
if (type === this._glContext.VERTEX_SHADER)
|
|
68
|
+
log(`cocos2d: \n${this.vertexShaderLog()}`);
|
|
69
|
+
else
|
|
70
|
+
log(`cocos2d: \n${this.fragmentShaderLog()}`);
|
|
71
|
+
}
|
|
72
|
+
return status === true;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* destroy program
|
|
76
|
+
*/
|
|
77
|
+
destroyProgram() {
|
|
78
|
+
this._vertShader = null;
|
|
79
|
+
this._fragShader = null;
|
|
80
|
+
this._uniforms = null;
|
|
81
|
+
this._hashForUniforms = null;
|
|
82
|
+
this._glContext.deleteProgram(this._programObj);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Initializes the GLProgram with a vertex and fragment with string
|
|
86
|
+
* @param {String} vertShaderStr
|
|
87
|
+
* @param {String} fragShaderStr
|
|
88
|
+
* @return {Boolean}
|
|
89
|
+
*/
|
|
90
|
+
initWithVertexShaderByteArray(vertShaderStr, fragShaderStr) {
|
|
91
|
+
const locGL = this._glContext;
|
|
92
|
+
this._programObj = locGL.createProgram();
|
|
93
|
+
//checkGLErrorDebug();
|
|
94
|
+
this._vertShader = null;
|
|
95
|
+
this._fragShader = null;
|
|
96
|
+
if (vertShaderStr) {
|
|
97
|
+
this._vertShader = locGL.createShader(locGL.VERTEX_SHADER);
|
|
98
|
+
if (!this._compileShader(this._vertShader, locGL.VERTEX_SHADER, vertShaderStr)) {
|
|
99
|
+
log('cocos2d: ERROR: Failed to compile vertex shader');
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
// Create and compile fragment shader
|
|
103
|
+
if (fragShaderStr) {
|
|
104
|
+
this._fragShader = locGL.createShader(locGL.FRAGMENT_SHADER);
|
|
105
|
+
if (!this._compileShader(this._fragShader, locGL.FRAGMENT_SHADER, fragShaderStr)) {
|
|
106
|
+
log('cocos2d: ERROR: Failed to compile fragment shader');
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
if (this._vertShader)
|
|
110
|
+
locGL.attachShader(this._programObj, this._vertShader);
|
|
111
|
+
checkGLErrorDebug();
|
|
112
|
+
if (this._fragShader)
|
|
113
|
+
locGL.attachShader(this._programObj, this._fragShader);
|
|
114
|
+
if (Object.keys(this._hashForUniforms).length > 0)
|
|
115
|
+
this._hashForUniforms = {};
|
|
116
|
+
checkGLErrorDebug();
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Initializes the GLProgram with a vertex and fragment with string
|
|
121
|
+
* @param {String} vertShaderStr
|
|
122
|
+
* @param {String} fragShaderStr
|
|
123
|
+
* @return {Boolean}
|
|
124
|
+
*/
|
|
125
|
+
initWithString(vertShaderStr, fragShaderStr) {
|
|
126
|
+
return this.initWithVertexShaderByteArray(vertShaderStr, fragShaderStr);
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Initializes the CCGLProgram with a vertex and fragment with contents of filenames
|
|
130
|
+
* @param {String} vShaderFilename
|
|
131
|
+
* @param {String} fShaderFileName
|
|
132
|
+
* @return {Boolean}
|
|
133
|
+
*/
|
|
134
|
+
initWithVertexShaderFilename(vShaderFilename, fShaderFileName) {
|
|
135
|
+
const vertexSource = loader.getRes(vShaderFilename);
|
|
136
|
+
if (!vertexSource)
|
|
137
|
+
throw new Error(`Please load the resource firset : ${vShaderFilename}`);
|
|
138
|
+
const fragmentSource = loader.getRes(fShaderFileName);
|
|
139
|
+
if (!fragmentSource)
|
|
140
|
+
throw new Error(`Please load the resource firset : ${fShaderFileName}`);
|
|
141
|
+
return this.initWithVertexShaderByteArray(vertexSource, fragmentSource);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Initializes the CCGLProgram with a vertex and fragment with contents of filenames
|
|
145
|
+
* @param {String} vShaderFilename
|
|
146
|
+
* @param {String} fShaderFileName
|
|
147
|
+
* @return {Boolean}
|
|
148
|
+
*/
|
|
149
|
+
init(vShaderFilename, fShaderFileName) {
|
|
150
|
+
return this.initWithVertexShaderFilename(vShaderFilename, fShaderFileName);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* It will add a new attribute to the shader
|
|
154
|
+
* @param {String} attributeName
|
|
155
|
+
* @param {Number} index
|
|
156
|
+
*/
|
|
157
|
+
addAttribute(attributeName, index) {
|
|
158
|
+
this._glContext.bindAttribLocation(this._programObj, index, attributeName);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* links the glProgram
|
|
162
|
+
* @return {Boolean}
|
|
163
|
+
*/
|
|
164
|
+
link() {
|
|
165
|
+
if (!this._programObj) {
|
|
166
|
+
log('GLProgram.link(): Cannot link invalid program');
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
this._glContext.linkProgram(this._programObj);
|
|
170
|
+
if (this._vertShader)
|
|
171
|
+
this._glContext.deleteShader(this._vertShader);
|
|
172
|
+
if (this._fragShader)
|
|
173
|
+
this._glContext.deleteShader(this._fragShader);
|
|
174
|
+
this._vertShader = null;
|
|
175
|
+
this._fragShader = null;
|
|
176
|
+
if (game.config[Game.CONFIG_KEY.debugMode]) {
|
|
177
|
+
const status = this._glContext.getProgramParameter(this._programObj, this._glContext.LINK_STATUS);
|
|
178
|
+
if (!status) {
|
|
179
|
+
log(`cocos2d: ERROR: Failed to link program: ${this._glContext.getProgramInfoLog(this._programObj)}`);
|
|
180
|
+
glDeleteProgram(this._programObj);
|
|
181
|
+
this._programObj = null;
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return true;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* it will call glUseProgram()
|
|
189
|
+
*/
|
|
190
|
+
use() {
|
|
191
|
+
glUseProgram(this._programObj);
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* It will create 4 uniforms:
|
|
195
|
+
* UNIFORM_PMATRIX
|
|
196
|
+
* UNIFORM_MVMATRIX
|
|
197
|
+
* UNIFORM_MVPMATRIX
|
|
198
|
+
* UNIFORM_SAMPLER
|
|
199
|
+
*/
|
|
200
|
+
updateUniforms() {
|
|
201
|
+
this._addUniformLocation(UNIFORM_PMATRIX_S);
|
|
202
|
+
this._addUniformLocation(UNIFORM_MVMATRIX_S);
|
|
203
|
+
this._addUniformLocation(UNIFORM_MVPMATRIX_S);
|
|
204
|
+
this._addUniformLocation(UNIFORM_TIME_S);
|
|
205
|
+
this._addUniformLocation(UNIFORM_SINTIME_S);
|
|
206
|
+
this._addUniformLocation(UNIFORM_COSTIME_S);
|
|
207
|
+
this._addUniformLocation(UNIFORM_RANDOM01_S);
|
|
208
|
+
this._addUniformLocation(UNIFORM_SAMPLER_S);
|
|
209
|
+
this._usesTime =
|
|
210
|
+
this._uniforms[UNIFORM_TIME_S] != null || this._uniforms[UNIFORM_SINTIME_S] != null || this._uniforms[UNIFORM_COSTIME_S] != null;
|
|
211
|
+
this.use();
|
|
212
|
+
// Since sample most probably won't change, set it to 0 now.
|
|
213
|
+
this.setUniformLocationWith1i(this._uniforms[UNIFORM_SAMPLER_S], 0);
|
|
214
|
+
}
|
|
215
|
+
_addUniformLocation(name) {
|
|
216
|
+
const location = this._glContext.getUniformLocation(this._programObj, name);
|
|
217
|
+
if (location)
|
|
218
|
+
location._name = name;
|
|
219
|
+
this._uniforms[name] = location;
|
|
220
|
+
return location;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* calls retrieves the named uniform location for this shader program.
|
|
224
|
+
* @param {String} name
|
|
225
|
+
* @returns {Number}
|
|
226
|
+
*/
|
|
227
|
+
getUniformLocationForName(name) {
|
|
228
|
+
if (!name)
|
|
229
|
+
throw new Error('GLProgram.getUniformLocationForName(): uniform name should be non-null');
|
|
230
|
+
if (!this._programObj)
|
|
231
|
+
throw new Error('GLProgram.getUniformLocationForName(): Invalid operation. Cannot get uniform location when program is not initialized');
|
|
232
|
+
const location = this._uniforms[name] || this._addUniformLocation(name);
|
|
233
|
+
return location;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* get uniform MVP matrix
|
|
237
|
+
* @returns {WebGLUniformLocation}
|
|
238
|
+
*/
|
|
239
|
+
getUniformMVPMatrix() {
|
|
240
|
+
return this._uniforms[UNIFORM_MVPMATRIX_S];
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* get uniform sampler
|
|
244
|
+
* @returns {WebGLUniformLocation}
|
|
245
|
+
*/
|
|
246
|
+
getUniformSampler() {
|
|
247
|
+
return this._uniforms[UNIFORM_SAMPLER_S];
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* calls glUniform1i only if the values are different than the previous call for this same shader program.
|
|
251
|
+
* @param {WebGLUniformLocation|String} location
|
|
252
|
+
* @param {Number} i1
|
|
253
|
+
*/
|
|
254
|
+
setUniformLocationWith1i(location, i1) {
|
|
255
|
+
const isString = typeof location === 'string';
|
|
256
|
+
const name = isString ? location : location?._name;
|
|
257
|
+
if (name) {
|
|
258
|
+
if (this._updateUniform(name, i1)) {
|
|
259
|
+
if (isString)
|
|
260
|
+
location = this.getUniformLocationForName(name);
|
|
261
|
+
this._glContext.uniform1i(location, i1);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
this._glContext.uniform1i(location, i1);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* calls glUniform2i only if the values are different than the previous call for this same shader program.
|
|
270
|
+
* @param {WebGLUniformLocation|String} location
|
|
271
|
+
* @param {Number} i1
|
|
272
|
+
* @param {Number} i2
|
|
273
|
+
*/
|
|
274
|
+
setUniformLocationWith2i(location, i1, i2) {
|
|
275
|
+
const isString = typeof location === 'string';
|
|
276
|
+
const name = isString ? location : location && location._name;
|
|
277
|
+
if (name) {
|
|
278
|
+
if (this._updateUniform(name, i1, i2)) {
|
|
279
|
+
if (isString)
|
|
280
|
+
location = this.getUniformLocationForName(name);
|
|
281
|
+
this._glContext.uniform2i(location, i1, i2);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
else {
|
|
285
|
+
this._glContext.uniform2i(location, i1, i2);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* calls glUniform3i only if the values are different than the previous call for this same shader program.
|
|
290
|
+
* @param {WebGLUniformLocation|String} location
|
|
291
|
+
* @param {Number} i1
|
|
292
|
+
* @param {Number} i2
|
|
293
|
+
* @param {Number} i3
|
|
294
|
+
*/
|
|
295
|
+
setUniformLocationWith3i(location, i1, i2, i3) {
|
|
296
|
+
const isString = typeof location === 'string';
|
|
297
|
+
const name = isString ? location : location && location._name;
|
|
298
|
+
if (name) {
|
|
299
|
+
if (this._updateUniform(name, i1, i2, i3)) {
|
|
300
|
+
if (isString)
|
|
301
|
+
location = this.getUniformLocationForName(name);
|
|
302
|
+
this._glContext.uniform3i(location, i1, i2, i3);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
else {
|
|
306
|
+
this._glContext.uniform3i(location, i1, i2, i3);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* calls glUniform4i only if the values are different than the previous call for this same shader program.
|
|
311
|
+
* @param {WebGLUniformLocation|String} location
|
|
312
|
+
* @param {Number} i1
|
|
313
|
+
* @param {Number} i2
|
|
314
|
+
* @param {Number} i3
|
|
315
|
+
* @param {Number} i4
|
|
316
|
+
*/
|
|
317
|
+
setUniformLocationWith4i(location, i1, i2, i3, i4) {
|
|
318
|
+
const isString = typeof location === 'string';
|
|
319
|
+
const name = isString ? location : location && location._name;
|
|
320
|
+
if (name) {
|
|
321
|
+
if (this._updateUniform(name, i1, i2, i3, i4)) {
|
|
322
|
+
if (isString)
|
|
323
|
+
location = this.getUniformLocationForName(name);
|
|
324
|
+
this._glContext.uniform4i(location, i1, i2, i3, i4);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
else {
|
|
328
|
+
this._glContext.uniform4i(location, i1, i2, i3, i4);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* calls glUniform2iv
|
|
333
|
+
* @param {WebGLUniformLocation|String} location
|
|
334
|
+
* @param {Int32Array} intArray
|
|
335
|
+
* @param {Number} numberOfArrays
|
|
336
|
+
*/
|
|
337
|
+
setUniformLocationWith2iv(location, intArray) {
|
|
338
|
+
const isString = typeof location === 'string';
|
|
339
|
+
const name = isString ? location : location && location._name;
|
|
340
|
+
if (name) {
|
|
341
|
+
if (this._updateUniform(name, intArray)) {
|
|
342
|
+
if (isString)
|
|
343
|
+
location = this.getUniformLocationForName(name);
|
|
344
|
+
this._glContext.uniform2iv(location, intArray);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
else {
|
|
348
|
+
this._glContext.uniform2iv(location, intArray);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* calls glUniform3iv
|
|
353
|
+
* @param {WebGLUniformLocation|String} location
|
|
354
|
+
* @param {Int32Array} intArray
|
|
355
|
+
*/
|
|
356
|
+
setUniformLocationWith3iv(location, intArray) {
|
|
357
|
+
const isString = typeof location === 'string';
|
|
358
|
+
const name = isString ? location : location && location._name;
|
|
359
|
+
if (name) {
|
|
360
|
+
if (this._updateUniform(name, intArray)) {
|
|
361
|
+
if (isString)
|
|
362
|
+
location = this.getUniformLocationForName(name);
|
|
363
|
+
this._glContext.uniform3iv(location, intArray);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
else {
|
|
367
|
+
this._glContext.uniform3iv(location, intArray);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* calls glUniform4iv
|
|
372
|
+
* @param {WebGLUniformLocation|String} location
|
|
373
|
+
* @param {Int32Array} intArray
|
|
374
|
+
*/
|
|
375
|
+
setUniformLocationWith4iv(location, intArray) {
|
|
376
|
+
const isString = typeof location === 'string';
|
|
377
|
+
const name = isString ? location : location && location._name;
|
|
378
|
+
if (name) {
|
|
379
|
+
if (this._updateUniform(name, intArray)) {
|
|
380
|
+
if (isString)
|
|
381
|
+
location = this.getUniformLocationForName(name);
|
|
382
|
+
this._glContext.uniform4iv(location, intArray);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
else {
|
|
386
|
+
this._glContext.uniform4iv(location, intArray);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* calls glUniform1i only if the values are different than the previous call for this same shader program.
|
|
391
|
+
* @param {WebGLUniformLocation|String} location
|
|
392
|
+
* @param {Number} i1
|
|
393
|
+
*/
|
|
394
|
+
setUniformLocationI32(location, i1) {
|
|
395
|
+
this.setUniformLocationWith1i(location, i1);
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* calls glUniform1f only if the values are different than the previous call for this same shader program.
|
|
399
|
+
* @param {WebGLUniformLocation|String} location
|
|
400
|
+
* @param {Number} f1
|
|
401
|
+
*/
|
|
402
|
+
setUniformLocationWith1f(location, f1) {
|
|
403
|
+
const isString = typeof location === 'string';
|
|
404
|
+
const name = isString ? location : location && location._name;
|
|
405
|
+
if (name) {
|
|
406
|
+
if (this._updateUniform(name, f1)) {
|
|
407
|
+
if (isString)
|
|
408
|
+
location = this.getUniformLocationForName(name);
|
|
409
|
+
this._glContext.uniform1f(location, f1);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
else {
|
|
413
|
+
this._glContext.uniform1f(location, f1);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* calls glUniform2f only if the values are different than the previous call for this same shader program.
|
|
418
|
+
* @param {WebGLUniformLocation|String} location
|
|
419
|
+
* @param {Number} f1
|
|
420
|
+
* @param {Number} f2
|
|
421
|
+
*/
|
|
422
|
+
setUniformLocationWith2f(location, f1, f2) {
|
|
423
|
+
const isString = typeof location === 'string';
|
|
424
|
+
const name = isString ? location : location && location._name;
|
|
425
|
+
if (name) {
|
|
426
|
+
if (this._updateUniform(name, f1, f2)) {
|
|
427
|
+
if (isString)
|
|
428
|
+
location = this.getUniformLocationForName(name);
|
|
429
|
+
this._glContext.uniform2f(location, f1, f2);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
else {
|
|
433
|
+
this._glContext.uniform2f(location, f1, f2);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* calls glUniform3f only if the values are different than the previous call for this same shader program.
|
|
438
|
+
* @param {WebGLUniformLocation|String} location
|
|
439
|
+
* @param {Number} f1
|
|
440
|
+
* @param {Number} f2
|
|
441
|
+
* @param {Number} f3
|
|
442
|
+
*/
|
|
443
|
+
setUniformLocationWith3f(location, f1, f2, f3) {
|
|
444
|
+
const isString = typeof location === 'string';
|
|
445
|
+
const name = isString ? location : location && location._name;
|
|
446
|
+
if (name) {
|
|
447
|
+
if (this._updateUniform(name, f1, f2, f3)) {
|
|
448
|
+
if (isString)
|
|
449
|
+
location = this.getUniformLocationForName(name);
|
|
450
|
+
this._glContext.uniform3f(location, f1, f2, f3);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
else {
|
|
454
|
+
this._glContext.uniform3f(location, f1, f2, f3);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* calls glUniform4f only if the values are different than the previous call for this same shader program.
|
|
459
|
+
* @param {WebGLUniformLocation|String} location
|
|
460
|
+
* @param {Number} f1
|
|
461
|
+
* @param {Number} f2
|
|
462
|
+
* @param {Number} f3
|
|
463
|
+
* @param {Number} f4
|
|
464
|
+
*/
|
|
465
|
+
setUniformLocationWith4f(location, f1, f2, f3, f4) {
|
|
466
|
+
const isString = typeof location === 'string';
|
|
467
|
+
const name = isString ? location : location && location._name;
|
|
468
|
+
if (name) {
|
|
469
|
+
if (this._updateUniform(name, f1, f2, f3, f4)) {
|
|
470
|
+
if (isString)
|
|
471
|
+
location = this.getUniformLocationForName(name);
|
|
472
|
+
this._glContext.uniform4f(location, f1, f2, f3, f4);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
else {
|
|
476
|
+
this._glContext.uniform4f(location, f1, f2, f3, f4);
|
|
477
|
+
log('uniform4f', f1, f2, f3, f4);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* calls glUniform2fv
|
|
482
|
+
* @param {WebGLUniformLocation|String} location
|
|
483
|
+
* @param {Float32Array} floatArray
|
|
484
|
+
*/
|
|
485
|
+
setUniformLocationWith2fv(location, floatArray) {
|
|
486
|
+
const isString = typeof location === 'string';
|
|
487
|
+
const name = isString ? location : location && location._name;
|
|
488
|
+
if (name) {
|
|
489
|
+
if (this._updateUniform(name, floatArray)) {
|
|
490
|
+
if (isString)
|
|
491
|
+
location = this.getUniformLocationForName(name);
|
|
492
|
+
this._glContext.uniform2fv(location, floatArray);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
else {
|
|
496
|
+
this._glContext.uniform2fv(location, floatArray);
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* calls glUniform3fv
|
|
501
|
+
* @param {WebGLUniformLocation|String} location
|
|
502
|
+
* @param {Float32Array} floatArray
|
|
503
|
+
*/
|
|
504
|
+
setUniformLocationWith3fv(location, floatArray) {
|
|
505
|
+
const isString = typeof location === 'string';
|
|
506
|
+
const name = isString ? location : location && location._name;
|
|
507
|
+
if (name) {
|
|
508
|
+
if (this._updateUniform(name, floatArray)) {
|
|
509
|
+
if (isString)
|
|
510
|
+
location = this.getUniformLocationForName(name);
|
|
511
|
+
this._glContext.uniform3fv(location, floatArray);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
else {
|
|
515
|
+
this._glContext.uniform3fv(location, floatArray);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* calls glUniform4fv
|
|
520
|
+
* @param {WebGLUniformLocation|String} location
|
|
521
|
+
* @param {Float32Array} floatArray
|
|
522
|
+
*/
|
|
523
|
+
setUniformLocationWith4fv(location, floatArray) {
|
|
524
|
+
const isString = typeof location === 'string';
|
|
525
|
+
const name = isString ? location : location && location._name;
|
|
526
|
+
if (name) {
|
|
527
|
+
if (this._updateUniform(name, floatArray)) {
|
|
528
|
+
if (isString)
|
|
529
|
+
location = this.getUniformLocationForName(name);
|
|
530
|
+
this._glContext.uniform4fv(location, floatArray);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
else {
|
|
534
|
+
this._glContext.uniform4fv(location, floatArray);
|
|
535
|
+
log('uniform4fv', floatArray);
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
/**
|
|
539
|
+
* calls glUniformMatrix2fv
|
|
540
|
+
* @param {WebGLUniformLocation|String} location
|
|
541
|
+
* @param {Float32Array} matrixArray
|
|
542
|
+
*/
|
|
543
|
+
setUniformLocationWithMatrix2fv(location, matrixArray) {
|
|
544
|
+
const isString = typeof location === 'string';
|
|
545
|
+
const name = isString ? location : location && location._name;
|
|
546
|
+
if (name) {
|
|
547
|
+
if (this._updateUniform(name, matrixArray)) {
|
|
548
|
+
if (isString)
|
|
549
|
+
location = this.getUniformLocationForName(name);
|
|
550
|
+
this._glContext.uniformMatrix2fv(location, false, matrixArray);
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
else {
|
|
554
|
+
this._glContext.uniformMatrix2fv(location, false, matrixArray);
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
* calls glUniformMatrix3fv
|
|
559
|
+
* @param {WebGLUniformLocation|String} location
|
|
560
|
+
* @param {Float32Array} matrixArray
|
|
561
|
+
*/
|
|
562
|
+
setUniformLocationWithMatrix3fv(location, matrixArray) {
|
|
563
|
+
console.log('setUniformLocationWithMatrix4fv', location, matrixArray);
|
|
564
|
+
const isString = typeof location === 'string';
|
|
565
|
+
const name = isString ? location : location && location._name;
|
|
566
|
+
if (name) {
|
|
567
|
+
if (this._updateUniform(name, matrixArray)) {
|
|
568
|
+
if (isString)
|
|
569
|
+
location = this.getUniformLocationForName(name);
|
|
570
|
+
this._glContext.uniformMatrix3fv(location, false, matrixArray);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
else {
|
|
574
|
+
this._glContext.uniformMatrix3fv(location, false, matrixArray);
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* calls glUniformMatrix4fv
|
|
579
|
+
* @param {WebGLUniformLocation|String} location
|
|
580
|
+
* @param {Float32Array} matrixArray
|
|
581
|
+
*/
|
|
582
|
+
setUniformLocationWithMatrix4fv(location, matrixArray, v1) {
|
|
583
|
+
// console.log('setUniformLocationWithMatrix4fv', location, matrixArray)
|
|
584
|
+
const isString = typeof location === 'string';
|
|
585
|
+
const name = isString ? location : location && location._name;
|
|
586
|
+
if (name) {
|
|
587
|
+
if (this._updateUniform(name, matrixArray)) {
|
|
588
|
+
if (isString)
|
|
589
|
+
location = this.getUniformLocationForName(name);
|
|
590
|
+
this._glContext.uniformMatrix4fv(location, false, matrixArray);
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
else {
|
|
594
|
+
this._glContext.uniformMatrix4fv(location, false, matrixArray);
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
setUniformLocationF32(...args) {
|
|
598
|
+
if (args.length < 2)
|
|
599
|
+
return;
|
|
600
|
+
switch (args.length) {
|
|
601
|
+
case 2:
|
|
602
|
+
this.setUniformLocationWith1f(args[0], args[1]);
|
|
603
|
+
break;
|
|
604
|
+
case 3:
|
|
605
|
+
this.setUniformLocationWith2f(args[0], args[1], args[2]);
|
|
606
|
+
break;
|
|
607
|
+
case 4:
|
|
608
|
+
this.setUniformLocationWith3f(args[0], args[1], args[2], args[3]);
|
|
609
|
+
break;
|
|
610
|
+
case 5:
|
|
611
|
+
this.setUniformLocationWith4f(args[0], args[1], args[2], args[3], args[4]);
|
|
612
|
+
break;
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* will update the builtin uniforms if they are different than the previous call for this same shader program.
|
|
617
|
+
*/
|
|
618
|
+
setUniformsForBuiltins() {
|
|
619
|
+
const matrixP = new Matrix4();
|
|
620
|
+
const matrixMV = new Matrix4();
|
|
621
|
+
const matrixMVP = new Matrix4();
|
|
622
|
+
kmGLGetMatrix(KM_GL_PROJECTION, matrixP);
|
|
623
|
+
kmGLGetMatrix(KM_GL_MODELVIEW, matrixMV);
|
|
624
|
+
kmMat4Multiply(matrixMVP, matrixP, matrixMV);
|
|
625
|
+
this.setUniformLocationWithMatrix4fv(this._uniforms[UNIFORM_PMATRIX_S], matrixP.mat, 1);
|
|
626
|
+
this.setUniformLocationWithMatrix4fv(this._uniforms[UNIFORM_MVMATRIX_S], matrixMV.mat, 1);
|
|
627
|
+
this.setUniformLocationWithMatrix4fv(this._uniforms[UNIFORM_MVPMATRIX_S], matrixMVP.mat, 1);
|
|
628
|
+
if (this._usesTime) {
|
|
629
|
+
// This doesn't give the most accurate global time value.
|
|
630
|
+
// Cocos2D doesn't store a high precision time value, so this will have to do.
|
|
631
|
+
// Getting Mach time per frame per shader using time could be extremely expensive.
|
|
632
|
+
const time = director.getTotalFrames() * director.getAnimationInterval();
|
|
633
|
+
this.setUniformLocationWith4f(this._uniforms[UNIFORM_TIME_S], time / 10.0, time, time * 2, time * 4);
|
|
634
|
+
this.setUniformLocationWith4f(this._uniforms[UNIFORM_SINTIME_S], time / 8.0, time / 4.0, time / 2.0, Math.sin(time));
|
|
635
|
+
this.setUniformLocationWith4f(this._uniforms[UNIFORM_COSTIME_S], time / 8.0, time / 4.0, time / 2.0, Math.cos(time));
|
|
636
|
+
}
|
|
637
|
+
if (this._uniforms[UNIFORM_RANDOM01_S] !== -1)
|
|
638
|
+
this.setUniformLocationWith4f(this._uniforms[UNIFORM_RANDOM01_S], Math.random(), Math.random(), Math.random(), Math.random());
|
|
639
|
+
}
|
|
640
|
+
_setUniformsForBuiltinsForRenderer(node) {
|
|
641
|
+
if (!node || !node._renderCmd)
|
|
642
|
+
return;
|
|
643
|
+
const matrixP = new Matrix4();
|
|
644
|
+
//var matrixMV = new kmMat4();
|
|
645
|
+
const matrixMVP = new Matrix4();
|
|
646
|
+
kmGLGetMatrix(KM_GL_PROJECTION, matrixP);
|
|
647
|
+
//kmGLGetMatrix(KM_GL_MODELVIEW, node._stackMatrix);
|
|
648
|
+
kmMat4Multiply(matrixMVP, matrixP, node._renderCmd._stackMatrix);
|
|
649
|
+
this.setUniformLocationWithMatrix4fv(this._uniforms[UNIFORM_PMATRIX_S], matrixP.mat, 1);
|
|
650
|
+
this.setUniformLocationWithMatrix4fv(this._uniforms[UNIFORM_MVMATRIX_S], node._renderCmd._stackMatrix.mat, 1);
|
|
651
|
+
this.setUniformLocationWithMatrix4fv(this._uniforms[UNIFORM_MVPMATRIX_S], matrixMVP.mat, 1);
|
|
652
|
+
if (this._usesTime) {
|
|
653
|
+
// This doesn't give the most accurate global time value.
|
|
654
|
+
// Cocos2D doesn't store a high precision time value, so this will have to do.
|
|
655
|
+
// Getting Mach time per frame per shader using time could be extremely expensive.
|
|
656
|
+
const time = director.getTotalFrames() * director.getAnimationInterval();
|
|
657
|
+
this.setUniformLocationWith4f(this._uniforms[UNIFORM_TIME_S], time / 10.0, time, time * 2, time * 4);
|
|
658
|
+
this.setUniformLocationWith4f(this._uniforms[UNIFORM_SINTIME_S], time / 8.0, time / 4.0, time / 2.0, Math.sin(time));
|
|
659
|
+
this.setUniformLocationWith4f(this._uniforms[UNIFORM_COSTIME_S], time / 8.0, time / 4.0, time / 2.0, Math.cos(time));
|
|
660
|
+
}
|
|
661
|
+
if (this._uniforms[UNIFORM_RANDOM01_S] !== -1)
|
|
662
|
+
this.setUniformLocationWith4f(this._uniforms[UNIFORM_RANDOM01_S], Math.random(), Math.random(), Math.random(), Math.random());
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* will update the MVP matrix on the MVP uniform if it is different than the previous call for this same shader program.
|
|
666
|
+
*/
|
|
667
|
+
setUniformForModelViewProjectionMatrix() {
|
|
668
|
+
this.setUniformLocationWithMatrix4fv(this._uniforms[UNIFORM_MVPMATRIX_S], getMat4MultiplyValue(projection_matrix_stack.top, modelview_matrix_stack.top));
|
|
669
|
+
}
|
|
670
|
+
setUniformForModelViewProjectionMatrixWithMat4(swapMat4) {
|
|
671
|
+
kmMat4Multiply(swapMat4, projection_matrix_stack.top, modelview_matrix_stack.top);
|
|
672
|
+
this.setUniformLocationWithMatrix4fv(this._uniforms[UNIFORM_MVPMATRIX_S], swapMat4.mat);
|
|
673
|
+
}
|
|
674
|
+
setUniformForModelViewAndProjectionMatrixWithMat4() {
|
|
675
|
+
this.setUniformLocationWithMatrix4fv(this._uniforms[UNIFORM_MVMATRIX_S], modelview_matrix_stack.top.mat);
|
|
676
|
+
this.setUniformLocationWithMatrix4fv(this._uniforms[UNIFORM_PMATRIX_S], projection_matrix_stack.top.mat);
|
|
677
|
+
}
|
|
678
|
+
_setUniformForMVPMatrixWithMat4(modelViewMatrix) {
|
|
679
|
+
if (!modelViewMatrix)
|
|
680
|
+
throw new Error('modelView matrix is undefined.');
|
|
681
|
+
this.setUniformLocationWithMatrix4fv(this._uniforms[UNIFORM_MVMATRIX_S], modelViewMatrix.mat);
|
|
682
|
+
this.setUniformLocationWithMatrix4fv(this._uniforms[UNIFORM_PMATRIX_S], projection_matrix_stack.top.mat);
|
|
683
|
+
}
|
|
684
|
+
_updateProjectionUniform() {
|
|
685
|
+
const stack = projection_matrix_stack;
|
|
686
|
+
if (stack.lastUpdated !== this._projectionUpdated) {
|
|
687
|
+
this._glContext.uniformMatrix4fv(this._uniforms[UNIFORM_PMATRIX_S], false, stack.top.mat);
|
|
688
|
+
this._projectionUpdated = stack.lastUpdated;
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
/**
|
|
692
|
+
* returns the vertexShader error log
|
|
693
|
+
* @return {String}
|
|
694
|
+
*/
|
|
695
|
+
vertexShaderLog() {
|
|
696
|
+
return this._glContext.getShaderInfoLog(this._vertShader);
|
|
697
|
+
}
|
|
698
|
+
/**
|
|
699
|
+
* returns the vertexShader error log
|
|
700
|
+
* @return {String}
|
|
701
|
+
*/
|
|
702
|
+
getVertexShaderLog() {
|
|
703
|
+
return this._glContext.getShaderInfoLog(this._vertShader);
|
|
704
|
+
}
|
|
705
|
+
/**
|
|
706
|
+
* returns the fragmentShader error log
|
|
707
|
+
* @returns {String}
|
|
708
|
+
*/
|
|
709
|
+
getFragmentShaderLog() {
|
|
710
|
+
return this._glContext.getShaderInfoLog(this._vertShader);
|
|
711
|
+
}
|
|
712
|
+
/**
|
|
713
|
+
* returns the fragmentShader error log
|
|
714
|
+
* @return {String}
|
|
715
|
+
*/
|
|
716
|
+
fragmentShaderLog() {
|
|
717
|
+
return this._glContext.getShaderInfoLog(this._fragShader);
|
|
718
|
+
}
|
|
719
|
+
/**
|
|
720
|
+
* returns the program error log
|
|
721
|
+
* @return {String}
|
|
722
|
+
*/
|
|
723
|
+
programLog() {
|
|
724
|
+
return this._glContext.getProgramInfoLog(this._programObj);
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* returns the program error log
|
|
728
|
+
* @return {String}
|
|
729
|
+
*/
|
|
730
|
+
getProgramLog() {
|
|
731
|
+
return this._glContext.getProgramInfoLog(this._programObj);
|
|
732
|
+
}
|
|
733
|
+
/**
|
|
734
|
+
* reload all shaders, this function is designed for android <br/>
|
|
735
|
+
* when opengl context lost, so don't call it.
|
|
736
|
+
*/
|
|
737
|
+
reset() {
|
|
738
|
+
this._vertShader = null;
|
|
739
|
+
this._fragShader = null;
|
|
740
|
+
if (Object.keys(this._uniforms).length > 0)
|
|
741
|
+
this._uniforms = {};
|
|
742
|
+
// it is already deallocated by android
|
|
743
|
+
//ccGLDeleteProgram(m_uProgram);
|
|
744
|
+
this._glContext.deleteProgram(this._programObj);
|
|
745
|
+
this._programObj = null;
|
|
746
|
+
// Purge uniform hash
|
|
747
|
+
if (Object.keys(this._hashForUniforms).length > 0)
|
|
748
|
+
this._hashForUniforms = {};
|
|
749
|
+
}
|
|
750
|
+
/**
|
|
751
|
+
* get WebGLProgram object
|
|
752
|
+
* @return {WebGLProgram}
|
|
753
|
+
*/
|
|
754
|
+
getProgram() {
|
|
755
|
+
return this._programObj;
|
|
756
|
+
}
|
|
757
|
+
/**
|
|
758
|
+
* Currently JavaScript Bindings (JSB), in some cases, needs to use retain and release. This is a bug in JSB,
|
|
759
|
+
* and the ugly workaround is to use retain/release. So, these 2 methods were added to be compatible with JSB.
|
|
760
|
+
* This is a hack, and should be removed once JSB fixes the retain/release bug
|
|
761
|
+
*/
|
|
762
|
+
retain() { }
|
|
763
|
+
release() { }
|
|
764
|
+
static _isHighpSupported() {
|
|
765
|
+
const ctx = _renderContext;
|
|
766
|
+
if (ctx.getShaderPrecisionFormat && GLProgram._highpSupported == null) {
|
|
767
|
+
const highp = ctx.getShaderPrecisionFormat(ctx.FRAGMENT_SHADER, ctx.HIGH_FLOAT);
|
|
768
|
+
GLProgram._highpSupported = highp.precision !== 0;
|
|
769
|
+
}
|
|
770
|
+
return GLProgram._highpSupported;
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
/**
|
|
774
|
+
* <p>
|
|
775
|
+
* Sets the shader program for this node
|
|
776
|
+
*
|
|
777
|
+
* Since v2.0, each rendering node must set its shader program.
|
|
778
|
+
* It should be set in initialize phase.
|
|
779
|
+
* </p>
|
|
780
|
+
* @function
|
|
781
|
+
* @param {Node} node
|
|
782
|
+
* @param {GLProgram} program The shader program which fetches from CCShaderCache.
|
|
783
|
+
* @example
|
|
784
|
+
* setGLProgram(node, shaderCache.programForKey(SHADER_POSITION_TEXTURECOLOR));
|
|
785
|
+
*/
|
|
786
|
+
export function setProgram(node, program) {
|
|
787
|
+
node.shaderProgram = program;
|
|
788
|
+
const children = node.children;
|
|
789
|
+
if (!children)
|
|
790
|
+
return;
|
|
791
|
+
for (let i = 0; i < children.length; i++)
|
|
792
|
+
setProgram(children[i], program);
|
|
793
|
+
}
|
|
794
|
+
//# sourceMappingURL=GLProgram.js.map
|