ris-framework 0.1.0-dev.6 → 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.
Files changed (640) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/LICENSE +202 -21
  3. package/LICENSES/Apache-2.0.txt +202 -0
  4. package/NOTICE +2 -0
  5. package/README.md +46 -47
  6. package/THIRD_PARTY_NOTICES.md +27 -0
  7. package/dist/Framework.d.ts +81 -0
  8. package/dist/Framework.d.ts.map +1 -0
  9. package/dist/api/FrameworkConfiguration.d.ts +23 -0
  10. package/dist/api/FrameworkConfiguration.d.ts.map +1 -0
  11. package/dist/api/IFramework.d.ts +125 -0
  12. package/dist/api/IFramework.d.ts.map +1 -0
  13. package/dist/api/IFrameworkConfiguration.d.ts +25 -0
  14. package/dist/api/IFrameworkConfiguration.d.ts.map +1 -0
  15. package/dist/api/_export.d.ts +27 -0
  16. package/dist/api/_export.d.ts.map +1 -0
  17. package/dist/api/camera/CameraFactory.d.ts +25 -0
  18. package/dist/api/camera/CameraFactory.d.ts.map +1 -0
  19. package/dist/api/camera/ICamera.d.ts +43 -0
  20. package/dist/api/camera/ICamera.d.ts.map +1 -0
  21. package/dist/api/camera/ICameraFactory.d.ts +46 -0
  22. package/dist/api/camera/ICameraFactory.d.ts.map +1 -0
  23. package/dist/api/camera/IOrthographicCamera.d.ts +31 -0
  24. package/dist/api/camera/IOrthographicCamera.d.ts.map +1 -0
  25. package/dist/api/camera/OrbitCamera.d.ts +120 -0
  26. package/dist/api/camera/OrbitCamera.d.ts.map +1 -0
  27. package/dist/api/camera/OrthographicCamera.d.ts +96 -0
  28. package/dist/api/camera/OrthographicCamera.d.ts.map +1 -0
  29. package/dist/api/camera/PerspectiveCamera.d.ts +108 -0
  30. package/dist/api/camera/PerspectiveCamera.d.ts.map +1 -0
  31. package/dist/api/camera/_export.d.ts +8 -0
  32. package/dist/api/camera/_export.d.ts.map +1 -0
  33. package/dist/api/content/ContentConfig.d.ts +11 -0
  34. package/dist/api/content/ContentConfig.d.ts.map +1 -0
  35. package/dist/api/content/ContentManager.d.ts +27 -0
  36. package/dist/api/content/ContentManager.d.ts.map +1 -0
  37. package/dist/api/content/IContent.d.ts +8 -0
  38. package/dist/api/content/IContent.d.ts.map +1 -0
  39. package/dist/api/content/IContentManager.d.ts +37 -0
  40. package/dist/api/content/IContentManager.d.ts.map +1 -0
  41. package/dist/api/content/IContentModule.d.ts +58 -0
  42. package/dist/api/content/IContentModule.d.ts.map +1 -0
  43. package/dist/api/content/ShaderModuleContent.d.ts +14 -0
  44. package/dist/api/content/ShaderModuleContent.d.ts.map +1 -0
  45. package/dist/api/content/_export-content.d.ts +5 -0
  46. package/dist/api/content/_export-content.d.ts.map +1 -0
  47. package/dist/api/core/IDisposable.d.ts +10 -0
  48. package/dist/api/core/IDisposable.d.ts.map +1 -0
  49. package/dist/api/core/_export-core.d.ts +2 -0
  50. package/dist/api/core/_export-core.d.ts.map +1 -0
  51. package/dist/api/data/Color.d.ts +119 -0
  52. package/dist/api/data/Color.d.ts.map +1 -0
  53. package/dist/api/data/Rect.d.ts +61 -0
  54. package/dist/api/data/Rect.d.ts.map +1 -0
  55. package/dist/api/data/State.d.ts +11 -0
  56. package/dist/api/data/State.d.ts.map +1 -0
  57. package/dist/api/data/_export.d.ts +4 -0
  58. package/dist/api/data/_export.d.ts.map +1 -0
  59. package/dist/api/geometry/BaseGeometry.d.ts +44 -0
  60. package/dist/api/geometry/BaseGeometry.d.ts.map +1 -0
  61. package/dist/api/geometry/GeometryBuilder.d.ts +11 -0
  62. package/dist/api/geometry/GeometryBuilder.d.ts.map +1 -0
  63. package/dist/api/geometry/GeometryFormat.d.ts +34 -0
  64. package/dist/api/geometry/GeometryFormat.d.ts.map +1 -0
  65. package/dist/api/geometry/IGeometry.d.ts +54 -0
  66. package/dist/api/geometry/IGeometry.d.ts.map +1 -0
  67. package/dist/api/geometry/IGeometryBuilder.d.ts +15 -0
  68. package/dist/api/geometry/IGeometryBuilder.d.ts.map +1 -0
  69. package/dist/api/geometry/VertexFormat.d.ts +14 -0
  70. package/dist/api/geometry/VertexFormat.d.ts.map +1 -0
  71. package/dist/api/geometry/_export-geometry.d.ts +5 -0
  72. package/dist/api/geometry/_export-geometry.d.ts.map +1 -0
  73. package/dist/api/image/CpuImageProcessor.d.ts +16 -0
  74. package/dist/api/image/CpuImageProcessor.d.ts.map +1 -0
  75. package/dist/api/image/IImageProcessor.d.ts +26 -0
  76. package/dist/api/image/IImageProcessor.d.ts.map +1 -0
  77. package/dist/api/image/RawImageData.d.ts +34 -0
  78. package/dist/api/image/RawImageData.d.ts.map +1 -0
  79. package/dist/api/image/_export.d.ts +4 -0
  80. package/dist/api/image/_export.d.ts.map +1 -0
  81. package/dist/api/index.d.ts +2 -0
  82. package/dist/api/index.d.ts.map +1 -0
  83. package/dist/api/input/IInputManager.d.ts +53 -0
  84. package/dist/api/input/IInputManager.d.ts.map +1 -0
  85. package/dist/api/input/InputDeviceType.d.ts +18 -0
  86. package/dist/api/input/InputDeviceType.d.ts.map +1 -0
  87. package/dist/api/input/InputManager.d.ts +73 -0
  88. package/dist/api/input/InputManager.d.ts.map +1 -0
  89. package/dist/api/input/Key.d.ts +36 -0
  90. package/dist/api/input/Key.d.ts.map +1 -0
  91. package/dist/api/input/KeyboardState.d.ts +37 -0
  92. package/dist/api/input/KeyboardState.d.ts.map +1 -0
  93. package/dist/api/input/_export.d.ts +14 -0
  94. package/dist/api/input/_export.d.ts.map +1 -0
  95. package/dist/api/input/gamepad/Button.d.ts +22 -0
  96. package/dist/api/input/gamepad/Button.d.ts.map +1 -0
  97. package/dist/api/input/gamepad/GamePadState.d.ts +48 -0
  98. package/dist/api/input/gamepad/GamePadState.d.ts.map +1 -0
  99. package/dist/api/input/gamepad/GamePadThumbSticks.d.ts +17 -0
  100. package/dist/api/input/gamepad/GamePadThumbSticks.d.ts.map +1 -0
  101. package/dist/api/input/mouse/MouseButton.d.ts +10 -0
  102. package/dist/api/input/mouse/MouseButton.d.ts.map +1 -0
  103. package/dist/api/input/mouse/MouseState.d.ts +52 -0
  104. package/dist/api/input/mouse/MouseState.d.ts.map +1 -0
  105. package/dist/api/input/touch/TouchCollection.d.ts +79 -0
  106. package/dist/api/input/touch/TouchCollection.d.ts.map +1 -0
  107. package/dist/api/input/touch/TouchLocation.d.ts +80 -0
  108. package/dist/api/input/touch/TouchLocation.d.ts.map +1 -0
  109. package/dist/api/input/touch/TouchLocationState.d.ts +16 -0
  110. package/dist/api/input/touch/TouchLocationState.d.ts.map +1 -0
  111. package/dist/api/input/touch/TouchPanelCapabilities.d.ts +24 -0
  112. package/dist/api/input/touch/TouchPanelCapabilities.d.ts.map +1 -0
  113. package/dist/api/loaders/IImageLoader.d.ts +20 -0
  114. package/dist/api/loaders/IImageLoader.d.ts.map +1 -0
  115. package/dist/api/loaders/ImageLoader.d.ts +36 -0
  116. package/dist/api/loaders/ImageLoader.d.ts.map +1 -0
  117. package/dist/api/loaders/_export.d.ts +3 -0
  118. package/dist/api/loaders/_export.d.ts.map +1 -0
  119. package/dist/api/material/IMaterial.d.ts +35 -0
  120. package/dist/api/material/IMaterial.d.ts.map +1 -0
  121. package/dist/api/material/IMaterialFactory.d.ts +19 -0
  122. package/dist/api/material/IMaterialFactory.d.ts.map +1 -0
  123. package/dist/api/material/InspectTextureMipsMaterial.d.ts +58 -0
  124. package/dist/api/material/InspectTextureMipsMaterial.d.ts.map +1 -0
  125. package/dist/api/material/MaterialFactory.d.ts +20 -0
  126. package/dist/api/material/MaterialFactory.d.ts.map +1 -0
  127. package/dist/api/material/UnlitMaterial.d.ts +76 -0
  128. package/dist/api/material/UnlitMaterial.d.ts.map +1 -0
  129. package/dist/api/material/_export.d.ts +6 -0
  130. package/dist/api/material/_export.d.ts.map +1 -0
  131. package/dist/api/meshes/IMesh.d.ts +17 -0
  132. package/dist/api/meshes/IMesh.d.ts.map +1 -0
  133. package/dist/api/meshes/IMeshFactory.d.ts +25 -0
  134. package/dist/api/meshes/IMeshFactory.d.ts.map +1 -0
  135. package/dist/api/meshes/Mesh.d.ts +93 -0
  136. package/dist/api/meshes/Mesh.d.ts.map +1 -0
  137. package/dist/api/meshes/MeshFactory.d.ts +23 -0
  138. package/dist/api/meshes/MeshFactory.d.ts.map +1 -0
  139. package/dist/api/meshes/MeshParameters.d.ts +22 -0
  140. package/dist/api/meshes/MeshParameters.d.ts.map +1 -0
  141. package/dist/api/meshes/QuadMesh.d.ts +33 -0
  142. package/dist/api/meshes/QuadMesh.d.ts.map +1 -0
  143. package/dist/api/meshes/_export.d.ts +7 -0
  144. package/dist/api/meshes/_export.d.ts.map +1 -0
  145. package/dist/api/rendering/IGPUInfo.d.ts +35 -0
  146. package/dist/api/rendering/IGPUInfo.d.ts.map +1 -0
  147. package/dist/api/rendering/IGraphicsDevice.d.ts +88 -0
  148. package/dist/api/rendering/IGraphicsDevice.d.ts.map +1 -0
  149. package/dist/api/rendering/IGraphicsDeviceFeatures.d.ts +27 -0
  150. package/dist/api/rendering/IGraphicsDeviceFeatures.d.ts.map +1 -0
  151. package/dist/api/rendering/IRenderer.d.ts +71 -0
  152. package/dist/api/rendering/IRenderer.d.ts.map +1 -0
  153. package/dist/api/rendering/PowerPreference.d.ts +13 -0
  154. package/dist/api/rendering/PowerPreference.d.ts.map +1 -0
  155. package/dist/api/rendering/RenderingBackend.d.ts +18 -0
  156. package/dist/api/rendering/RenderingBackend.d.ts.map +1 -0
  157. package/dist/api/rendering/_export-rendering.d.ts +7 -0
  158. package/dist/api/rendering/_export-rendering.d.ts.map +1 -0
  159. package/dist/api/rendering/blending/IBlendState.d.ts +16 -0
  160. package/dist/api/rendering/blending/IBlendState.d.ts.map +1 -0
  161. package/dist/api/rendering/blending/_export.d.ts +2 -0
  162. package/dist/api/rendering/blending/_export.d.ts.map +1 -0
  163. package/dist/api/rendering/buffers/BufferUsage.d.ts +57 -0
  164. package/dist/api/rendering/buffers/BufferUsage.d.ts.map +1 -0
  165. package/dist/api/rendering/buffers/IBuffer.d.ts +20 -0
  166. package/dist/api/rendering/buffers/IBuffer.d.ts.map +1 -0
  167. package/dist/api/rendering/buffers/IBufferFactory.d.ts +34 -0
  168. package/dist/api/rendering/buffers/IBufferFactory.d.ts.map +1 -0
  169. package/dist/api/rendering/buffers/IIndexBuffer.d.ts +31 -0
  170. package/dist/api/rendering/buffers/IIndexBuffer.d.ts.map +1 -0
  171. package/dist/api/rendering/buffers/IUniformBuffer.d.ts +18 -0
  172. package/dist/api/rendering/buffers/IUniformBuffer.d.ts.map +1 -0
  173. package/dist/api/rendering/buffers/IVertexBuffer.d.ts +26 -0
  174. package/dist/api/rendering/buffers/IVertexBuffer.d.ts.map +1 -0
  175. package/dist/api/rendering/buffers/IVertexBufferLayout.d.ts +23 -0
  176. package/dist/api/rendering/buffers/IVertexBufferLayout.d.ts.map +1 -0
  177. package/dist/api/rendering/buffers/IndexBufferType.d.ts +14 -0
  178. package/dist/api/rendering/buffers/IndexBufferType.d.ts.map +1 -0
  179. package/dist/api/rendering/buffers/VertexAttribute.d.ts +22 -0
  180. package/dist/api/rendering/buffers/VertexAttribute.d.ts.map +1 -0
  181. package/dist/api/rendering/buffers/VertexStepMode.d.ts +14 -0
  182. package/dist/api/rendering/buffers/VertexStepMode.d.ts.map +1 -0
  183. package/dist/api/rendering/buffers/_export-buffers.d.ts +11 -0
  184. package/dist/api/rendering/buffers/_export-buffers.d.ts.map +1 -0
  185. package/dist/api/rendering/enums.d.ts +18 -0
  186. package/dist/api/rendering/enums.d.ts.map +1 -0
  187. package/dist/api/rendering/primitive/CullMode.d.ts +18 -0
  188. package/dist/api/rendering/primitive/CullMode.d.ts.map +1 -0
  189. package/dist/api/rendering/primitive/FrontFace.d.ts +14 -0
  190. package/dist/api/rendering/primitive/FrontFace.d.ts.map +1 -0
  191. package/dist/api/rendering/primitive/IPrimitiveState.d.ts +22 -0
  192. package/dist/api/rendering/primitive/IPrimitiveState.d.ts.map +1 -0
  193. package/dist/api/rendering/primitive/PrimitiveStateDescriptor.d.ts +24 -0
  194. package/dist/api/rendering/primitive/PrimitiveStateDescriptor.d.ts.map +1 -0
  195. package/dist/api/rendering/primitive/PrimitiveTopology.d.ts +26 -0
  196. package/dist/api/rendering/primitive/PrimitiveTopology.d.ts.map +1 -0
  197. package/dist/api/rendering/primitive/_export.d.ts +6 -0
  198. package/dist/api/rendering/primitive/_export.d.ts.map +1 -0
  199. package/dist/api/rendering/render-pipelines/IInspectTextureMipsRenderPipeline.d.ts +33 -0
  200. package/dist/api/rendering/render-pipelines/IInspectTextureMipsRenderPipeline.d.ts.map +1 -0
  201. package/dist/api/rendering/render-pipelines/IMainRenderTargetRenderPipeline.d.ts +18 -0
  202. package/dist/api/rendering/render-pipelines/IMainRenderTargetRenderPipeline.d.ts.map +1 -0
  203. package/dist/api/rendering/render-pipelines/IRenderPipeline.d.ts +39 -0
  204. package/dist/api/rendering/render-pipelines/IRenderPipeline.d.ts.map +1 -0
  205. package/dist/api/rendering/render-pipelines/IRenderPipelineFactory.d.ts +42 -0
  206. package/dist/api/rendering/render-pipelines/IRenderPipelineFactory.d.ts.map +1 -0
  207. package/dist/api/rendering/render-pipelines/ISpriteRenderPipeline.d.ts +22 -0
  208. package/dist/api/rendering/render-pipelines/ISpriteRenderPipeline.d.ts.map +1 -0
  209. package/dist/api/rendering/render-pipelines/IUnlitRenderPipeline.d.ts +33 -0
  210. package/dist/api/rendering/render-pipelines/IUnlitRenderPipeline.d.ts.map +1 -0
  211. package/dist/api/rendering/render-pipelines/_export-render-pipelines.d.ts +7 -0
  212. package/dist/api/rendering/render-pipelines/_export-render-pipelines.d.ts.map +1 -0
  213. package/dist/api/rendering/renderer-interface.d.ts +81 -0
  214. package/dist/api/rendering/renderer-interface.d.ts.map +1 -0
  215. package/dist/api/rendering/rendering-limits.d.ts +16 -0
  216. package/dist/api/rendering/rendering-limits.d.ts.map +1 -0
  217. package/dist/api/rendering/renderpass/IRenderPass.d.ts +15 -0
  218. package/dist/api/rendering/renderpass/IRenderPass.d.ts.map +1 -0
  219. package/dist/api/rendering/renderpass/LoadAction.d.ts +33 -0
  220. package/dist/api/rendering/renderpass/LoadAction.d.ts.map +1 -0
  221. package/dist/api/rendering/renderpass/RenderPassColorAttachment.d.ts +53 -0
  222. package/dist/api/rendering/renderpass/RenderPassColorAttachment.d.ts.map +1 -0
  223. package/dist/api/rendering/renderpass/RenderPassDepthStencilAttachment.d.ts +56 -0
  224. package/dist/api/rendering/renderpass/RenderPassDepthStencilAttachment.d.ts.map +1 -0
  225. package/dist/api/rendering/renderpass/RenderPassDescriptor.d.ts +22 -0
  226. package/dist/api/rendering/renderpass/RenderPassDescriptor.d.ts.map +1 -0
  227. package/dist/api/rendering/renderpass/StoreAction.d.ts +24 -0
  228. package/dist/api/rendering/renderpass/StoreAction.d.ts.map +1 -0
  229. package/dist/api/rendering/renderpass/_export.d.ts +7 -0
  230. package/dist/api/rendering/renderpass/_export.d.ts.map +1 -0
  231. package/dist/api/rendering/sampler/ISampler.d.ts +43 -0
  232. package/dist/api/rendering/sampler/ISampler.d.ts.map +1 -0
  233. package/dist/api/rendering/sampler/MipMapSamplerFilter.d.ts +18 -0
  234. package/dist/api/rendering/sampler/MipMapSamplerFilter.d.ts.map +1 -0
  235. package/dist/api/rendering/sampler/SamplerAddressMode.d.ts +24 -0
  236. package/dist/api/rendering/sampler/SamplerAddressMode.d.ts.map +1 -0
  237. package/dist/api/rendering/sampler/SamplerDescriptor.d.ts +40 -0
  238. package/dist/api/rendering/sampler/SamplerDescriptor.d.ts.map +1 -0
  239. package/dist/api/rendering/sampler/SamplerFilter.d.ts +14 -0
  240. package/dist/api/rendering/sampler/SamplerFilter.d.ts.map +1 -0
  241. package/dist/api/rendering/sampler/_export.d.ts +6 -0
  242. package/dist/api/rendering/sampler/_export.d.ts.map +1 -0
  243. package/dist/api/rendering/sampler/sampler-enums.d.ts +15 -0
  244. package/dist/api/rendering/sampler/sampler-enums.d.ts.map +1 -0
  245. package/dist/api/rendering/swapchain/ISwapChain.d.ts +29 -0
  246. package/dist/api/rendering/swapchain/ISwapChain.d.ts.map +1 -0
  247. package/dist/api/rendering/swapchain/SurfacePresentMode.d.ts +23 -0
  248. package/dist/api/rendering/swapchain/SurfacePresentMode.d.ts.map +1 -0
  249. package/dist/api/rendering/swapchain/SwapChainDescriptor.d.ts +20 -0
  250. package/dist/api/rendering/swapchain/SwapChainDescriptor.d.ts.map +1 -0
  251. package/dist/api/rendering/swapchain/_export.d.ts +4 -0
  252. package/dist/api/rendering/swapchain/_export.d.ts.map +1 -0
  253. package/dist/api/rendering/texture/ITexture2D.d.ts +83 -0
  254. package/dist/api/rendering/texture/ITexture2D.d.ts.map +1 -0
  255. package/dist/api/rendering/texture/ITextureFactory.d.ts +42 -0
  256. package/dist/api/rendering/texture/ITextureFactory.d.ts.map +1 -0
  257. package/dist/api/rendering/texture/ITextureView.d.ts +17 -0
  258. package/dist/api/rendering/texture/ITextureView.d.ts.map +1 -0
  259. package/dist/api/rendering/texture/TextureDescriptor.d.ts +42 -0
  260. package/dist/api/rendering/texture/TextureDescriptor.d.ts.map +1 -0
  261. package/dist/api/rendering/texture/TextureFormat.d.ts +54 -0
  262. package/dist/api/rendering/texture/TextureFormat.d.ts.map +1 -0
  263. package/dist/api/rendering/texture/TextureUsage.d.ts +42 -0
  264. package/dist/api/rendering/texture/TextureUsage.d.ts.map +1 -0
  265. package/dist/api/rendering/texture/TextureUtilities.d.ts +54 -0
  266. package/dist/api/rendering/texture/TextureUtilities.d.ts.map +1 -0
  267. package/dist/api/rendering/texture/TextureViewDescriptor.d.ts +22 -0
  268. package/dist/api/rendering/texture/TextureViewDescriptor.d.ts.map +1 -0
  269. package/dist/api/rendering/texture/TextureViewDimension.d.ts +17 -0
  270. package/dist/api/rendering/texture/TextureViewDimension.d.ts.map +1 -0
  271. package/dist/api/rendering/texture/_export-texture.d.ts +10 -0
  272. package/dist/api/rendering/texture/_export-texture.d.ts.map +1 -0
  273. package/dist/api/shader/IShaderModule.d.ts +21 -0
  274. package/dist/api/shader/IShaderModule.d.ts.map +1 -0
  275. package/dist/api/shader/IShaderModuleLoader.d.ts +13 -0
  276. package/dist/api/shader/IShaderModuleLoader.d.ts.map +1 -0
  277. package/dist/api/shader/ShaderStage.d.ts +10 -0
  278. package/dist/api/shader/ShaderStage.d.ts.map +1 -0
  279. package/dist/api/shader/_export-shader.d.ts +4 -0
  280. package/dist/api/shader/_export-shader.d.ts.map +1 -0
  281. package/dist/api/shader/shader-loader.d.ts +12 -0
  282. package/dist/api/shader/shader-loader.d.ts.map +1 -0
  283. package/dist/api/sprites/ISpriteBatch.d.ts +114 -0
  284. package/dist/api/sprites/ISpriteBatch.d.ts.map +1 -0
  285. package/dist/api/sprites/SpriteBatch.d.ts +50 -0
  286. package/dist/api/sprites/SpriteBatch.d.ts.map +1 -0
  287. package/dist/api/sprites/SpriteBatchDrawable.d.ts +57 -0
  288. package/dist/api/sprites/SpriteBatchDrawable.d.ts.map +1 -0
  289. package/dist/api/sprites/SpriteBatchMesh.d.ts +32 -0
  290. package/dist/api/sprites/SpriteBatchMesh.d.ts.map +1 -0
  291. package/dist/api/sprites/_export_sprites.d.ts +2 -0
  292. package/dist/api/sprites/_export_sprites.d.ts.map +1 -0
  293. package/dist/api/time/GameTime.d.ts +23 -0
  294. package/dist/api/time/GameTime.d.ts.map +1 -0
  295. package/dist/api/time/ITimeManager.d.ts +19 -0
  296. package/dist/api/time/ITimeManager.d.ts.map +1 -0
  297. package/dist/api/time/TimeManager.d.ts +15 -0
  298. package/dist/api/time/TimeManager.d.ts.map +1 -0
  299. package/dist/api/time/_export_time.d.ts +4 -0
  300. package/dist/api/time/_export_time.d.ts.map +1 -0
  301. package/dist/api/utilities/AlignUtilities.d.ts +20 -0
  302. package/dist/api/utilities/AlignUtilities.d.ts.map +1 -0
  303. package/dist/api/utilities/GeometryUtilities.d.ts +13 -0
  304. package/dist/api/utilities/GeometryUtilities.d.ts.map +1 -0
  305. package/dist/api/utilities/MathHelper.d.ts +162 -0
  306. package/dist/api/utilities/MathHelper.d.ts.map +1 -0
  307. package/dist/api/utilities/_export.d.ts +4 -0
  308. package/dist/api/utilities/_export.d.ts.map +1 -0
  309. package/dist/api/window/IWindowManager.d.ts +64 -0
  310. package/dist/api/window/IWindowManager.d.ts.map +1 -0
  311. package/dist/api/window/WindowBounds.d.ts +16 -0
  312. package/dist/api/window/WindowBounds.d.ts.map +1 -0
  313. package/dist/api/window/WindowManager.d.ts +32 -0
  314. package/dist/api/window/WindowManager.d.ts.map +1 -0
  315. package/dist/api/window/_export.d.ts +3 -0
  316. package/dist/api/window/_export.d.ts.map +1 -0
  317. package/dist/core/rendering/AGraphicsDevice.d.ts +73 -0
  318. package/dist/core/rendering/AGraphicsDevice.d.ts.map +1 -0
  319. package/dist/core/rendering/ARenderer.d.ts +74 -0
  320. package/dist/core/rendering/ARenderer.d.ts.map +1 -0
  321. package/dist/core/rendering/blending/blend-component-descriptor.d.ts +25 -0
  322. package/dist/core/rendering/blending/blend-component-descriptor.d.ts.map +1 -0
  323. package/dist/core/rendering/blending/blend-state-descriptor.d.ts +29 -0
  324. package/dist/core/rendering/blending/blend-state-descriptor.d.ts.map +1 -0
  325. package/dist/core/rendering/blending/enums.d.ts +43 -0
  326. package/dist/core/rendering/blending/enums.d.ts.map +1 -0
  327. package/dist/core/rendering/enums.d.ts +20 -0
  328. package/dist/core/rendering/enums.d.ts.map +1 -0
  329. package/dist/core/rendering/sampler/sampler-descriptor.d.ts +28 -0
  330. package/dist/core/rendering/sampler/sampler-descriptor.d.ts.map +1 -0
  331. package/dist/core/rendering/texture/texture.d.ts +69 -0
  332. package/dist/core/rendering/texture/texture.d.ts.map +1 -0
  333. package/dist/core/rendering/vertex-buffer-layout.d.ts +22 -0
  334. package/dist/core/rendering/vertex-buffer-layout.d.ts.map +1 -0
  335. package/dist/index.d.ts +5 -0
  336. package/dist/index.d.ts.map +1 -0
  337. package/dist/index.js +8054 -0
  338. package/dist/libktx-Cjh8w7XG-DhnH9lxr.js +4 -0
  339. package/dist/webgl/WebGLGraphicsDeviceFeatures.d.ts +31 -0
  340. package/dist/webgl/WebGLGraphicsDeviceFeatures.d.ts.map +1 -0
  341. package/dist/webgl/WebGlGpuInfo.d.ts +25 -0
  342. package/dist/webgl/WebGlGpuInfo.d.ts.map +1 -0
  343. package/dist/webgl/WebGlGraphicsDevice.d.ts +47 -0
  344. package/dist/webgl/WebGlGraphicsDevice.d.ts.map +1 -0
  345. package/dist/webgl/WebGlRenderer.d.ts +18 -0
  346. package/dist/webgl/WebGlRenderer.d.ts.map +1 -0
  347. package/dist/webgl/blending/webgl-blend-state.d.ts +33 -0
  348. package/dist/webgl/blending/webgl-blend-state.d.ts.map +1 -0
  349. package/dist/webgl/buffers/WebGlBuffersFactory.d.ts +16 -0
  350. package/dist/webgl/buffers/WebGlBuffersFactory.d.ts.map +1 -0
  351. package/dist/webgl/buffers/WebGlUniformBuffer.d.ts +34 -0
  352. package/dist/webgl/buffers/WebGlUniformBuffer.d.ts.map +1 -0
  353. package/dist/webgl/buffers/WebGlVertexBuffer.d.ts +48 -0
  354. package/dist/webgl/buffers/WebGlVertexBuffer.d.ts.map +1 -0
  355. package/dist/webgl/buffers/webgl-index-buffer.d.ts +43 -0
  356. package/dist/webgl/buffers/webgl-index-buffer.d.ts.map +1 -0
  357. package/dist/webgl/cast/cast.d.ts +52 -0
  358. package/dist/webgl/cast/cast.d.ts.map +1 -0
  359. package/dist/webgl/primitive/WebGlPrimitiveState.d.ts +29 -0
  360. package/dist/webgl/primitive/WebGlPrimitiveState.d.ts.map +1 -0
  361. package/dist/webgl/render-pass/WebGlRenderPass.d.ts +34 -0
  362. package/dist/webgl/render-pass/WebGlRenderPass.d.ts.map +1 -0
  363. package/dist/webgl/render-pipelines/AWebGlRenderPipeline.d.ts +53 -0
  364. package/dist/webgl/render-pipelines/AWebGlRenderPipeline.d.ts.map +1 -0
  365. package/dist/webgl/render-pipelines/WebGlMainRenderTargetRenderPipeline.d.ts +30 -0
  366. package/dist/webgl/render-pipelines/WebGlMainRenderTargetRenderPipeline.d.ts.map +1 -0
  367. package/dist/webgl/render-pipelines/WebGlRenderPipelineFactory.d.ts +24 -0
  368. package/dist/webgl/render-pipelines/WebGlRenderPipelineFactory.d.ts.map +1 -0
  369. package/dist/webgl/render-pipelines/inspect/WebGlInspectTextureMipsRenderPipeline.d.ts +57 -0
  370. package/dist/webgl/render-pipelines/inspect/WebGlInspectTextureMipsRenderPipeline.d.ts.map +1 -0
  371. package/dist/webgl/render-pipelines/material/WebGlUnlitRenderPipeline.d.ts +57 -0
  372. package/dist/webgl/render-pipelines/material/WebGlUnlitRenderPipeline.d.ts.map +1 -0
  373. package/dist/webgl/render-pipelines/sprite/WebGlSpriteRenderPipeline.d.ts +40 -0
  374. package/dist/webgl/render-pipelines/sprite/WebGlSpriteRenderPipeline.d.ts.map +1 -0
  375. package/dist/webgl/rendering/webgl-vertex-attribute.d.ts +10 -0
  376. package/dist/webgl/rendering/webgl-vertex-attribute.d.ts.map +1 -0
  377. package/dist/webgl/rendering/webgl-vertex-buffer-layout.d.ts +27 -0
  378. package/dist/webgl/rendering/webgl-vertex-buffer-layout.d.ts.map +1 -0
  379. package/dist/webgl/sampler/webgl-sampler.d.ts +48 -0
  380. package/dist/webgl/sampler/webgl-sampler.d.ts.map +1 -0
  381. package/dist/webgl/shader/WebGlShaderModule.d.ts +34 -0
  382. package/dist/webgl/shader/WebGlShaderModule.d.ts.map +1 -0
  383. package/dist/webgl/shader/WebGlShaderModuleLoader.d.ts +19 -0
  384. package/dist/webgl/shader/WebGlShaderModuleLoader.d.ts.map +1 -0
  385. package/dist/webgl/swap-chain/WebGlSwapChain.d.ts +27 -0
  386. package/dist/webgl/swap-chain/WebGlSwapChain.d.ts.map +1 -0
  387. package/dist/webgl/texture/WebGlTexture2D.d.ts +37 -0
  388. package/dist/webgl/texture/WebGlTexture2D.d.ts.map +1 -0
  389. package/dist/webgl/texture/WebGlTextureFactory.d.ts +17 -0
  390. package/dist/webgl/texture/WebGlTextureFactory.d.ts.map +1 -0
  391. package/dist/webgl/utilities/WebGlBufferUtilities.d.ts +45 -0
  392. package/dist/webgl/utilities/WebGlBufferUtilities.d.ts.map +1 -0
  393. package/dist/webgl/utilities/WebGlConverter.d.ts +108 -0
  394. package/dist/webgl/utilities/WebGlConverter.d.ts.map +1 -0
  395. package/dist/webgl/utilities/WebGlFrameBufferUtilities.d.ts +54 -0
  396. package/dist/webgl/utilities/WebGlFrameBufferUtilities.d.ts.map +1 -0
  397. package/dist/webgl/utilities/WebGlSamplerUtilities.d.ts +23 -0
  398. package/dist/webgl/utilities/WebGlSamplerUtilities.d.ts.map +1 -0
  399. package/dist/webgl/utilities/WebGlShaderUtilities.d.ts +28 -0
  400. package/dist/webgl/utilities/WebGlShaderUtilities.d.ts.map +1 -0
  401. package/dist/webgl/utilities/WebGlTextureUtilities.d.ts +33 -0
  402. package/dist/webgl/utilities/WebGlTextureUtilities.d.ts.map +1 -0
  403. package/dist/webgl/utilities/WebGlUtilities.d.ts +60 -0
  404. package/dist/webgl/utilities/WebGlUtilities.d.ts.map +1 -0
  405. package/dist/webgl/utilities/spector-js-utilities.d.ts +9 -0
  406. package/dist/webgl/utilities/spector-js-utilities.d.ts.map +1 -0
  407. package/dist/webgl/utilities/webgl-blending-utilities.d.ts +17 -0
  408. package/dist/webgl/utilities/webgl-blending-utilities.d.ts.map +1 -0
  409. package/dist/webgl/utilities/webgl-culling-utilities.d.ts +13 -0
  410. package/dist/webgl/utilities/webgl-culling-utilities.d.ts.map +1 -0
  411. package/dist/webgl/utilities/webgl-filter-anisotropic-utilities.d.ts +24 -0
  412. package/dist/webgl/utilities/webgl-filter-anisotropic-utilities.d.ts.map +1 -0
  413. package/dist/webgl/utilities/webgl-program-utilities.d.ts +14 -0
  414. package/dist/webgl/utilities/webgl-program-utilities.d.ts.map +1 -0
  415. package/dist/webgl/utilities/webgl-renderbuffer-utilities.d.ts +17 -0
  416. package/dist/webgl/utilities/webgl-renderbuffer-utilities.d.ts.map +1 -0
  417. package/package.json +19 -12
  418. package/shaders/glsl/sprite_fs.glsl +1 -1
  419. package/src/{core/Framework.ts → Framework.ts} +78 -38
  420. package/src/api/FrameworkConfiguration.ts +29 -0
  421. package/src/api/IFramework.ts +153 -0
  422. package/src/api/IFrameworkConfiguration.ts +30 -0
  423. package/src/api/_export.ts +26 -0
  424. package/src/api/camera/CameraFactory.ts +56 -0
  425. package/src/api/camera/ICamera.ts +52 -0
  426. package/src/api/camera/ICameraFactory.ts +69 -0
  427. package/src/api/camera/IOrthographicCamera.ts +38 -0
  428. package/src/api/camera/OrbitCamera.ts +402 -0
  429. package/src/api/camera/OrthographicCamera.ts +257 -0
  430. package/src/api/camera/PerspectiveCamera.ts +206 -0
  431. package/src/api/camera/_export.ts +7 -0
  432. package/src/api/content/ContentConfig.ts +11 -0
  433. package/src/{core → api}/content/ContentManager.ts +4 -3
  434. package/src/api/content/IContent.ts +9 -0
  435. package/src/api/content/IContentManager.ts +41 -0
  436. package/src/api/content/IContentModule.ts +67 -0
  437. package/src/{content → api/content}/ShaderModuleContent.ts +8 -8
  438. package/src/api/content/_export-content.ts +4 -0
  439. package/src/api/core/IDisposable.ts +10 -0
  440. package/src/api/core/_export-core.ts +1 -0
  441. package/src/api/data/Color.ts +228 -0
  442. package/src/api/data/Rect.ts +92 -0
  443. package/src/api/data/State.ts +10 -0
  444. package/src/api/data/_export.ts +3 -0
  445. package/src/{geometry → api/geometry}/BaseGeometry.ts +15 -2
  446. package/src/{geometry → api/geometry}/GeometryBuilder.ts +1 -1
  447. package/src/api/geometry/GeometryFormat.ts +33 -0
  448. package/src/api/geometry/IGeometry.ts +66 -0
  449. package/src/api/geometry/IGeometryBuilder.ts +17 -0
  450. package/src/{VertexFormat.ts → api/geometry/VertexFormat.ts} +3 -7
  451. package/src/api/geometry/_export-geometry.ts +4 -0
  452. package/src/api/image/CpuImageProcessor.ts +125 -0
  453. package/src/api/image/IImageProcessor.ts +28 -0
  454. package/src/api/image/RawImageData.ts +47 -0
  455. package/src/api/image/_export.ts +3 -0
  456. package/src/api/index.ts +1 -0
  457. package/src/api/input/IInputManager.ts +62 -0
  458. package/src/api/input/InputDeviceType.ts +20 -0
  459. package/src/api/input/InputManager.ts +513 -0
  460. package/src/api/input/Key.ts +35 -0
  461. package/src/api/input/KeyboardState.ts +44 -0
  462. package/src/api/input/_export.ts +13 -0
  463. package/src/api/input/gamepad/Button.ts +21 -0
  464. package/src/api/input/gamepad/GamePadState.ts +65 -0
  465. package/src/api/input/gamepad/GamePadThumbSticks.ts +18 -0
  466. package/src/api/input/mouse/MouseButton.ts +9 -0
  467. package/src/api/input/mouse/MouseState.ts +70 -0
  468. package/src/api/input/touch/TouchCollection.ts +164 -0
  469. package/src/api/input/touch/TouchLocation.ts +159 -0
  470. package/src/api/input/touch/TouchLocationState.ts +15 -0
  471. package/src/api/input/touch/TouchPanelCapabilities.ts +31 -0
  472. package/src/api/loaders/IImageLoader.ts +22 -0
  473. package/src/api/loaders/ImageLoader.ts +93 -0
  474. package/src/api/loaders/_export.ts +2 -0
  475. package/src/api/material/IMaterial.ts +41 -0
  476. package/src/api/material/IMaterialFactory.ts +21 -0
  477. package/src/api/material/InspectTextureMipsMaterial.ts +113 -0
  478. package/src/api/material/MaterialFactory.ts +27 -0
  479. package/src/api/material/UnlitMaterial.ts +143 -0
  480. package/src/api/material/_export.ts +5 -0
  481. package/src/api/meshes/IMesh.ts +20 -0
  482. package/src/api/meshes/IMeshFactory.ts +28 -0
  483. package/src/api/meshes/Mesh.ts +256 -0
  484. package/src/api/meshes/MeshFactory.ts +36 -0
  485. package/src/api/meshes/MeshParameters.ts +25 -0
  486. package/src/api/meshes/QuadMesh.ts +104 -0
  487. package/src/api/meshes/_export.ts +6 -0
  488. package/src/api/rendering/IGPUInfo.ts +42 -0
  489. package/src/api/rendering/IGraphicsDevice.ts +103 -0
  490. package/src/api/rendering/IGraphicsDeviceFeatures.ts +32 -0
  491. package/src/api/rendering/IRenderer.ts +84 -0
  492. package/src/api/rendering/PowerPreference.ts +15 -0
  493. package/src/api/rendering/RenderingBackend.ts +20 -0
  494. package/src/api/rendering/_export-rendering.ts +6 -0
  495. package/src/api/rendering/blending/IBlendState.ts +17 -0
  496. package/src/api/rendering/blending/_export.ts +1 -0
  497. package/src/api/rendering/buffers/BufferUsage.ts +56 -0
  498. package/src/api/rendering/buffers/IBuffer.ts +24 -0
  499. package/src/api/rendering/buffers/IBufferFactory.ts +38 -0
  500. package/src/api/rendering/buffers/IIndexBuffer.ts +37 -0
  501. package/src/api/rendering/buffers/IUniformBuffer.ts +21 -0
  502. package/src/api/rendering/buffers/IVertexBuffer.ts +32 -0
  503. package/src/api/rendering/buffers/IVertexBufferLayout.ts +27 -0
  504. package/src/api/rendering/buffers/IndexBufferType.ts +13 -0
  505. package/src/api/rendering/buffers/VertexAttribute.ts +26 -0
  506. package/src/api/rendering/buffers/VertexStepMode.ts +13 -0
  507. package/src/api/rendering/buffers/_export-buffers.ts +11 -0
  508. package/src/api/rendering/primitive/CullMode.ts +17 -0
  509. package/src/api/rendering/primitive/FrontFace.ts +13 -0
  510. package/src/api/rendering/primitive/IPrimitiveState.ts +25 -0
  511. package/src/api/rendering/primitive/PrimitiveStateDescriptor.ts +27 -0
  512. package/src/api/rendering/primitive/PrimitiveTopology.ts +25 -0
  513. package/src/api/rendering/primitive/_export.ts +5 -0
  514. package/src/api/rendering/render-pipelines/IInspectTextureMipsRenderPipeline.ts +38 -0
  515. package/src/api/rendering/render-pipelines/IMainRenderTargetRenderPipeline.ts +21 -0
  516. package/src/api/rendering/render-pipelines/IRenderPipeline.ts +47 -0
  517. package/src/api/rendering/render-pipelines/IRenderPipelineFactory.ts +52 -0
  518. package/src/api/rendering/render-pipelines/ISpriteRenderPipeline.ts +25 -0
  519. package/src/api/rendering/render-pipelines/IUnlitRenderPipeline.ts +38 -0
  520. package/src/api/rendering/render-pipelines/_export-render-pipelines.ts +6 -0
  521. package/src/{core/renderer → api/rendering}/renderer-interface.ts +15 -9
  522. package/src/api/rendering/renderpass/IRenderPass.ts +18 -0
  523. package/src/api/rendering/renderpass/LoadAction.ts +32 -0
  524. package/src/api/rendering/renderpass/RenderPassColorAttachment.ts +61 -0
  525. package/src/api/rendering/renderpass/RenderPassDepthStencilAttachment.ts +76 -0
  526. package/src/api/rendering/renderpass/RenderPassDescriptor.ts +26 -0
  527. package/src/api/rendering/renderpass/StoreAction.ts +23 -0
  528. package/src/api/rendering/renderpass/_export.ts +6 -0
  529. package/src/api/rendering/sampler/ISampler.ts +52 -0
  530. package/src/api/rendering/sampler/MipMapSamplerFilter.ts +17 -0
  531. package/src/api/rendering/sampler/SamplerAddressMode.ts +23 -0
  532. package/src/api/rendering/sampler/SamplerDescriptor.ts +46 -0
  533. package/src/api/rendering/sampler/SamplerFilter.ts +13 -0
  534. package/src/api/rendering/sampler/_export.ts +5 -0
  535. package/src/api/rendering/sampler/sampler-enums.ts +20 -0
  536. package/src/api/rendering/swapchain/ISwapChain.ts +33 -0
  537. package/src/api/rendering/swapchain/SurfacePresentMode.ts +22 -0
  538. package/src/api/rendering/swapchain/SwapChainDescriptor.ts +23 -0
  539. package/src/api/rendering/swapchain/_export.ts +3 -0
  540. package/src/api/rendering/texture/ITexture2D.ts +100 -0
  541. package/src/api/rendering/texture/ITextureFactory.ts +56 -0
  542. package/src/api/rendering/texture/ITextureView.ts +20 -0
  543. package/src/api/rendering/texture/TextureDescriptor.ts +52 -0
  544. package/src/api/rendering/texture/TextureFormat.ts +58 -0
  545. package/src/api/rendering/texture/TextureUsage.ts +41 -0
  546. package/src/api/rendering/texture/TextureUtilities.ts +149 -0
  547. package/src/api/rendering/texture/TextureViewDescriptor.ts +25 -0
  548. package/src/api/rendering/texture/TextureViewDimension.ts +16 -0
  549. package/src/api/rendering/texture/_export-texture.ts +9 -0
  550. package/src/api/shader/IShaderModule.ts +23 -0
  551. package/src/api/shader/IShaderModuleLoader.ts +15 -0
  552. package/src/api/shader/ShaderStage.ts +9 -0
  553. package/src/api/shader/_export-shader.ts +3 -0
  554. package/src/{core → api}/shader/shader-loader.ts +1 -1
  555. package/src/api/sprites/ISpriteBatch.ts +144 -0
  556. package/src/{core/sprite-batch → api/sprites}/SpriteBatch.ts +8 -5
  557. package/src/{core/sprite-batch → api/sprites}/SpriteBatchDrawable.ts +6 -6
  558. package/src/{core/sprite-batch → api/sprites}/SpriteBatchMesh.ts +8 -4
  559. package/src/api/sprites/_export_sprites.ts +1 -0
  560. package/src/api/time/GameTime.ts +30 -0
  561. package/src/api/time/ITimeManager.ts +22 -0
  562. package/src/api/time/TimeManager.ts +33 -0
  563. package/src/api/time/_export_time.ts +3 -0
  564. package/src/api/utilities/AlignUtilities.ts +39 -0
  565. package/src/api/utilities/GeometryUtilities.ts +20 -0
  566. package/src/api/utilities/MathHelper.ts +256 -0
  567. package/src/api/utilities/_export.ts +3 -0
  568. package/src/api/window/IWindowManager.ts +78 -0
  569. package/src/api/window/WindowBounds.ts +17 -0
  570. package/src/{core/window/window-manager.ts → api/window/WindowManager.ts} +2 -2
  571. package/src/api/window/_export.ts +2 -0
  572. package/src/core/rendering/AGraphicsDevice.ts +15 -9
  573. package/src/core/rendering/ARenderer.ts +7 -7
  574. package/src/core/rendering/blending/enums.ts +5 -5
  575. package/src/core/rendering/sampler/sampler-descriptor.ts +1 -1
  576. package/src/core/rendering/texture/texture.ts +4 -3
  577. package/src/core/rendering/vertex-buffer-layout.ts +3 -4
  578. package/src/glsl-raw.d.ts +4 -0
  579. package/src/index.ts +3 -2
  580. package/src/main.ts +5 -10
  581. package/src/webgl/WebGLGraphicsDeviceFeatures.ts +1 -1
  582. package/src/webgl/WebGlGpuInfo.ts +1 -1
  583. package/src/webgl/WebGlGraphicsDevice.ts +19 -15
  584. package/src/webgl/WebGlRenderer.ts +7 -5
  585. package/src/webgl/blending/webgl-blend-state.ts +1 -1
  586. package/src/webgl/buffers/WebGlBuffersFactory.ts +1 -1
  587. package/src/webgl/buffers/WebGlUniformBuffer.ts +1 -1
  588. package/src/webgl/buffers/WebGlVertexBuffer.ts +8 -7
  589. package/src/webgl/buffers/webgl-index-buffer.ts +2 -2
  590. package/src/webgl/cast/cast.ts +2 -2
  591. package/src/webgl/primitive/WebGlPrimitiveState.ts +7 -3
  592. package/src/webgl/render-pass/WebGlRenderPass.ts +17 -8
  593. package/src/webgl/render-pipelines/AWebGlRenderPipeline.ts +1 -1
  594. package/src/webgl/render-pipelines/WebGlMainRenderTargetRenderPipeline.ts +10 -2
  595. package/src/webgl/render-pipelines/WebGlRenderPipelineFactory.ts +1 -1
  596. package/src/webgl/render-pipelines/inspect/WebGlInspectTextureMipsRenderPipeline.ts +3 -3
  597. package/src/webgl/render-pipelines/material/WebGlUnlitRenderPipeline.ts +2 -2
  598. package/src/webgl/render-pipelines/sprite/WebGlSpriteRenderPipeline.ts +2 -2
  599. package/src/webgl/sampler/webgl-sampler.ts +2 -2
  600. package/src/webgl/shader/WebGlShaderModule.ts +2 -2
  601. package/src/webgl/shader/WebGlShaderModuleLoader.ts +1 -1
  602. package/src/webgl/swap-chain/WebGlSwapChain.ts +1 -1
  603. package/src/webgl/texture/WebGlTexture2D.ts +6 -4
  604. package/src/webgl/texture/WebGlTextureFactory.ts +7 -7
  605. package/src/webgl/utilities/WebGlBufferUtilities.ts +1 -1
  606. package/src/webgl/utilities/WebGlConverter.ts +19 -62
  607. package/src/webgl/utilities/WebGlFrameBufferUtilities.ts +1 -1
  608. package/src/webgl/utilities/WebGlSamplerUtilities.ts +4 -4
  609. package/src/webgl/utilities/WebGlTextureUtilities.ts +29 -20
  610. package/src/webgl/utilities/webgl-culling-utilities.ts +1 -1
  611. package/src/webgl/utilities/webgl-filter-anisotropic-utilities.ts +1 -1
  612. package/src/webgl/utilities/webgl-renderbuffer-utilities.ts +1 -1
  613. package/dist/assets/_ris-ktx2-node-module-stub-DwDS30PT.js +0 -1
  614. package/dist/assets/cat.jpg +0 -0
  615. package/dist/assets/index-BmeGit54.css +0 -1
  616. package/dist/assets/index-qyn4pzGw.js +0 -151
  617. package/dist/assets/libktx-Cjh8w7XG-Ci1Fm_MH.js +0 -1
  618. package/dist/assets/test.png +0 -0
  619. package/dist/index.html +0 -16
  620. package/dist/vite.svg +0 -1
  621. package/src/TextureFormat.ts +0 -0
  622. package/src/common/sampler-enums.ts +0 -21
  623. package/src/common/vertex-step-mode.ts +0 -12
  624. package/src/core/FrameworkConfig.ts +0 -31
  625. package/src/core/buffers/buffers-factory-interface.ts +0 -0
  626. package/src/core/buffers/vertex-buffer-interface.ts +0 -0
  627. package/src/core/dependency-injection/register-services-interface.ts +0 -15
  628. package/src/core/framework-interface.ts +0 -0
  629. package/src/core/input/InputManager.ts +0 -115
  630. package/src/core/rendering/primitive/PrimitiveStateDescriptor.ts +0 -32
  631. package/src/core/rendering/primitive/enums.ts +0 -68
  632. package/src/core/rendering/render-pass/render-pass-descriptor.ts +0 -0
  633. package/src/core/rendering/render-pass/render-pass-interface.ts +0 -17
  634. package/src/core/rendering/vertex-attribute.ts +0 -20
  635. package/src/core/shader/shader-module-interface.ts +0 -1
  636. package/src/counter.ts +0 -9
  637. package/src/geometry/GeometryFormat.ts +0 -37
  638. package/src/webgl/utilities/webgl-render-buffer-utilities.ts +0 -23
  639. /package/src/{core/renderer → api/rendering}/enums.ts +0 -0
  640. /package/src/{core/renderer → api/rendering}/rendering-limits.ts +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebGlTextureUtilities.d.ts","sourceRoot":"","sources":["../../../src/webgl/utilities/WebGlTextureUtilities.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,aAAa,EAAC,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAE/B;;GAEG;AACH,qBAAa,qBAAqB;IAE9B;;;;;;;;;;;OAWG;IACI,eAAe,CAClB,EAAE,EAAE,sBAAsB,EAC1B,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAC7B,IAAI,GAAE,UAAU,EAAE,GAAG,gBAAgB,EAAE,GAAG,IAAW,EACrD,aAAa,gBAA6B,EAC1C,UAAU,UAAQ,EAClB,UAAU,SAAM,EAChB,KAAK,GAAE,MAAM,GAAG,IAAW,GAC5B,YAAY;IA2Df;;;;;;;;;;OAUG;IACI,yBAAyB,CAC5B,EAAE,EAAE,sBAAsB,EAC1B,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAChC,IAAI,GAAE,UAAU,EAAE,GAAG,IAAW,EAChC,KAAK,GAAE,MAAM,GAAG,IAAW,EAC3B,aAAa,gBAA6B,EAC1C,UAAU,SAAM,GACjB,YAAY;CAgElB"}
