ris-framework 0.1.0-dev.7 → 0.1.0-dev.9
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/CHANGELOG.md +4 -1
- package/LICENSE +202 -21
- package/NOTICE +2 -0
- package/README.md +29 -47
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/{core/Framework.d.ts → Framework.d.ts} +10 -8
- package/dist/Framework.d.ts.map +1 -0
- package/dist/api/FrameworkConfiguration.d.ts +23 -0
- package/dist/api/FrameworkConfiguration.d.ts.map +1 -0
- package/dist/api/IFramework.d.ts +125 -0
- package/dist/api/IFramework.d.ts.map +1 -0
- package/dist/api/IFrameworkConfiguration.d.ts +25 -0
- package/dist/api/IFrameworkConfiguration.d.ts.map +1 -0
- package/dist/api/_export.d.ts +27 -0
- package/dist/api/_export.d.ts.map +1 -0
- package/dist/api/camera/CameraFactory.d.ts +25 -0
- package/dist/api/camera/CameraFactory.d.ts.map +1 -0
- package/dist/api/camera/ICamera.d.ts +43 -0
- package/dist/api/camera/ICamera.d.ts.map +1 -0
- package/dist/api/camera/ICameraFactory.d.ts +46 -0
- package/dist/api/camera/ICameraFactory.d.ts.map +1 -0
- package/dist/api/camera/IOrthographicCamera.d.ts +31 -0
- package/dist/api/camera/IOrthographicCamera.d.ts.map +1 -0
- package/dist/api/camera/OrbitCamera.d.ts +120 -0
- package/dist/api/camera/OrbitCamera.d.ts.map +1 -0
- package/dist/api/camera/OrthographicCamera.d.ts +96 -0
- package/dist/api/camera/OrthographicCamera.d.ts.map +1 -0
- package/dist/api/camera/PerspectiveCamera.d.ts +108 -0
- package/dist/api/camera/PerspectiveCamera.d.ts.map +1 -0
- package/dist/api/camera/_export.d.ts +8 -0
- package/dist/api/camera/_export.d.ts.map +1 -0
- package/dist/api/content/ContentConfig.d.ts +11 -0
- package/dist/api/content/ContentConfig.d.ts.map +1 -0
- package/dist/{core → api}/content/ContentManager.d.ts +3 -2
- package/dist/api/content/ContentManager.d.ts.map +1 -0
- package/dist/api/content/IContent.d.ts +8 -0
- package/dist/api/content/IContent.d.ts.map +1 -0
- package/dist/api/content/IContentManager.d.ts +37 -0
- package/dist/api/content/IContentManager.d.ts.map +1 -0
- package/dist/api/content/IContentModule.d.ts +58 -0
- package/dist/api/content/IContentModule.d.ts.map +1 -0
- package/dist/api/content/ShaderModuleContent.d.ts.map +1 -0
- package/dist/api/content/_export-content.d.ts +5 -0
- package/dist/api/content/_export-content.d.ts.map +1 -0
- package/dist/api/core/IDisposable.d.ts +10 -0
- package/dist/api/core/IDisposable.d.ts.map +1 -0
- package/dist/api/core/_export-core.d.ts +2 -0
- package/dist/api/core/_export-core.d.ts.map +1 -0
- package/dist/api/data/Color.d.ts +119 -0
- package/dist/api/data/Color.d.ts.map +1 -0
- package/dist/api/data/Rect.d.ts +61 -0
- package/dist/api/data/Rect.d.ts.map +1 -0
- package/dist/api/data/State.d.ts +11 -0
- package/dist/api/data/State.d.ts.map +1 -0
- package/dist/api/data/_export.d.ts +4 -0
- package/dist/api/data/_export.d.ts.map +1 -0
- package/dist/{geometry → api/geometry}/BaseGeometry.d.ts +5 -2
- package/dist/api/geometry/BaseGeometry.d.ts.map +1 -0
- package/dist/{geometry → api/geometry}/GeometryBuilder.d.ts +1 -1
- package/dist/api/geometry/GeometryBuilder.d.ts.map +1 -0
- package/dist/api/geometry/GeometryFormat.d.ts +34 -0
- package/dist/api/geometry/GeometryFormat.d.ts.map +1 -0
- package/dist/api/geometry/IGeometry.d.ts +54 -0
- package/dist/api/geometry/IGeometry.d.ts.map +1 -0
- package/dist/api/geometry/IGeometryBuilder.d.ts +15 -0
- package/dist/api/geometry/IGeometryBuilder.d.ts.map +1 -0
- package/dist/api/geometry/VertexFormat.d.ts.map +1 -0
- package/dist/api/geometry/_export-geometry.d.ts +5 -0
- package/dist/api/geometry/_export-geometry.d.ts.map +1 -0
- package/dist/api/image/CpuImageProcessor.d.ts +16 -0
- package/dist/api/image/CpuImageProcessor.d.ts.map +1 -0
- package/dist/api/image/IImageProcessor.d.ts +26 -0
- package/dist/api/image/IImageProcessor.d.ts.map +1 -0
- package/dist/api/image/RawImageData.d.ts +34 -0
- package/dist/api/image/RawImageData.d.ts.map +1 -0
- package/dist/api/image/_export.d.ts +4 -0
- package/dist/api/image/_export.d.ts.map +1 -0
- package/dist/api/index.d.ts +2 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/input/IInputManager.d.ts +53 -0
- package/dist/api/input/IInputManager.d.ts.map +1 -0
- package/dist/api/input/InputDeviceType.d.ts +18 -0
- package/dist/api/input/InputDeviceType.d.ts.map +1 -0
- package/dist/api/input/InputManager.d.ts +73 -0
- package/dist/api/input/InputManager.d.ts.map +1 -0
- package/dist/api/input/Key.d.ts +36 -0
- package/dist/api/input/Key.d.ts.map +1 -0
- package/dist/api/input/KeyboardState.d.ts +37 -0
- package/dist/api/input/KeyboardState.d.ts.map +1 -0
- package/dist/api/input/_export.d.ts +14 -0
- package/dist/api/input/_export.d.ts.map +1 -0
- package/dist/api/input/gamepad/Button.d.ts +22 -0
- package/dist/api/input/gamepad/Button.d.ts.map +1 -0
- package/dist/api/input/gamepad/GamePadState.d.ts +48 -0
- package/dist/api/input/gamepad/GamePadState.d.ts.map +1 -0
- package/dist/api/input/gamepad/GamePadThumbSticks.d.ts +17 -0
- package/dist/api/input/gamepad/GamePadThumbSticks.d.ts.map +1 -0
- package/dist/api/input/mouse/MouseButton.d.ts +10 -0
- package/dist/api/input/mouse/MouseButton.d.ts.map +1 -0
- package/dist/api/input/mouse/MouseState.d.ts +52 -0
- package/dist/api/input/mouse/MouseState.d.ts.map +1 -0
- package/dist/api/input/touch/TouchCollection.d.ts +79 -0
- package/dist/api/input/touch/TouchCollection.d.ts.map +1 -0
- package/dist/api/input/touch/TouchLocation.d.ts +80 -0
- package/dist/api/input/touch/TouchLocation.d.ts.map +1 -0
- package/dist/api/input/touch/TouchLocationState.d.ts +16 -0
- package/dist/api/input/touch/TouchLocationState.d.ts.map +1 -0
- package/dist/api/input/touch/TouchPanelCapabilities.d.ts +24 -0
- package/dist/api/input/touch/TouchPanelCapabilities.d.ts.map +1 -0
- package/dist/api/loaders/IImageLoader.d.ts +20 -0
- package/dist/api/loaders/IImageLoader.d.ts.map +1 -0
- package/dist/api/loaders/ImageLoader.d.ts +36 -0
- package/dist/api/loaders/ImageLoader.d.ts.map +1 -0
- package/dist/api/loaders/_export.d.ts +3 -0
- package/dist/api/loaders/_export.d.ts.map +1 -0
- package/dist/api/material/IMaterial.d.ts +35 -0
- package/dist/api/material/IMaterial.d.ts.map +1 -0
- package/dist/api/material/IMaterialFactory.d.ts +19 -0
- package/dist/api/material/IMaterialFactory.d.ts.map +1 -0
- package/dist/api/material/InspectTextureMipsMaterial.d.ts +58 -0
- package/dist/api/material/InspectTextureMipsMaterial.d.ts.map +1 -0
- package/dist/api/material/MaterialFactory.d.ts +20 -0
- package/dist/api/material/MaterialFactory.d.ts.map +1 -0
- package/dist/api/material/UnlitMaterial.d.ts +76 -0
- package/dist/api/material/UnlitMaterial.d.ts.map +1 -0
- package/dist/api/material/_export.d.ts +6 -0
- package/dist/api/material/_export.d.ts.map +1 -0
- package/dist/api/meshes/IMesh.d.ts +17 -0
- package/dist/api/meshes/IMesh.d.ts.map +1 -0
- package/dist/api/meshes/IMeshFactory.d.ts +25 -0
- package/dist/api/meshes/IMeshFactory.d.ts.map +1 -0
- package/dist/api/meshes/Mesh.d.ts +93 -0
- package/dist/api/meshes/Mesh.d.ts.map +1 -0
- package/dist/api/meshes/MeshFactory.d.ts +23 -0
- package/dist/api/meshes/MeshFactory.d.ts.map +1 -0
- package/dist/api/meshes/MeshParameters.d.ts +22 -0
- package/dist/api/meshes/MeshParameters.d.ts.map +1 -0
- package/dist/api/meshes/QuadMesh.d.ts +33 -0
- package/dist/api/meshes/QuadMesh.d.ts.map +1 -0
- package/dist/api/meshes/_export.d.ts +7 -0
- package/dist/api/meshes/_export.d.ts.map +1 -0
- package/dist/api/rendering/IGPUInfo.d.ts +35 -0
- package/dist/api/rendering/IGPUInfo.d.ts.map +1 -0
- package/dist/api/rendering/IGraphicsDevice.d.ts +88 -0
- package/dist/api/rendering/IGraphicsDevice.d.ts.map +1 -0
- package/dist/api/rendering/IGraphicsDeviceFeatures.d.ts +27 -0
- package/dist/api/rendering/IGraphicsDeviceFeatures.d.ts.map +1 -0
- package/dist/api/rendering/IRenderer.d.ts +71 -0
- package/dist/api/rendering/IRenderer.d.ts.map +1 -0
- package/dist/api/rendering/PowerPreference.d.ts +13 -0
- package/dist/api/rendering/PowerPreference.d.ts.map +1 -0
- package/dist/api/rendering/RenderingBackend.d.ts +18 -0
- package/dist/api/rendering/RenderingBackend.d.ts.map +1 -0
- package/dist/api/rendering/_export-rendering.d.ts +7 -0
- package/dist/api/rendering/_export-rendering.d.ts.map +1 -0
- package/dist/api/rendering/blending/IBlendState.d.ts +16 -0
- package/dist/api/rendering/blending/IBlendState.d.ts.map +1 -0
- package/dist/api/rendering/blending/_export.d.ts +2 -0
- package/dist/api/rendering/blending/_export.d.ts.map +1 -0
- package/dist/api/rendering/buffers/BufferUsage.d.ts +57 -0
- package/dist/api/rendering/buffers/BufferUsage.d.ts.map +1 -0
- package/dist/api/rendering/buffers/IBuffer.d.ts +20 -0
- package/dist/api/rendering/buffers/IBuffer.d.ts.map +1 -0
- package/dist/api/rendering/buffers/IBufferFactory.d.ts +34 -0
- package/dist/api/rendering/buffers/IBufferFactory.d.ts.map +1 -0
- package/dist/api/rendering/buffers/IIndexBuffer.d.ts +31 -0
- package/dist/api/rendering/buffers/IIndexBuffer.d.ts.map +1 -0
- package/dist/api/rendering/buffers/IUniformBuffer.d.ts +18 -0
- package/dist/api/rendering/buffers/IUniformBuffer.d.ts.map +1 -0
- package/dist/api/rendering/buffers/IVertexBuffer.d.ts +26 -0
- package/dist/api/rendering/buffers/IVertexBuffer.d.ts.map +1 -0
- package/dist/api/rendering/buffers/IVertexBufferLayout.d.ts +23 -0
- package/dist/api/rendering/buffers/IVertexBufferLayout.d.ts.map +1 -0
- package/dist/api/rendering/buffers/IndexBufferType.d.ts +14 -0
- package/dist/api/rendering/buffers/IndexBufferType.d.ts.map +1 -0
- package/dist/api/rendering/buffers/VertexAttribute.d.ts +22 -0
- package/dist/api/rendering/buffers/VertexAttribute.d.ts.map +1 -0
- package/dist/api/rendering/buffers/VertexStepMode.d.ts +14 -0
- package/dist/api/rendering/buffers/VertexStepMode.d.ts.map +1 -0
- package/dist/api/rendering/buffers/_export-buffers.d.ts +11 -0
- package/dist/api/rendering/buffers/_export-buffers.d.ts.map +1 -0
- package/dist/{core/renderer → api/rendering}/enums.d.ts.map +1 -1
- package/dist/api/rendering/primitive/CullMode.d.ts +18 -0
- package/dist/api/rendering/primitive/CullMode.d.ts.map +1 -0
- package/dist/api/rendering/primitive/FrontFace.d.ts +14 -0
- package/dist/api/rendering/primitive/FrontFace.d.ts.map +1 -0
- package/dist/api/rendering/primitive/IPrimitiveState.d.ts +22 -0
- package/dist/api/rendering/primitive/IPrimitiveState.d.ts.map +1 -0
- package/dist/api/rendering/primitive/PrimitiveStateDescriptor.d.ts +24 -0
- package/dist/api/rendering/primitive/PrimitiveStateDescriptor.d.ts.map +1 -0
- package/dist/api/rendering/primitive/PrimitiveTopology.d.ts +26 -0
- package/dist/api/rendering/primitive/PrimitiveTopology.d.ts.map +1 -0
- package/dist/api/rendering/primitive/_export.d.ts +6 -0
- package/dist/api/rendering/primitive/_export.d.ts.map +1 -0
- package/dist/api/rendering/render-pipelines/IInspectTextureMipsRenderPipeline.d.ts +33 -0
- package/dist/api/rendering/render-pipelines/IInspectTextureMipsRenderPipeline.d.ts.map +1 -0
- package/dist/api/rendering/render-pipelines/IMainRenderTargetRenderPipeline.d.ts +18 -0
- package/dist/api/rendering/render-pipelines/IMainRenderTargetRenderPipeline.d.ts.map +1 -0
- package/dist/api/rendering/render-pipelines/IRenderPipeline.d.ts +39 -0
- package/dist/api/rendering/render-pipelines/IRenderPipeline.d.ts.map +1 -0
- package/dist/api/rendering/render-pipelines/IRenderPipelineFactory.d.ts +42 -0
- package/dist/api/rendering/render-pipelines/IRenderPipelineFactory.d.ts.map +1 -0
- package/dist/api/rendering/render-pipelines/ISpriteRenderPipeline.d.ts +22 -0
- package/dist/api/rendering/render-pipelines/ISpriteRenderPipeline.d.ts.map +1 -0
- package/dist/api/rendering/render-pipelines/IUnlitRenderPipeline.d.ts +33 -0
- package/dist/api/rendering/render-pipelines/IUnlitRenderPipeline.d.ts.map +1 -0
- package/dist/api/rendering/render-pipelines/_export-render-pipelines.d.ts +7 -0
- package/dist/api/rendering/render-pipelines/_export-render-pipelines.d.ts.map +1 -0
- package/dist/{core/renderer → api/rendering}/renderer-interface.d.ts +11 -7
- package/dist/api/rendering/renderer-interface.d.ts.map +1 -0
- package/dist/{core/renderer → api/rendering}/rendering-limits.d.ts.map +1 -1
- package/dist/api/rendering/renderpass/IRenderPass.d.ts +15 -0
- package/dist/api/rendering/renderpass/IRenderPass.d.ts.map +1 -0
- package/dist/api/rendering/renderpass/LoadAction.d.ts +33 -0
- package/dist/api/rendering/renderpass/LoadAction.d.ts.map +1 -0
- package/dist/api/rendering/renderpass/RenderPassColorAttachment.d.ts +53 -0
- package/dist/api/rendering/renderpass/RenderPassColorAttachment.d.ts.map +1 -0
- package/dist/api/rendering/renderpass/RenderPassDepthStencilAttachment.d.ts +56 -0
- package/dist/api/rendering/renderpass/RenderPassDepthStencilAttachment.d.ts.map +1 -0
- package/dist/api/rendering/renderpass/RenderPassDescriptor.d.ts +22 -0
- package/dist/api/rendering/renderpass/RenderPassDescriptor.d.ts.map +1 -0
- package/dist/api/rendering/renderpass/StoreAction.d.ts +24 -0
- package/dist/api/rendering/renderpass/StoreAction.d.ts.map +1 -0
- package/dist/api/rendering/renderpass/_export.d.ts +7 -0
- package/dist/api/rendering/renderpass/_export.d.ts.map +1 -0
- package/dist/api/rendering/sampler/ISampler.d.ts +43 -0
- package/dist/api/rendering/sampler/ISampler.d.ts.map +1 -0
- package/dist/api/rendering/sampler/MipMapSamplerFilter.d.ts +18 -0
- package/dist/api/rendering/sampler/MipMapSamplerFilter.d.ts.map +1 -0
- package/dist/api/rendering/sampler/SamplerAddressMode.d.ts +24 -0
- package/dist/api/rendering/sampler/SamplerAddressMode.d.ts.map +1 -0
- package/dist/api/rendering/sampler/SamplerDescriptor.d.ts +40 -0
- package/dist/api/rendering/sampler/SamplerDescriptor.d.ts.map +1 -0
- package/dist/api/rendering/sampler/SamplerFilter.d.ts +14 -0
- package/dist/api/rendering/sampler/SamplerFilter.d.ts.map +1 -0
- package/dist/api/rendering/sampler/_export.d.ts +6 -0
- package/dist/api/rendering/sampler/_export.d.ts.map +1 -0
- package/dist/api/rendering/sampler/sampler-enums.d.ts +15 -0
- package/dist/api/rendering/sampler/sampler-enums.d.ts.map +1 -0
- package/dist/api/rendering/swapchain/ISwapChain.d.ts +29 -0
- package/dist/api/rendering/swapchain/ISwapChain.d.ts.map +1 -0
- package/dist/api/rendering/swapchain/SurfacePresentMode.d.ts +23 -0
- package/dist/api/rendering/swapchain/SurfacePresentMode.d.ts.map +1 -0
- package/dist/api/rendering/swapchain/SwapChainDescriptor.d.ts +20 -0
- package/dist/api/rendering/swapchain/SwapChainDescriptor.d.ts.map +1 -0
- package/dist/api/rendering/swapchain/_export.d.ts +4 -0
- package/dist/api/rendering/swapchain/_export.d.ts.map +1 -0
- package/dist/api/rendering/texture/ITexture2D.d.ts +83 -0
- package/dist/api/rendering/texture/ITexture2D.d.ts.map +1 -0
- package/dist/api/rendering/texture/ITextureFactory.d.ts +42 -0
- package/dist/api/rendering/texture/ITextureFactory.d.ts.map +1 -0
- package/dist/api/rendering/texture/ITextureView.d.ts +17 -0
- package/dist/api/rendering/texture/ITextureView.d.ts.map +1 -0
- package/dist/api/rendering/texture/TextureDescriptor.d.ts +42 -0
- package/dist/api/rendering/texture/TextureDescriptor.d.ts.map +1 -0
- package/dist/api/rendering/texture/TextureFormat.d.ts +54 -0
- package/dist/api/rendering/texture/TextureFormat.d.ts.map +1 -0
- package/dist/api/rendering/texture/TextureUsage.d.ts +42 -0
- package/dist/api/rendering/texture/TextureUsage.d.ts.map +1 -0
- package/dist/api/rendering/texture/TextureUtilities.d.ts +54 -0
- package/dist/api/rendering/texture/TextureUtilities.d.ts.map +1 -0
- package/dist/api/rendering/texture/TextureViewDescriptor.d.ts +22 -0
- package/dist/api/rendering/texture/TextureViewDescriptor.d.ts.map +1 -0
- package/dist/api/rendering/texture/TextureViewDimension.d.ts +17 -0
- package/dist/api/rendering/texture/TextureViewDimension.d.ts.map +1 -0
- package/dist/api/rendering/texture/_export-texture.d.ts +10 -0
- package/dist/api/rendering/texture/_export-texture.d.ts.map +1 -0
- package/dist/api/shader/IShaderModule.d.ts +21 -0
- package/dist/api/shader/IShaderModule.d.ts.map +1 -0
- package/dist/api/shader/IShaderModuleLoader.d.ts +13 -0
- package/dist/api/shader/IShaderModuleLoader.d.ts.map +1 -0
- package/dist/api/shader/ShaderStage.d.ts +10 -0
- package/dist/api/shader/ShaderStage.d.ts.map +1 -0
- package/dist/api/shader/_export-shader.d.ts +4 -0
- package/dist/api/shader/_export-shader.d.ts.map +1 -0
- package/dist/{core → api}/shader/shader-loader.d.ts +1 -1
- package/dist/api/shader/shader-loader.d.ts.map +1 -0
- package/dist/api/sprites/ISpriteBatch.d.ts +114 -0
- package/dist/api/sprites/ISpriteBatch.d.ts.map +1 -0
- package/dist/{core/sprite-batch → api/sprites}/SpriteBatch.d.ts +1 -1
- package/dist/api/sprites/SpriteBatch.d.ts.map +1 -0
- package/dist/{core/sprite-batch → api/sprites}/SpriteBatchDrawable.d.ts +1 -1
- package/dist/api/sprites/SpriteBatchDrawable.d.ts.map +1 -0
- package/dist/{core/sprite-batch → api/sprites}/SpriteBatchMesh.d.ts +1 -1
- package/dist/api/sprites/SpriteBatchMesh.d.ts.map +1 -0
- package/dist/api/sprites/_export_sprites.d.ts +2 -0
- package/dist/api/sprites/_export_sprites.d.ts.map +1 -0
- package/dist/api/time/GameTime.d.ts +23 -0
- package/dist/api/time/GameTime.d.ts.map +1 -0
- package/dist/api/time/ITimeManager.d.ts +19 -0
- package/dist/api/time/ITimeManager.d.ts.map +1 -0
- package/dist/api/time/TimeManager.d.ts +15 -0
- package/dist/api/time/TimeManager.d.ts.map +1 -0
- package/dist/api/time/_export_time.d.ts +4 -0
- package/dist/api/time/_export_time.d.ts.map +1 -0
- package/dist/api/utilities/AlignUtilities.d.ts +20 -0
- package/dist/api/utilities/AlignUtilities.d.ts.map +1 -0
- package/dist/api/utilities/GeometryUtilities.d.ts +13 -0
- package/dist/api/utilities/GeometryUtilities.d.ts.map +1 -0
- package/dist/api/utilities/MathHelper.d.ts +162 -0
- package/dist/api/utilities/MathHelper.d.ts.map +1 -0
- package/dist/api/utilities/_export.d.ts +4 -0
- package/dist/api/utilities/_export.d.ts.map +1 -0
- package/dist/api/window/IWindowManager.d.ts +64 -0
- package/dist/api/window/IWindowManager.d.ts.map +1 -0
- package/dist/api/window/WindowBounds.d.ts +16 -0
- package/dist/api/window/WindowBounds.d.ts.map +1 -0
- package/dist/{core/window/window-manager.d.ts → api/window/WindowManager.d.ts} +3 -3
- package/dist/api/window/WindowManager.d.ts.map +1 -0
- package/dist/api/window/_export.d.ts +3 -0
- package/dist/api/window/_export.d.ts.map +1 -0
- package/dist/core/rendering/AGraphicsDevice.d.ts +10 -6
- package/dist/core/rendering/AGraphicsDevice.d.ts.map +1 -1
- package/dist/core/rendering/ARenderer.d.ts +4 -5
- package/dist/core/rendering/ARenderer.d.ts.map +1 -1
- package/dist/core/rendering/blending/enums.d.ts +5 -2
- package/dist/core/rendering/blending/enums.d.ts.map +1 -1
- package/dist/core/rendering/sampler/sampler-descriptor.d.ts +1 -1
- package/dist/core/rendering/sampler/sampler-descriptor.d.ts.map +1 -1
- package/dist/core/rendering/texture/texture.d.ts +1 -1
- package/dist/core/rendering/texture/texture.d.ts.map +1 -1
- package/dist/core/rendering/vertex-buffer-layout.d.ts +2 -3
- package/dist/core/rendering/vertex-buffer-layout.d.ts.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4052 -596
- package/dist/webgl/WebGLGraphicsDeviceFeatures.d.ts +1 -1
- package/dist/webgl/WebGLGraphicsDeviceFeatures.d.ts.map +1 -1
- package/dist/webgl/WebGlGpuInfo.d.ts +1 -1
- package/dist/webgl/WebGlGpuInfo.d.ts.map +1 -1
- package/dist/webgl/WebGlGraphicsDevice.d.ts +7 -5
- package/dist/webgl/WebGlGraphicsDevice.d.ts.map +1 -1
- package/dist/webgl/WebGlRenderer.d.ts +3 -3
- package/dist/webgl/WebGlRenderer.d.ts.map +1 -1
- package/dist/webgl/blending/webgl-blend-state.d.ts +1 -1
- package/dist/webgl/blending/webgl-blend-state.d.ts.map +1 -1
- package/dist/webgl/buffers/WebGlBuffersFactory.d.ts +1 -1
- package/dist/webgl/buffers/WebGlBuffersFactory.d.ts.map +1 -1
- package/dist/webgl/buffers/WebGlUniformBuffer.d.ts +1 -1
- package/dist/webgl/buffers/WebGlUniformBuffer.d.ts.map +1 -1
- package/dist/webgl/buffers/WebGlVertexBuffer.d.ts +6 -6
- package/dist/webgl/buffers/WebGlVertexBuffer.d.ts.map +1 -1
- package/dist/webgl/buffers/webgl-index-buffer.d.ts +2 -2
- package/dist/webgl/buffers/webgl-index-buffer.d.ts.map +1 -1
- package/dist/webgl/cast/cast.d.ts +2 -2
- package/dist/webgl/cast/cast.d.ts.map +1 -1
- package/dist/webgl/primitive/WebGlPrimitiveState.d.ts +1 -3
- package/dist/webgl/primitive/WebGlPrimitiveState.d.ts.map +1 -1
- package/dist/webgl/render-pass/WebGlRenderPass.d.ts +3 -3
- package/dist/webgl/render-pass/WebGlRenderPass.d.ts.map +1 -1
- package/dist/webgl/render-pipelines/AWebGlRenderPipeline.d.ts +1 -1
- package/dist/webgl/render-pipelines/AWebGlRenderPipeline.d.ts.map +1 -1
- package/dist/webgl/render-pipelines/WebGlMainRenderTargetRenderPipeline.d.ts +3 -1
- package/dist/webgl/render-pipelines/WebGlMainRenderTargetRenderPipeline.d.ts.map +1 -1
- package/dist/webgl/render-pipelines/WebGlRenderPipelineFactory.d.ts +1 -1
- package/dist/webgl/render-pipelines/WebGlRenderPipelineFactory.d.ts.map +1 -1
- package/dist/webgl/render-pipelines/inspect/WebGlInspectTextureMipsRenderPipeline.d.ts +3 -3
- package/dist/webgl/render-pipelines/inspect/WebGlInspectTextureMipsRenderPipeline.d.ts.map +1 -1
- package/dist/webgl/render-pipelines/material/WebGlUnlitRenderPipeline.d.ts +2 -2
- package/dist/webgl/render-pipelines/material/WebGlUnlitRenderPipeline.d.ts.map +1 -1
- package/dist/webgl/render-pipelines/sprite/WebGlSpriteRenderPipeline.d.ts +2 -2
- package/dist/webgl/render-pipelines/sprite/WebGlSpriteRenderPipeline.d.ts.map +1 -1
- package/dist/webgl/sampler/webgl-sampler.d.ts +1 -1
- package/dist/webgl/sampler/webgl-sampler.d.ts.map +1 -1
- package/dist/webgl/shader/WebGlShaderModule.d.ts +1 -1
- package/dist/webgl/shader/WebGlShaderModule.d.ts.map +1 -1
- package/dist/webgl/shader/WebGlShaderModuleLoader.d.ts +1 -1
- package/dist/webgl/shader/WebGlShaderModuleLoader.d.ts.map +1 -1
- package/dist/webgl/swap-chain/WebGlSwapChain.d.ts +1 -1
- package/dist/webgl/swap-chain/WebGlSwapChain.d.ts.map +1 -1
- package/dist/webgl/texture/WebGlTexture2D.d.ts +1 -1
- package/dist/webgl/texture/WebGlTexture2D.d.ts.map +1 -1
- package/dist/webgl/texture/WebGlTextureFactory.d.ts +3 -3
- package/dist/webgl/texture/WebGlTextureFactory.d.ts.map +1 -1
- package/dist/webgl/utilities/WebGlBufferUtilities.d.ts +1 -1
- package/dist/webgl/utilities/WebGlBufferUtilities.d.ts.map +1 -1
- package/dist/webgl/utilities/WebGlConverter.d.ts +6 -22
- package/dist/webgl/utilities/WebGlConverter.d.ts.map +1 -1
- package/dist/webgl/utilities/WebGlFrameBufferUtilities.d.ts +1 -1
- package/dist/webgl/utilities/WebGlFrameBufferUtilities.d.ts.map +1 -1
- package/dist/webgl/utilities/WebGlSamplerUtilities.d.ts +3 -3
- package/dist/webgl/utilities/WebGlSamplerUtilities.d.ts.map +1 -1
- package/dist/webgl/utilities/WebGlTextureUtilities.d.ts +5 -5
- package/dist/webgl/utilities/WebGlTextureUtilities.d.ts.map +1 -1
- package/dist/webgl/utilities/webgl-culling-utilities.d.ts +1 -1
- package/dist/webgl/utilities/webgl-culling-utilities.d.ts.map +1 -1
- package/dist/webgl/utilities/webgl-filter-anisotropic-utilities.d.ts +1 -1
- package/dist/webgl/utilities/webgl-renderbuffer-utilities.d.ts +1 -1
- package/dist/webgl/utilities/webgl-renderbuffer-utilities.d.ts.map +1 -1
- package/package.json +7 -6
- package/shaders/glsl/sprite_fs.glsl +1 -1
- package/src/{core/Framework.ts → Framework.ts} +78 -38
- package/src/api/FrameworkConfiguration.ts +29 -0
- package/src/api/IFramework.ts +153 -0
- package/src/api/IFrameworkConfiguration.ts +30 -0
- package/src/api/_export.ts +26 -0
- package/src/api/camera/CameraFactory.ts +56 -0
- package/src/api/camera/ICamera.ts +52 -0
- package/src/api/camera/ICameraFactory.ts +69 -0
- package/src/api/camera/IOrthographicCamera.ts +38 -0
- package/src/api/camera/OrbitCamera.ts +402 -0
- package/src/api/camera/OrthographicCamera.ts +257 -0
- package/src/api/camera/PerspectiveCamera.ts +206 -0
- package/src/api/camera/_export.ts +7 -0
- package/src/api/content/ContentConfig.ts +11 -0
- package/src/{core → api}/content/ContentManager.ts +4 -3
- package/src/api/content/IContent.ts +9 -0
- package/src/api/content/IContentManager.ts +41 -0
- package/src/api/content/IContentModule.ts +67 -0
- package/src/{content → api/content}/ShaderModuleContent.ts +8 -8
- package/src/api/content/_export-content.ts +4 -0
- package/src/api/core/IDisposable.ts +10 -0
- package/src/api/core/_export-core.ts +1 -0
- package/src/api/data/Color.ts +228 -0
- package/src/api/data/Rect.ts +92 -0
- package/src/api/data/State.ts +10 -0
- package/src/api/data/_export.ts +3 -0
- package/src/{geometry → api/geometry}/BaseGeometry.ts +15 -2
- package/src/{geometry → api/geometry}/GeometryBuilder.ts +1 -1
- package/src/api/geometry/GeometryFormat.ts +33 -0
- package/src/api/geometry/IGeometry.ts +66 -0
- package/src/api/geometry/IGeometryBuilder.ts +17 -0
- package/src/{VertexFormat.ts → api/geometry/VertexFormat.ts} +3 -7
- package/src/api/geometry/_export-geometry.ts +4 -0
- package/src/api/image/CpuImageProcessor.ts +125 -0
- package/src/api/image/IImageProcessor.ts +28 -0
- package/src/api/image/RawImageData.ts +47 -0
- package/src/api/image/_export.ts +3 -0
- package/src/api/index.ts +1 -0
- package/src/api/input/IInputManager.ts +62 -0
- package/src/api/input/InputDeviceType.ts +20 -0
- package/src/api/input/InputManager.ts +513 -0
- package/src/api/input/Key.ts +35 -0
- package/src/api/input/KeyboardState.ts +44 -0
- package/src/api/input/_export.ts +13 -0
- package/src/api/input/gamepad/Button.ts +21 -0
- package/src/api/input/gamepad/GamePadState.ts +65 -0
- package/src/api/input/gamepad/GamePadThumbSticks.ts +18 -0
- package/src/api/input/mouse/MouseButton.ts +9 -0
- package/src/api/input/mouse/MouseState.ts +70 -0
- package/src/api/input/touch/TouchCollection.ts +164 -0
- package/src/api/input/touch/TouchLocation.ts +159 -0
- package/src/api/input/touch/TouchLocationState.ts +15 -0
- package/src/api/input/touch/TouchPanelCapabilities.ts +31 -0
- package/src/api/loaders/IImageLoader.ts +22 -0
- package/src/api/loaders/ImageLoader.ts +93 -0
- package/src/api/loaders/_export.ts +2 -0
- package/src/api/material/IMaterial.ts +41 -0
- package/src/api/material/IMaterialFactory.ts +21 -0
- package/src/api/material/InspectTextureMipsMaterial.ts +113 -0
- package/src/api/material/MaterialFactory.ts +27 -0
- package/src/api/material/UnlitMaterial.ts +143 -0
- package/src/api/material/_export.ts +5 -0
- package/src/api/meshes/IMesh.ts +20 -0
- package/src/api/meshes/IMeshFactory.ts +28 -0
- package/src/api/meshes/Mesh.ts +256 -0
- package/src/api/meshes/MeshFactory.ts +36 -0
- package/src/api/meshes/MeshParameters.ts +25 -0
- package/src/api/meshes/QuadMesh.ts +104 -0
- package/src/api/meshes/_export.ts +6 -0
- package/src/api/rendering/IGPUInfo.ts +42 -0
- package/src/api/rendering/IGraphicsDevice.ts +103 -0
- package/src/api/rendering/IGraphicsDeviceFeatures.ts +32 -0
- package/src/api/rendering/IRenderer.ts +84 -0
- package/src/api/rendering/PowerPreference.ts +15 -0
- package/src/api/rendering/RenderingBackend.ts +20 -0
- package/src/api/rendering/_export-rendering.ts +6 -0
- package/src/api/rendering/blending/IBlendState.ts +17 -0
- package/src/api/rendering/blending/_export.ts +1 -0
- package/src/api/rendering/buffers/BufferUsage.ts +56 -0
- package/src/api/rendering/buffers/IBuffer.ts +24 -0
- package/src/api/rendering/buffers/IBufferFactory.ts +38 -0
- package/src/api/rendering/buffers/IIndexBuffer.ts +37 -0
- package/src/api/rendering/buffers/IUniformBuffer.ts +21 -0
- package/src/api/rendering/buffers/IVertexBuffer.ts +32 -0
- package/src/api/rendering/buffers/IVertexBufferLayout.ts +27 -0
- package/src/api/rendering/buffers/IndexBufferType.ts +13 -0
- package/src/api/rendering/buffers/VertexAttribute.ts +26 -0
- package/src/api/rendering/buffers/VertexStepMode.ts +13 -0
- package/src/api/rendering/buffers/_export-buffers.ts +11 -0
- package/src/api/rendering/primitive/CullMode.ts +17 -0
- package/src/api/rendering/primitive/FrontFace.ts +13 -0
- package/src/api/rendering/primitive/IPrimitiveState.ts +25 -0
- package/src/api/rendering/primitive/PrimitiveStateDescriptor.ts +27 -0
- package/src/api/rendering/primitive/PrimitiveTopology.ts +25 -0
- package/src/api/rendering/primitive/_export.ts +5 -0
- package/src/api/rendering/render-pipelines/IInspectTextureMipsRenderPipeline.ts +38 -0
- package/src/api/rendering/render-pipelines/IMainRenderTargetRenderPipeline.ts +21 -0
- package/src/api/rendering/render-pipelines/IRenderPipeline.ts +47 -0
- package/src/api/rendering/render-pipelines/IRenderPipelineFactory.ts +52 -0
- package/src/api/rendering/render-pipelines/ISpriteRenderPipeline.ts +25 -0
- package/src/api/rendering/render-pipelines/IUnlitRenderPipeline.ts +38 -0
- package/src/api/rendering/render-pipelines/_export-render-pipelines.ts +6 -0
- package/src/{core/renderer → api/rendering}/renderer-interface.ts +15 -9
- package/src/api/rendering/renderpass/IRenderPass.ts +18 -0
- package/src/api/rendering/renderpass/LoadAction.ts +32 -0
- package/src/api/rendering/renderpass/RenderPassColorAttachment.ts +61 -0
- package/src/api/rendering/renderpass/RenderPassDepthStencilAttachment.ts +76 -0
- package/src/api/rendering/renderpass/RenderPassDescriptor.ts +26 -0
- package/src/api/rendering/renderpass/StoreAction.ts +23 -0
- package/src/api/rendering/renderpass/_export.ts +6 -0
- package/src/api/rendering/sampler/ISampler.ts +52 -0
- package/src/api/rendering/sampler/MipMapSamplerFilter.ts +17 -0
- package/src/api/rendering/sampler/SamplerAddressMode.ts +23 -0
- package/src/api/rendering/sampler/SamplerDescriptor.ts +46 -0
- package/src/api/rendering/sampler/SamplerFilter.ts +13 -0
- package/src/api/rendering/sampler/_export.ts +5 -0
- package/src/api/rendering/sampler/sampler-enums.ts +20 -0
- package/src/api/rendering/swapchain/ISwapChain.ts +33 -0
- package/src/api/rendering/swapchain/SurfacePresentMode.ts +22 -0
- package/src/api/rendering/swapchain/SwapChainDescriptor.ts +23 -0
- package/src/api/rendering/swapchain/_export.ts +3 -0
- package/src/api/rendering/texture/ITexture2D.ts +100 -0
- package/src/api/rendering/texture/ITextureFactory.ts +56 -0
- package/src/api/rendering/texture/ITextureView.ts +20 -0
- package/src/api/rendering/texture/TextureDescriptor.ts +52 -0
- package/src/api/rendering/texture/TextureFormat.ts +58 -0
- package/src/api/rendering/texture/TextureUsage.ts +41 -0
- package/src/api/rendering/texture/TextureUtilities.ts +149 -0
- package/src/api/rendering/texture/TextureViewDescriptor.ts +25 -0
- package/src/api/rendering/texture/TextureViewDimension.ts +16 -0
- package/src/api/rendering/texture/_export-texture.ts +9 -0
- package/src/api/shader/IShaderModule.ts +23 -0
- package/src/api/shader/IShaderModuleLoader.ts +15 -0
- package/src/api/shader/ShaderStage.ts +9 -0
- package/src/api/shader/_export-shader.ts +3 -0
- package/src/{core → api}/shader/shader-loader.ts +1 -1
- package/src/api/sprites/ISpriteBatch.ts +144 -0
- package/src/{core/sprite-batch → api/sprites}/SpriteBatch.ts +8 -5
- package/src/{core/sprite-batch → api/sprites}/SpriteBatchDrawable.ts +6 -6
- package/src/{core/sprite-batch → api/sprites}/SpriteBatchMesh.ts +8 -4
- package/src/api/sprites/_export_sprites.ts +1 -0
- package/src/api/time/GameTime.ts +30 -0
- package/src/api/time/ITimeManager.ts +22 -0
- package/src/api/time/TimeManager.ts +33 -0
- package/src/api/time/_export_time.ts +3 -0
- package/src/api/utilities/AlignUtilities.ts +39 -0
- package/src/api/utilities/GeometryUtilities.ts +20 -0
- package/src/api/utilities/MathHelper.ts +256 -0
- package/src/api/utilities/_export.ts +3 -0
- package/src/api/window/IWindowManager.ts +78 -0
- package/src/api/window/WindowBounds.ts +17 -0
- package/src/{core/window/window-manager.ts → api/window/WindowManager.ts} +2 -2
- package/src/api/window/_export.ts +2 -0
- package/src/core/rendering/AGraphicsDevice.ts +15 -9
- package/src/core/rendering/ARenderer.ts +7 -7
- package/src/core/rendering/blending/enums.ts +5 -5
- package/src/core/rendering/sampler/sampler-descriptor.ts +1 -1
- package/src/core/rendering/texture/texture.ts +4 -3
- package/src/core/rendering/vertex-buffer-layout.ts +3 -4
- package/src/index.ts +3 -2
- package/src/main.ts +5 -10
- package/src/webgl/WebGLGraphicsDeviceFeatures.ts +1 -1
- package/src/webgl/WebGlGpuInfo.ts +1 -1
- package/src/webgl/WebGlGraphicsDevice.ts +19 -15
- package/src/webgl/WebGlRenderer.ts +7 -5
- package/src/webgl/blending/webgl-blend-state.ts +1 -1
- package/src/webgl/buffers/WebGlBuffersFactory.ts +1 -1
- package/src/webgl/buffers/WebGlUniformBuffer.ts +1 -1
- package/src/webgl/buffers/WebGlVertexBuffer.ts +8 -7
- package/src/webgl/buffers/webgl-index-buffer.ts +2 -2
- package/src/webgl/cast/cast.ts +2 -2
- package/src/webgl/primitive/WebGlPrimitiveState.ts +7 -3
- package/src/webgl/render-pass/WebGlRenderPass.ts +17 -8
- package/src/webgl/render-pipelines/AWebGlRenderPipeline.ts +1 -1
- package/src/webgl/render-pipelines/WebGlMainRenderTargetRenderPipeline.ts +10 -2
- package/src/webgl/render-pipelines/WebGlRenderPipelineFactory.ts +1 -1
- package/src/webgl/render-pipelines/inspect/WebGlInspectTextureMipsRenderPipeline.ts +3 -3
- package/src/webgl/render-pipelines/material/WebGlUnlitRenderPipeline.ts +2 -2
- package/src/webgl/render-pipelines/sprite/WebGlSpriteRenderPipeline.ts +2 -2
- package/src/webgl/sampler/webgl-sampler.ts +2 -2
- package/src/webgl/shader/WebGlShaderModule.ts +2 -2
- package/src/webgl/shader/WebGlShaderModuleLoader.ts +1 -1
- package/src/webgl/swap-chain/WebGlSwapChain.ts +1 -1
- package/src/webgl/texture/WebGlTexture2D.ts +6 -4
- package/src/webgl/texture/WebGlTextureFactory.ts +7 -7
- package/src/webgl/utilities/WebGlBufferUtilities.ts +1 -1
- package/src/webgl/utilities/WebGlConverter.ts +19 -62
- package/src/webgl/utilities/WebGlFrameBufferUtilities.ts +1 -1
- package/src/webgl/utilities/WebGlSamplerUtilities.ts +4 -4
- package/src/webgl/utilities/WebGlTextureUtilities.ts +29 -20
- package/src/webgl/utilities/webgl-culling-utilities.ts +1 -1
- package/src/webgl/utilities/webgl-filter-anisotropic-utilities.ts +1 -1
- package/src/webgl/utilities/webgl-renderbuffer-utilities.ts +1 -1
- package/dist/TextureFormat.d.ts +0 -2
- package/dist/TextureFormat.d.ts.map +0 -1
- package/dist/VertexFormat.d.ts.map +0 -1
- package/dist/_ris-ktx2-node-module-stub-nzBRmiO_.js +0 -10
- package/dist/common/sampler-enums.d.ts +0 -16
- package/dist/common/sampler-enums.d.ts.map +0 -1
- package/dist/common/vertex-step-mode.d.ts +0 -11
- package/dist/common/vertex-step-mode.d.ts.map +0 -1
- package/dist/content/ShaderModuleContent.d.ts.map +0 -1
- package/dist/core/Framework.d.ts.map +0 -1
- package/dist/core/FrameworkConfig.d.ts +0 -26
- package/dist/core/FrameworkConfig.d.ts.map +0 -1
- package/dist/core/buffers/buffers-factory-interface.d.ts +0 -2
- package/dist/core/buffers/buffers-factory-interface.d.ts.map +0 -1
- package/dist/core/buffers/vertex-buffer-interface.d.ts +0 -2
- package/dist/core/buffers/vertex-buffer-interface.d.ts.map +0 -1
- package/dist/core/content/ContentManager.d.ts.map +0 -1
- package/dist/core/dependency-injection/register-services-interface.d.ts +0 -13
- package/dist/core/dependency-injection/register-services-interface.d.ts.map +0 -1
- package/dist/core/framework-interface.d.ts +0 -2
- package/dist/core/framework-interface.d.ts.map +0 -1
- package/dist/core/input/InputManager.d.ts +0 -27
- package/dist/core/input/InputManager.d.ts.map +0 -1
- package/dist/core/renderer/renderer-interface.d.ts.map +0 -1
- package/dist/core/rendering/primitive/PrimitiveStateDescriptor.d.ts +0 -26
- package/dist/core/rendering/primitive/PrimitiveStateDescriptor.d.ts.map +0 -1
- package/dist/core/rendering/primitive/enums.d.ts +0 -56
- package/dist/core/rendering/primitive/enums.d.ts.map +0 -1
- package/dist/core/rendering/render-pass/render-pass-descriptor.d.ts +0 -2
- package/dist/core/rendering/render-pass/render-pass-descriptor.d.ts.map +0 -1
- package/dist/core/rendering/render-pass/render-pass-interface.d.ts +0 -15
- package/dist/core/rendering/render-pass/render-pass-interface.d.ts.map +0 -1
- package/dist/core/rendering/vertex-attribute.d.ts +0 -17
- package/dist/core/rendering/vertex-attribute.d.ts.map +0 -1
- package/dist/core/shader/shader-loader.d.ts.map +0 -1
- package/dist/core/shader/shader-module-interface.d.ts +0 -2
- package/dist/core/shader/shader-module-interface.d.ts.map +0 -1
- package/dist/core/sprite-batch/SpriteBatch.d.ts.map +0 -1
- package/dist/core/sprite-batch/SpriteBatchDrawable.d.ts.map +0 -1
- package/dist/core/sprite-batch/SpriteBatchMesh.d.ts.map +0 -1
- package/dist/core/window/window-manager.d.ts.map +0 -1
- package/dist/geometry/BaseGeometry.d.ts.map +0 -1
- package/dist/geometry/GeometryBuilder.d.ts.map +0 -1
- package/dist/geometry/GeometryFormat.d.ts +0 -34
- package/dist/geometry/GeometryFormat.d.ts.map +0 -1
- package/dist/webgl/utilities/webgl-render-buffer-utilities.d.ts +0 -5
- package/dist/webgl/utilities/webgl-render-buffer-utilities.d.ts.map +0 -1
- package/src/TextureFormat.ts +0 -0
- package/src/common/sampler-enums.ts +0 -21
- package/src/common/vertex-step-mode.ts +0 -12
- package/src/core/FrameworkConfig.ts +0 -31
- package/src/core/buffers/buffers-factory-interface.ts +0 -0
- package/src/core/buffers/vertex-buffer-interface.ts +0 -0
- package/src/core/dependency-injection/register-services-interface.ts +0 -15
- package/src/core/framework-interface.ts +0 -0
- package/src/core/input/InputManager.ts +0 -115
- package/src/core/rendering/primitive/PrimitiveStateDescriptor.ts +0 -32
- package/src/core/rendering/primitive/enums.ts +0 -68
- package/src/core/rendering/render-pass/render-pass-descriptor.ts +0 -0
- package/src/core/rendering/render-pass/render-pass-interface.ts +0 -17
- package/src/core/rendering/vertex-attribute.ts +0 -20
- package/src/core/shader/shader-module-interface.ts +0 -1
- package/src/counter.ts +0 -9
- package/src/geometry/GeometryFormat.ts +0 -37
- package/src/webgl/utilities/webgl-render-buffer-utilities.ts +0 -23
- /package/dist/{content → api/content}/ShaderModuleContent.d.ts +0 -0
- /package/dist/{VertexFormat.d.ts → api/geometry/VertexFormat.d.ts} +0 -0
- /package/dist/{core/renderer → api/rendering}/enums.d.ts +0 -0
- /package/dist/{core/renderer → api/rendering}/rendering-limits.d.ts +0 -0
- /package/src/{core/renderer → api/rendering}/enums.ts +0 -0
- /package/src/{core/renderer → api/rendering}/rendering-limits.ts +0 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {Key} from "./Key.ts";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The keyboard state.
|
|
5
|
+
*/
|
|
6
|
+
export class KeyboardState {
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The constructor.
|
|
10
|
+
* @param downKeys - The keys that are down.
|
|
11
|
+
* @param releasedKeys - The keys that are just released.
|
|
12
|
+
*/
|
|
13
|
+
public constructor(private readonly _downKeys: { [key: number]: boolean },
|
|
14
|
+
private readonly _releasedKeys: { [key: number]: boolean }) {
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Returns true if key is down in current frame.
|
|
19
|
+
* @param key - The key to check.
|
|
20
|
+
* @returns True if key is down.
|
|
21
|
+
*/
|
|
22
|
+
public isKeyDown(key: Key): boolean {
|
|
23
|
+
return this._downKeys[key];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Returns true if key is up in current frame.
|
|
28
|
+
* @param key - The key to check.
|
|
29
|
+
* @returns True if key is up.
|
|
30
|
+
*/
|
|
31
|
+
public isKeyUp(key: Key): boolean {
|
|
32
|
+
return !this.isKeyDown(key);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Returns true if the key was just released in current frame.
|
|
37
|
+
* @param key - The key to check.
|
|
38
|
+
* @returns True if key is released in current frame.
|
|
39
|
+
*/
|
|
40
|
+
public isKeyReleased(key: Key): boolean {
|
|
41
|
+
return this._releasedKeys[key];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from "./IInputManager.ts"
|
|
2
|
+
export * from "./mouse/MouseState.ts"
|
|
3
|
+
export * from "./gamepad/GamePadState.ts"
|
|
4
|
+
export * from "./gamepad/GamePadThumbSticks.ts"
|
|
5
|
+
export * from "./KeyboardState.ts"
|
|
6
|
+
export * from "./Key.ts"
|
|
7
|
+
export * from "./gamepad/Button.ts"
|
|
8
|
+
export * from "./mouse/MouseButton.ts"
|
|
9
|
+
export * from "./touch/TouchLocationState.ts"
|
|
10
|
+
export * from "./touch/TouchLocation.ts"
|
|
11
|
+
export * from "./touch/TouchCollection.ts"
|
|
12
|
+
export * from "./touch/TouchPanelCapabilities.ts"
|
|
13
|
+
export * from "./InputDeviceType.ts"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The buttons of the gamepad.
|
|
3
|
+
*/
|
|
4
|
+
export enum Button {
|
|
5
|
+
NONE = 0,
|
|
6
|
+
A = 1,
|
|
7
|
+
B = 2,
|
|
8
|
+
BACK = 3,
|
|
9
|
+
BIGBUTTON = 4,
|
|
10
|
+
DPADDOWN = 5,
|
|
11
|
+
DPADLEFT = 6,
|
|
12
|
+
DPADRIGHT = 7,
|
|
13
|
+
DPADUP = 8,
|
|
14
|
+
LEFTSHOULDER = 9,
|
|
15
|
+
LEFTSTICK = 10,
|
|
16
|
+
RIGHTSHOULDER = 11,
|
|
17
|
+
RIGHTSTICK = 12,
|
|
18
|
+
START = 13,
|
|
19
|
+
X = 14,
|
|
20
|
+
Y = 15
|
|
21
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import {GamePadThumbSticks} from "./GamePadThumbSticks.ts";
|
|
2
|
+
import {vec2} from "gl-matrix";
|
|
3
|
+
import {Button} from "./Button.ts";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The state of the gamepad.
|
|
7
|
+
*/
|
|
8
|
+
export class GamePadState {
|
|
9
|
+
private readonly _thumbSticks: GamePadThumbSticks;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The constructor.
|
|
13
|
+
* @param isConnected - Set to true if gamepad is connected.
|
|
14
|
+
* @param downButtons - The down buttons.
|
|
15
|
+
* @param releasedButtons - The released buttons.
|
|
16
|
+
* @param leftThumbstick - The left thumbstick position.
|
|
17
|
+
* @param rightThumbstick - The right thumbstick position.
|
|
18
|
+
*/
|
|
19
|
+
public constructor(
|
|
20
|
+
public readonly isConnected: boolean,
|
|
21
|
+
private readonly _downButtons: { [key: number]: boolean },
|
|
22
|
+
private readonly _releasedButtons: { [key: number]: boolean },
|
|
23
|
+
leftThumbstick: vec2,
|
|
24
|
+
rightThumbstick: vec2
|
|
25
|
+
) {
|
|
26
|
+
this._thumbSticks = new GamePadThumbSticks(
|
|
27
|
+
leftThumbstick,
|
|
28
|
+
rightThumbstick
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The thumbstick positions.
|
|
34
|
+
*/
|
|
35
|
+
public get thumbSticks(): GamePadThumbSticks {
|
|
36
|
+
return this._thumbSticks;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Check if the button is down.
|
|
41
|
+
* @param button - The button to check.
|
|
42
|
+
* @returns true if button is down, false otherwise.
|
|
43
|
+
*/
|
|
44
|
+
public isButtonDown(button: Button): boolean {
|
|
45
|
+
return this._downButtons[button] ?? false;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Check if the button is up.
|
|
50
|
+
* @param button - The button to check.
|
|
51
|
+
* @returns true if button is up, false otherwise.
|
|
52
|
+
*/
|
|
53
|
+
public isButtonUp(button: Button): boolean {
|
|
54
|
+
return !this.isButtonDown(button);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Check if the button is released in current frame.
|
|
59
|
+
* @param button - The button to check.
|
|
60
|
+
* @returns true if button is released.
|
|
61
|
+
*/
|
|
62
|
+
public isButtonReleased(button: Button): boolean {
|
|
63
|
+
return this._releasedButtons[button] ?? false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {vec2} from "gl-matrix";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The thumbsticks of the gamepad.
|
|
5
|
+
* @param left - The left thumbstick.
|
|
6
|
+
* @param right - The right thumbstick.
|
|
7
|
+
*/
|
|
8
|
+
export class GamePadThumbSticks {
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The thumbsticks of the gamepad.
|
|
12
|
+
* @param left - The left thumbstick.
|
|
13
|
+
* @param right - The right thumbstick.
|
|
14
|
+
*/
|
|
15
|
+
public constructor(public left: vec2, public right: vec2) {
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import {MouseButton} from "./MouseButton.ts";
|
|
2
|
+
import {vec2} from "gl-matrix";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The mouse state.
|
|
6
|
+
*/
|
|
7
|
+
export class MouseState {
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The constructor. InputManager owns these objects and updates them in place.
|
|
11
|
+
* @param _downButtons - The buttons that are down, keyed by MouseButton.
|
|
12
|
+
* @param _releasedButtons - The buttons released this frame, keyed by MouseButton.
|
|
13
|
+
* @param position - The cursor position in viewport (clientX / clientY) CSS pixels.
|
|
14
|
+
* @param delta - The cursor movement since the previous frame.
|
|
15
|
+
* @param scrollWheelPosition - The wheel direction this frame. Each axis is -1, 0, or 1.
|
|
16
|
+
*/
|
|
17
|
+
public constructor(private readonly _downButtons: { [key: number]: boolean },
|
|
18
|
+
private readonly _releasedButtons: { [key: number]: boolean },
|
|
19
|
+
public position: vec2,
|
|
20
|
+
public delta: vec2,
|
|
21
|
+
public scrollWheelPosition: vec2) {
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** The x position. */
|
|
25
|
+
public get x(): number {
|
|
26
|
+
return this.position[0];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** The y position. */
|
|
30
|
+
public get y(): number {
|
|
31
|
+
return this.position[1];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** The delta x.*/
|
|
35
|
+
public get dX(): number {
|
|
36
|
+
return this.delta[0];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** The delta y. */
|
|
40
|
+
public get dY(): number {
|
|
41
|
+
return this.delta[1];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Returns true if MouseButton is down in current frame.
|
|
46
|
+
* @param button - The button to check.
|
|
47
|
+
* @returns True if button is down.
|
|
48
|
+
*/
|
|
49
|
+
public isButtonDown(button: MouseButton): boolean {
|
|
50
|
+
return this._downButtons[button];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Returns true if the button is up in current frame.
|
|
55
|
+
* @param button - The button to check.
|
|
56
|
+
* @returns True if the button is up.
|
|
57
|
+
*/
|
|
58
|
+
public isButtonUp(button: MouseButton): boolean {
|
|
59
|
+
return !this.isButtonDown(button);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Checks if the button is released in current frame.
|
|
64
|
+
* @param button - The button to check.
|
|
65
|
+
* @returns True if the button is released in current frame.
|
|
66
|
+
*/
|
|
67
|
+
public isButtonReleased(button: MouseButton): boolean {
|
|
68
|
+
return this._releasedButtons[button];
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import {TouchLocation} from "./TouchLocation.ts";
|
|
2
|
+
import {TouchLocationState} from "./TouchLocationState.ts";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The touch locations for one frame.
|
|
6
|
+
* Slots are allocated once. clear and tryAdd reuse them, and reads do not allocate.
|
|
7
|
+
*/
|
|
8
|
+
export class TouchCollection {
|
|
9
|
+
|
|
10
|
+
/** Default number of simultaneous touches the collection stores. */
|
|
11
|
+
public static readonly MAX_TOUCH_COUNT = 8;
|
|
12
|
+
|
|
13
|
+
/** The fixed number of slots in this collection. */
|
|
14
|
+
public readonly maxTouchCount: number;
|
|
15
|
+
|
|
16
|
+
private readonly _locations: TouchLocation[];
|
|
17
|
+
private _count = 0;
|
|
18
|
+
private _activeCount = 0;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The constructor.
|
|
22
|
+
* @param maxTouchCount The fixed slot count. Values below 1 store no touches. The default is MAX_TOUCH_COUNT.
|
|
23
|
+
*/
|
|
24
|
+
public constructor(maxTouchCount = TouchCollection.MAX_TOUCH_COUNT) {
|
|
25
|
+
const capacity = maxTouchCount > 0 ? Math.floor(maxTouchCount) : 0;
|
|
26
|
+
this.maxTouchCount = capacity;
|
|
27
|
+
const locations = new Array<TouchLocation>(capacity);
|
|
28
|
+
for (let i = 0; i < capacity; i++) {
|
|
29
|
+
locations[i] = new TouchLocation();
|
|
30
|
+
}
|
|
31
|
+
this._locations = locations;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** The number of touch locations written this frame, including releases. */
|
|
35
|
+
public get count(): number {
|
|
36
|
+
return this._count;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The number of touches that were down when they were written.
|
|
41
|
+
* Pressed and moved contacts count. Released, cancelled, and invalid contacts do not.
|
|
42
|
+
* This is stored while contacts are written, not counted again on read.
|
|
43
|
+
*/
|
|
44
|
+
public get activeCount(): number {
|
|
45
|
+
return this._activeCount;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Drops the frame's contacts.
|
|
50
|
+
* Slots stay allocated. The next tryAdd reuses them from the start.
|
|
51
|
+
*/
|
|
52
|
+
public clear(): void {
|
|
53
|
+
this._count = 0;
|
|
54
|
+
this._activeCount = 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Writes the next contact into the next free slot.
|
|
59
|
+
* @param id The touch id.
|
|
60
|
+
* @param state The touch location state.
|
|
61
|
+
* @param x The x position.
|
|
62
|
+
* @param y The y position.
|
|
63
|
+
* @param pressure The pressure.
|
|
64
|
+
* @param previousState The previous state. Omit it when this is the first sample.
|
|
65
|
+
* @param previousX The previous x position.
|
|
66
|
+
* @param previousY The previous y position.
|
|
67
|
+
* @param previousPressure The previous pressure.
|
|
68
|
+
* @returns The slot that was written, or undefined when every slot is already used.
|
|
69
|
+
*/
|
|
70
|
+
public tryAdd(id: number,
|
|
71
|
+
state: TouchLocationState,
|
|
72
|
+
x: number,
|
|
73
|
+
y: number,
|
|
74
|
+
pressure = 0,
|
|
75
|
+
previousState?: TouchLocationState,
|
|
76
|
+
previousX = 0,
|
|
77
|
+
previousY = 0,
|
|
78
|
+
previousPressure = 0): TouchLocation | undefined {
|
|
79
|
+
if (this._count >= this._locations.length) {
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const location = this._locations[this._count];
|
|
84
|
+
location.write(id, state, x, y, pressure);
|
|
85
|
+
if (previousState !== undefined) {
|
|
86
|
+
location.writePrevious(previousState, previousX, previousY, previousPressure);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
this._count++;
|
|
90
|
+
if (location.isDown) {
|
|
91
|
+
this._activeCount++;
|
|
92
|
+
}
|
|
93
|
+
return location;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* The touch at an index in this frame.
|
|
98
|
+
* @param index The index, from 0 to count - 1.
|
|
99
|
+
* @returns The stored location, or undefined when the index is outside this frame.
|
|
100
|
+
*/
|
|
101
|
+
public get(index: number): TouchLocation | undefined {
|
|
102
|
+
if (index < 0 || index >= this._count) {
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
105
|
+
return this._locations[index];
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Finds a touch by id.
|
|
110
|
+
* Scans only the contacts written this frame. The first match wins.
|
|
111
|
+
* @param id The touch id.
|
|
112
|
+
* @returns The stored location, or undefined when this frame has no contact with that id.
|
|
113
|
+
*/
|
|
114
|
+
public findById(id: number): TouchLocation | undefined {
|
|
115
|
+
const count = this._count;
|
|
116
|
+
const locations = this._locations;
|
|
117
|
+
for (let i = 0; i < count; i++) {
|
|
118
|
+
const location = locations[i];
|
|
119
|
+
if (location.id === id) {
|
|
120
|
+
return location;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return undefined;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* True when the contact with this id is down.
|
|
128
|
+
* A missing id is not down.
|
|
129
|
+
* @param id The touch id.
|
|
130
|
+
*/
|
|
131
|
+
public isDown(id: number): boolean {
|
|
132
|
+
const location = this.findById(id);
|
|
133
|
+
if (location === undefined) {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
return location.isDown;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* True when the contact with this id was released this frame.
|
|
141
|
+
* A missing id was not released.
|
|
142
|
+
* @param id The touch id.
|
|
143
|
+
*/
|
|
144
|
+
public isReleased(id: number): boolean {
|
|
145
|
+
const location = this.findById(id);
|
|
146
|
+
if (location === undefined) {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
return location.isReleased();
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* True when the contact with this id was cancelled this frame.
|
|
154
|
+
* A missing id was not cancelled. A cancel is not a release.
|
|
155
|
+
* @param id The touch id.
|
|
156
|
+
*/
|
|
157
|
+
public isCancelled(id: number): boolean {
|
|
158
|
+
const location = this.findById(id);
|
|
159
|
+
if (location === undefined) {
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
return location.isCancelled();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import {vec2} from "gl-matrix";
|
|
2
|
+
import {TouchLocationState} from "./TouchLocationState.ts";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A single touch contact.
|
|
6
|
+
* Position, delta, and the previous sample are stored on this object.
|
|
7
|
+
* Reading them again returns those same instances.
|
|
8
|
+
*/
|
|
9
|
+
export class TouchLocation {
|
|
10
|
+
|
|
11
|
+
/** The touch id. Stable for the lifetime of the contact. */
|
|
12
|
+
public id = 0;
|
|
13
|
+
|
|
14
|
+
/** The pressure, from 0 to 1. 0 when the device does not report pressure. */
|
|
15
|
+
public pressure = 0;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The position of the touch.
|
|
19
|
+
* Viewport coordinates in CSS pixels, the same space as MouseState (clientX, clientY).
|
|
20
|
+
*/
|
|
21
|
+
public readonly position: vec2 = vec2.create();
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The delta from the previous sample. Zero when this frame has no previous sample.
|
|
25
|
+
* Viewport coordinates in CSS pixels, the same space as MouseState delta.
|
|
26
|
+
*/
|
|
27
|
+
public readonly delta: vec2 = vec2.create();
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* True when the contact is pressed or moved.
|
|
31
|
+
* Updated when state is written.
|
|
32
|
+
*/
|
|
33
|
+
public isDown = false;
|
|
34
|
+
|
|
35
|
+
private _state = TouchLocationState.INVALID;
|
|
36
|
+
private _hasPrevious = false;
|
|
37
|
+
private readonly _previous: TouchLocation | undefined;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The constructor.
|
|
41
|
+
* @param ownsPrevious True when this location keeps a previous sample. The previous sample does not keep one of its own.
|
|
42
|
+
*/
|
|
43
|
+
public constructor(ownsPrevious = true) {
|
|
44
|
+
if (ownsPrevious) {
|
|
45
|
+
this._previous = new TouchLocation(false);
|
|
46
|
+
} else {
|
|
47
|
+
this._previous = undefined;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** The touch location state. */
|
|
52
|
+
public get state(): TouchLocationState {
|
|
53
|
+
return this._state;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** The touch location state. */
|
|
57
|
+
public set state(value: TouchLocationState) {
|
|
58
|
+
this._state = value;
|
|
59
|
+
this.isDown = value === TouchLocationState.PRESSED
|
|
60
|
+
|| value === TouchLocationState.MOVED;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** The x position. */
|
|
64
|
+
public get x(): number {
|
|
65
|
+
return this.position[0];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** The y position. */
|
|
69
|
+
public get y(): number {
|
|
70
|
+
return this.position[1];
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** The delta x. */
|
|
74
|
+
public get dX(): number {
|
|
75
|
+
return this.delta[0];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** The delta y. */
|
|
79
|
+
public get dY(): number {
|
|
80
|
+
return this.delta[1];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** True when the contact started this frame. */
|
|
84
|
+
public isPressed(): boolean {
|
|
85
|
+
return this._state === TouchLocationState.PRESSED;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** True when the contact moved while held. */
|
|
89
|
+
public isMoved(): boolean {
|
|
90
|
+
return this._state === TouchLocationState.MOVED;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** True when the contact was released this frame. */
|
|
94
|
+
public isReleased(): boolean {
|
|
95
|
+
return this._state === TouchLocationState.RELEASED;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** True when the contact was cancelled this frame. A cancel is not a finger lift. */
|
|
99
|
+
public isCancelled(): boolean {
|
|
100
|
+
return this._state === TouchLocationState.CANCELLED;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* The previous sample of this contact.
|
|
105
|
+
* Undefined when this is the first sample. The same instance is returned for every call in the frame.
|
|
106
|
+
*/
|
|
107
|
+
public tryGetPreviousLocation(): TouchLocation | undefined {
|
|
108
|
+
if (!this._hasPrevious) {
|
|
109
|
+
return undefined;
|
|
110
|
+
}
|
|
111
|
+
return this._previous;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Writes this sample.
|
|
116
|
+
* Clears the previous sample and sets delta to zero.
|
|
117
|
+
* @param id The touch id.
|
|
118
|
+
* @param state The touch location state.
|
|
119
|
+
* @param x The x position.
|
|
120
|
+
* @param y The y position.
|
|
121
|
+
* @param pressure The pressure.
|
|
122
|
+
*/
|
|
123
|
+
public write(id: number,
|
|
124
|
+
state: TouchLocationState,
|
|
125
|
+
x: number,
|
|
126
|
+
y: number,
|
|
127
|
+
pressure: number): void {
|
|
128
|
+
this.id = id;
|
|
129
|
+
this.state = state;
|
|
130
|
+
this.position[0] = x;
|
|
131
|
+
this.position[1] = y;
|
|
132
|
+
this.pressure = pressure;
|
|
133
|
+
this._hasPrevious = false;
|
|
134
|
+
this.delta[0] = 0;
|
|
135
|
+
this.delta[1] = 0;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Writes the previous sample and caches delta as this position minus that position.
|
|
140
|
+
* @param state The previous touch location state.
|
|
141
|
+
* @param x The previous x position.
|
|
142
|
+
* @param y The previous y position.
|
|
143
|
+
* @param pressure The previous pressure.
|
|
144
|
+
*/
|
|
145
|
+
public writePrevious(state: TouchLocationState,
|
|
146
|
+
x: number,
|
|
147
|
+
y: number,
|
|
148
|
+
pressure: number): void {
|
|
149
|
+
const previous = this._previous;
|
|
150
|
+
if (previous === undefined) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
previous.write(this.id, state, x, y, pressure);
|
|
155
|
+
this._hasPrevious = true;
|
|
156
|
+
this.delta[0] = this.position[0] - x;
|
|
157
|
+
this.delta[1] = this.position[1] - y;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The state of a touch location for the current frame.
|
|
3
|
+
*/
|
|
4
|
+
export enum TouchLocationState {
|
|
5
|
+
/** No contact. */
|
|
6
|
+
INVALID = 0,
|
|
7
|
+
/** The contact was released this frame. */
|
|
8
|
+
RELEASED = 1,
|
|
9
|
+
/** The contact started this frame. */
|
|
10
|
+
PRESSED = 2,
|
|
11
|
+
/** The contact moved while held. */
|
|
12
|
+
MOVED = 3,
|
|
13
|
+
/** The contact was cancelled this frame. This is not a finger lift. */
|
|
14
|
+
CANCELLED = 4,
|
|
15
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capabilities of the touch panel.
|
|
3
|
+
* Fields stay on this instance. Update them in place when the device changes.
|
|
4
|
+
*/
|
|
5
|
+
export class TouchPanelCapabilities {
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The constructor.
|
|
9
|
+
* @param isConnected True when a touch device is connected.
|
|
10
|
+
* @param maximumTouchCount The maximum number of simultaneous touches. 0 when none are supported.
|
|
11
|
+
* @param hasPressure True when contacts report pressure.
|
|
12
|
+
*/
|
|
13
|
+
public constructor(public isConnected: boolean,
|
|
14
|
+
public maximumTouchCount: number,
|
|
15
|
+
public hasPressure: boolean) {
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Writes new capabilities into this instance.
|
|
20
|
+
* @param isConnected True when a touch device is connected.
|
|
21
|
+
* @param maximumTouchCount The maximum number of simultaneous touches. 0 when none are supported.
|
|
22
|
+
* @param hasPressure True when contacts report pressure.
|
|
23
|
+
*/
|
|
24
|
+
public set(isConnected: boolean,
|
|
25
|
+
maximumTouchCount: number,
|
|
26
|
+
hasPressure: boolean): void {
|
|
27
|
+
this.isConnected = isConnected;
|
|
28
|
+
this.maximumTouchCount = maximumTouchCount;
|
|
29
|
+
this.hasPressure = hasPressure;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {RawImageData} from "../image/RawImageData.ts";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The image loader interface.
|
|
5
|
+
*/
|
|
6
|
+
export interface IImageLoader {
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Loads an image from a file.
|
|
10
|
+
* @param path - The file path.
|
|
11
|
+
* @param cache - Whether to cache the image in a persistent cache.
|
|
12
|
+
* @returns The raw image data.
|
|
13
|
+
*/
|
|
14
|
+
loadAsync(path: string, cache?: boolean): Promise<RawImageData>;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Disposes of the temporary cache.
|
|
18
|
+
*
|
|
19
|
+
* Used internally, call only if you know what you are doing.
|
|
20
|
+
*/
|
|
21
|
+
disposeOfTemporaryCache(): void;
|
|
22
|
+
}
|