@@ -0,0 +1,60 @@
1
+ import { WebGLBlendingUtilities } from "./webgl-blending-utilities";
2
+ import { WebGlBufferUtilities } from "./WebGlBufferUtilities.js";
3
+ import { WebGLCullingUtilities } from "./webgl-culling-utilities";
4
+ import { WebGLFilterAnisotropicUtilities } from "./webgl-filter-anisotropic-utilities";
5
+ import { WebGlFrameBufferUtilities } from "./WebGlFrameBufferUtilities.js";
6
+ import { WebGLProgramUtilities } from "./webgl-program-utilities";
7
+ import { WebGLRenderbufferUtilities } from "./webgl-renderbuffer-utilities";
8
+ import { WebGlSamplerUtilities } from "./WebGlSamplerUtilities.js";
9
+ import { WebGlShaderUtilities } from "./WebGlShaderUtilities.js";
10
+ import { WebGlTextureUtilities } from "./WebGlTextureUtilities.js";
11
+ /**
12
+ * The utility class for WebGL operations.
13
+ */
14
+ export declare class WebGlUtilities {
15
+ /**
16
+ * The WebGL blending utilities.
17
+ */
18
+ static readonly blending: WebGLBlendingUtilities;
19
+ /**
20
+ * The WebGL anisotropic filtering utilities.
21
+ */
22
+ static readonly anisotropy: WebGLFilterAnisotropicUtilities;
23
+ /**
24
+ * The WebGL culling utilities.
25
+ */
26
+ static readonly culling: WebGLCullingUtilities;
27
+ /**
28
+ * The WebGL texture utilities.
29
+ */
30
+ static readonly texture: WebGlTextureUtilities;
31
+ /**
32
+ * The WebGL framebuffer utilities.
33
+ */
34
+ static readonly framebuffer: WebGlFrameBufferUtilities;
35
+ /**
36
+ * The WebGL render buffer utilities.
37
+ */
38
+ static readonly renderbuffer: WebGLRenderbufferUtilities;
39
+ /**
40
+ * The WebGL buffer utilities.
41
+ */
42
+ static readonly buffer: WebGlBufferUtilities;
43
+ /**
44
+ * The WebGL render buffer utilities.
45
+ */
46
+ static readonly renderBuffer: WebGLRenderbufferUtilities;
47
+ /**
48
+ * The WebGL sampler utilities.
49
+ */
50
+ static readonly sampler: WebGlSamplerUtilities;
51
+ /**
52
+ * The WebGL shader utilities.
53
+ */
54
+ static readonly shader: WebGlShaderUtilities;
55
+ /**
56
+ * The WebGL program utilities.
57
+ */
58
+ static readonly program: WebGLProgramUtilities;
59
+ }
60
+ //# sourceMappingURL=WebGlUtilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebGlUtilities.d.ts","sourceRoot":"","sources":["../../../src/webgl/utilities/WebGlUtilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE;;GAEG;AACH,qBAAa,cAAc;IAEvB;;OAEG;IACH,gBAAuB,QAAQ,yBAAgC;IAE/D;;OAEG;IACH,gBAAuB,UAAU,kCAAyC;IAE1E;;OAEG;IACH,gBAAuB,OAAO,wBAA+B;IAE7D;;OAEG;IACH,gBAAuB,OAAO,wBAA+B;IAE7D;;OAEG;IACH,gBAAuB,WAAW,4BAAmC;IAErE;;OAEG;IACH,gBAAuB,YAAY,6BAAoC;IAEvE;;OAEG;IACH,gBAAuB,MAAM,uBAA8B;IAE3D;;OAEG;IACH,gBAAuB,YAAY,6BAAoC;IAEvE;;OAEG;IACH,gBAAuB,OAAO,wBAA+B;IAE7D;;OAEG;IACH,gBAAuB,MAAM,uBAA8B;IAE3D;;OAEG;IACH,gBAAuB,OAAO,wBAA+B;CAChE"}
@@ -0,0 +1,9 @@
1
+ export declare class SpectorJSUtilities {
2
+ /**
3
+ * Sets the label for a WebGL object to be used by Spector.js.
4
+ * @param target The WebGL object to set the label for (e.g., WebGLBuffer, WebGLTexture, WebGLFramebuffer, etc.).
5
+ * @param label The label to set for the WebGL object. This will be displayed in Spector.js for easier identification.
6
+ */
7
+ static setLabel(target: any, label: string): void;
8
+ }
9
+ //# sourceMappingURL=spector-js-utilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spector-js-utilities.d.ts","sourceRoot":"","sources":["../../../src/webgl/utilities/spector-js-utilities.ts"],"names":[],"mappings":"AAAA,qBAAa,kBAAkB;IAE3B;;;;OAIG;WACW,QAAQ,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;CAK3D"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The utility class for WebGL blending operations.
3
+ */
4
+ export declare class WebGLBlendingUtilities {
5
+ /**
6
+ * Enables blending with the specified parameters.
7
+ * @param gl The WebGL2RenderingContext context.
8
+ * @param colorFunc The color function. By default, it is FUNC_ADD.
9
+ * @param srcColorFactor The source color factor. By default, it is SRC_ALPHA.
10
+ * @param dstColorFactor The destination color factor. By default, it is ONE_MINUS_SRC_ALPHA.
11
+ * @param alphaFunc The alpha function. By default, it is FUNC_ADD.
12
+ * @param srcAlphaFactor The source alpha factor. By default, it is SRC_ALPHA.
13
+ * @param dstAlphaFactor The destination alpha factor. By default, it is ONE_MINUS_SRC_ALPHA.
14
+ */
15
+ enableBlend(gl: WebGL2RenderingContext, colorFunc?: number | null, srcColorFactor?: number | null, dstColorFactor?: number | null, alphaFunc?: number | null, srcAlphaFactor?: number | null, dstAlphaFactor?: number | null): void;
16
+ }
17
+ //# sourceMappingURL=webgl-blending-utilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webgl-blending-utilities.d.ts","sourceRoot":"","sources":["../../../src/webgl/utilities/webgl-blending-utilities.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,sBAAsB;IAC/B;;;;;;;;;OASG;IACI,WAAW,CACd,EAAE,EAAE,sBAAsB,EAC1B,SAAS,GAAE,MAAM,GAAG,IAAW,EAC/B,cAAc,GAAE,MAAM,GAAG,IAAW,EACpC,cAAc,GAAE,MAAM,GAAG,IAAW,EACpC,SAAS,GAAE,MAAM,GAAG,IAAW,EAC/B,cAAc,GAAE,MAAM,GAAG,IAAW,EACpC,cAAc,GAAE,MAAM,GAAG,IAAW,GACrC,IAAI;CA8DV"}
@@ -0,0 +1,13 @@
1
+ import { Culling } from "../../api/rendering/enums.js";
2
+ /**
3
+ * The WebGL culling utilities.
4
+ */
5
+ export declare class WebGLCullingUtilities {
6
+ /**
7
+ * Sets the culling mode.
8
+ * @param gl The WebGL2RenderingContext.
9
+ * @param culling The culling mode.
10
+ */
11
+ setCulling(gl: WebGL2RenderingContext, culling: Culling): void;
12
+ }
13
+ //# sourceMappingURL=webgl-culling-utilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webgl-culling-utilities.d.ts","sourceRoot":"","sources":["../../../src/webgl/utilities/webgl-culling-utilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAGvD;;GAEG;AACH,qBAAa,qBAAqB;IAE9B;;;;OAIG;IACI,UAAU,CAAC,EAAE,EAAE,sBAAsB,EAAE,OAAO,EAAE,OAAO;CASjE"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The utility class for WebGL anisotropic filtering operations.
3
+ */
4
+ export declare class WebGLFilterAnisotropicUtilities {
5
+ /**
6
+ * The max anisotropy extension string.
7
+ */
8
+ private MAX_ANISOTROPY_EXT;
9
+ private _extension;
10
+ /**
11
+ * Gets the max anisotropy.
12
+ * @param gl The WebGL2 rendering context.
13
+ * @returns The maximum supported level of anisotropic filtering. `0` if not supported.
14
+ */
15
+ getMaxAnisotropy(gl: WebGL2RenderingContext): number;
16
+ /**
17
+ * Sets the anisotropy filtering level for texture.
18
+ * @param gl The WebGL2 rendering context.
19
+ * @param texture The WebGL texture.
20
+ * @param anisotropy The level of anisotropic filtering
21
+ */
22
+ setAnisotropy(gl: WebGL2RenderingContext, texture: WebGLTexture, anisotropy: number): void;
23
+ }
24
+ //# sourceMappingURL=webgl-filter-anisotropic-utilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webgl-filter-anisotropic-utilities.d.ts","sourceRoot":"","sources":["../../../src/webgl/utilities/webgl-filter-anisotropic-utilities.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,+BAA+B;IACxC;;OAEG;IACH,OAAO,CAAC,kBAAkB,CAA4C;IAEtE,OAAO,CAAC,UAAU,CAAM;IAExB;;;;OAIG;IACI,gBAAgB,CAAC,EAAE,EAAE,sBAAsB,GAAG,MAAM;IAU3D;;;;;OAKG;IACI,aAAa,CAAC,EAAE,EAAE,sBAAsB,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM;CAI7F"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This module provides utility functions for working with WebGL programs, such as creating and linking shader programs.
3
+ */
4
+ export declare class WebGLProgramUtilities {
5
+ /**
6
+ * Creates a WebGL program with the given vertex shader and fragment shader.
7
+ * @param gl The WebGL2 rendering context.
8
+ * @param vertexShader The vertex shader to be attached to the program.
9
+ * @param fragmentShader The fragment shader to be attached to the program.
10
+ * @returns The linked WebGLProgram object.
11
+ */
12
+ create(gl: WebGL2RenderingContext, vertexShader: WebGLShader, fragmentShader: WebGLShader): WebGLProgram;
13
+ }
14
+ //# sourceMappingURL=webgl-program-utilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webgl-program-utilities.d.ts","sourceRoot":"","sources":["../../../src/webgl/utilities/webgl-program-utilities.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,qBAAqB;IAE9B;;;;;;OAMG;IACI,MAAM,CAAC,EAAE,EAAE,sBAAsB,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,GAAG,YAAY;CAgBlH"}
@@ -0,0 +1,17 @@
1
+ import type { TextureFormat } from "../../api/index.js";
2
+ /**
3
+ * The utility class for WebGL render buffer operations. It provides methods for creating render buffers with specified formats, dimensions, and labels. Render buffers are used in WebGL for off-screen rendering, particularly for depth and stencil attachments in framebuffers. This class abstracts the details of creating and configuring render buffers, making it easier to manage them in a WebGL application.
4
+ */
5
+ export declare class WebGLRenderbufferUtilities {
6
+ /**
7
+ * Creates a render buffer with the specified internal format, width, height, and label.
8
+ * @param gl The WebGL2 rendering context.
9
+ * @param internalFormat The internal format of the render buffer, which determines the type of data stored in the buffer (e.g., depth, stencil, or depth-stencil).
10
+ * @param width The width of the render buffer in pixels.
11
+ * @param height The height of the render buffer in pixels.
12
+ * @param label The label of the render buffer, which can be used for debugging purposes. It is optional and can be null or undefined.
13
+ * @returns The created WebGLRenderbuffer object.
14
+ */
15
+ create(gl: WebGL2RenderingContext, internalFormat: TextureFormat, width: number, height: number, label: string | null | undefined): WebGLRenderbuffer;
16
+ }
17
+ //# sourceMappingURL=webgl-renderbuffer-utilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webgl-renderbuffer-utilities.d.ts","sourceRoot":"","sources":["../../../src/webgl/utilities/webgl-renderbuffer-utilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAIxD;;GAEG;AACH,qBAAa,0BAA0B;IACnC;;;;;;;;OAQG;IACI,MAAM,CAAC,EAAE,EAAE,sBAAsB,EAAE,cAAc,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,iBAAiB;CAiB/J"}
package/package.json CHANGED
@@ -1,44 +1,51 @@
1
1
  {
2
2
  "name": "ris-framework",
3
- "version": "0.1.0-dev.6",
3
+ "version": "0.1.0-dev.9",
4
+ "license": "Apache-2.0",
4
5
  "repository": {
5
6
  "type": "git",
6
7
  "url": "https://github.com/luka712/ris-framework-ts"
7
8
  },
8
9
  "type": "module",
9
- "main": "./src/index.ts",
10
- "types": "./src/index.ts",
10
+ "main": "./dist/index.js",
11
+ "module": "./dist/index.js",
12
+ "types": "./dist/index.d.ts",
11
13
  "exports": {
12
14
  ".": {
13
- "types": "./src/index.ts",
14
- "import": "./src/index.ts",
15
- "default": "./src/index.ts"
15
+ "types": "./dist/index.d.ts",
16
+ "import": "./dist/index.js",
17
+ "default": "./dist/index.js"
16
18
  }
17
19
  },
18
20
  "scripts": {
19
21
  "dev": "vite",
20
- "build": "tsc && vite build",
22
+ "build": "tsc --noEmit && npm run build:lib && npm run build:app",
23
+ "build:lib": "rm -rf dist && vite build --config vite.lib.config.ts && tsc -p tsconfig.lib.json && node scripts/rewrite-declaration-extensions.mjs",
24
+ "build:app": "vite build",
21
25
  "preview": "vite preview",
22
- "test": "tsc --noEmit"
26
+ "test": "tsc --noEmit && tsc -p tsconfig.test.json --noEmit && vitest run"
23
27
  },
24
28
  "devDependencies": {
25
29
  "typescript": "~5.9.3",
26
- "vite": "^7.2.4"
30
+ "vite": "^7.2.4",
31
+ "vitest": "^5.0.3"
27
32
  },
28
33
  "dependencies": {
29
34
  "gl-matrix": "^3.4.4",
30
35
  "reflect-metadata": "^0.2.2",
31
- "ris-framework-api": "0.1.0-dev.5",
32
- "ris-ktx2": "^0.1.0-dev.2",
36
+ "ris-ktx2": "^0.1.0",
33
37
  "tsyringe": "^4.10.0"
34
38
  },
35
39
  "files": [
36
40
  "dist",
37
41
  "src",
38
42
  "shaders",
43
+ "LICENSES",
39
44
  "LICENSE",
45
+ "NOTICE",
40
46
  "README.md",
41
- "CHANGELOG.md"
47
+ "CHANGELOG.md",
48
+ "THIRD_PARTY_NOTICES.md"
42
49
  ],
43
50
  "publishConfig": {
44
51
  "access": "public"
@@ -10,5 +10,5 @@ uniform sampler2D u_texture;
10
10
 
11
11
  void main()
12
12
  {
13
- o_outputColor = texture(u_texture, v_texCoords) * v_color;
13
+ o_outputColor = texture(u_texture, v_texCoords) * v_color + vec4(1.0);
14
14
  }
@@ -1,32 +1,50 @@
1
1
  import {container, type DependencyContainer} from "tsyringe";
2
- import {WindowManager} from "./window/window-manager.ts";
3
- import {FrameworkConfig} from "./FrameworkConfig.ts";
4
- import {IFrameworkSymbol} from "./dependency-injection/register-services-interface.ts";
5
- import { RenderConfiguration, RenderConfigurationSymbol} from "./renderer/renderer-interface.ts";
6
- import {GeometryBuilder} from "../geometry/GeometryBuilder.ts";
7
- import {ContentManager} from "./content/ContentManager.ts";
8
- import {WebGlRenderer} from "../webgl/WebGlRenderer.ts";
9
- import {WebGlBuffersFactory} from "../webgl/buffers/WebGlBuffersFactory.ts";
2
+ import {WindowManager} from "./api/window/WindowManager.ts";
3
+ import {FrameworkConfiguration} from "./api/FrameworkConfiguration.ts";
4
+ import {type IRendererConfiguration, RenderConfigurationSymbol} from "./api/rendering/renderer-interface.ts";
5
+ import {GeometryBuilder} from "./api/geometry/GeometryBuilder.ts";
6
+ import {ContentManager} from "./api/content/ContentManager.ts";
7
+ import {WebGlRenderer} from "./webgl/WebGlRenderer.ts";
8
+ import {WebGlBuffersFactory} from "./webgl/buffers/WebGlBuffersFactory.ts";
10
9
  import {
11
- CameraFactory, CpuImageProcessor, GameTime,
12
- type IBufferFactory, type IGeometryBuilder, type IGraphicsDevice, type IImageProcessor, type IInputManager,
10
+ type ICameraFactory,
11
+ type IContentManager,
12
+ type IFramework, IFrameworkConfiguration,
13
+ type IImageLoader,
14
+ type IRenderer,
15
+ type IRenderPipelineFactory,
16
+ type IWindowManager
17
+ } from "./api/index.ts";
18
+ import {
19
+ CameraFactory,
20
+ CpuImageProcessor,
21
+ GameTime,
22
+ type IBufferFactory,
23
+ type IGeometryBuilder,
24
+ type IGraphicsDevice,
25
+ type IImageProcessor,
26
+ type IInputManager,
13
27
  ImageLoader,
14
- type IMeshFactory, type ISpriteBatch, type ITextureFactory, type ITimeManager, RenderingBackend, TimeManager
15
- } from "ris-framework-api";
16
- import {WebGlShaderModuleLoader} from "../webgl/shader/WebGlShaderModuleLoader.ts";
17
- import {TextureSamplerFilteringPreset} from "./rendering/enums.ts";
18
- import {SpriteBatch} from "./sprite-batch/SpriteBatch.ts";
19
- import type {ICameraFactory, IContentManager, IFramework, IImageLoader,
20
- IRenderer,
21
- IWindowManager
22
- } from "ris-framework-api";
23
- import {WebGlTextureFactory} from "../webgl/texture/WebGlTextureFactory.ts";
24
- import {WebGlRenderPipelineFactory} from "../webgl/render-pipelines/WebGlRenderPipelineFactory.ts";
25
- import type {IRenderPipelineFactory} from "ris-framework-api";
26
- import {MeshFactory, type IMaterialFactory, MaterialFactory} from "ris-framework-api";
27
- import {InputManager} from "./input/InputManager.ts";
28
+ type IMaterialFactory,
29
+ type IMeshFactory,
30
+ type ISpriteBatch,
31
+ type ITextureFactory,
32
+ type ITimeManager,
33
+ MaterialFactory,
34
+ MeshFactory,
35
+ RenderingBackend,
36
+ TimeManager
37
+ } from "./api/index.ts";
38
+ import {WebGlShaderModuleLoader} from "./webgl/shader/WebGlShaderModuleLoader.ts";
39
+ import {TextureSamplerFilteringPreset} from "./core/rendering/enums.ts";
40
+ import {SpriteBatch} from "./api/sprites/SpriteBatch.ts";
41
+ import {WebGlTextureFactory} from "./webgl/texture/WebGlTextureFactory.ts";
42
+ import {WebGlRenderPipelineFactory} from "./webgl/render-pipelines/WebGlRenderPipelineFactory.ts";
43
+ import {InputManager} from "./api/input/InputManager.ts";
44
+ import type {IKtx2Factory} from "ris-ktx2";
28
45
  import {Ktx2Factory} from "ris-ktx2";
29
- import type {IKtx2Factory} from "ris-ktx2-api";
46
+ import {PowerPreferenceType} from "./api/rendering/PowerPreference.ts";
47
+ import {vec2} from "gl-matrix";
30
48
 
31
49
  export class Framework implements IFramework {
32
50
 
@@ -44,19 +62,27 @@ export class Framework implements IFramework {
44
62
 
45
63
  /**
46
64
  * The constructor for the Framework class.
47
- * @param options The optional options for them framework.
65
+ * @param options The optional framework configuration. When omitted, a default `FrameworkConfiguration` is used.
48
66
  */
49
- constructor(options: FrameworkConfig | null = null) {
50
- options = options ?? new FrameworkConfig();
67
+ constructor(options?: IFrameworkConfiguration) {
68
+ options = options ?? new FrameworkConfiguration();
69
+
70
+ // Without a canvas, WindowManager creates one and appends it to document.body.
71
+ if(!options.canvas){
72
+ console.warn("Canvas not provided. Creating canvas and appending it to document.body.")
73
+ }
74
+ options.backBufferSize = options.backBufferSize ?? vec2.fromValues(800, 600);
51
75
 
52
76
  this._container = container.createChildContainer();
53
- this.windowManager = new WindowManager(options.canvas);
77
+ this.windowManager = new WindowManager(options.canvas ?? null);
54
78
 
55
79
  // Setup container.
56
- this._container.registerInstance(IFrameworkSymbol, this);
57
- const rendererConfig = new RenderConfiguration();
58
- rendererConfig.backBufferSize = options.backBufferSize;
59
- rendererConfig.textureFiltering = options.textureFiltering ?? TextureSamplerFilteringPreset.BILINEAR;
80
+ const rendererConfig: IRendererConfiguration = {
81
+ backBufferSize: options.backBufferSize,
82
+ textureFiltering: options.textureFiltering ?? TextureSamplerFilteringPreset.BILINEAR,
83
+ alpha: options.alpha ?? false,
84
+ powerPreference: options.powerPreference ?? PowerPreferenceType.DEFAULT
85
+ };
60
86
  this._container.registerInstance(RenderConfigurationSymbol, rendererConfig);
61
87
  this.renderer = new WebGlRenderer(this, rendererConfig);
62
88
  this.renderingBackend = RenderingBackend.WEB_GL;
@@ -107,7 +133,7 @@ export class Framework implements IFramework {
107
133
 
108
134
  /** @inheritDoc */
109
135
  public removeOnInitializedListener(event: () => void): void {
110
- this._onInitializeListeners.splice(this._onInitializeListeners.indexOf(event), 1);
136
+ Framework._removeListener(this._onInitializeListeners, event);
111
137
  }
112
138
 
113
139
  /** @inheritdoc */
@@ -117,7 +143,7 @@ export class Framework implements IFramework {
117
143
 
118
144
  /** @inheritdoc */
119
145
  public removeOnLoadContentListener(event: () => void): void {
120
- this._onLoadContentListeners.splice(this._onLoadContentListeners.indexOf(event), 1);
146
+ Framework._removeListener(this._onLoadContentListeners, event);
121
147
  }
122
148
 
123
149
  /** @inheritdoc */
@@ -127,7 +153,7 @@ export class Framework implements IFramework {
127
153
 
128
154
  /** @inheritdoc */
129
155
  public removeOnUpdateListener(event: (gameTime: GameTime) => void): void {
130
- this._onUpdateListeners.splice(this._onUpdateListeners.indexOf(event), 1);
156
+ Framework._removeListener(this._onUpdateListeners, event);
131
157
  }
132
158
 
133
159
  /** @inheritdoc */
@@ -137,7 +163,18 @@ export class Framework implements IFramework {
137
163
 
138
164
  /** @inheritdoc */
139
165
  public removeOnRenderListener(event: () => void): void {
140
- this._onRenderListeners.splice(this._onRenderListeners.indexOf(event), 1);
166
+ Framework._removeListener(this._onRenderListeners, event);
167
+ }
168
+
169
+ /**
170
+ * Removes a listener if it is registered. An unknown listener is ignored,
171
+ * instead of `splice(-1, 1)` removing the last registered one.
172
+ */
173
+ private static _removeListener<T>(listeners: T[], listener: T): void {
174
+ const index = listeners.indexOf(listener);
175
+ if (index >= 0) {
176
+ listeners.splice(index, 1);
177
+ }
141
178
  }
142
179
 
143
180
  /** @inheritdoc */
@@ -188,7 +225,10 @@ export class Framework implements IFramework {
188
225
  /** @inheritdoc */
189
226
  public initialize(): void {
190
227
 
191
- this.ktx2Factory?.initializeAsync();
228
+ if(this.ktx2Factory) {
229
+ this.ktx2Factory.initializeAsync();
230
+ }
231
+
192
232
  (this.renderer as WebGlRenderer).initialize();
193
233
  this.spriteBatch.initialize();
194
234
  this.input.initialize();
@@ -0,0 +1,29 @@
1
+ import { TextureSamplerFilteringPreset } from "../core/rendering/enums.ts";
2
+ import {vec2} from "gl-matrix";
3
+ import type {IFrameworkConfiguration} from "./IFrameworkConfiguration.ts";
4
+ import {PowerPreferenceType} from "./rendering/PowerPreference.ts";
5
+
6
+ /**
7
+ * The options for configuring the Framework.
8
+ * @public
9
+ */
10
+ export class FrameworkConfiguration implements IFrameworkConfiguration {
11
+
12
+ /** @inheritDoc */
13
+ useKtx2 = false;
14
+
15
+ /** @inheritDoc */
16
+ canvas?: HTMLCanvasElement;
17
+
18
+ /** @inheritDoc */
19
+ backBufferSize?: vec2;
20
+
21
+ /** @inheritDoc */
22
+ textureFiltering? = TextureSamplerFilteringPreset.BILINEAR;
23
+
24
+ /** @inheritDoc */
25
+ alpha = false;
26
+
27
+ /** @inheritDoc */
28
+ powerPreference = PowerPreferenceType.DEFAULT;
29
+ }
@@ -0,0 +1,153 @@
1
+ import {RenderingBackend} from "./rendering/RenderingBackend.ts";
2
+ import type { ISpriteBatch } from "./sprites/ISpriteBatch.ts";
3
+ import type { IRenderer } from "./rendering/IRenderer.ts";
4
+ import type { IGraphicsDevice } from "./rendering/IGraphicsDevice.ts";
5
+ import type { IRenderPipelineFactory } from "./rendering/render-pipelines/IRenderPipelineFactory.ts";
6
+ import type { IBufferFactory } from "./rendering/buffers/IBufferFactory.ts";
7
+ import type { IGeometryBuilder } from "./geometry/IGeometryBuilder.ts";
8
+ import type { ICameraFactory } from "./camera/ICameraFactory.ts";
9
+ import type { ITextureFactory } from "./rendering/texture/ITextureFactory.ts";
10
+ import type { IContentManager } from "./content/IContentManager.ts";
11
+ import type { IImageLoader } from "./loaders/IImageLoader.ts";
12
+ import type { IMeshFactory } from "./meshes/IMeshFactory.ts";
13
+ import type { IMaterialFactory } from "./material/IMaterialFactory.ts";
14
+ import type { ITimeManager } from "./time/ITimeManager.ts";
15
+ import type { IInputManager } from "./input/IInputManager.ts";
16
+ import type { IWindowManager } from "./window/IWindowManager.ts";
17
+ import {GameTime} from "./time/GameTime.ts";
18
+ import type { IImageProcessor } from "./image/IImageProcessor.ts";
19
+ import type { IKtx2Factory } from "ris-ktx2";
20
+ import type { IDisposable } from "./core/IDisposable.ts";
21
+
22
+ /** The framework interface. */
23
+ export interface IFramework extends IDisposable {
24
+
25
+ /**
26
+ * The image loader.
27
+ */
28
+ readonly imageLoader: IImageLoader;
29
+
30
+ /**
31
+ * The used rendering backend.
32
+ */
33
+ readonly renderingBackend: RenderingBackend;
34
+
35
+ /**
36
+ * The sprite batches.
37
+ */
38
+ readonly spriteBatch: ISpriteBatch;
39
+
40
+ /**
41
+ * The renderer used by the framework.
42
+ */
43
+ readonly renderer: IRenderer;
44
+
45
+ /**
46
+ * The graphics device used by the framework.
47
+ */
48
+ readonly graphicsDevice: IGraphicsDevice;
49
+
50
+ /**
51
+ * The pipeline factory.
52
+ * Responsible for creating low-level rendering pipelines.
53
+ * Pipeline includes everything necessary to render some geometry
54
+ * and can be thought of as a material or renderer.
55
+ */
56
+ readonly renderPipelineFactory: IRenderPipelineFactory;
57
+
58
+ /**
59
+ * The buffer factory, responsible for creating GPU memory buffers.
60
+ */
61
+ readonly bufferFactory: IBufferFactory;
62
+
63
+ /**
64
+ * The geometry builder.
65
+ */
66
+ readonly geometryBuilder: IGeometryBuilder;
67
+
68
+ /** The texture factory. */
69
+ readonly textureFactory: ITextureFactory;
70
+
71
+ /** The KTX2 factory. Initialized only if KTX2 is requested or loaded. */
72
+ readonly ktx2Factory?: IKtx2Factory;
73
+
74
+ /**
75
+ * The camera factory.
76
+ */
77
+ readonly cameraFactory: ICameraFactory;
78
+
79
+ /**
80
+ * The content manager.
81
+ */
82
+ readonly content: IContentManager;
83
+
84
+ /**
85
+ * The mesh factory.
86
+ */
87
+ readonly meshFactory: IMeshFactory;
88
+
89
+ /**
90
+ * The material factory.
91
+ */
92
+ readonly materialFactory: IMaterialFactory;
93
+
94
+ /**
95
+ * The time manager.
96
+ */
97
+ readonly timeManager: ITimeManager;
98
+
99
+ /** The input manager. */
100
+ readonly input: IInputManager;
101
+
102
+ /** The window manager. */
103
+ readonly windowManager: IWindowManager;
104
+
105
+ /** The image processor. */
106
+ readonly imageProcessor: IImageProcessor;
107
+
108
+ /**
109
+ * Called right after the framework is initialized and before the render loop starts.
110
+ * Content can be loaded here.
111
+ */
112
+ addOnLoadContentListener(event: () => void): void;
113
+
114
+ /**
115
+ * Called right after the framework is initialized and before the render loop starts.
116
+ * Content can be loaded here.
117
+ */
118
+ removeOnLoadContentListener(event: () => void): void;
119
+
120
+ /**
121
+ * Called when the framework is initialized.
122
+ */
123
+ addOnInitializedListener(event: () => void): void;
124
+
125
+ /**
126
+ * Called when the framework is initialized.
127
+ */
128
+ removeOnInitializedListener(event: () => void): void;
129
+
130
+ /**
131
+ * Called when framework is updated.
132
+ */
133
+ addOnUpdateListener(event: (gameTime: GameTime) => void): void;
134
+
135
+ /**
136
+ * Called when framework is updated.
137
+ */
138
+ removeOnUpdateListener(event: (gameTime: GameTime) => void): void;
139
+
140
+ /**
141
+ * Called when the framework is rendered.
142
+ */
143
+ addOnRenderListener(event: () => void): void;
144
+
145
+ /**
146
+ * Called when the framework is rendered.
147
+ */
148
+ removeOnRenderListener(event: () => void): void;
149
+
150
+ /** Initializes the framework. */
151
+ initialize(): void;
152
+
153
+ }
@@ -0,0 +1,30 @@
1
+ import {PowerPreferenceType} from "./rendering/PowerPreference.ts";
2
+ import type {vec2} from "gl-matrix";
3
+ import type {TextureSamplerFilteringPreset} from "../core/rendering/enums.ts";
4
+
5
+ /**
6
+ * The configuration for the framework.
7
+ * @public
8
+ **/
9
+ export class IFrameworkConfiguration {
10
+ /** If true, creates and makes the KTX2 factory available. */
11
+ useKtx2?: boolean;
12
+
13
+ /** The size of back buffer. */
14
+ backBufferSize?: vec2;
15
+
16
+ /** The texture filtering to configure */
17
+ textureFiltering?: TextureSamplerFilteringPreset;
18
+
19
+ /**
20
+ * The HTMLCanvasElement to use for rendering.
21
+ * If null, a new canvas will be created and added to the document body.
22
+ */
23
+ canvas?: HTMLCanvasElement;
24
+
25
+ /** Should back buffer use alpha. */
26
+ alpha?: boolean;
27
+
28
+ /** The preference when it comes to selecting GPU device. Only makes sense to set on multi-GPU devices. */
29
+ powerPreference ?: PowerPreferenceType;
30
+ }